From 1910f275f7a17f4e4b924bdb6c2c2f5f73588b0d Mon Sep 17 00:00:00 2001 From: Quentin Renard Date: Tue, 30 Jan 2024 11:10:59 +0100 Subject: [PATCH] Minor codec hardware config changes --- codec.go | 2 +- codec_hardware_config.go | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/codec.go b/codec.go index 22579f5..85462e5 100644 --- a/codec.go +++ b/codec.go @@ -112,7 +112,7 @@ func (c *Codec) HardwareConfigs() (configs []CodecHardwareConfig) { if config == nil { break } - configs = append(configs, CodecHardwareConfig{c: config}) + configs = append(configs, newCodecHardwareConfigFromC(config)) i++ } return diff --git a/codec_hardware_config.go b/codec_hardware_config.go index 9b89ace..7b9d973 100644 --- a/codec_hardware_config.go +++ b/codec_hardware_config.go @@ -9,6 +9,10 @@ type CodecHardwareConfig struct { c *C.AVCodecHWConfig } +func newCodecHardwareConfigFromC(c *C.AVCodecHWConfig) CodecHardwareConfig { + return CodecHardwareConfig{c: c} +} + func (chc CodecHardwareConfig) HardwareDeviceType() HardwareDeviceType { return HardwareDeviceType(chc.c.device_type) }