FFmpeg
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Functions | Variables
vf_libopencv.c File Reference

libopencv wrapper functions More...

#include "config.h"
#include <opencv/cv.h>
#include <opencv/cxcore.h>
#include "libavutil/avstring.h"
#include "libavutil/common.h"
#include "libavutil/file.h"
#include "libavutil/opt.h"
#include "avfilter.h"
#include "formats.h"
#include "internal.h"
#include "video.h"

Go to the source code of this file.

Data Structures

struct  OCVContext
 
struct  SmoothContext
 
struct  DilateContext
 
struct  OCVFilterEntry
 

Macros

#define OFFSET(x)   offsetof(OCVContext, x)
 
#define FLAGS   AV_OPT_FLAG_VIDEO_PARAM | AV_OPT_FLAG_FILTERING_PARAM
 

Functions

static void fill_iplimage_from_frame (IplImage *img, const AVFrame *frame, enum AVPixelFormat pixfmt)
 
static void fill_frame_from_iplimage (AVFrame *frame, const IplImage *img, enum AVPixelFormat pixfmt)
 
static int query_formats (AVFilterContext *ctx)
 
static av_cold int smooth_init (AVFilterContext *ctx, const char *args)
 
static void smooth_end_frame_filter (AVFilterContext *ctx, IplImage *inimg, IplImage *outimg)
 
static int read_shape_from_file (int *cols, int *rows, int **values, const char *filename, void *log_ctx)
 
static int parse_iplconvkernel (IplConvKernel **kernel, char *buf, void *log_ctx)
 
static av_cold int dilate_init (AVFilterContext *ctx, const char *args)
 
static av_cold void dilate_uninit (AVFilterContext *ctx)
 
static void dilate_end_frame_filter (AVFilterContext *ctx, IplImage *inimg, IplImage *outimg)
 
static void erode_end_frame_filter (AVFilterContext *ctx, IplImage *inimg, IplImage *outimg)
 
static av_cold int init (AVFilterContext *ctx)
 
static av_cold void uninit (AVFilterContext *ctx)
 
static int filter_frame (AVFilterLink *inlink, AVFrame *in)
 
 AVFILTER_DEFINE_CLASS (ocv)
 

Variables

static const OCVFilterEntry ocv_filter_entries []
 
static const AVOption ocv_options []
 
static const AVFilterPad avfilter_vf_ocv_inputs []
 
static const AVFilterPad avfilter_vf_ocv_outputs []
 
AVFilter ff_vf_ocv
 

Detailed Description

libopencv wrapper functions

Definition in file vf_libopencv.c.

Macro Definition Documentation

#define OFFSET (   x)    offsetof(OCVContext, x)

Definition at line 397 of file vf_libopencv.c.

Definition at line 398 of file vf_libopencv.c.

Function Documentation

static void fill_iplimage_from_frame ( IplImage *  img,
const AVFrame frame,
enum AVPixelFormat  pixfmt 
)
static

Definition at line 43 of file vf_libopencv.c.

Referenced by filter_frame().

static void fill_frame_from_iplimage ( AVFrame frame,
const IplImage *  img,
enum AVPixelFormat  pixfmt 
)
static

Definition at line 61 of file vf_libopencv.c.

Referenced by filter_frame().

static int query_formats ( AVFilterContext ctx)
static

Definition at line 67 of file vf_libopencv.c.

static av_cold int smooth_init ( AVFilterContext ctx,
const char *  args 
)
static

Definition at line 94 of file vf_libopencv.c.

static void smooth_end_frame_filter ( AVFilterContext ctx,
IplImage *  inimg,
IplImage *  outimg 
)
static

Definition at line 137 of file vf_libopencv.c.

static int read_shape_from_file ( int cols,
int rows,
int **  values,
const char *  filename,
void log_ctx 
)
static

Definition at line 144 of file vf_libopencv.c.

Referenced by parse_iplconvkernel().

static int parse_iplconvkernel ( IplConvKernel **  kernel,
char *  buf,
void log_ctx 
)
static

Definition at line 211 of file vf_libopencv.c.

Referenced by dilate_init().

static av_cold int dilate_init ( AVFilterContext ctx,
const char *  args 
)
static

Definition at line 266 of file vf_libopencv.c.

static av_cold void dilate_uninit ( AVFilterContext ctx)
static

Definition at line 301 of file vf_libopencv.c.

static void dilate_end_frame_filter ( AVFilterContext ctx,
IplImage *  inimg,
IplImage *  outimg 
)
static

Definition at line 309 of file vf_libopencv.c.

static void erode_end_frame_filter ( AVFilterContext ctx,
IplImage *  inimg,
IplImage *  outimg 
)
static

Definition at line 316 of file vf_libopencv.c.

static av_cold int init ( AVFilterContext ctx)
static

Definition at line 337 of file vf_libopencv.c.

static av_cold void uninit ( AVFilterContext ctx)
static

Definition at line 363 of file vf_libopencv.c.

static int filter_frame ( AVFilterLink inlink,
AVFrame in 
)
static

Definition at line 372 of file vf_libopencv.c.

AVFILTER_DEFINE_CLASS ( ocv  )

Variable Documentation

const OCVFilterEntry ocv_filter_entries[]
static
Initial value:
= {
}
#define NULL
Definition: coverity.c:32
static void smooth_end_frame_filter(AVFilterContext *ctx, IplImage *inimg, IplImage *outimg)
Definition: vf_libopencv.c:137
static av_cold void dilate_uninit(AVFilterContext *ctx)
Definition: vf_libopencv.c:301
static void dilate_end_frame_filter(AVFilterContext *ctx, IplImage *inimg, IplImage *outimg)
Definition: vf_libopencv.c:309
static av_cold int dilate_init(AVFilterContext *ctx, const char *args)
Definition: vf_libopencv.c:266
static void erode_end_frame_filter(AVFilterContext *ctx, IplImage *inimg, IplImage *outimg)
Definition: vf_libopencv.c:316
static av_cold int smooth_init(AVFilterContext *ctx, const char *args)
Definition: vf_libopencv.c:94

Definition at line 331 of file vf_libopencv.c.

const AVOption ocv_options[]
static
Initial value:
= {
{ "filter_name", NULL, OFFSET(name), AV_OPT_TYPE_STRING, .flags = FLAGS },
{ "filter_params", NULL, OFFSET(params), AV_OPT_TYPE_STRING, .flags = FLAGS },
{ NULL }
}
#define NULL
Definition: coverity.c:32
#define FLAGS
Definition: vf_libopencv.c:398
#define OFFSET(x)
Definition: vf_libopencv.c:397
GLenum GLint * params
Definition: opengl_enc.c:114
const char * name
Definition: opengl_enc.c:103

Definition at line 399 of file vf_libopencv.c.

const AVFilterPad avfilter_vf_ocv_inputs[]
static
Initial value:
= {
{
.name = "default",
.filter_frame = filter_frame,
},
{ NULL }
}
#define NULL
Definition: coverity.c:32
static int filter_frame(AVFilterLink *inlink, AVFrame *in)
Definition: vf_libopencv.c:372

Definition at line 407 of file vf_libopencv.c.

const AVFilterPad avfilter_vf_ocv_outputs[]
static
Initial value:
= {
{
.name = "default",
},
{ NULL }
}
#define NULL
Definition: coverity.c:32

Definition at line 416 of file vf_libopencv.c.

AVFilter ff_vf_ocv
Initial value:
= {
.name = "ocv",
.description = NULL_IF_CONFIG_SMALL("Apply transform using libopencv."),
.priv_size = sizeof(OCVContext),
.priv_class = &ocv_class,
.init = init,
}
static av_cold int init(AVFilterContext *ctx)
Definition: vf_libopencv.c:337
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification. ...
Definition: internal.h:176
static const AVFilterPad avfilter_vf_ocv_outputs[]
Definition: vf_libopencv.c:416
static const AVFilterPad outputs[]
Definition: af_afftfilt.c:386
static const AVFilterPad inputs[]
Definition: af_afftfilt.c:376
static const AVFilterPad avfilter_vf_ocv_inputs[]
Definition: vf_libopencv.c:407
static av_cold void uninit(AVFilterContext *ctx)
Definition: vf_libopencv.c:363
static int query_formats(AVFilterContext *ctx)
Definition: vf_libopencv.c:67

Definition at line 424 of file vf_libopencv.c.