diff mbox series

[FFmpeg-devel,2/2] qsv: remove audio error code

Message ID 20200819061023.443304-2-haihao.xiang@intel.com
State New
Headers show
Series [FFmpeg-devel,1/2] qsv: needn't load user plugin since libmfx 1.28 | expand

Checks

Context Check Description
andriy/default pending
andriy/configure warning Failed to apply patch

Commit Message

Xiang, Haihao Aug. 19, 2020, 6:10 a.m. UTC
---
 libavcodec/qsv.c | 3 ---
 1 file changed, 3 deletions(-)

Comments

Jun Zhao Aug. 19, 2020, 10:43 a.m. UTC | #1
On Wed, Aug 19, 2020 at 2:10 PM Haihao Xiang <haihao.xiang@intel.com> wrote:
>
> ---
>  libavcodec/qsv.c | 3 ---
>  1 file changed, 3 deletions(-)
>
> diff --git a/libavcodec/qsv.c b/libavcodec/qsv.c
> index faa424bb68..6776b745b9 100644
> --- a/libavcodec/qsv.c
> +++ b/libavcodec/qsv.c
> @@ -143,8 +143,6 @@ static const struct {
>      { MFX_ERR_INVALID_VIDEO_PARAM,      AVERROR(EINVAL), "invalid video parameters"             },
>      { MFX_ERR_UNDEFINED_BEHAVIOR,       AVERROR_BUG,     "undefined behavior"                   },
>      { MFX_ERR_DEVICE_FAILED,            AVERROR(EIO),    "device failed"                        },
> -    { MFX_ERR_INCOMPATIBLE_AUDIO_PARAM, AVERROR(EINVAL), "incompatible audio parameters"        },
> -    { MFX_ERR_INVALID_AUDIO_PARAM,      AVERROR(EINVAL), "invalid audio parameters"             },
>
>      { MFX_WRN_IN_EXECUTION,             0,               "operation in execution"               },
>      { MFX_WRN_DEVICE_BUSY,              0,               "device busy"                          },
> @@ -154,7 +152,6 @@ static const struct {
>      { MFX_WRN_VALUE_NOT_CHANGED,        0,               "value is saturated"                   },
>      { MFX_WRN_OUT_OF_RANGE,             0,               "value out of range"                   },
>      { MFX_WRN_FILTER_SKIPPED,           0,               "filter skipped"                       },
> -    { MFX_WRN_INCOMPATIBLE_AUDIO_PARAM, 0,               "incompatible audio parameters"        },
>  };
>
>  int ff_qsv_map_error(mfxStatus mfx_err, const char **desc)
> --
> 2.25.1
LGTM
Nicolas George Aug. 19, 2020, 11:53 a.m. UTC | #2
Haihao Xiang (12020-08-19):
> ---
>  libavcodec/qsv.c | 3 ---
>  1 file changed, 3 deletions(-)
> 
> diff --git a/libavcodec/qsv.c b/libavcodec/qsv.c
> index faa424bb68..6776b745b9 100644
> --- a/libavcodec/qsv.c
> +++ b/libavcodec/qsv.c
> @@ -143,8 +143,6 @@ static const struct {
>      { MFX_ERR_INVALID_VIDEO_PARAM,      AVERROR(EINVAL), "invalid video parameters"             },
>      { MFX_ERR_UNDEFINED_BEHAVIOR,       AVERROR_BUG,     "undefined behavior"                   },
>      { MFX_ERR_DEVICE_FAILED,            AVERROR(EIO),    "device failed"                        },
> -    { MFX_ERR_INCOMPATIBLE_AUDIO_PARAM, AVERROR(EINVAL), "incompatible audio parameters"        },
> -    { MFX_ERR_INVALID_AUDIO_PARAM,      AVERROR(EINVAL), "invalid audio parameters"             },
>  
>      { MFX_WRN_IN_EXECUTION,             0,               "operation in execution"               },
>      { MFX_WRN_DEVICE_BUSY,              0,               "device busy"                          },
> @@ -154,7 +152,6 @@ static const struct {
>      { MFX_WRN_VALUE_NOT_CHANGED,        0,               "value is saturated"                   },
>      { MFX_WRN_OUT_OF_RANGE,             0,               "value out of range"                   },
>      { MFX_WRN_FILTER_SKIPPED,           0,               "filter skipped"                       },
> -    { MFX_WRN_INCOMPATIBLE_AUDIO_PARAM, 0,               "incompatible audio parameters"        },
>  };
>  
>  int ff_qsv_map_error(mfxStatus mfx_err, const char **desc)

Why?

Regards,
Xiang, Haihao Aug. 20, 2020, 12:13 a.m. UTC | #3
On Wed, 2020-08-19 at 13:53 +0200, Nicolas George wrote:
> Haihao Xiang (12020-08-19):
> > ---
> >  libavcodec/qsv.c | 3 ---
> >  1 file changed, 3 deletions(-)
> > 
> > diff --git a/libavcodec/qsv.c b/libavcodec/qsv.c
> > index faa424bb68..6776b745b9 100644
> > --- a/libavcodec/qsv.c
> > +++ b/libavcodec/qsv.c
> > @@ -143,8 +143,6 @@ static const struct {
> >      { MFX_ERR_INVALID_VIDEO_PARAM,      AVERROR(EINVAL), "invalid video
> > parameters"             },
> >      { MFX_ERR_UNDEFINED_BEHAVIOR,       AVERROR_BUG,     "undefined
> > behavior"                   },
> >      { MFX_ERR_DEVICE_FAILED,            AVERROR(EIO),    "device
> > failed"                        },
> > -    { MFX_ERR_INCOMPATIBLE_AUDIO_PARAM, AVERROR(EINVAL), "incompatible
> > audio parameters"        },
> > -    { MFX_ERR_INVALID_AUDIO_PARAM,      AVERROR(EINVAL), "invalid audio
> > parameters"             },
> >  
> >      { MFX_WRN_IN_EXECUTION,             0,               "operation in
> > execution"               },
> >      { MFX_WRN_DEVICE_BUSY,              0,               "device
> > busy"                          },
> > @@ -154,7 +152,6 @@ static const struct {
> >      { MFX_WRN_VALUE_NOT_CHANGED,        0,               "value is
> > saturated"                   },
> >      { MFX_WRN_OUT_OF_RANGE,             0,               "value out of
> > range"                   },
> >      { MFX_WRN_FILTER_SKIPPED,           0,               "filter
> > skipped"                       },
> > -    { MFX_WRN_INCOMPATIBLE_AUDIO_PARAM, 0,               "incompatible
> > audio parameters"        },
> >  };
> >  
> >  int ff_qsv_map_error(mfxStatus mfx_err, const char **desc)
> 
> Why?

qsv in FFmpeg is for video only, actually the SDK is for HW accelerated video
decode, encode and filtering now, see 
https://github.com/Intel-Media-SDK/MediaSDK#intel-media-sdk.

Thanks
Haihao

> 
> Regards,
> 
> _______________________________________________
> ffmpeg-devel mailing list
> ffmpeg-devel@ffmpeg.org
> https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
> 
> To unsubscribe, visit link above, or email
> ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".
Thilo Borgmann Aug. 21, 2020, 7:47 a.m. UTC | #4
> 
> 
> On Thu, 2020-08-20 at 02:26 +0200, Thilo Borgmann wrote:
>> Am 20.08.20 um 02:13 schrieb Xiang, Haihao:
>>> On Wed, 2020-08-19 at 13:53 +0200, Nicolas George wrote:
>>>> Haihao Xiang (12020-08-19):
>>>>> ---
>>>>>  libavcodec/qsv.c | 3 ---
>>>>>  1 file changed, 3 deletions(-)
>>>>>
>>>>> diff --git a/libavcodec/qsv.c b/libavcodec/qsv.c
>>>>> index faa424bb68..6776b745b9 100644
>>>>> --- a/libavcodec/qsv.c
>>>>> +++ b/libavcodec/qsv.c
>>>>> @@ -143,8 +143,6 @@ static const struct {
>>>>>      { MFX_ERR_INVALID_VIDEO_PARAM,      AVERROR(EINVAL), "invalid video
>>>>> parameters"             },
>>>>>      { MFX_ERR_UNDEFINED_BEHAVIOR,       AVERROR_BUG,     "undefined
>>>>> behavior"                   },
>>>>>      { MFX_ERR_DEVICE_FAILED,            AVERROR(EIO),    "device
>>>>> failed"                        },
>>>>> -    { MFX_ERR_INCOMPATIBLE_AUDIO_PARAM, AVERROR(EINVAL), "incompatible
>>>>> audio parameters"        },
>>>>> -    { MFX_ERR_INVALID_AUDIO_PARAM,      AVERROR(EINVAL), "invalid audio
>>>>> parameters"             },
>>>>>  
>>>>>      { MFX_WRN_IN_EXECUTION,             0,               "operation in
>>>>> execution"               },
>>>>>      { MFX_WRN_DEVICE_BUSY,              0,               "device
>>>>> busy"                          },
>>>>> @@ -154,7 +152,6 @@ static const struct {
>>>>>      { MFX_WRN_VALUE_NOT_CHANGED,        0,               "value is
>>>>> saturated"                   },
>>>>>      { MFX_WRN_OUT_OF_RANGE,             0,               "value out of
>>>>> range"                   },
>>>>>      { MFX_WRN_FILTER_SKIPPED,           0,               "filter
>>>>> skipped"                       },
>>>>> -    { MFX_WRN_INCOMPATIBLE_AUDIO_PARAM, 0,               "incompatible
>>>>> audio parameters"        },
>>>>>  };
>>>>>  
>>>>>  int ff_qsv_map_error(mfxStatus mfx_err, const char **desc)
>>>>
>>>> Why?
>>>
>>> qsv in FFmpeg is for video only, actually the SDK is for HW accelerated
>>> video
>>> decode, encode and filtering now, see 
>>> https://github.com/Intel-Media-SDK/MediaSDK#intel-media-sdk.
>>
>> This seems like a generic translation from the library errors to FF error
>> codes. So even if we'll never touch the audio functionality of it, I'd prefer
>> to have that struct complete already.
>>
> 
> In general, I agree with you. But the SDK no longer support audio and the
> corresponding code might be deprecated or removed in the future, so I'd prefer
> to do a clean up (of course we may add some #ifdef.. #endif)

Hm it's ugly yet used in other places in qsv.c already to do the same. So you should also make use of it there IMHO.


> BTW did you not reply the mailing list? I didn't see your comment in the
> patchwork (
> https://patchwork.ffmpeg.org/project/ffmpeg/patch/20200819061023.443304-2-haihao.xiang@intel.com/
> )

Oh sorry I messed that up, so I included the short history now, thx!

-Thilo
Xiang, Haihao Aug. 24, 2020, 6:20 a.m. UTC | #5
On Fri, 2020-08-21 at 09:47 +0200, Thilo Borgmann wrote:
> > 
> > 
> > On Thu, 2020-08-20 at 02:26 +0200, Thilo Borgmann wrote:
> > > Am 20.08.20 um 02:13 schrieb Xiang, Haihao:
> > > > On Wed, 2020-08-19 at 13:53 +0200, Nicolas George wrote:
> > > > > Haihao Xiang (12020-08-19):
> > > > > > ---
> > > > > >  libavcodec/qsv.c | 3 ---
> > > > > >  1 file changed, 3 deletions(-)
> > > > > > 
> > > > > > diff --git a/libavcodec/qsv.c b/libavcodec/qsv.c
> > > > > > index faa424bb68..6776b745b9 100644
> > > > > > --- a/libavcodec/qsv.c
> > > > > > +++ b/libavcodec/qsv.c
> > > > > > @@ -143,8 +143,6 @@ static const struct {
> > > > > >      { MFX_ERR_INVALID_VIDEO_PARAM,      AVERROR(EINVAL), "invalid
> > > > > > video
> > > > > > parameters"             },
> > > > > >      { MFX_ERR_UNDEFINED_BEHAVIOR,       AVERROR_BUG,     "undefined
> > > > > > behavior"                   },
> > > > > >      { MFX_ERR_DEVICE_FAILED,            AVERROR(EIO),    "device
> > > > > > failed"                        },
> > > > > > -    { MFX_ERR_INCOMPATIBLE_AUDIO_PARAM, AVERROR(EINVAL),
> > > > > > "incompatible
> > > > > > audio parameters"        },
> > > > > > -    { MFX_ERR_INVALID_AUDIO_PARAM,      AVERROR(EINVAL), "invalid
> > > > > > audio
> > > > > > parameters"             },
> > > > > >  
> > > > > >      { MFX_WRN_IN_EXECUTION,             0,               "operation
> > > > > > in
> > > > > > execution"               },
> > > > > >      { MFX_WRN_DEVICE_BUSY,              0,               "device
> > > > > > busy"                          },
> > > > > > @@ -154,7 +152,6 @@ static const struct {
> > > > > >      { MFX_WRN_VALUE_NOT_CHANGED,        0,               "value is
> > > > > > saturated"                   },
> > > > > >      { MFX_WRN_OUT_OF_RANGE,             0,               "value out
> > > > > > of
> > > > > > range"                   },
> > > > > >      { MFX_WRN_FILTER_SKIPPED,           0,               "filter
> > > > > > skipped"                       },
> > > > > > -    { MFX_WRN_INCOMPATIBLE_AUDIO_PARAM,
> > > > > > 0,               "incompatible
> > > > > > audio parameters"        },
> > > > > >  };
> > > > > >  
> > > > > >  int ff_qsv_map_error(mfxStatus mfx_err, const char **desc)
> > > > > 
> > > > > Why?
> > > > 
> > > > qsv in FFmpeg is for video only, actually the SDK is for HW accelerated
> > > > video
> > > > decode, encode and filtering now, see 
> > > > https://github.com/Intel-Media-SDK/MediaSDK#intel-media-sdk.
> > > 
> > > This seems like a generic translation from the library errors to FF error
> > > codes. So even if we'll never touch the audio functionality of it, I'd
> > > prefer
> > > to have that struct complete already.
> > > 
> > 
> > In general, I agree with you. But the SDK no longer support audio and the
> > corresponding code might be deprecated or removed in the future, so I'd
> > prefer
> > to do a clean up (of course we may add some #ifdef.. #endif)
> 
> Hm it's ugly yet used in other places in qsv.c already to do the same. So you
> should also make use of it there IMHO.
> 

OK, please ignore this patch, I will submit a new patch once these error codes
are removed or deprecated. 

Thanks
Haihao


> 
> > BTW did you not reply the mailing list? I didn't see your comment in the
> > patchwork (
> > 
https://patchwork.ffmpeg.org/project/ffmpeg/patch/20200819061023.443304-2-haihao.xiang@intel.com/
> > )
> 
> Oh sorry I messed that up, so I included the short history now, thx!
> 
> -Thilo
> 
> _______________________________________________
> ffmpeg-devel mailing list
> ffmpeg-devel@ffmpeg.org
> https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
> 
> To unsubscribe, visit link above, or email
> ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".
diff mbox series

Patch

diff --git a/libavcodec/qsv.c b/libavcodec/qsv.c
index faa424bb68..6776b745b9 100644
--- a/libavcodec/qsv.c
+++ b/libavcodec/qsv.c
@@ -143,8 +143,6 @@  static const struct {
     { MFX_ERR_INVALID_VIDEO_PARAM,      AVERROR(EINVAL), "invalid video parameters"             },
     { MFX_ERR_UNDEFINED_BEHAVIOR,       AVERROR_BUG,     "undefined behavior"                   },
     { MFX_ERR_DEVICE_FAILED,            AVERROR(EIO),    "device failed"                        },
-    { MFX_ERR_INCOMPATIBLE_AUDIO_PARAM, AVERROR(EINVAL), "incompatible audio parameters"        },
-    { MFX_ERR_INVALID_AUDIO_PARAM,      AVERROR(EINVAL), "invalid audio parameters"             },
 
     { MFX_WRN_IN_EXECUTION,             0,               "operation in execution"               },
     { MFX_WRN_DEVICE_BUSY,              0,               "device busy"                          },
@@ -154,7 +152,6 @@  static const struct {
     { MFX_WRN_VALUE_NOT_CHANGED,        0,               "value is saturated"                   },
     { MFX_WRN_OUT_OF_RANGE,             0,               "value out of range"                   },
     { MFX_WRN_FILTER_SKIPPED,           0,               "filter skipped"                       },
-    { MFX_WRN_INCOMPATIBLE_AUDIO_PARAM, 0,               "incompatible audio parameters"        },
 };
 
 int ff_qsv_map_error(mfxStatus mfx_err, const char **desc)