-
Notifications
You must be signed in to change notification settings - Fork 47
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add HardwareConfigs to codec create codec_hardware_config create codec_hardware_config_method_flag update example update flags better error handling in TransferHardwareData update CreateHardwareDeviceContext, better null handling remove hw ctx test because it fails when no nvidia is present some reordering of conss in hardware_device_type
- Loading branch information
Showing
12 changed files
with
153 additions
and
90 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
package astiav | ||
|
||
//#cgo pkg-config: libavcodec | ||
//#include <libavcodec/avcodec.h> | ||
import "C" | ||
|
||
// https://github.com/FFmpeg/FFmpeg/blob/n5.0/libavcodec/codec.h#L460 | ||
type CodecHardwareConfig struct { | ||
c *C.AVCodecHWConfig | ||
} | ||
|
||
func (chc CodecHardwareConfig) HardwareDeviceType() HardwareDeviceType { | ||
return HardwareDeviceType(chc.c.device_type) | ||
} | ||
|
||
func (chc CodecHardwareConfig) MethodFlags() CodecHardwareConfigMethodFlags { | ||
return CodecHardwareConfigMethodFlags(chc.c.methods) | ||
} | ||
|
||
func (chc CodecHardwareConfig) PixelFormat() PixelFormat { | ||
return PixelFormat(chc.c.pix_fmt) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
package astiav | ||
|
||
//#cgo pkg-config: libavcodec | ||
//#include <libavcodec/avcodec.h> | ||
import "C" | ||
|
||
// https://github.com/FFmpeg/FFmpeg/blob/n5.0/libavcodec/codec.h#L420 | ||
type CodecHardwareConfigMethodFlag int | ||
|
||
const ( | ||
CodecHardwareConfigMethodHwDeviceCtx = CodecHardwareConfigMethodFlag(C.AV_CODEC_HW_CONFIG_METHOD_HW_DEVICE_CTX) | ||
CodecHardwareConfigMethodHwFramesCtx = CodecHardwareConfigMethodFlag(C.AV_CODEC_HW_CONFIG_METHOD_HW_FRAMES_CTX) | ||
CodecHardwareConfigMethodInternal = CodecHardwareConfigMethodFlag(C.AV_CODEC_HW_CONFIG_METHOD_INTERNAL) | ||
CodecHardwareConfigMethodAdHoc = CodecHardwareConfigMethodFlag(C.AV_CODEC_HW_CONFIG_METHOD_AD_HOC) | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.