[FFmpeg-devel,v2,2/4] hwcontext_opencl: dump the device name when can't match device type.

Submitted by Jun Zhao on June 21, 2018, 11:45 a.m.

Details

Message ID 1529581546-5892-2-git-send-email-mypopydev@gmail.com
State New
Headers show

Commit Message

Jun Zhao June 21, 2018, 11:45 a.m.
afther the change, we can get more detail debug message like:
"Intel(R) Core(TM) i7-6500U CPU @ 2.50GHz" does not match device type "gpu".

Signed-off-by: Jun Zhao <mypopydev@gmail.com>
---
 libavutil/hwcontext_opencl.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

Comments

Mark Thompson June 28, 2018, 3:41 p.m.
On 21/06/18 12:45, Jun Zhao wrote:
> afther the change, we can get more detail debug message like:
> "Intel(R) Core(TM) i7-6500U CPU @ 2.50GHz" does not match device type "gpu".
> 
> Signed-off-by: Jun Zhao <mypopydev@gmail.com>
> ---
>  libavutil/hwcontext_opencl.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/libavutil/hwcontext_opencl.c b/libavutil/hwcontext_opencl.c
> index f6cceef..9e96e96 100644
> --- a/libavutil/hwcontext_opencl.c
> +++ b/libavutil/hwcontext_opencl.c
> @@ -430,7 +430,8 @@ static int opencl_filter_device(AVHWDeviceContext *hwdev,
>          }
>  
>          if (!(device_type & match_type)) {
> -            av_log(hwdev, AV_LOG_DEBUG, "device_type does not match.\n");
> +            av_log(hwdev, AV_LOG_DEBUG, "\"%s\" does not match device type \"%s\".\n",
> +                   device_name, param->value);
>              return 1;
>          }
>      }
> 

Unless you want to change the other messages, this should probably match them (so it shows what type the device is and what type you're matching to - the name isn't really what you want there).

- Mark

Patch hide | download patch | download mbox

diff --git a/libavutil/hwcontext_opencl.c b/libavutil/hwcontext_opencl.c
index f6cceef..9e96e96 100644
--- a/libavutil/hwcontext_opencl.c
+++ b/libavutil/hwcontext_opencl.c
@@ -430,7 +430,8 @@  static int opencl_filter_device(AVHWDeviceContext *hwdev,
         }
 
         if (!(device_type & match_type)) {
-            av_log(hwdev, AV_LOG_DEBUG, "device_type does not match.\n");
+            av_log(hwdev, AV_LOG_DEBUG, "\"%s\" does not match device type \"%s\".\n",
+                   device_name, param->value);
             return 1;
         }
     }