/*
* Copyright (c) 2010 Stefano Sabatini
*
- * This file is part of Libav.
+ * This file is part of FFmpeg.
*
- * Libav is free software; you can redistribute it and/or
+ * FFmpeg is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
- * Libav is distributed in the hope that it will be useful,
+ * FFmpeg is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
- * License along with Libav; if not, write to the Free Software
+ * License along with FFmpeg; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
else if (!strcmp(type_str, "gaussian" )) smooth->type = CV_GAUSSIAN;
else if (!strcmp(type_str, "bilateral" )) smooth->type = CV_BILATERAL;
else {
- av_log(ctx, AV_LOG_ERROR, "Smoothing type '%s' unknown\n.", type_str);
+ av_log(ctx, AV_LOG_ERROR, "Smoothing type '%s' unknown.\n", type_str);
return AVERROR(EINVAL);
}
return ret;
} else {
av_log(log_ctx, AV_LOG_ERROR,
- "Shape unspecified or type '%s' unknown\n.", shape_str);
+ "Shape unspecified or type '%s' unknown.\n", shape_str);
return AVERROR(EINVAL);
}
memset(ocv, 0, sizeof(*ocv));
}
-static void end_frame(AVFilterLink *inlink)
+static int end_frame(AVFilterLink *inlink)
{
AVFilterContext *ctx = inlink->dst;
OCVContext *ocv = ctx->priv;
AVFilterBufferRef *inpicref = inlink ->cur_buf;
AVFilterBufferRef *outpicref = outlink->out_buf;
IplImage inimg, outimg;
+ int ret;
fill_iplimage_from_picref(&inimg , inpicref , inlink->format);
fill_iplimage_from_picref(&outimg, outpicref, inlink->format);
ocv->end_frame_filter(ctx, &inimg, &outimg);
fill_picref_from_iplimage(outpicref, &outimg, inlink->format);
- ff_draw_slice(outlink, 0, outlink->h, 1);
- ff_end_frame(outlink);
+ if ((ret = ff_draw_slice(outlink, 0, outlink->h, 1)) < 0 ||
+ (ret = ff_end_frame(outlink)) < 0)
+ return ret;
+ return 0;
}
AVFilter avfilter_vf_ocv = {