本文整理汇总了C++中OCVContext::init方法的典型用法代码示例。如果您正苦于以下问题:C++ OCVContext::init方法的具体用法?C++ OCVContext::init怎么用?C++ OCVContext::init使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类OCVContext
的用法示例。
在下文中一共展示了OCVContext::init方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: AVERROR
static av_cold int init(AVFilterContext *ctx, const char *args)
{
OCVContext *ocv = ctx->priv;
char name[128], priv_args[1024];
int i;
char c;
sscanf(args, "%127[^=:]%c%1023s", name, &c, priv_args);
for (i = 0; i < FF_ARRAY_ELEMS(ocv_filter_entries); i++) {
OCVFilterEntry *entry = &ocv_filter_entries[i];
if (!strcmp(name, entry->name)) {
ocv->name = entry->name;
ocv->init = entry->init;
ocv->uninit = entry->uninit;
ocv->end_frame_filter = entry->end_frame_filter;
if (!(ocv->priv = av_mallocz(entry->priv_size)))
return AVERROR(ENOMEM);
return ocv->init(ctx, priv_args);
}
}
av_log(ctx, AV_LOG_ERROR, "No libopencv filter named '%s'\n", name);
return AVERROR(EINVAL);
}
示例2: AVERROR
static av_cold int init(AVFilterContext *ctx)
{
OCVContext *s = ctx->priv;
int i;
if (!s->name) {
av_log(ctx, AV_LOG_ERROR, "No libopencv filter name specified\n");
return AVERROR(EINVAL);
}
for (i = 0; i < FF_ARRAY_ELEMS(ocv_filter_entries); i++) {
const OCVFilterEntry *entry = &ocv_filter_entries[i];
if (!strcmp(s->name, entry->name)) {
s->init = entry->init;
s->uninit = entry->uninit;
s->end_frame_filter = entry->end_frame_filter;
if (!(s->priv = av_mallocz(entry->priv_size)))
return AVERROR(ENOMEM);
return s->init(ctx, s->params);
}
}
av_log(ctx, AV_LOG_ERROR, "No libopencv filter named '%s'\n", s->name);
return AVERROR(EINVAL);
}