diff mbox

[FFmpeg-devel,12/17] vaapi_decode: Ignore the profile when not useful

Message ID 20171124005134.5683-12-sw@jkqxz.net
State New
Headers show

Commit Message

Mark Thompson Nov. 24, 2017, 12:51 a.m. UTC
Enables VP8 decoding - the decoder places the the bitstream version
in the profile field, which we want to ignore.
---
 libavcodec/vaapi_decode.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

Comments

Philip Langdale Nov. 24, 2017, 4:50 p.m. UTC | #1
On Fri, 24 Nov 2017 00:51:29 +0000
Mark Thompson <sw@jkqxz.net> wrote:

> Enables VP8 decoding - the decoder places the the bitstream version
> in the profile field, which we want to ignore.
> ---
>  libavcodec/vaapi_decode.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/libavcodec/vaapi_decode.c b/libavcodec/vaapi_decode.c
> index d36ef906a2..572b3a40ac 100644
> --- a/libavcodec/vaapi_decode.c
> +++ b/libavcodec/vaapi_decode.c
> @@ -324,7 +324,8 @@ static int
> vaapi_decode_make_config(AVCodecContext *avctx, int profile_match = 0;
>          if (avctx->codec_id != vaapi_profile_map[i].codec_id)
>              continue;
> -        if (avctx->profile == vaapi_profile_map[i].codec_profile)
> +        if (avctx->profile == vaapi_profile_map[i].codec_profile ||
> +            vaapi_profile_map[i].codec_profile == FF_PROFILE_UNKNOWN)
>              profile_match = 1;
>          for (j = 0; j < profile_count; j++) {
>              if (vaapi_profile_map[i].va_profile == profile_list[j]) {

First 12 parts look good.

--phil
Mark Thompson Nov. 26, 2017, 10:01 p.m. UTC | #2
On 24/11/17 16:50, Philip Langdale wrote:
> On Fri, 24 Nov 2017 00:51:29 +0000
> Mark Thompson <sw@jkqxz.net> wrote:
> 
>> Enables VP8 decoding - the decoder places the the bitstream version
>> in the profile field, which we want to ignore.
>> ---
>>  libavcodec/vaapi_decode.c | 3 ++-
>>  1 file changed, 2 insertions(+), 1 deletion(-)
>>
>> diff --git a/libavcodec/vaapi_decode.c b/libavcodec/vaapi_decode.c
>> index d36ef906a2..572b3a40ac 100644
>> --- a/libavcodec/vaapi_decode.c
>> +++ b/libavcodec/vaapi_decode.c
>> @@ -324,7 +324,8 @@ static int
>> vaapi_decode_make_config(AVCodecContext *avctx, int profile_match = 0;
>>          if (avctx->codec_id != vaapi_profile_map[i].codec_id)
>>              continue;
>> -        if (avctx->profile == vaapi_profile_map[i].codec_profile)
>> +        if (avctx->profile == vaapi_profile_map[i].codec_profile ||
>> +            vaapi_profile_map[i].codec_profile == FF_PROFILE_UNKNOWN)
>>              profile_match = 1;
>>          for (j = 0; j < profile_count; j++) {
>>              if (vaapi_profile_map[i].va_profile == profile_list[j]) {
> 
> First 12 parts look good.

First 12 applied; I have a bit more to do on MJPEG hwaccel for the rest.

Given how many small things got touched here it is quite likely that something has broken with this - I've tried to get some testing on all of the affected platforms, but do tell me if you find anything further and I'll try to fix it asap.

Thanks to everyone who commented on / reviewed this series :)

- Mark
diff mbox

Patch

diff --git a/libavcodec/vaapi_decode.c b/libavcodec/vaapi_decode.c
index d36ef906a2..572b3a40ac 100644
--- a/libavcodec/vaapi_decode.c
+++ b/libavcodec/vaapi_decode.c
@@ -324,7 +324,8 @@  static int vaapi_decode_make_config(AVCodecContext *avctx,
         int profile_match = 0;
         if (avctx->codec_id != vaapi_profile_map[i].codec_id)
             continue;
-        if (avctx->profile == vaapi_profile_map[i].codec_profile)
+        if (avctx->profile == vaapi_profile_map[i].codec_profile ||
+            vaapi_profile_map[i].codec_profile == FF_PROFILE_UNKNOWN)
             profile_match = 1;
         for (j = 0; j < profile_count; j++) {
             if (vaapi_profile_map[i].va_profile == profile_list[j]) {