diff mbox

[FFmpeg-devel] lavc/vaapi_encode: give a debug message if attrs unsupported.

Message ID 1215bc8d-a90b-cffa-ac49-293390a77016@gmail.com
State Accepted
Commit a31a48261164f2ec7d218f541891086f930b090b
Headers show

Commit Message

Jun Zhao Dec. 19, 2017, 6:25 a.m. UTC
From 8400fa85b7af47c3cff6abd87fdc392ac7891e35 Mon Sep 17 00:00:00 2001
From: Jun Zhao <jun.zhao@intel.com>
Date: Tue, 19 Dec 2017 14:13:58 +0800
Subject: [PATCH] lavc/vaapi_encode: give a debug message if attrs unsupported.

Give a debug message when query attribute get VA_ATTRIB_NOT_SUPPORTED,
it's will help to trace and debug some issue.

Signed-off-by: Jun Zhao <jun.zhao@intel.com>
---
 libavcodec/vaapi_encode.c | 2 ++
 1 file changed, 2 insertions(+)

Comments

Liu Steven Dec. 19, 2017, 6:29 a.m. UTC | #1
> On 19 Dec 2017, at 14:25, Jun Zhao <mypopydev@gmail.com> wrote:
> 
> <0001-lavc-vaapi_encode-give-a-debug-message-if-attrs-unsu.patch>

I saw you using AV_LOG_DEBUG, What about use AV_LOG_WARNING? Because that message is tell user attrs unsupported.

Thanks
Jun Zhao Dec. 19, 2017, 7:02 a.m. UTC | #2
On 2017/12/19 14:29, 刘歧 wrote:
>> On 19 Dec 2017, at 14:25, Jun Zhao <mypopydev@gmail.com> wrote:
>>
>> <0001-lavc-vaapi_encode-give-a-debug-message-if-attrs-unsu.patch>
> I saw you using AV_LOG_DEBUG, What about use AV_LOG_WARNING? Because that message is tell user attrs unsupported.
>
> Thanks

I don't ensure user like the message as "Attribute 35 is not supported"
this style. And I guess Mark just want to become silent in this case in
original code.

>
>
>
> _______________________________________________
> ffmpeg-devel mailing list
> ffmpeg-devel@ffmpeg.org
> http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Mark Thompson Dec. 19, 2017, 11:11 p.m. UTC | #3
On 19/12/17 06:25, Jun Zhao wrote:
> From 8400fa85b7af47c3cff6abd87fdc392ac7891e35 Mon Sep 17 00:00:00 2001
> From: Jun Zhao <jun.zhao@intel.com>
> Date: Tue, 19 Dec 2017 14:13:58 +0800
> Subject: [PATCH] lavc/vaapi_encode: give a debug message if attrs unsupported.
> 
> Give a debug message when query attribute get VA_ATTRIB_NOT_SUPPORTED,
> it's will help to trace and debug some issue.
> 
> Signed-off-by: Jun Zhao <jun.zhao@intel.com>
> ---
>  libavcodec/vaapi_encode.c | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/libavcodec/vaapi_encode.c b/libavcodec/vaapi_encode.c
> index 1d3cb4db83..9bc9c89d3b 100644
> --- a/libavcodec/vaapi_encode.c
> +++ b/libavcodec/vaapi_encode.c
> @@ -1048,6 +1048,8 @@ static av_cold int vaapi_encode_config_attributes(AVCodecContext *avctx)
>              // Unfortunately we have to treat this as "don't know" and hope
>              // for the best, because the Intel MJPEG encoder returns this
>              // for all the interesting attributes.
> +            av_log(avctx, AV_LOG_DEBUG, "Attribute (%d) is not supported.\n",
> +                   attr[i].type);
>              continue;
>          }
>          switch (attr[i].type) {
> -- 
> 2.14.1
> 

LGTM, applied.

On 19/12/17 07:02, Jun Zhao wrote:
> On 2017/12/19 14:29, 刘歧 wrote:
>>> On 19 Dec 2017, at 14:25, Jun Zhao <mypopydev@gmail.com> wrote:
>>>
>>> <0001-lavc-vaapi_encode-give-a-debug-message-if-attrs-unsu.patch>
>> I saw you using AV_LOG_DEBUG, What about use AV_LOG_WARNING? Because that message is tell user attrs unsupported.
>>
>> Thanks
> 
> I don't ensure user like the message as "Attribute 35 is not supported"
> this style. And I guess Mark just want to become silent in this case in
> original code.

See the comment above the message.  We get:

[mjpeg_vaapi @ 0x5654cf1bb520] Attribute (5) is not supported.
[mjpeg_vaapi @ 0x5654cf1bb520] Attribute (13) is not supported.

helpfully telling us that rate control isn't available for JPEG.  (A driver could in theory implement something other than CQP, but I don't think there is much reason to.)

Thanks,

- Mark
Jun Zhao Dec. 20, 2017, 1:09 a.m. UTC | #4
On 2017/12/20 7:11, Mark Thompson wrote:
> On 19/12/17 06:25, Jun Zhao wrote:
>> From 8400fa85b7af47c3cff6abd87fdc392ac7891e35 Mon Sep 17 00:00:00 2001
>> From: Jun Zhao <jun.zhao@intel.com>
>> Date: Tue, 19 Dec 2017 14:13:58 +0800
>> Subject: [PATCH] lavc/vaapi_encode: give a debug message if attrs unsupported.
>>
>> Give a debug message when query attribute get VA_ATTRIB_NOT_SUPPORTED,
>> it's will help to trace and debug some issue.
>>
>> Signed-off-by: Jun Zhao <jun.zhao@intel.com>
>> ---
>>  libavcodec/vaapi_encode.c | 2 ++
>>  1 file changed, 2 insertions(+)
>>
>> diff --git a/libavcodec/vaapi_encode.c b/libavcodec/vaapi_encode.c
>> index 1d3cb4db83..9bc9c89d3b 100644
>> --- a/libavcodec/vaapi_encode.c
>> +++ b/libavcodec/vaapi_encode.c
>> @@ -1048,6 +1048,8 @@ static av_cold int vaapi_encode_config_attributes(AVCodecContext *avctx)
>>              // Unfortunately we have to treat this as "don't know" and hope
>>              // for the best, because the Intel MJPEG encoder returns this
>>              // for all the interesting attributes.
>> +            av_log(avctx, AV_LOG_DEBUG, "Attribute (%d) is not supported.\n",
>> +                   attr[i].type);
>>              continue;
>>          }
>>          switch (attr[i].type) {
>> -- 
>> 2.14.1
>>
> LGTM, applied.
>
> On 19/12/17 07:02, Jun Zhao wrote:
>> On 2017/12/19 14:29, 刘歧 wrote:
>>>> On 19 Dec 2017, at 14:25, Jun Zhao <mypopydev@gmail.com> wrote:
>>>>
>>>> <0001-lavc-vaapi_encode-give-a-debug-message-if-attrs-unsu.patch>
>>> I saw you using AV_LOG_DEBUG, What about use AV_LOG_WARNING? Because that message is tell user attrs unsupported.
>>>
>>> Thanks
>> I don't ensure user like the message as "Attribute 35 is not supported"
>> this style. And I guess Mark just want to become silent in this case in
>> original code.
> See the comment above the message.  We get:
>
> [mjpeg_vaapi @ 0x5654cf1bb520] Attribute (5) is not supported.
> [mjpeg_vaapi @ 0x5654cf1bb520] Attribute (13) is not supported.
>
> helpfully telling us that rate control isn't available for JPEG.  (A driver could in theory implement something other than CQP, but I don't think there is much reason to.)
>
> Thanks,
Yes, it's will telling us the attributes is or isn't available for
AVC/HEVC/MJPEG/..., and I've
consider use constchar*vaConfigAttribTypeStr(VAConfigAttribType
configAttribType) in this message, but this function can't work before
VA-API 2.1
>
> - Mark
> _______________________________________________
> ffmpeg-devel mailing list
> ffmpeg-devel@ffmpeg.org
> http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
diff mbox

Patch

diff --git a/libavcodec/vaapi_encode.c b/libavcodec/vaapi_encode.c
index 1d3cb4db83..9bc9c89d3b 100644
--- a/libavcodec/vaapi_encode.c
+++ b/libavcodec/vaapi_encode.c
@@ -1048,6 +1048,8 @@  static av_cold int vaapi_encode_config_attributes(AVCodecContext *avctx)
             // Unfortunately we have to treat this as "don't know" and hope
             // for the best, because the Intel MJPEG encoder returns this
             // for all the interesting attributes.
+            av_log(avctx, AV_LOG_DEBUG, "Attribute (%d) is not supported.\n",
+                   attr[i].type);
             continue;
         }
         switch (attr[i].type) {