diff --git a/video/external/src/decoder.rs b/video/external/src/decoder.rs index d7169e5b894ff..07052b431ca8e 100644 --- a/video/external/src/decoder.rs +++ b/video/external/src/decoder.rs @@ -1,5 +1,6 @@ +// cargo install bindgen-cli // bindgen ../openh264/codec/api/wels/codec_api.h --no-prepend-enum-name \ -// --dynamic-loading OpenH264 -o openh264_sys.rs +// --no-layout-tests --dynamic-loading OpenH264 -o openh264_sys.rs #[cfg(feature = "openh264")] #[allow(non_upper_case_globals)] #[allow(non_camel_case_types)] diff --git a/video/external/src/decoder/openh264.rs b/video/external/src/decoder/openh264.rs index b273d247e2eaa..5752005689ff2 100644 --- a/video/external/src/decoder/openh264.rs +++ b/video/external/src/decoder/openh264.rs @@ -43,7 +43,7 @@ pub struct OpenH264Codec { } impl OpenH264Codec { - const VERSION: OpenH264Version = OpenH264Version(2, 4, 1); + const VERSION: OpenH264Version = OpenH264Version(2, 5, 0); /// Returns the OpenH264 library data for the current platform. fn get_data() -> Result> { @@ -51,44 +51,48 @@ impl OpenH264Codec { const ARCH: &str = std::env::consts::ARCH; let local_filenames = match OS { - "linux" => vec!["libopenh264.so.7", "libopenh264.so.2.4.1", "libopenh264.so"], + "linux" => vec!["libopenh264.so.7", "libopenh264.so.2.5.0", "libopenh264.so"], // TODO: investigate other OSes _ => vec![], }; - // Source: https://github.com/cisco/openh264/releases/tag/v2.4.1 + // Source: https://github.com/cisco/openh264/releases/tag/v2.5.0 let (download_filename, download_sha256) = match (OS, ARCH) { ("linux", "x86") => ( - "libopenh264-2.4.1-linux32.7.so", - "b7cf0e407f99056d90cbf62787a34820a7595b2129b165319d50766e00a66704", + "libopenh264-2.5.0-linux32.7.so", + "cfa8fcf711114fd174c7e377979bb88a4ef330c8ae6da1b9275f87c5146ba789", ), ("linux", "x86_64") => ( - "libopenh264-2.4.1-linux64.7.so", - "1392d21466bc638e68151b716d5b2086d54cd812afd43253f1adb5b6e0185f51", + "libopenh264-2.5.0-linux64.7.so", + "e17f533b41dae28682e118273e368d4c11bff945207a22363188102c28877b3d", ), ("linux", "arm") => ( - "libopenh264-2.4.1-linux-arm.7.so", - "fd1dfb27d30bb72e903c9d2b4c650104a4369d2e7ffe8a4a533e8db2e7e9b19e", + "libopenh264-2.5.0-linux-arm.7.so", + "0eb4ef9f3c8c7c1959c1731ce3fd13e43b542c14fdd163154bb92d1836c179ae", ), ("linux", "aarch64") => ( - "libopenh264-2.4.1-linux-arm64.7.so", - "e8ea7e42855ceb4a90e7bd0b3abeba0c58b5f97166e8b0a30eefd58e099557a4", + "libopenh264-2.5.0-linux-arm64.7.so", + "a3561cbd04889f38ba82b6f4e4a226f00063863c263bd4ae13e1398b5ca9df80", ), ("macos", "x86_64") => ( - "libopenh264-2.4.1-mac-x64.dylib", - "cc0ba518a63791c37571f3c851f0aa03a4fbda5410acc214ecd4f24f8d1c478e", + "libopenh264-2.5.0-mac-x64.dylib", + "83af03a9d9bc816fdced1ecb2aa775416890fe8154c0ef4897da2af1a5af3eab", ), ("macos", "aarch64") => ( - "libopenh264-2.4.1-mac-arm64.dylib", - "213ff93831cfa3dd6d7ad0c3a3403a6ceedf4ac1341e1278b5b869d42fefb496", + "libopenh264-2.5.0-mac-arm64.dylib", + "784f1b95d88b1904ceb6d6b2c18f93d250ab6479e62b84c4f79a67d7d6db6ad9", ), ("windows", "x86") => ( - "openh264-2.4.1-win32.dll", - "83270149640469c994a62cc32a6d8c0413cd7b802b7f1f2f532159f5bdc1cedd", + "openh264-2.5.0-win32.dll", + "2824a4fbfc4640c2cd94aa208f78aac16304bd49e83529d0fb106a87b165f89a", ), ("windows", "x86_64") => ( - "openh264-2.4.1-win64.dll", - "081b0c081480d177cbfddfbc90b1613640e702f875897b30d8de195cde73dd34", + "openh264-2.5.0-win64.dll", + "bf91c488638b32448f7d89611f6bb9c232dce82975d7d2827c78f78fc2a7fb2b", + ), + ("windows", "aarch64") => ( + "openh264-2.5.0-win-arm64.dll", + "6d046ac2f85082fdfebdc54bc53c9c4ff7add4e9383ea52aa0e05b6a0b380b64", ), (os, arch) => return Err(format!("Unsupported OS/arch: {}/{}", os, arch).into()), }; diff --git a/video/external/src/decoder/openh264_sys.rs b/video/external/src/decoder/openh264_sys.rs index 6246e21177325..9bf8f82558842 100644 --- a/video/external/src/decoder/openh264_sys.rs +++ b/video/external/src/decoder/openh264_sys.rs @@ -1,4 +1,4 @@ -/* automatically generated by rust-bindgen 0.69.1 */ +/* automatically generated by rust-bindgen 0.70.1 */ pub const __bool_true_false_are_defined: u32 = 1; pub const true_: u32 = 1; @@ -114,7 +114,7 @@ pub const ET_RFS: _bindgen_ty_2 = 128; pub type _bindgen_ty_2 = ::std::os::raw::c_uint; #[doc = " @brief Information of coded Slice(=NAL)(s)"] #[repr(C)] -#[derive(Debug, Copy, Clone, Hash, PartialOrd, Ord, PartialEq, Eq)] +#[derive(Debug, Copy, Clone)] pub struct SliceInformation { #[doc = "< base buffer of coded slice(s)"] pub pBufferOfSlices: *mut ::std::os::raw::c_uchar, @@ -137,22 +137,13 @@ pub struct SliceInformation { #[doc = "< whether final NAL is involved in buffer of coded slices, flag used in Pause feature in T27"] pub uiContainingFinalNal: ::std::os::raw::c_uchar, } -impl Default for SliceInformation { - fn default() -> Self { - let mut s = ::std::mem::MaybeUninit::::uninit(); - unsafe { - ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); - s.assume_init() - } - } -} #[doc = " @brief Information of coded Slice(=NAL)(s)"] pub type SliceInfo = SliceInformation; #[doc = " @brief Information of coded Slice(=NAL)(s)"] pub type PSliceInfo = *mut SliceInformation; #[doc = " @brief thresholds of the initial, maximal and minimal rate"] #[repr(C)] -#[derive(Debug, Default, Copy, Clone, Hash, PartialOrd, Ord, PartialEq, Eq)] +#[derive(Debug, Copy, Clone)] pub struct SRateThresholds { #[doc = "< frame width"] pub iWidth: ::std::os::raw::c_int, @@ -175,7 +166,7 @@ pub struct SRateThresholds { pub type PRateThresholds = *mut SRateThresholds; #[doc = " @brief Structure for decoder memery"] #[repr(C)] -#[derive(Debug, Default, Copy, Clone, Hash, PartialOrd, Ord, PartialEq, Eq)] +#[derive(Debug, Copy, Clone)] pub struct TagSysMemBuffer { #[doc = "< width of decoded pic for display"] pub iWidth: ::std::os::raw::c_int, @@ -208,33 +199,11 @@ pub union TagBufferInfo__bindgen_ty_1 { #[doc = "< memory info for one picture"] pub sSystemBuffer: SSysMEMBuffer, } -impl Default for TagBufferInfo__bindgen_ty_1 { - fn default() -> Self { - let mut s = ::std::mem::MaybeUninit::::uninit(); - unsafe { - ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); - s.assume_init() - } - } -} -impl Default for TagBufferInfo { - fn default() -> Self { - let mut s = ::std::mem::MaybeUninit::::uninit(); - unsafe { - ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); - s.assume_init() - } - } -} #[doc = " @brief Buffer info"] pub type SBufferInfo = TagBufferInfo; -extern "C" { - #[doc = " @brief In a GOP, multiple of the key frame number, derived from\n the number of layers(index or array below)"] - pub static kiKeyNumMultiple: [::std::os::raw::c_char; 6usize]; -} #[doc = " @brief Struct of OpenH264 version\n/\n///\n/// E.g. SDK version is 1.2.0.0, major version number is 1, minor version number is 2, and revision number is 0."] #[repr(C)] -#[derive(Debug, Default, Copy, Clone, Hash, PartialOrd, Ord, PartialEq, Eq)] +#[derive(Debug, Copy, Clone)] pub struct _tagVersion { #[doc = "< The major version number"] pub uMajor: ::std::os::raw::c_uint, @@ -408,7 +377,7 @@ pub const LTR_MARKING_FAILED: KEY_FRAME_REQUEST_TYPE = 5; pub type KEY_FRAME_REQUEST_TYPE = ::std::os::raw::c_uint; #[doc = " @brief Structure for LTR recover request"] #[repr(C)] -#[derive(Debug, Default, Copy, Clone, Hash, PartialOrd, Ord, PartialEq, Eq)] +#[derive(Debug, Copy, Clone)] pub struct SLTRRecoverRequest { #[doc = "< IDR request or LTR recovery request"] pub uiFeedbackType: ::std::os::raw::c_uint, @@ -421,7 +390,7 @@ pub struct SLTRRecoverRequest { } #[doc = " @brief Structure for LTR marking feedback"] #[repr(C)] -#[derive(Debug, Default, Copy, Clone, Hash, PartialOrd, Ord, PartialEq, Eq)] +#[derive(Debug, Copy, Clone)] pub struct SLTRMarkingFeedback { #[doc = "< mark failed or successful"] pub uiFeedbackType: ::std::os::raw::c_uint, @@ -433,7 +402,7 @@ pub struct SLTRMarkingFeedback { } #[doc = " @brief Structure for LTR configuration"] #[repr(C)] -#[derive(Debug, Default, Copy, Clone, Hash, PartialOrd, Ord, PartialEq, Eq)] +#[derive(Debug, Copy, Clone)] pub struct SLTRConfig { #[doc = "< 1: on, 0: off"] pub bEnableLongTermReference: bool, @@ -518,7 +487,7 @@ pub const SM_RESERVED: SliceModeEnum = 4; pub type SliceModeEnum = ::std::os::raw::c_uint; #[doc = " @brief Structure for slice argument"] #[repr(C)] -#[derive(Debug, Copy, Clone, Hash, PartialOrd, Ord, PartialEq, Eq)] +#[derive(Debug, Copy, Clone)] pub struct SSliceArgument { #[doc = "< by default, uiSliceMode will be SM_SINGLE_SLICE"] pub uiSliceMode: SliceModeEnum, @@ -529,15 +498,6 @@ pub struct SSliceArgument { #[doc = "< now only used when uiSliceMode=4"] pub uiSliceSizeConstraint: ::std::os::raw::c_uint, } -impl Default for SSliceArgument { - fn default() -> Self { - let mut s = ::std::mem::MaybeUninit::::uninit(); - unsafe { - ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); - s.assume_init() - } - } -} pub const VF_COMPONENT: EVideoFormatSPS = 0; pub const VF_PAL: EVideoFormatSPS = 1; pub const VF_NTSC: EVideoFormatSPS = 2; @@ -612,7 +572,7 @@ pub const ASP_EXT_SAR: ESampleAspectRatio = 255; pub type ESampleAspectRatio = ::std::os::raw::c_uint; #[doc = " @brief Structure for spatial layer configuration"] #[repr(C)] -#[derive(Debug, Copy, Clone, PartialOrd, PartialEq)] +#[derive(Debug, Copy, Clone)] pub struct SSpatialLayerConfig { #[doc = "< width of picture in luminance samples of a layer"] pub iVideoWidth: ::std::os::raw::c_int, @@ -647,15 +607,6 @@ pub struct SSpatialLayerConfig { #[doc = "< use if aspect ratio idc == 255"] pub sAspectRatioExtHeight: ::std::os::raw::c_ushort, } -impl Default for SSpatialLayerConfig { - fn default() -> Self { - let mut s = ::std::mem::MaybeUninit::::uninit(); - unsafe { - ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); - s.assume_init() - } - } -} #[doc = "< camera video for real-time communication"] pub const CAMERA_VIDEO_REAL_TIME: EUsageType = 0; #[doc = "< screen content signal"] @@ -685,7 +636,7 @@ pub const SPS_PPS_LISTING: EParameterSetStrategy = 6; pub type EParameterSetStrategy = ::std::os::raw::c_uint; #[doc = " @brief SVC Encoding Parameters"] #[repr(C)] -#[derive(Debug, Copy, Clone, PartialOrd, PartialEq)] +#[derive(Debug, Copy, Clone)] pub struct TagEncParamBase { #[doc = "< application type; please refer to the definition of EUsageType"] pub iUsageType: EUsageType, @@ -700,22 +651,13 @@ pub struct TagEncParamBase { #[doc = "< maximal input frame rate"] pub fMaxFrameRate: f32, } -impl Default for TagEncParamBase { - fn default() -> Self { - let mut s = ::std::mem::MaybeUninit::::uninit(); - unsafe { - ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); - s.assume_init() - } - } -} #[doc = " @brief SVC Encoding Parameters"] pub type SEncParamBase = TagEncParamBase; #[doc = " @brief SVC Encoding Parameters"] pub type PEncParamBase = *mut TagEncParamBase; #[doc = " @brief SVC Encoding Parameters extention"] #[repr(C)] -#[derive(Debug, Copy, Clone, PartialOrd, PartialEq)] +#[derive(Debug, Copy, Clone)] pub struct TagEncParamExt { #[doc = "< same as in TagEncParamBase"] pub iUsageType: EUsageType, @@ -793,38 +735,20 @@ pub struct TagEncParamExt { #[doc = "< the target bits of IDR is (idr_bitrate_ratio/100) * average target bit per frame."] pub iIdrBitrateRatio: ::std::os::raw::c_int, } -impl Default for TagEncParamExt { - fn default() -> Self { - let mut s = ::std::mem::MaybeUninit::::uninit(); - unsafe { - ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); - s.assume_init() - } - } -} #[doc = " @brief SVC Encoding Parameters extention"] pub type SEncParamExt = TagEncParamExt; #[doc = " @brief Define a new struct to show the property of video bitstream."] #[repr(C)] -#[derive(Debug, Copy, Clone, Hash, PartialOrd, Ord, PartialEq, Eq)] +#[derive(Debug, Copy, Clone)] pub struct SVideoProperty { #[doc = "< size of the struct"] pub size: ::std::os::raw::c_uint, #[doc = "< video stream type (AVC/SVC)"] pub eVideoBsType: VIDEO_BITSTREAM_TYPE, } -impl Default for SVideoProperty { - fn default() -> Self { - let mut s = ::std::mem::MaybeUninit::::uninit(); - unsafe { - ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); - s.assume_init() - } - } -} #[doc = " @brief SVC Decoding Parameters, reserved here and potential applicable in the future"] #[repr(C)] -#[derive(Debug, Copy, Clone, Hash, PartialOrd, Ord, PartialEq, Eq)] +#[derive(Debug, Copy, Clone)] pub struct TagSVCDecodingParam { #[doc = "< file name of reconstructed frame used for PSNR calculation based debug"] pub pFileNameRestructed: *mut ::std::os::raw::c_char, @@ -839,22 +763,13 @@ pub struct TagSVCDecodingParam { #[doc = "< video stream property"] pub sVideoProperty: SVideoProperty, } -impl Default for TagSVCDecodingParam { - fn default() -> Self { - let mut s = ::std::mem::MaybeUninit::::uninit(); - unsafe { - ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); - s.assume_init() - } - } -} #[doc = " @brief SVC Decoding Parameters, reserved here and potential applicable in the future"] pub type SDecodingParam = TagSVCDecodingParam; #[doc = " @brief SVC Decoding Parameters, reserved here and potential applicable in the future"] pub type PDecodingParam = *mut TagSVCDecodingParam; #[doc = " @brief Bitstream inforamtion of a layer being encoded"] #[repr(C)] -#[derive(Debug, Copy, Clone, Hash, PartialOrd, Ord, PartialEq, Eq)] +#[derive(Debug, Copy, Clone)] pub struct SLayerBSInfo { pub uiTemporalId: ::std::os::raw::c_uchar, pub uiSpatialId: ::std::os::raw::c_uchar, @@ -870,20 +785,11 @@ pub struct SLayerBSInfo { #[doc = "< buffer of bitstream contained"] pub pBsBuf: *mut ::std::os::raw::c_uchar, } -impl Default for SLayerBSInfo { - fn default() -> Self { - let mut s = ::std::mem::MaybeUninit::::uninit(); - unsafe { - ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); - s.assume_init() - } - } -} #[doc = " @brief Bitstream inforamtion of a layer being encoded"] pub type PLayerBSInfo = *mut SLayerBSInfo; #[doc = " @brief Frame bit stream info"] #[repr(C)] -#[derive(Debug, Copy, Clone, Hash, PartialOrd, Ord, PartialEq, Eq)] +#[derive(Debug, Copy, Clone)] pub struct SFrameBSInfo { pub iLayerNum: ::std::os::raw::c_int, pub sLayerInfo: [SLayerBSInfo; 128usize], @@ -891,20 +797,11 @@ pub struct SFrameBSInfo { pub iFrameSizeInBytes: ::std::os::raw::c_int, pub uiTimeStamp: ::std::os::raw::c_longlong, } -impl Default for SFrameBSInfo { - fn default() -> Self { - let mut s = ::std::mem::MaybeUninit::::uninit(); - unsafe { - ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); - s.assume_init() - } - } -} #[doc = " @brief Frame bit stream info"] pub type PFrameBSInfo = *mut SFrameBSInfo; #[doc = " @brief Structure for source picture"] #[repr(C)] -#[derive(Debug, Copy, Clone, Hash, PartialOrd, Ord, PartialEq, Eq)] +#[derive(Debug, Copy, Clone)] pub struct Source_Picture_s { #[doc = "< color space type"] pub iColorFormat: ::std::os::raw::c_int, @@ -919,95 +816,50 @@ pub struct Source_Picture_s { #[doc = "< timestamp of the source picture, unit: millisecond"] pub uiTimeStamp: ::std::os::raw::c_longlong, } -impl Default for Source_Picture_s { - fn default() -> Self { - let mut s = ::std::mem::MaybeUninit::::uninit(); - unsafe { - ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); - s.assume_init() - } - } -} #[doc = " @brief Structure for source picture"] pub type SSourcePicture = Source_Picture_s; #[doc = " @brief Structure for bit rate info"] #[repr(C)] -#[derive(Debug, Copy, Clone, Hash, PartialOrd, Ord, PartialEq, Eq)] +#[derive(Debug, Copy, Clone)] pub struct TagBitrateInfo { pub iLayer: LAYER_NUM, #[doc = "< the maximum bitrate"] pub iBitrate: ::std::os::raw::c_int, } -impl Default for TagBitrateInfo { - fn default() -> Self { - let mut s = ::std::mem::MaybeUninit::::uninit(); - unsafe { - ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); - s.assume_init() - } - } -} #[doc = " @brief Structure for bit rate info"] pub type SBitrateInfo = TagBitrateInfo; #[doc = " @brief Structure for dump layer info"] #[repr(C)] -#[derive(Debug, Copy, Clone, Hash, PartialOrd, Ord, PartialEq, Eq)] +#[derive(Debug, Copy, Clone)] pub struct TagDumpLayer { pub iLayer: ::std::os::raw::c_int, pub pFileName: *mut ::std::os::raw::c_char, } -impl Default for TagDumpLayer { - fn default() -> Self { - let mut s = ::std::mem::MaybeUninit::::uninit(); - unsafe { - ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); - s.assume_init() - } - } -} #[doc = " @brief Structure for dump layer info"] pub type SDumpLayer = TagDumpLayer; #[doc = " @brief Structure for profile info in layer"] #[repr(C)] -#[derive(Debug, Copy, Clone, Hash, PartialOrd, Ord, PartialEq, Eq)] +#[derive(Debug, Copy, Clone)] pub struct TagProfileInfo { pub iLayer: ::std::os::raw::c_int, #[doc = "< the profile info"] pub uiProfileIdc: EProfileIdc, } -impl Default for TagProfileInfo { - fn default() -> Self { - let mut s = ::std::mem::MaybeUninit::::uninit(); - unsafe { - ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); - s.assume_init() - } - } -} #[doc = " @brief Structure for profile info in layer"] pub type SProfileInfo = TagProfileInfo; #[doc = " @brief Structure for level info in layer"] #[repr(C)] -#[derive(Debug, Copy, Clone, Hash, PartialOrd, Ord, PartialEq, Eq)] +#[derive(Debug, Copy, Clone)] pub struct TagLevelInfo { pub iLayer: ::std::os::raw::c_int, #[doc = "< the level info"] pub uiLevelIdc: ELevelIdc, } -impl Default for TagLevelInfo { - fn default() -> Self { - let mut s = ::std::mem::MaybeUninit::::uninit(); - unsafe { - ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); - s.assume_init() - } - } -} #[doc = " @brief Structure for level info in layer"] pub type SLevelInfo = TagLevelInfo; #[doc = " @brief Structure for dilivery status"] #[repr(C)] -#[derive(Debug, Default, Copy, Clone, Hash, PartialOrd, Ord, PartialEq, Eq)] +#[derive(Debug, Copy, Clone)] pub struct TagDeliveryStatus { #[doc = "< 0: the previous frame isn't delivered,1: the previous frame is delivered"] pub bDeliveryFlag: bool, @@ -1020,7 +872,7 @@ pub struct TagDeliveryStatus { pub type SDeliveryStatus = TagDeliveryStatus; #[doc = " @brief The capability of decoder, for SDP negotiation"] #[repr(C)] -#[derive(Debug, Default, Copy, Clone, Hash, PartialOrd, Ord, PartialEq, Eq)] +#[derive(Debug, Copy, Clone)] pub struct TagDecoderCapability { #[doc = "< profile_idc"] pub iProfileIdc: ::std::os::raw::c_int, @@ -1045,7 +897,7 @@ pub struct TagDecoderCapability { pub type SDecoderCapability = TagDecoderCapability; #[doc = " @brief Structure for parse only output"] #[repr(C)] -#[derive(Debug, Copy, Clone, Hash, PartialOrd, Ord, PartialEq, Eq)] +#[derive(Debug, Copy, Clone)] pub struct TagParserBsInfo { #[doc = "< total NAL number in current AU"] pub iNalNum: ::std::os::raw::c_int, @@ -1062,22 +914,13 @@ pub struct TagParserBsInfo { #[doc = "< output BS timestamp"] pub uiOutBsTimeStamp: ::std::os::raw::c_ulonglong, } -impl Default for TagParserBsInfo { - fn default() -> Self { - let mut s = ::std::mem::MaybeUninit::::uninit(); - unsafe { - ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); - s.assume_init() - } - } -} #[doc = " @brief Structure for parse only output"] pub type SParserBsInfo = TagParserBsInfo; #[doc = " @brief Structure for parse only output"] pub type PParserBsInfo = *mut TagParserBsInfo; #[doc = " @brief Structure for encoder statistics"] #[repr(C)] -#[derive(Debug, Default, Copy, Clone, PartialOrd, PartialEq)] +#[derive(Debug, Copy, Clone)] pub struct TagVideoEncoderStatistics { #[doc = "< the width of encoded frame"] pub uiWidth: ::std::os::raw::c_uint, @@ -1115,7 +958,7 @@ pub struct TagVideoEncoderStatistics { pub type SEncoderStatistics = TagVideoEncoderStatistics; #[doc = " @brief Structure for decoder statistics"] #[repr(C)] -#[derive(Debug, Default, Copy, Clone, PartialOrd, PartialEq)] +#[derive(Debug, Copy, Clone)] pub struct TagVideoDecoderStatistics { #[doc = "< the width of encode/decode frame"] pub uiWidth: ::std::os::raw::c_uint, @@ -1174,7 +1017,7 @@ pub struct TagVideoDecoderStatistics { pub type SDecoderStatistics = TagVideoDecoderStatistics; #[doc = " @brief Structure for sample aspect ratio (SAR) info in VUI"] #[repr(C)] -#[derive(Debug, Default, Copy, Clone, Hash, PartialOrd, Ord, PartialEq, Eq)] +#[derive(Debug, Copy, Clone)] pub struct TagVuiSarInfo { #[doc = "< SAR width"] pub uiSarWidth: ::std::os::raw::c_uint, @@ -1189,7 +1032,7 @@ pub type SVuiSarInfo = TagVuiSarInfo; pub type PVuiSarInfo = *mut TagVuiSarInfo; pub type ISVCEncoder = *const ISVCEncoderVtbl; #[repr(C)] -#[derive(Debug, Default, Copy, Clone, Hash, PartialOrd, Ord, PartialEq, Eq)] +#[derive(Debug, Copy, Clone)] pub struct ISVCEncoderVtbl { pub Initialize: ::std::option::Option< unsafe extern "C" fn( @@ -1245,7 +1088,7 @@ pub struct ISVCEncoderVtbl { } pub type ISVCDecoder = *const ISVCDecoderVtbl; #[repr(C)] -#[derive(Debug, Default, Copy, Clone, Hash, PartialOrd, Ord, PartialEq, Eq)] +#[derive(Debug, Copy, Clone)] pub struct ISVCDecoderVtbl { pub Initialize: ::std::option::Option< unsafe extern "C" fn( @@ -1335,9 +1178,9 @@ pub type WelsTraceCallback = ::std::option::Option< string: *const ::std::os::raw::c_char, ), >; -extern crate libloading; pub struct OpenH264 { __library: ::libloading::Library, + pub kiKeyNumMultiple: Result<*mut [::std::os::raw::c_char; 6usize], ::libloading::Error>, pub WelsCreateSVCEncoder: Result< unsafe extern "C" fn(ppEncoder: *mut *mut ISVCEncoder) -> ::std::os::raw::c_int, ::libloading::Error, @@ -1359,11 +1202,11 @@ pub struct OpenH264 { Result, } impl OpenH264 { - pub unsafe fn new

(filename: P) -> Result + pub unsafe fn new

(path: P) -> Result where P: AsRef<::std::ffi::OsStr>, { - let library = ::libloading::Library::new(filename)?; + let library = ::libloading::Library::new(path)?; Self::from_library(library) } pub unsafe fn from_library(library: L) -> Result @@ -1371,6 +1214,9 @@ impl OpenH264 { L: Into<::libloading::Library>, { let __library = library.into(); + let kiKeyNumMultiple = __library + .get::<*mut [::std::os::raw::c_char; 6usize]>(b"kiKeyNumMultiple\0") + .map(|sym| *sym); let WelsCreateSVCEncoder = __library.get(b"WelsCreateSVCEncoder\0").map(|sym| *sym); let WelsDestroySVCEncoder = __library.get(b"WelsDestroySVCEncoder\0").map(|sym| *sym); let WelsGetDecoderCapability = __library.get(b"WelsGetDecoderCapability\0").map(|sym| *sym); @@ -1380,6 +1226,7 @@ impl OpenH264 { let WelsGetCodecVersionEx = __library.get(b"WelsGetCodecVersionEx\0").map(|sym| *sym); Ok(OpenH264 { __library, + kiKeyNumMultiple, WelsCreateSVCEncoder, WelsDestroySVCEncoder, WelsGetDecoderCapability, @@ -1389,6 +1236,12 @@ impl OpenH264 { WelsGetCodecVersionEx, }) } + pub unsafe fn kiKeyNumMultiple(&self) -> *mut [::std::os::raw::c_char; 6usize] { + *self + .kiKeyNumMultiple + .as_ref() + .expect("Expected variable, got error.") + } #[doc = " @brief Create encoder\n @param ppEncoder encoder\n @return 0 - success; otherwise - failed;"] pub unsafe fn WelsCreateSVCEncoder( &self,