Merge pull request #66 from zmwangx/fix-linting-errors
Fix linting errors
This commit is contained in:
commit
10a83ff8fc
3
.github/workflows/build.yml
vendored
3
.github/workflows/build.yml
vendored
@ -11,7 +11,7 @@ jobs:
|
|||||||
container: jrottenberg/ffmpeg:${{ matrix.ffmpeg_version }}-ubuntu
|
container: jrottenberg/ffmpeg:${{ matrix.ffmpeg_version }}-ubuntu
|
||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
ffmpeg_version: ["3.4", "4.0", "4.1", "4.2", "4.3"]
|
ffmpeg_version: ["3.4", "4.0", "4.1", "4.2", "4.3", "4.4"]
|
||||||
fail-fast: false
|
fail-fast: false
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v2
|
||||||
@ -87,6 +87,7 @@ jobs:
|
|||||||
mkdir ffmpeg
|
mkdir ffmpeg
|
||||||
mv ffmpeg-*/* ffmpeg/
|
mv ffmpeg-*/* ffmpeg/
|
||||||
Add-Content $env:GITHUB_ENV "FFMPEG_DIR=${pwd}\ffmpeg`n"
|
Add-Content $env:GITHUB_ENV "FFMPEG_DIR=${pwd}\ffmpeg`n"
|
||||||
|
Add-Content $env:GITHUB_PATH "${pwd}\ffmpeg\bin`n"
|
||||||
- name: Set up Rust
|
- name: Set up Rust
|
||||||
uses: actions-rs/toolchain@v1
|
uses: actions-rs/toolchain@v1
|
||||||
with:
|
with:
|
||||||
|
@ -31,9 +31,9 @@ impl From<AVAudioServiceType> for AudioService {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
impl Into<AVAudioServiceType> for AudioService {
|
impl From<AudioService> for AVAudioServiceType {
|
||||||
fn into(self) -> AVAudioServiceType {
|
fn from(value: AudioService) -> AVAudioServiceType {
|
||||||
match self {
|
match value {
|
||||||
AudioService::Main => AV_AUDIO_SERVICE_TYPE_MAIN,
|
AudioService::Main => AV_AUDIO_SERVICE_TYPE_MAIN,
|
||||||
AudioService::Effects => AV_AUDIO_SERVICE_TYPE_EFFECTS,
|
AudioService::Effects => AV_AUDIO_SERVICE_TYPE_EFFECTS,
|
||||||
AudioService::VisuallyImpaired => AV_AUDIO_SERVICE_TYPE_VISUALLY_IMPAIRED,
|
AudioService::VisuallyImpaired => AV_AUDIO_SERVICE_TYPE_VISUALLY_IMPAIRED,
|
||||||
|
@ -24,9 +24,9 @@ impl From<c_int> for Compliance {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
impl Into<c_int> for Compliance {
|
impl From<Compliance> for c_int {
|
||||||
fn into(self) -> c_int {
|
fn from(value: Compliance) -> c_int {
|
||||||
match self {
|
match value {
|
||||||
Compliance::VeryStrict => FF_COMPLIANCE_VERY_STRICT,
|
Compliance::VeryStrict => FF_COMPLIANCE_VERY_STRICT,
|
||||||
Compliance::Strict => FF_COMPLIANCE_STRICT,
|
Compliance::Strict => FF_COMPLIANCE_STRICT,
|
||||||
Compliance::Normal => FF_COMPLIANCE_NORMAL,
|
Compliance::Normal => FF_COMPLIANCE_NORMAL,
|
||||||
|
@ -26,9 +26,9 @@ impl From<AVDiscard> for Discard {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
impl Into<AVDiscard> for Discard {
|
impl From<Discard> for AVDiscard {
|
||||||
fn into(self) -> AVDiscard {
|
fn from(value: Discard) -> AVDiscard {
|
||||||
match self {
|
match value {
|
||||||
Discard::None => AVDISCARD_NONE,
|
Discard::None => AVDISCARD_NONE,
|
||||||
Discard::Default => AVDISCARD_DEFAULT,
|
Discard::Default => AVDISCARD_DEFAULT,
|
||||||
Discard::NonReference => AVDISCARD_NONREF,
|
Discard::NonReference => AVDISCARD_NONREF,
|
||||||
|
@ -46,9 +46,9 @@ impl From<c_int> for Comparison {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
impl Into<c_int> for Comparison {
|
impl From<Comparison> for c_int {
|
||||||
fn into(self) -> c_int {
|
fn from(value: Comparison) -> c_int {
|
||||||
match self {
|
match value {
|
||||||
Comparison::SAD => FF_CMP_SAD,
|
Comparison::SAD => FF_CMP_SAD,
|
||||||
Comparison::SSE => FF_CMP_SSE,
|
Comparison::SSE => FF_CMP_SSE,
|
||||||
Comparison::SATD => FF_CMP_SATD,
|
Comparison::SATD => FF_CMP_SATD,
|
||||||
|
@ -20,9 +20,9 @@ impl From<c_int> for Decision {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
impl Into<c_int> for Decision {
|
impl From<Decision> for c_int {
|
||||||
fn into(self) -> c_int {
|
fn from(value: Decision) -> c_int {
|
||||||
match self {
|
match value {
|
||||||
Decision::Simple => FF_MB_DECISION_SIMPLE,
|
Decision::Simple => FF_MB_DECISION_SIMPLE,
|
||||||
Decision::Bits => FF_MB_DECISION_BITS,
|
Decision::Bits => FF_MB_DECISION_BITS,
|
||||||
Decision::RateDistortion => FF_MB_DECISION_RD,
|
Decision::RateDistortion => FF_MB_DECISION_RD,
|
||||||
|
@ -33,9 +33,9 @@ impl From<c_int> for MotionEstimation {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
impl Into<c_int> for MotionEstimation {
|
impl From<MotionEstimation> for c_int {
|
||||||
fn into(self) -> c_int {
|
fn from(value: MotionEstimation) -> c_int {
|
||||||
match self {
|
match value {
|
||||||
MotionEstimation::Zero => 1,
|
MotionEstimation::Zero => 1,
|
||||||
MotionEstimation::Full => 2,
|
MotionEstimation::Full => 2,
|
||||||
MotionEstimation::Log => 3,
|
MotionEstimation::Log => 3,
|
||||||
|
@ -20,9 +20,9 @@ impl From<c_int> for Prediction {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
impl Into<c_int> for Prediction {
|
impl From<Prediction> for c_int {
|
||||||
fn into(self) -> c_int {
|
fn from(value: Prediction) -> c_int {
|
||||||
match self {
|
match value {
|
||||||
Prediction::Left => FF_PRED_LEFT,
|
Prediction::Left => FF_PRED_LEFT,
|
||||||
Prediction::Plane => FF_PRED_PLANE,
|
Prediction::Plane => FF_PRED_PLANE,
|
||||||
Prediction::Median => FF_PRED_MEDIAN,
|
Prediction::Median => FF_PRED_MEDIAN,
|
||||||
|
@ -24,9 +24,9 @@ impl From<AVFieldOrder> for FieldOrder {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
impl Into<AVFieldOrder> for FieldOrder {
|
impl From<FieldOrder> for AVFieldOrder {
|
||||||
fn into(self) -> AVFieldOrder {
|
fn from(value: FieldOrder) -> AVFieldOrder {
|
||||||
match self {
|
match value {
|
||||||
FieldOrder::Unknown => AV_FIELD_UNKNOWN,
|
FieldOrder::Unknown => AV_FIELD_UNKNOWN,
|
||||||
FieldOrder::Progressive => AV_FIELD_PROGRESSIVE,
|
FieldOrder::Progressive => AV_FIELD_PROGRESSIVE,
|
||||||
FieldOrder::TT => AV_FIELD_TT,
|
FieldOrder::TT => AV_FIELD_TT,
|
||||||
|
@ -594,7 +594,7 @@ pub enum Id {
|
|||||||
#[cfg(feature = "ffmpeg_4_4")]
|
#[cfg(feature = "ffmpeg_4_4")]
|
||||||
ADPCM_IMA_MOFLEX,
|
ADPCM_IMA_MOFLEX,
|
||||||
#[cfg(feature = "ffmpeg_4_4")]
|
#[cfg(feature = "ffmpeg_4_4")]
|
||||||
FASTAUDIO
|
FASTAUDIO,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl Id {
|
impl Id {
|
||||||
@ -1196,14 +1196,14 @@ impl From<AVCodecID> for Id {
|
|||||||
#[cfg(feature = "ffmpeg_4_4")]
|
#[cfg(feature = "ffmpeg_4_4")]
|
||||||
AV_CODEC_ID_ADPCM_IMA_MOFLEX => Id::ADPCM_IMA_MOFLEX,
|
AV_CODEC_ID_ADPCM_IMA_MOFLEX => Id::ADPCM_IMA_MOFLEX,
|
||||||
#[cfg(feature = "ffmpeg_4_4")]
|
#[cfg(feature = "ffmpeg_4_4")]
|
||||||
AV_CODEC_ID_FASTAUDIO => Id::FASTAUDIO
|
AV_CODEC_ID_FASTAUDIO => Id::FASTAUDIO,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
impl Into<AVCodecID> for Id {
|
impl From<Id> for AVCodecID {
|
||||||
fn into(self) -> AVCodecID {
|
fn from(value: Id) -> AVCodecID {
|
||||||
match self {
|
match value {
|
||||||
Id::None => AV_CODEC_ID_NONE,
|
Id::None => AV_CODEC_ID_NONE,
|
||||||
|
|
||||||
/* video codecs */
|
/* video codecs */
|
||||||
@ -1790,7 +1790,7 @@ impl Into<AVCodecID> for Id {
|
|||||||
#[cfg(feature = "ffmpeg_4_4")]
|
#[cfg(feature = "ffmpeg_4_4")]
|
||||||
Id::ADPCM_IMA_MOFLEX => AV_CODEC_ID_ADPCM_IMA_MOFLEX,
|
Id::ADPCM_IMA_MOFLEX => AV_CODEC_ID_ADPCM_IMA_MOFLEX,
|
||||||
#[cfg(feature = "ffmpeg_4_4")]
|
#[cfg(feature = "ffmpeg_4_4")]
|
||||||
Id::FASTAUDIO => AV_CODEC_ID_FASTAUDIO
|
Id::FASTAUDIO => AV_CODEC_ID_FASTAUDIO,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -50,7 +50,7 @@ pub enum Type {
|
|||||||
DOVI_CONF,
|
DOVI_CONF,
|
||||||
|
|
||||||
#[cfg(feature = "ffmpeg_4_4")]
|
#[cfg(feature = "ffmpeg_4_4")]
|
||||||
S12M_TIMECODE
|
S12M_TIMECODE,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl From<AVPacketSideDataType> for Type {
|
impl From<AVPacketSideDataType> for Type {
|
||||||
@ -99,14 +99,14 @@ impl From<AVPacketSideDataType> for Type {
|
|||||||
AV_PKT_DATA_DOVI_CONF => Type::DOVI_CONF,
|
AV_PKT_DATA_DOVI_CONF => Type::DOVI_CONF,
|
||||||
|
|
||||||
#[cfg(feature = "ffmpeg_4_4")]
|
#[cfg(feature = "ffmpeg_4_4")]
|
||||||
AV_PKT_DATA_S12M_TIMECODE => Type::S12M_TIMECODE
|
AV_PKT_DATA_S12M_TIMECODE => Type::S12M_TIMECODE,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
impl Into<AVPacketSideDataType> for Type {
|
impl From<Type> for AVPacketSideDataType {
|
||||||
fn into(self) -> AVPacketSideDataType {
|
fn from(value: Type) -> AVPacketSideDataType {
|
||||||
match self {
|
match value {
|
||||||
Type::Palette => AV_PKT_DATA_PALETTE,
|
Type::Palette => AV_PKT_DATA_PALETTE,
|
||||||
Type::NewExtraData => AV_PKT_DATA_NEW_EXTRADATA,
|
Type::NewExtraData => AV_PKT_DATA_NEW_EXTRADATA,
|
||||||
Type::ParamChange => AV_PKT_DATA_PARAM_CHANGE,
|
Type::ParamChange => AV_PKT_DATA_PARAM_CHANGE,
|
||||||
@ -150,7 +150,7 @@ impl Into<AVPacketSideDataType> for Type {
|
|||||||
Type::DOVI_CONF => AV_PKT_DATA_DOVI_CONF,
|
Type::DOVI_CONF => AV_PKT_DATA_DOVI_CONF,
|
||||||
|
|
||||||
#[cfg(feature = "ffmpeg_4_4")]
|
#[cfg(feature = "ffmpeg_4_4")]
|
||||||
Type::S12M_TIMECODE => AV_PKT_DATA_S12M_TIMECODE
|
Type::S12M_TIMECODE => AV_PKT_DATA_S12M_TIMECODE,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -279,9 +279,9 @@ impl From<(Id, c_int)> for Profile {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
impl Into<c_int> for Profile {
|
impl From<Profile> for c_int {
|
||||||
fn into(self) -> c_int {
|
fn from(value: Profile) -> c_int {
|
||||||
match self {
|
match value {
|
||||||
Profile::Unknown => FF_PROFILE_UNKNOWN,
|
Profile::Unknown => FF_PROFILE_UNKNOWN,
|
||||||
Profile::Reserved => FF_PROFILE_RESERVED,
|
Profile::Reserved => FF_PROFILE_RESERVED,
|
||||||
|
|
||||||
|
@ -33,9 +33,9 @@ impl From<AVSubtitleType> for Type {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
impl Into<AVSubtitleType> for Type {
|
impl From<Type> for AVSubtitleType {
|
||||||
fn into(self) -> AVSubtitleType {
|
fn from(value: Type) -> AVSubtitleType {
|
||||||
match self {
|
match value {
|
||||||
Type::None => SUBTITLE_NONE,
|
Type::None => SUBTITLE_NONE,
|
||||||
Type::Bitmap => SUBTITLE_BITMAP,
|
Type::Bitmap => SUBTITLE_BITMAP,
|
||||||
Type::Text => SUBTITLE_TEXT,
|
Type::Text => SUBTITLE_TEXT,
|
||||||
|
@ -59,9 +59,9 @@ impl From<c_int> for Type {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
impl Into<c_int> for Type {
|
impl From<Type> for c_int {
|
||||||
fn into(self) -> c_int {
|
fn from(value: Type) -> c_int {
|
||||||
match self {
|
match value {
|
||||||
Type::None => 0,
|
Type::None => 0,
|
||||||
Type::Frame => FF_THREAD_FRAME,
|
Type::Frame => FF_THREAD_FRAME,
|
||||||
Type::Slice => FF_THREAD_SLICE,
|
Type::Slice => FF_THREAD_SLICE,
|
||||||
|
@ -38,9 +38,9 @@ impl From<SwrDitherType> for Dither {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
impl Into<SwrDitherType> for Dither {
|
impl From<Dither> for SwrDitherType {
|
||||||
fn into(self) -> SwrDitherType {
|
fn from(value: Dither) -> SwrDitherType {
|
||||||
match self {
|
match value {
|
||||||
Dither::None => SWR_DITHER_NONE,
|
Dither::None => SWR_DITHER_NONE,
|
||||||
Dither::Rectangular => SWR_DITHER_RECTANGULAR,
|
Dither::Rectangular => SWR_DITHER_RECTANGULAR,
|
||||||
Dither::Triangular => SWR_DITHER_TRIANGULAR,
|
Dither::Triangular => SWR_DITHER_TRIANGULAR,
|
||||||
|
@ -17,9 +17,9 @@ impl From<SwrEngine> for Engine {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
impl Into<SwrEngine> for Engine {
|
impl From<Engine> for SwrEngine {
|
||||||
fn into(self) -> SwrEngine {
|
fn from(value: Engine) -> SwrEngine {
|
||||||
match self {
|
match value {
|
||||||
Engine::Software => SWR_ENGINE_SWR,
|
Engine::Software => SWR_ENGINE_SWR,
|
||||||
Engine::SoundExchange => SWR_ENGINE_SOXR,
|
Engine::SoundExchange => SWR_ENGINE_SOXR,
|
||||||
}
|
}
|
||||||
|
@ -18,9 +18,9 @@ impl From<SwrFilterType> for Filter {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
impl Into<SwrFilterType> for Filter {
|
impl From<Filter> for SwrFilterType {
|
||||||
fn into(self) -> SwrFilterType {
|
fn from(value: Filter) -> SwrFilterType {
|
||||||
match self {
|
match value {
|
||||||
Filter::Cubic => SWR_FILTER_TYPE_CUBIC,
|
Filter::Cubic => SWR_FILTER_TYPE_CUBIC,
|
||||||
Filter::BlackmanNuttall => SWR_FILTER_TYPE_BLACKMAN_NUTTALL,
|
Filter::BlackmanNuttall => SWR_FILTER_TYPE_BLACKMAN_NUTTALL,
|
||||||
Filter::Kaiser => SWR_FILTER_TYPE_KAISER,
|
Filter::Kaiser => SWR_FILTER_TYPE_KAISER,
|
||||||
|
@ -26,9 +26,9 @@ impl From<c_int> for ColorSpace {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
impl Into<c_int> for ColorSpace {
|
impl From<ColorSpace> for c_int {
|
||||||
fn into(self) -> c_int {
|
fn from(value: ColorSpace) -> c_int {
|
||||||
match self {
|
match value {
|
||||||
ColorSpace::Default => SWS_CS_DEFAULT,
|
ColorSpace::Default => SWS_CS_DEFAULT,
|
||||||
ColorSpace::ITU709 => SWS_CS_ITU709,
|
ColorSpace::ITU709 => SWS_CS_ITU709,
|
||||||
ColorSpace::FCC => SWS_CS_FCC,
|
ColorSpace::FCC => SWS_CS_FCC,
|
||||||
|
@ -27,9 +27,9 @@ impl From<AVChromaLocation> for Location {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
impl Into<AVChromaLocation> for Location {
|
impl From<Location> for AVChromaLocation {
|
||||||
fn into(self) -> AVChromaLocation {
|
fn from(value: Location) -> AVChromaLocation {
|
||||||
match self {
|
match value {
|
||||||
Location::Unspecified => AVCHROMA_LOC_UNSPECIFIED,
|
Location::Unspecified => AVCHROMA_LOC_UNSPECIFIED,
|
||||||
Location::Left => AVCHROMA_LOC_LEFT,
|
Location::Left => AVCHROMA_LOC_LEFT,
|
||||||
Location::Center => AVCHROMA_LOC_CENTER,
|
Location::Center => AVCHROMA_LOC_CENTER,
|
||||||
|
@ -70,9 +70,9 @@ impl From<AVColorPrimaries> for Primaries {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
impl Into<AVColorPrimaries> for Primaries {
|
impl From<Primaries> for AVColorPrimaries {
|
||||||
fn into(self) -> AVColorPrimaries {
|
fn from(value: Primaries) -> AVColorPrimaries {
|
||||||
match self {
|
match value {
|
||||||
Primaries::Reserved0 => AVCOL_PRI_RESERVED0,
|
Primaries::Reserved0 => AVCOL_PRI_RESERVED0,
|
||||||
Primaries::BT709 => AVCOL_PRI_BT709,
|
Primaries::BT709 => AVCOL_PRI_BT709,
|
||||||
Primaries::Unspecified => AVCOL_PRI_UNSPECIFIED,
|
Primaries::Unspecified => AVCOL_PRI_UNSPECIFIED,
|
||||||
|
@ -35,9 +35,9 @@ impl From<AVColorRange> for Range {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
impl Into<AVColorRange> for Range {
|
impl From<Range> for AVColorRange {
|
||||||
fn into(self) -> AVColorRange {
|
fn from(value: Range) -> AVColorRange {
|
||||||
match self {
|
match value {
|
||||||
Range::Unspecified => AVCOL_RANGE_UNSPECIFIED,
|
Range::Unspecified => AVCOL_RANGE_UNSPECIFIED,
|
||||||
Range::MPEG => AVCOL_RANGE_MPEG,
|
Range::MPEG => AVCOL_RANGE_MPEG,
|
||||||
Range::JPEG => AVCOL_RANGE_JPEG,
|
Range::JPEG => AVCOL_RANGE_JPEG,
|
||||||
|
@ -63,9 +63,9 @@ impl From<AVColorSpace> for Space {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
impl Into<AVColorSpace> for Space {
|
impl From<Space> for AVColorSpace {
|
||||||
fn into(self) -> AVColorSpace {
|
fn from(value: Space) -> AVColorSpace {
|
||||||
match self {
|
match value {
|
||||||
Space::RGB => AVCOL_SPC_RGB,
|
Space::RGB => AVCOL_SPC_RGB,
|
||||||
Space::BT709 => AVCOL_SPC_BT709,
|
Space::BT709 => AVCOL_SPC_BT709,
|
||||||
Space::Unspecified => AVCOL_SPC_UNSPECIFIED,
|
Space::Unspecified => AVCOL_SPC_UNSPECIFIED,
|
||||||
|
@ -67,9 +67,9 @@ impl From<AVColorTransferCharacteristic> for TransferCharacteristic {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
impl Into<AVColorTransferCharacteristic> for TransferCharacteristic {
|
impl From<TransferCharacteristic> for AVColorTransferCharacteristic {
|
||||||
fn into(self) -> AVColorTransferCharacteristic {
|
fn from(value: TransferCharacteristic) -> AVColorTransferCharacteristic {
|
||||||
match self {
|
match value {
|
||||||
TransferCharacteristic::Reserved0 => AVCOL_TRC_RESERVED0,
|
TransferCharacteristic::Reserved0 => AVCOL_TRC_RESERVED0,
|
||||||
TransferCharacteristic::BT709 => AVCOL_TRC_BT709,
|
TransferCharacteristic::BT709 => AVCOL_TRC_BT709,
|
||||||
TransferCharacteristic::Unspecified => AVCOL_TRC_UNSPECIFIED,
|
TransferCharacteristic::Unspecified => AVCOL_TRC_UNSPECIFIED,
|
||||||
|
@ -100,9 +100,9 @@ impl From<c_int> for Error {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
impl Into<c_int> for Error {
|
impl From<Error> for c_int {
|
||||||
fn into(self) -> c_int {
|
fn from(value: Error) -> c_int {
|
||||||
match self {
|
match value {
|
||||||
Error::BsfNotFound => AVERROR_BSF_NOT_FOUND,
|
Error::BsfNotFound => AVERROR_BSF_NOT_FOUND,
|
||||||
Error::Bug => AVERROR_BUG,
|
Error::Bug => AVERROR_BUG,
|
||||||
Error::BufferTooSmall => AVERROR_BUFFER_TOO_SMALL,
|
Error::BufferTooSmall => AVERROR_BUFFER_TOO_SMALL,
|
||||||
@ -202,7 +202,7 @@ fn index(error: &Error) -> usize {
|
|||||||
|
|
||||||
// XXX: the length has to be synced with the number of errors
|
// XXX: the length has to be synced with the number of errors
|
||||||
static mut STRINGS: [[c_char; AV_ERROR_MAX_STRING_SIZE]; 27] =
|
static mut STRINGS: [[c_char; AV_ERROR_MAX_STRING_SIZE]; 27] =
|
||||||
[[0 as c_char; AV_ERROR_MAX_STRING_SIZE]; 27];
|
[[0_i8; AV_ERROR_MAX_STRING_SIZE]; 27];
|
||||||
|
|
||||||
pub fn register_all() {
|
pub fn register_all() {
|
||||||
unsafe {
|
unsafe {
|
||||||
|
@ -702,10 +702,10 @@ impl From<AVPixelFormat> for Pixel {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
impl Into<AVPixelFormat> for Pixel {
|
impl From<Pixel> for AVPixelFormat {
|
||||||
#[inline]
|
#[inline]
|
||||||
fn into(self) -> AVPixelFormat {
|
fn from(value: Pixel) -> AVPixelFormat {
|
||||||
match self {
|
match value {
|
||||||
Pixel::None => AV_PIX_FMT_NONE,
|
Pixel::None => AV_PIX_FMT_NONE,
|
||||||
|
|
||||||
Pixel::YUV420P => AV_PIX_FMT_YUV420P,
|
Pixel::YUV420P => AV_PIX_FMT_YUV420P,
|
||||||
|
@ -101,10 +101,10 @@ impl From<&'static str> for Sample {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
impl Into<AVSampleFormat> for Sample {
|
impl From<Sample> for AVSampleFormat {
|
||||||
#[inline]
|
#[inline]
|
||||||
fn into(self) -> AVSampleFormat {
|
fn from(value: Sample) -> AVSampleFormat {
|
||||||
match self {
|
match value {
|
||||||
Sample::None => AV_SAMPLE_FMT_NONE,
|
Sample::None => AV_SAMPLE_FMT_NONE,
|
||||||
|
|
||||||
Sample::U8(Type::Packed) => AV_SAMPLE_FMT_U8,
|
Sample::U8(Type::Packed) => AV_SAMPLE_FMT_U8,
|
||||||
|
@ -47,7 +47,7 @@ pub enum Type {
|
|||||||
#[cfg(feature = "ffmpeg_4_4")]
|
#[cfg(feature = "ffmpeg_4_4")]
|
||||||
SEI_UNREGISTERED,
|
SEI_UNREGISTERED,
|
||||||
#[cfg(feature = "ffmpeg_4_4")]
|
#[cfg(feature = "ffmpeg_4_4")]
|
||||||
FILM_GRAIN_PARAMS
|
FILM_GRAIN_PARAMS,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl Type {
|
impl Type {
|
||||||
@ -100,15 +100,15 @@ impl From<AVFrameSideDataType> for Type {
|
|||||||
#[cfg(feature = "ffmpeg_4_4")]
|
#[cfg(feature = "ffmpeg_4_4")]
|
||||||
AV_FRAME_DATA_SEI_UNREGISTERED => Type::SEI_UNREGISTERED,
|
AV_FRAME_DATA_SEI_UNREGISTERED => Type::SEI_UNREGISTERED,
|
||||||
#[cfg(feature = "ffmpeg_4_4")]
|
#[cfg(feature = "ffmpeg_4_4")]
|
||||||
AV_FRAME_DATA_FILM_GRAIN_PARAMS => Type::FILM_GRAIN_PARAMS
|
AV_FRAME_DATA_FILM_GRAIN_PARAMS => Type::FILM_GRAIN_PARAMS,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
impl Into<AVFrameSideDataType> for Type {
|
impl From<Type> for AVFrameSideDataType {
|
||||||
#[inline(always)]
|
#[inline(always)]
|
||||||
fn into(self) -> AVFrameSideDataType {
|
fn from(value: Type) -> AVFrameSideDataType {
|
||||||
match self {
|
match value {
|
||||||
Type::PanScan => AV_FRAME_DATA_PANSCAN,
|
Type::PanScan => AV_FRAME_DATA_PANSCAN,
|
||||||
Type::A53CC => AV_FRAME_DATA_A53_CC,
|
Type::A53CC => AV_FRAME_DATA_A53_CC,
|
||||||
Type::Stereo3D => AV_FRAME_DATA_STEREO3D,
|
Type::Stereo3D => AV_FRAME_DATA_STEREO3D,
|
||||||
@ -146,7 +146,7 @@ impl Into<AVFrameSideDataType> for Type {
|
|||||||
#[cfg(feature = "ffmpeg_4_4")]
|
#[cfg(feature = "ffmpeg_4_4")]
|
||||||
Type::SEI_UNREGISTERED => AV_FRAME_DATA_SEI_UNREGISTERED,
|
Type::SEI_UNREGISTERED => AV_FRAME_DATA_SEI_UNREGISTERED,
|
||||||
#[cfg(feature = "ffmpeg_4_4")]
|
#[cfg(feature = "ffmpeg_4_4")]
|
||||||
Type::FILM_GRAIN_PARAMS => AV_FRAME_DATA_FILM_GRAIN_PARAMS
|
Type::FILM_GRAIN_PARAMS => AV_FRAME_DATA_FILM_GRAIN_PARAMS,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -37,9 +37,9 @@ impl TryFrom<c_int> for Level {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
impl Into<c_int> for Level {
|
impl From<Level> for c_int {
|
||||||
fn into(self) -> c_int {
|
fn from(value: Level) -> c_int {
|
||||||
match self {
|
match value {
|
||||||
Level::Quiet => AV_LOG_QUIET,
|
Level::Quiet => AV_LOG_QUIET,
|
||||||
Level::Panic => AV_LOG_PANIC,
|
Level::Panic => AV_LOG_PANIC,
|
||||||
Level::Fatal => AV_LOG_FATAL,
|
Level::Fatal => AV_LOG_FATAL,
|
||||||
|
@ -25,10 +25,10 @@ impl From<AVRounding> for Rounding {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
impl Into<AVRounding> for Rounding {
|
impl From<Rounding> for AVRounding {
|
||||||
#[inline(always)]
|
#[inline(always)]
|
||||||
fn into(self) -> AVRounding {
|
fn from(value: Rounding) -> AVRounding {
|
||||||
match self {
|
match value {
|
||||||
Rounding::Zero => AV_ROUND_ZERO,
|
Rounding::Zero => AV_ROUND_ZERO,
|
||||||
Rounding::Infinity => AV_ROUND_INF,
|
Rounding::Infinity => AV_ROUND_INF,
|
||||||
Rounding::Down => AV_ROUND_DOWN,
|
Rounding::Down => AV_ROUND_DOWN,
|
||||||
|
@ -26,10 +26,10 @@ impl From<AVMediaType> for Type {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
impl Into<AVMediaType> for Type {
|
impl From<Type> for AVMediaType {
|
||||||
#[inline(always)]
|
#[inline(always)]
|
||||||
fn into(self) -> AVMediaType {
|
fn from(value: Type) -> AVMediaType {
|
||||||
match self {
|
match value {
|
||||||
Type::Unknown => AVMEDIA_TYPE_UNKNOWN,
|
Type::Unknown => AVMEDIA_TYPE_UNKNOWN,
|
||||||
Type::Video => AVMEDIA_TYPE_VIDEO,
|
Type::Video => AVMEDIA_TYPE_VIDEO,
|
||||||
Type::Audio => AVMEDIA_TYPE_AUDIO,
|
Type::Audio => AVMEDIA_TYPE_AUDIO,
|
||||||
|
@ -55,9 +55,9 @@ impl From<AVOptionType> for Type {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
impl Into<AVOptionType> for Type {
|
impl From<Type> for AVOptionType {
|
||||||
fn into(self) -> AVOptionType {
|
fn from(value: Type) -> AVOptionType {
|
||||||
match self {
|
match value {
|
||||||
Type::Flags => AV_OPT_TYPE_FLAGS,
|
Type::Flags => AV_OPT_TYPE_FLAGS,
|
||||||
Type::Int => AV_OPT_TYPE_INT,
|
Type::Int => AV_OPT_TYPE_INT,
|
||||||
Type::Int64 => AV_OPT_TYPE_INT64,
|
Type::Int64 => AV_OPT_TYPE_INT64,
|
||||||
|
@ -29,10 +29,10 @@ impl From<AVPictureType> for Type {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
impl Into<AVPictureType> for Type {
|
impl From<Type> for AVPictureType {
|
||||||
#[inline(always)]
|
#[inline(always)]
|
||||||
fn into(self) -> AVPictureType {
|
fn from(value: Type) -> AVPictureType {
|
||||||
match self {
|
match value {
|
||||||
Type::None => AV_PICTURE_TYPE_NONE,
|
Type::None => AV_PICTURE_TYPE_NONE,
|
||||||
Type::I => AV_PICTURE_TYPE_I,
|
Type::I => AV_PICTURE_TYPE_I,
|
||||||
Type::P => AV_PICTURE_TYPE_P,
|
Type::P => AV_PICTURE_TYPE_P,
|
||||||
|
@ -67,12 +67,12 @@ impl From<AVRational> for Rational {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
impl Into<AVRational> for Rational {
|
impl From<Rational> for AVRational {
|
||||||
#[inline]
|
#[inline]
|
||||||
fn into(self) -> AVRational {
|
fn from(value: Rational) -> AVRational {
|
||||||
AVRational {
|
AVRational {
|
||||||
num: self.0,
|
num: value.0,
|
||||||
den: self.1,
|
den: value.1,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user