2010-09-14 15:21:13 +02:00
|
|
|
/*
|
2010-11-28 11:22:58 +01:00
|
|
|
* Copyright (c) 2010 Stefano Sabatini
|
2010-09-14 15:21:13 +02:00
|
|
|
*
|
2011-03-18 18:35:10 +01:00
|
|
|
* This file is part of Libav.
|
2010-09-14 15:21:13 +02:00
|
|
|
*
|
2011-03-18 18:35:10 +01:00
|
|
|
* Libav is free software; you can redistribute it and/or
|
2010-09-14 15:21:13 +02:00
|
|
|
* 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.
|
|
|
|
*
|
2011-03-18 18:35:10 +01:00
|
|
|
* Libav is distributed in the hope that it will be useful,
|
2010-09-14 15:21:13 +02:00
|
|
|
* 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
|
2011-03-18 18:35:10 +01:00
|
|
|
* License along with Libav; if not, write to the Free Software
|
2010-09-14 15:21:13 +02:00
|
|
|
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
|
|
|
*/
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @file
|
|
|
|
* libopencv wrapper functions
|
|
|
|
*/
|
|
|
|
|
2010-12-26 12:27:05 +01:00
|
|
|
/* #define DEBUG */
|
|
|
|
|
2010-09-16 10:47:34 +02:00
|
|
|
#include <opencv/cv.h>
|
2011-07-15 15:40:31 +02:00
|
|
|
#include <opencv/cxcore.h>
|
2010-12-26 12:27:05 +01:00
|
|
|
#include "libavutil/avstring.h"
|
2012-08-16 13:24:26 +02:00
|
|
|
#include "libavutil/common.h"
|
2010-12-26 12:27:05 +01:00
|
|
|
#include "libavutil/file.h"
|
2010-09-14 15:21:13 +02:00
|
|
|
#include "avfilter.h"
|
2012-06-09 16:00:16 +02:00
|
|
|
#include "formats.h"
|
|
|
|
#include "video.h"
|
2010-09-14 15:21:13 +02:00
|
|
|
|
|
|
|
static void fill_iplimage_from_picref(IplImage *img, const AVFilterBufferRef *picref, enum PixelFormat pixfmt)
|
|
|
|
{
|
|
|
|
IplImage *tmpimg;
|
|
|
|
int depth, channels_nb;
|
|
|
|
|
|
|
|
if (pixfmt == PIX_FMT_GRAY8) { depth = IPL_DEPTH_8U; channels_nb = 1; }
|
|
|
|
else if (pixfmt == PIX_FMT_BGRA) { depth = IPL_DEPTH_8U; channels_nb = 4; }
|
|
|
|
else if (pixfmt == PIX_FMT_BGR24) { depth = IPL_DEPTH_8U; channels_nb = 3; }
|
|
|
|
else return;
|
|
|
|
|
|
|
|
tmpimg = cvCreateImageHeader((CvSize){picref->video->w, picref->video->h}, depth, channels_nb);
|
|
|
|
*img = *tmpimg;
|
|
|
|
img->imageData = img->imageDataOrigin = picref->data[0];
|
|
|
|
img->dataOrder = IPL_DATA_ORDER_PIXEL;
|
|
|
|
img->origin = IPL_ORIGIN_TL;
|
|
|
|
img->widthStep = picref->linesize[0];
|
|
|
|
}
|
|
|
|
|
|
|
|
static void fill_picref_from_iplimage(AVFilterBufferRef *picref, const IplImage *img, enum PixelFormat pixfmt)
|
|
|
|
{
|
|
|
|
picref->linesize[0] = img->widthStep;
|
|
|
|
picref->data[0] = img->imageData;
|
|
|
|
}
|
|
|
|
|
|
|
|
static int query_formats(AVFilterContext *ctx)
|
|
|
|
{
|
|
|
|
static const enum PixelFormat pix_fmts[] = {
|
|
|
|
PIX_FMT_BGR24, PIX_FMT_BGRA, PIX_FMT_GRAY8, PIX_FMT_NONE
|
|
|
|
};
|
|
|
|
|
2012-05-30 10:12:55 +02:00
|
|
|
ff_set_common_formats(ctx, ff_make_format_list(pix_fmts));
|
2010-09-14 15:21:13 +02:00
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2012-07-14 09:25:33 +02:00
|
|
|
static int null_draw_slice(AVFilterLink *link, int y, int h, int slice_dir)
|
|
|
|
{
|
|
|
|
return 0;
|
|
|
|
}
|
2010-09-14 15:21:13 +02:00
|
|
|
|
2010-12-23 18:24:19 +01:00
|
|
|
typedef struct {
|
|
|
|
const char *name;
|
2012-06-21 07:55:56 +02:00
|
|
|
int (*init)(AVFilterContext *ctx, const char *args);
|
2010-12-23 18:24:19 +01:00
|
|
|
void (*uninit)(AVFilterContext *ctx);
|
|
|
|
void (*end_frame_filter)(AVFilterContext *ctx, IplImage *inimg, IplImage *outimg);
|
|
|
|
void *priv;
|
|
|
|
} OCVContext;
|
2010-09-14 15:21:13 +02:00
|
|
|
|
|
|
|
typedef struct {
|
|
|
|
int type;
|
|
|
|
int param1, param2;
|
|
|
|
double param3, param4;
|
|
|
|
} SmoothContext;
|
|
|
|
|
2012-06-21 07:55:56 +02:00
|
|
|
static av_cold int smooth_init(AVFilterContext *ctx, const char *args)
|
2010-09-14 15:21:13 +02:00
|
|
|
{
|
2010-12-23 18:24:19 +01:00
|
|
|
OCVContext *ocv = ctx->priv;
|
|
|
|
SmoothContext *smooth = ocv->priv;
|
2010-09-14 15:21:13 +02:00
|
|
|
char type_str[128] = "gaussian";
|
|
|
|
|
|
|
|
smooth->param1 = 3;
|
|
|
|
smooth->param2 = 0;
|
|
|
|
smooth->param3 = 0.0;
|
|
|
|
smooth->param4 = 0.0;
|
|
|
|
|
|
|
|
if (args)
|
|
|
|
sscanf(args, "%127[^:]:%d:%d:%lf:%lf", type_str, &smooth->param1, &smooth->param2, &smooth->param3, &smooth->param4);
|
|
|
|
|
|
|
|
if (!strcmp(type_str, "blur" )) smooth->type = CV_BLUR;
|
|
|
|
else if (!strcmp(type_str, "blur_no_scale")) smooth->type = CV_BLUR_NO_SCALE;
|
|
|
|
else if (!strcmp(type_str, "median" )) smooth->type = CV_MEDIAN;
|
|
|
|
else if (!strcmp(type_str, "gaussian" )) smooth->type = CV_GAUSSIAN;
|
|
|
|
else if (!strcmp(type_str, "bilateral" )) smooth->type = CV_BILATERAL;
|
|
|
|
else {
|
2012-08-04 21:40:35 +02:00
|
|
|
av_log(ctx, AV_LOG_ERROR, "Smoothing type '%s' unknown.\n", type_str);
|
2010-09-14 15:21:13 +02:00
|
|
|
return AVERROR(EINVAL);
|
|
|
|
}
|
|
|
|
|
|
|
|
if (smooth->param1 < 0 || !(smooth->param1%2)) {
|
|
|
|
av_log(ctx, AV_LOG_ERROR,
|
|
|
|
"Invalid value '%d' for param1, it has to be a positive odd number\n",
|
|
|
|
smooth->param1);
|
|
|
|
return AVERROR(EINVAL);
|
|
|
|
}
|
|
|
|
if ((smooth->type == CV_BLUR || smooth->type == CV_BLUR_NO_SCALE || smooth->type == CV_GAUSSIAN) &&
|
|
|
|
(smooth->param2 < 0 || (smooth->param2 && !(smooth->param2%2)))) {
|
|
|
|
av_log(ctx, AV_LOG_ERROR,
|
|
|
|
"Invalid value '%d' for param2, it has to be zero or a positive odd number\n",
|
|
|
|
smooth->param2);
|
|
|
|
return AVERROR(EINVAL);
|
|
|
|
}
|
|
|
|
|
2012-06-25 06:31:38 +02:00
|
|
|
av_log(ctx, AV_LOG_VERBOSE, "type:%s param1:%d param2:%d param3:%f param4:%f\n",
|
2010-09-14 15:21:13 +02:00
|
|
|
type_str, smooth->param1, smooth->param2, smooth->param3, smooth->param4);
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2010-12-23 18:24:19 +01:00
|
|
|
static void smooth_end_frame_filter(AVFilterContext *ctx, IplImage *inimg, IplImage *outimg)
|
2010-09-14 15:21:13 +02:00
|
|
|
{
|
2010-12-23 18:24:19 +01:00
|
|
|
OCVContext *ocv = ctx->priv;
|
|
|
|
SmoothContext *smooth = ocv->priv;
|
|
|
|
cvSmooth(inimg, outimg, smooth->type, smooth->param1, smooth->param2, smooth->param3, smooth->param4);
|
|
|
|
}
|
|
|
|
|
2010-12-26 12:27:05 +01:00
|
|
|
static int read_shape_from_file(int *cols, int *rows, int **values, const char *filename,
|
|
|
|
void *log_ctx)
|
|
|
|
{
|
|
|
|
uint8_t *buf, *p, *pend;
|
|
|
|
size_t size;
|
|
|
|
int ret, i, j, w;
|
|
|
|
|
|
|
|
if ((ret = av_file_map(filename, &buf, &size, 0, log_ctx)) < 0)
|
|
|
|
return ret;
|
|
|
|
|
|
|
|
/* prescan file to get the number of lines and the maximum width */
|
|
|
|
w = 0;
|
|
|
|
for (i = 0; i < size; i++) {
|
|
|
|
if (buf[i] == '\n') {
|
|
|
|
if (*rows == INT_MAX) {
|
|
|
|
av_log(log_ctx, AV_LOG_ERROR, "Overflow on the number of rows in the file\n");
|
|
|
|
return AVERROR_INVALIDDATA;
|
|
|
|
}
|
|
|
|
++(*rows);
|
|
|
|
*cols = FFMAX(*cols, w);
|
|
|
|
w = 0;
|
|
|
|
} else if (w == INT_MAX) {
|
|
|
|
av_log(log_ctx, AV_LOG_ERROR, "Overflow on the number of columns in the file\n");
|
|
|
|
return AVERROR_INVALIDDATA;
|
|
|
|
}
|
|
|
|
w++;
|
|
|
|
}
|
2011-04-21 10:31:48 +02:00
|
|
|
if (*rows > (SIZE_MAX / sizeof(int) / *cols)) {
|
2010-12-26 12:27:05 +01:00
|
|
|
av_log(log_ctx, AV_LOG_ERROR, "File with size %dx%d is too big\n",
|
|
|
|
*rows, *cols);
|
|
|
|
return AVERROR_INVALIDDATA;
|
|
|
|
}
|
|
|
|
if (!(*values = av_mallocz(sizeof(int) * *rows * *cols)))
|
|
|
|
return AVERROR(ENOMEM);
|
|
|
|
|
|
|
|
/* fill *values */
|
|
|
|
p = buf;
|
|
|
|
pend = buf + size-1;
|
|
|
|
for (i = 0; i < *rows; i++) {
|
|
|
|
for (j = 0;; j++) {
|
|
|
|
if (p > pend || *p == '\n') {
|
|
|
|
p++;
|
|
|
|
break;
|
|
|
|
} else
|
|
|
|
(*values)[*cols*i + j] = !!isgraph(*(p++));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
av_file_unmap(buf, size);
|
|
|
|
|
|
|
|
#ifdef DEBUG
|
|
|
|
{
|
|
|
|
char *line;
|
|
|
|
if (!(line = av_malloc(*cols + 1)))
|
|
|
|
return AVERROR(ENOMEM);
|
|
|
|
for (i = 0; i < *rows; i++) {
|
|
|
|
for (j = 0; j < *cols; j++)
|
|
|
|
line[j] = (*values)[i * *cols + j] ? '@' : ' ';
|
|
|
|
line[j] = 0;
|
|
|
|
av_log(log_ctx, AV_LOG_DEBUG, "%3d: %s\n", i, line);
|
|
|
|
}
|
|
|
|
av_free(line);
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
static int parse_iplconvkernel(IplConvKernel **kernel, char *buf, void *log_ctx)
|
|
|
|
{
|
|
|
|
char shape_filename[128] = "", shape_str[32] = "rect";
|
|
|
|
int cols = 0, rows = 0, anchor_x = 0, anchor_y = 0, shape = CV_SHAPE_RECT;
|
|
|
|
int *values = NULL, ret;
|
|
|
|
|
|
|
|
sscanf(buf, "%dx%d+%dx%d/%32[^=]=%127s", &cols, &rows, &anchor_x, &anchor_y, shape_str, shape_filename);
|
|
|
|
|
|
|
|
if (!strcmp(shape_str, "rect" )) shape = CV_SHAPE_RECT;
|
|
|
|
else if (!strcmp(shape_str, "cross" )) shape = CV_SHAPE_CROSS;
|
|
|
|
else if (!strcmp(shape_str, "ellipse")) shape = CV_SHAPE_ELLIPSE;
|
|
|
|
else if (!strcmp(shape_str, "custom" )) {
|
|
|
|
shape = CV_SHAPE_CUSTOM;
|
|
|
|
if ((ret = read_shape_from_file(&cols, &rows, &values, shape_filename, log_ctx)) < 0)
|
|
|
|
return ret;
|
|
|
|
} else {
|
|
|
|
av_log(log_ctx, AV_LOG_ERROR,
|
2012-08-04 21:40:35 +02:00
|
|
|
"Shape unspecified or type '%s' unknown.\n", shape_str);
|
2010-12-26 12:27:05 +01:00
|
|
|
return AVERROR(EINVAL);
|
|
|
|
}
|
|
|
|
|
|
|
|
if (rows <= 0 || cols <= 0) {
|
|
|
|
av_log(log_ctx, AV_LOG_ERROR,
|
|
|
|
"Invalid non-positive values for shape size %dx%d\n", cols, rows);
|
|
|
|
return AVERROR(EINVAL);
|
|
|
|
}
|
|
|
|
|
|
|
|
if (anchor_x < 0 || anchor_y < 0 || anchor_x >= cols || anchor_y >= rows) {
|
|
|
|
av_log(log_ctx, AV_LOG_ERROR,
|
|
|
|
"Shape anchor %dx%d is not inside the rectangle with size %dx%d.\n",
|
|
|
|
anchor_x, anchor_y, cols, rows);
|
|
|
|
return AVERROR(EINVAL);
|
|
|
|
}
|
|
|
|
|
|
|
|
*kernel = cvCreateStructuringElementEx(cols, rows, anchor_x, anchor_y, shape, values);
|
|
|
|
av_freep(&values);
|
|
|
|
if (!*kernel)
|
|
|
|
return AVERROR(ENOMEM);
|
|
|
|
|
2012-06-25 06:31:38 +02:00
|
|
|
av_log(log_ctx, AV_LOG_VERBOSE, "Structuring element: w:%d h:%d x:%d y:%d shape:%s\n",
|
2010-12-26 12:27:05 +01:00
|
|
|
rows, cols, anchor_x, anchor_y, shape_str);
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
typedef struct {
|
|
|
|
int nb_iterations;
|
|
|
|
IplConvKernel *kernel;
|
|
|
|
} DilateContext;
|
|
|
|
|
2012-06-21 07:55:56 +02:00
|
|
|
static av_cold int dilate_init(AVFilterContext *ctx, const char *args)
|
2010-12-26 12:27:05 +01:00
|
|
|
{
|
|
|
|
OCVContext *ocv = ctx->priv;
|
|
|
|
DilateContext *dilate = ocv->priv;
|
|
|
|
char default_kernel_str[] = "3x3+0x0/rect";
|
|
|
|
char *kernel_str;
|
|
|
|
const char *buf = args;
|
|
|
|
int ret;
|
|
|
|
|
|
|
|
dilate->nb_iterations = 1;
|
|
|
|
|
|
|
|
if (args)
|
|
|
|
kernel_str = av_get_token(&buf, ":");
|
|
|
|
if ((ret = parse_iplconvkernel(&dilate->kernel,
|
|
|
|
*kernel_str ? kernel_str : default_kernel_str,
|
|
|
|
ctx)) < 0)
|
|
|
|
return ret;
|
|
|
|
av_free(kernel_str);
|
|
|
|
|
|
|
|
sscanf(buf, ":%d", &dilate->nb_iterations);
|
2012-06-25 06:31:38 +02:00
|
|
|
av_log(ctx, AV_LOG_VERBOSE, "iterations_nb:%d\n", dilate->nb_iterations);
|
2010-12-26 12:27:05 +01:00
|
|
|
if (dilate->nb_iterations <= 0) {
|
|
|
|
av_log(ctx, AV_LOG_ERROR, "Invalid non-positive value '%d' for nb_iterations\n",
|
|
|
|
dilate->nb_iterations);
|
|
|
|
return AVERROR(EINVAL);
|
|
|
|
}
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
static av_cold void dilate_uninit(AVFilterContext *ctx)
|
|
|
|
{
|
|
|
|
OCVContext *ocv = ctx->priv;
|
|
|
|
DilateContext *dilate = ocv->priv;
|
|
|
|
|
|
|
|
cvReleaseStructuringElement(&dilate->kernel);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void dilate_end_frame_filter(AVFilterContext *ctx, IplImage *inimg, IplImage *outimg)
|
|
|
|
{
|
|
|
|
OCVContext *ocv = ctx->priv;
|
|
|
|
DilateContext *dilate = ocv->priv;
|
|
|
|
cvDilate(inimg, outimg, dilate->kernel, dilate->nb_iterations);
|
|
|
|
}
|
|
|
|
|
2010-12-26 12:27:09 +01:00
|
|
|
static void erode_end_frame_filter(AVFilterContext *ctx, IplImage *inimg, IplImage *outimg)
|
|
|
|
{
|
|
|
|
OCVContext *ocv = ctx->priv;
|
|
|
|
DilateContext *dilate = ocv->priv;
|
|
|
|
cvErode(inimg, outimg, dilate->kernel, dilate->nb_iterations);
|
|
|
|
}
|
|
|
|
|
2010-12-23 18:24:19 +01:00
|
|
|
typedef struct {
|
|
|
|
const char *name;
|
|
|
|
size_t priv_size;
|
2012-06-21 07:55:56 +02:00
|
|
|
int (*init)(AVFilterContext *ctx, const char *args);
|
2010-12-23 18:24:19 +01:00
|
|
|
void (*uninit)(AVFilterContext *ctx);
|
|
|
|
void (*end_frame_filter)(AVFilterContext *ctx, IplImage *inimg, IplImage *outimg);
|
|
|
|
} OCVFilterEntry;
|
|
|
|
|
|
|
|
static OCVFilterEntry ocv_filter_entries[] = {
|
2010-12-26 12:27:05 +01:00
|
|
|
{ "dilate", sizeof(DilateContext), dilate_init, dilate_uninit, dilate_end_frame_filter },
|
2010-12-26 12:27:09 +01:00
|
|
|
{ "erode", sizeof(DilateContext), dilate_init, dilate_uninit, erode_end_frame_filter },
|
2010-12-23 18:24:19 +01:00
|
|
|
{ "smooth", sizeof(SmoothContext), smooth_init, NULL, smooth_end_frame_filter },
|
|
|
|
};
|
|
|
|
|
2012-06-21 07:55:56 +02:00
|
|
|
static av_cold int init(AVFilterContext *ctx, const char *args)
|
2010-12-23 18:24:19 +01:00
|
|
|
{
|
|
|
|
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);
|
2012-06-21 07:55:56 +02:00
|
|
|
return ocv->init(ctx, priv_args);
|
2010-12-23 18:24:19 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
av_log(ctx, AV_LOG_ERROR, "No libopencv filter named '%s'\n", name);
|
|
|
|
return AVERROR(EINVAL);
|
|
|
|
}
|
|
|
|
|
|
|
|
static av_cold void uninit(AVFilterContext *ctx)
|
|
|
|
{
|
|
|
|
OCVContext *ocv = ctx->priv;
|
|
|
|
|
|
|
|
if (ocv->uninit)
|
|
|
|
ocv->uninit(ctx);
|
|
|
|
av_free(ocv->priv);
|
|
|
|
memset(ocv, 0, sizeof(*ocv));
|
|
|
|
}
|
|
|
|
|
2012-07-14 09:25:33 +02:00
|
|
|
static int end_frame(AVFilterLink *inlink)
|
2010-12-23 18:24:19 +01:00
|
|
|
{
|
|
|
|
AVFilterContext *ctx = inlink->dst;
|
|
|
|
OCVContext *ocv = ctx->priv;
|
|
|
|
AVFilterLink *outlink= inlink->dst->outputs[0];
|
2010-09-14 15:21:13 +02:00
|
|
|
AVFilterBufferRef *inpicref = inlink ->cur_buf;
|
|
|
|
AVFilterBufferRef *outpicref = outlink->out_buf;
|
|
|
|
IplImage inimg, outimg;
|
2012-07-14 09:25:33 +02:00
|
|
|
int ret;
|
2010-09-14 15:21:13 +02:00
|
|
|
|
|
|
|
fill_iplimage_from_picref(&inimg , inpicref , inlink->format);
|
|
|
|
fill_iplimage_from_picref(&outimg, outpicref, inlink->format);
|
2010-12-23 18:24:19 +01:00
|
|
|
ocv->end_frame_filter(ctx, &inimg, &outimg);
|
2010-09-14 15:21:13 +02:00
|
|
|
fill_picref_from_iplimage(outpicref, &outimg, inlink->format);
|
|
|
|
|
2012-07-14 09:25:33 +02:00
|
|
|
if ((ret = ff_draw_slice(outlink, 0, outlink->h, 1)) < 0 ||
|
|
|
|
(ret = ff_end_frame(outlink)) < 0)
|
|
|
|
return ret;
|
|
|
|
return 0;
|
2010-09-14 15:21:13 +02:00
|
|
|
}
|
|
|
|
|
2010-12-23 18:24:19 +01:00
|
|
|
AVFilter avfilter_vf_ocv = {
|
|
|
|
.name = "ocv",
|
|
|
|
.description = NULL_IF_CONFIG_SMALL("Apply transform using libopencv."),
|
2010-09-14 15:21:13 +02:00
|
|
|
|
2010-12-23 18:24:19 +01:00
|
|
|
.priv_size = sizeof(OCVContext),
|
2010-09-14 15:21:13 +02:00
|
|
|
|
|
|
|
.query_formats = query_formats,
|
2010-12-23 18:24:19 +01:00
|
|
|
.init = init,
|
|
|
|
.uninit = uninit,
|
2010-09-14 15:21:13 +02:00
|
|
|
|
2012-07-21 18:45:52 +02:00
|
|
|
.inputs = (const AVFilterPad[]) {{ .name = "default",
|
|
|
|
.type = AVMEDIA_TYPE_VIDEO,
|
|
|
|
.draw_slice = null_draw_slice,
|
|
|
|
.end_frame = end_frame,
|
|
|
|
.min_perms = AV_PERM_READ },
|
|
|
|
{ .name = NULL}},
|
|
|
|
|
|
|
|
.outputs = (const AVFilterPad[]) {{ .name = "default",
|
|
|
|
.type = AVMEDIA_TYPE_VIDEO, },
|
|
|
|
{ .name = NULL}},
|
2010-09-14 15:21:13 +02:00
|
|
|
};
|