diff --git a/examples/hardware_decoding/main.go b/examples/hardware_decoding/main.go index 5d15f93..d41e184 100644 --- a/examples/hardware_decoding/main.go +++ b/examples/hardware_decoding/main.go @@ -133,7 +133,7 @@ func main() { // Create hardware device context var err error - if s.hardwareDeviceContext, err = astiav.CreateHardwareDeviceContext(hardwareDeviceType, *hardwareDeviceName, nil); err != nil { + if s.hardwareDeviceContext, err = astiav.CreateHardwareDeviceContext(hardwareDeviceType, *hardwareDeviceName, nil, 0); err != nil { log.Fatal(fmt.Errorf("main: creating hardware device context failed: %w", err)) } diff --git a/hardware_device_context.go b/hardware_device_context.go index ee97fe0..cac896b 100644 --- a/hardware_device_context.go +++ b/hardware_device_context.go @@ -13,7 +13,7 @@ type HardwareDeviceContext struct { c *C.struct_AVBufferRef } -func CreateHardwareDeviceContext(t HardwareDeviceType, device string, options *Dictionary) (*HardwareDeviceContext, error) { +func CreateHardwareDeviceContext(t HardwareDeviceType, device string, options *Dictionary, flags int) (*HardwareDeviceContext, error) { hdc := HardwareDeviceContext{} deviceC := (*C.char)(nil) if device != "" { @@ -24,7 +24,7 @@ func CreateHardwareDeviceContext(t HardwareDeviceType, device string, options *D if options != nil { optionsC = options.c } - if err := newError(C.av_hwdevice_ctx_create(&hdc.c, (C.enum_AVHWDeviceType)(t), deviceC, optionsC, 0)); err != nil { + if err := newError(C.av_hwdevice_ctx_create(&hdc.c, (C.enum_AVHWDeviceType)(t), deviceC, optionsC, C.int(flags))); err != nil { return nil, err } return &hdc, nil