mirror of https://git.ffmpeg.org/ffmpeg.git
avfilter/dnn: add log context to ff_get_dnn_module
Print backend type when failed. Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
This commit is contained in:
parent
505c43bb65
commit
016f2f61c3
|
@ -29,7 +29,7 @@
|
||||||
extern const DNNModule ff_dnn_backend_openvino;
|
extern const DNNModule ff_dnn_backend_openvino;
|
||||||
extern const DNNModule ff_dnn_backend_tf;
|
extern const DNNModule ff_dnn_backend_tf;
|
||||||
|
|
||||||
const DNNModule *ff_get_dnn_module(DNNBackendType backend_type)
|
const DNNModule *ff_get_dnn_module(DNNBackendType backend_type, void *log_ctx)
|
||||||
{
|
{
|
||||||
switch(backend_type){
|
switch(backend_type){
|
||||||
#if (CONFIG_LIBTENSORFLOW == 1)
|
#if (CONFIG_LIBTENSORFLOW == 1)
|
||||||
|
@ -41,7 +41,9 @@ const DNNModule *ff_get_dnn_module(DNNBackendType backend_type)
|
||||||
return &ff_dnn_backend_openvino;
|
return &ff_dnn_backend_openvino;
|
||||||
#endif
|
#endif
|
||||||
default:
|
default:
|
||||||
av_log(NULL, AV_LOG_ERROR, "Module backend_type is not supported or enabled.\n");
|
av_log(log_ctx, AV_LOG_ERROR,
|
||||||
|
"Module backend_type %d is not supported or enabled.\n",
|
||||||
|
backend_type);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -68,7 +68,7 @@ int ff_dnn_init(DnnContext *ctx, DNNFunctionType func_type, AVFilterContext *fil
|
||||||
return AVERROR(EINVAL);
|
return AVERROR(EINVAL);
|
||||||
}
|
}
|
||||||
|
|
||||||
ctx->dnn_module = ff_get_dnn_module(ctx->backend_type);
|
ctx->dnn_module = ff_get_dnn_module(ctx->backend_type, filter_ctx);
|
||||||
if (!ctx->dnn_module) {
|
if (!ctx->dnn_module) {
|
||||||
av_log(filter_ctx, AV_LOG_ERROR, "could not create DNN module for requested backend\n");
|
av_log(filter_ctx, AV_LOG_ERROR, "could not create DNN module for requested backend\n");
|
||||||
return AVERROR(ENOMEM);
|
return AVERROR(ENOMEM);
|
||||||
|
|
|
@ -123,6 +123,6 @@ typedef struct DNNModule{
|
||||||
} DNNModule;
|
} DNNModule;
|
||||||
|
|
||||||
// Initializes DNNModule depending on chosen backend.
|
// Initializes DNNModule depending on chosen backend.
|
||||||
const DNNModule *ff_get_dnn_module(DNNBackendType backend_type);
|
const DNNModule *ff_get_dnn_module(DNNBackendType backend_type, void *log_ctx);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
Loading…
Reference in New Issue