mirror of
https://github.com/asticode/go-astiav.git
synced 2025-10-06 08:37:06 +08:00
1. Adds hardware_frames_constraints to retrieve valid HWPixelFormats and SWPixelFormats for specific hardware frame configurations. (#151)
2. Implements a HardwareFramesConstraints method in hardware_device_context to obtain these constraints for a given hardware frames context.
This commit is contained in:
@@ -30,6 +30,11 @@ func CreateHardwareDeviceContext(t HardwareDeviceType, device string, options *D
|
||||
return &hdc, nil
|
||||
}
|
||||
|
||||
// https://ffmpeg.org/doxygen/7.0/hwcontext_8c.html#a80f4c1184e1758150b6d9bc0adf2c1df
|
||||
func (hdc *HardwareDeviceContext) HardwareFramesConstraints() *HardwareFramesConstraints {
|
||||
return newHardwareFramesConstraintsFromC(C.av_hwdevice_get_hwframe_constraints(hdc.c, nil))
|
||||
}
|
||||
|
||||
func (hdc *HardwareDeviceContext) Free() {
|
||||
if hdc.c != nil {
|
||||
C.av_buffer_unref(&hdc.c)
|
||||
|
Reference in New Issue
Block a user