vf_mp.c File Reference
Include dependency graph for vf_mp.c:

Go to the source code of this file.

Data Structures

struct  MPContext
 

Macros

#define OFFSET(x)   offsetof(MPContext, x)
 
#define FLAGS   AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_VIDEO_PARAM
 
#define CLEAR_PACKEDYUV_PATTERN   0x80008000
 
#define CLEAR_PACKEDYUV_PATTERN_SWAPPED   0x00800080
 

Functions

enum AVPixelFormat ff_mp2ff_pix_fmt (int mp)
 
static void ff_sws_getFlagsAndFilterFromCmdLine (int *flags, SwsFilter **srcFilterParam, SwsFilter **dstFilterParam)
 
struct SwsContextff_sws_getContextFromCmdLine (int srcW, int srcH, int srcFormat, int dstW, int dstH, int dstFormat)
 
 AVFILTER_DEFINE_CLASS (mp)
 
void ff_mp_msg (int mod, int lev, const char *format,...)
 
int ff_mp_msg_test (int mod, int lev)
 
void ff_init_avcodec (void)
 
void ff_vf_clone_mpi_attributes (mp_image_t *dst, mp_image_t *src)
 
void ff_vf_next_draw_slice (struct vf_instance *vf, unsigned char **src, int *stride, int w, int h, int x, int y)
 
void ff_vf_mpi_clear (mp_image_t *mpi, int x0, int y0, int w, int h)
 
int ff_vf_next_query_format (struct vf_instance *vf, unsigned int fmt)
 
unsigned int ff_vf_match_csp (vf_instance_t **vfp, const unsigned int *list, unsigned int preferred)
 
mp_image_tff_vf_get_image (vf_instance_t *vf, unsigned int outfmt, int mp_imgtype, int mp_imgflag, int w, int h)
 
static void dummy_free (void *opaque, uint8_t *data)
 
int ff_vf_next_put_image (struct vf_instance *vf, mp_image_t *mpi, double pts)
 
int ff_vf_next_config (struct vf_instance *vf, int width, int height, int d_width, int d_height, unsigned int voflags, unsigned int outfmt)
 
int ff_vf_next_control (struct vf_instance *vf, int request, void *data)
 
static int vf_default_query_format (struct vf_instance *vf, unsigned int fmt)
 
static av_cold int init (AVFilterContext *ctx)
 
static av_cold void uninit (AVFilterContext *ctx)
 
static int query_formats (AVFilterContext *ctx)
 
static int config_inprops (AVFilterLink *inlink)
 
static int config_outprops (AVFilterLink *outlink)
 
static int request_frame (AVFilterLink *outlink)
 
static int filter_frame (AVFilterLink *inlink, AVFrame *inpic)
 

Variables

struct {
   int   fmt
 
   enum AVPixelFormat   pix_fmt
 
conversion_map []
 
const vf_info_t ff_vf_info_dint
 
const vf_info_t ff_vf_info_down3dright
 
const vf_info_t ff_vf_info_eq2
 
const vf_info_t ff_vf_info_eq
 
const vf_info_t ff_vf_info_fil
 
const vf_info_t ff_vf_info_fspp
 
const vf_info_t ff_vf_info_ilpack
 
const vf_info_t ff_vf_info_mcdeint
 
const vf_info_t ff_vf_info_ow
 
const vf_info_t ff_vf_info_perspective
 
const vf_info_t ff_vf_info_phase
 
const vf_info_t ff_vf_info_pp7
 
const vf_info_t ff_vf_info_pullup
 
const vf_info_t ff_vf_info_qp
 
const vf_info_t ff_vf_info_sab
 
const vf_info_t ff_vf_info_softpulldown
 
const vf_info_t ff_vf_info_spp
 
const vf_info_t ff_vf_info_tinterlace
 
const vf_info_t ff_vf_info_uspp
 
static const vf_info_t *const filters []
 
CpuCaps ff_gCpuCaps
 
static const AVOption mp_options []
 
static const AVFilterPad mp_inputs []
 
static const AVFilterPad mp_outputs []
 
AVFilter avfilter_vf_mp
 

Macro Definition Documentation

#define CLEAR_PACKEDYUV_PATTERN   0x80008000

Referenced by ff_vf_mpi_clear().

#define CLEAR_PACKEDYUV_PATTERN_SWAPPED   0x00800080

Referenced by ff_vf_mpi_clear().

Definition at line 267 of file vf_mp.c.

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

Definition at line 266 of file vf_mp.c.

Function Documentation

AVFILTER_DEFINE_CLASS ( mp  )
static int config_inprops ( AVFilterLink inlink)
static

Definition at line 755 of file vf_mp.c.

static int config_outprops ( AVFilterLink outlink)
static

Definition at line 774 of file vf_mp.c.

static void dummy_free ( void opaque,
uint8_t data 
)
static

Definition at line 537 of file vf_mp.c.

void ff_init_avcodec ( void  )

Definition at line 287 of file vf_mp.c.

Referenced by vf_open().

enum AVPixelFormat ff_mp2ff_pix_fmt ( int  mp)

Definition at line 195 of file vf_mp.c.

Referenced by ff_mp_image_alloc_planes().

void ff_mp_msg ( int  mod,
int  lev,
const char *  format,
  ... 
)
int ff_mp_msg_test ( int  mod,
int  lev 
)

Definition at line 283 of file vf_mp.c.

Referenced by analyze_plane(), and ff_sws_getFlagsAndFilterFromCmdLine().

struct SwsContext* ff_sws_getContextFromCmdLine ( int  srcW,
int  srcH,
int  srcFormat,
int  dstW,
int  dstH,
int  dstFormat 
)

Definition at line 240 of file vf_mp.c.

static void ff_sws_getFlagsAndFilterFromCmdLine ( int *  flags,
SwsFilter **  srcFilterParam,
SwsFilter **  dstFilterParam 
)
static

Definition at line 202 of file vf_mp.c.

Referenced by ff_sws_getContextFromCmdLine().

void ff_vf_clone_mpi_attributes ( mp_image_t dst,
mp_image_t src 
)

Definition at line 293 of file vf_mp.c.

Referenced by put_image().

mp_image_t* ff_vf_get_image ( vf_instance_t vf,
unsigned int  outfmt,
int  mp_imgtype,
int  mp_imgflag,
int  w,
int  h 
)

Definition at line 380 of file vf_mp.c.

Referenced by config(), get_image(), and put_image().

unsigned int ff_vf_match_csp ( vf_instance_t **  vfp,
const unsigned int *  list,
unsigned int  preferred 
)

Definition at line 376 of file vf_mp.c.

void ff_vf_mpi_clear ( mp_image_t mpi,
int  x0,
int  y0,
int  w,
int  h 
)

Definition at line 327 of file vf_mp.c.

Referenced by ff_vf_get_image(), and put_image().

int ff_vf_next_config ( struct vf_instance vf,
int  width,
int  height,
int  d_width,
int  d_height,
unsigned int  voflags,
unsigned int  outfmt 
)

Definition at line 584 of file vf_mp.c.

Referenced by config(), and init().

int ff_vf_next_control ( struct vf_instance vf,
int  request,
void data 
)

Definition at line 613 of file vf_mp.c.

Referenced by control(), and init().

void ff_vf_next_draw_slice ( struct vf_instance vf,
unsigned char **  src,
int *  stride,
int  w,
int  h,
int  x,
int  y 
)

Definition at line 304 of file vf_mp.c.

int ff_vf_next_put_image ( struct vf_instance vf,
mp_image_t mpi,
double  pts 
)

Definition at line 539 of file vf_mp.c.

Referenced by init(), and put_image().

int ff_vf_next_query_format ( struct vf_instance vf,
unsigned int  fmt 
)

Definition at line 371 of file vf_mp.c.

Referenced by query_format().

static int filter_frame ( AVFilterLink inlink,
AVFrame inpic 
)
static

Definition at line 801 of file vf_mp.c.

static av_cold int init ( AVFilterContext ctx)
static

Definition at line 632 of file vf_mp.c.

static int query_formats ( AVFilterContext ctx)
static

Definition at line 729 of file vf_mp.c.

static int request_frame ( AVFilterLink outlink)
static

Definition at line 784 of file vf_mp.c.

static av_cold void uninit ( AVFilterContext ctx)
static

Definition at line 712 of file vf_mp.c.

static int vf_default_query_format ( struct vf_instance vf,
unsigned int  fmt 
)
static

Definition at line 619 of file vf_mp.c.

Referenced by init().

Variable Documentation

AVFilter avfilter_vf_mp
Initial value:
= {
.name = "mp",
.description = NULL_IF_CONFIG_SMALL("Apply a libmpcodecs filter to the input video."),
.init = init,
.uninit = uninit,
.priv_size = sizeof(MPContext),
.priv_class = &mp_class,
}
static const AVFilterPad outputs[]
Definition: af_ashowinfo.c:117
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification. ...
static const AVFilterPad mp_outputs[]
Definition: vf_mp.c:842
static av_cold void uninit(AVFilterContext *ctx)
Definition: vf_mp.c:712
static av_cold int init(AVFilterContext *ctx)
Definition: vf_mp.c:632
static int query_formats(AVFilterContext *ctx)
Definition: vf_mp.c:729
static const AVFilterPad mp_inputs[]
Definition: vf_mp.c:832
these buffered frames must be flushed immediately if a new input produces new the filter must not call request_frame to get more It must just process the frame or queue it The task of requesting more frames is left to the filter s request_frame method or the application If a filter has several inputs

Definition at line 852 of file vf_mp.c.

CpuCaps ff_gCpuCaps

Definition at line 193 of file vf_mp.c.

Referenced by check_values(), init_pullup(), put_image(), and vf_open().

const vf_info_t ff_vf_info_dint

Definition at line 207 of file vf_dint.c.

const vf_info_t ff_vf_info_down3dright

Definition at line 159 of file vf_down3dright.c.

const vf_info_t ff_vf_info_eq

Definition at line 234 of file vf_eq.c.

const vf_info_t ff_vf_info_eq2

Definition at line 512 of file vf_eq2.c.

const vf_info_t ff_vf_info_fil

Definition at line 107 of file vf_fil.c.

const vf_info_t ff_vf_info_fspp

Definition at line 683 of file vf_fspp.c.

const vf_info_t ff_vf_info_ilpack

Definition at line 451 of file vf_ilpack.c.

const vf_info_t ff_vf_info_mcdeint

Definition at line 333 of file vf_mcdeint.c.

const vf_info_t ff_vf_info_ow

Definition at line 315 of file vf_ow.c.

const vf_info_t ff_vf_info_perspective

Definition at line 336 of file vf_perspective.c.

const vf_info_t ff_vf_info_phase

Definition at line 295 of file vf_phase.c.

const vf_info_t ff_vf_info_pp7

Definition at line 484 of file vf_pp7.c.

const vf_info_t ff_vf_info_pullup

Definition at line 309 of file vf_pullup.c.

const vf_info_t ff_vf_info_qp

Definition at line 171 of file vf_qp.c.

const vf_info_t ff_vf_info_sab

Definition at line 315 of file vf_sab.c.

const vf_info_t ff_vf_info_softpulldown

Definition at line 156 of file vf_softpulldown.c.

const vf_info_t ff_vf_info_spp

Definition at line 614 of file vf_spp.c.

const vf_info_t ff_vf_info_tinterlace

Definition at line 228 of file libmpcodecs/vf_tinterlace.c.

const vf_info_t ff_vf_info_uspp

Definition at line 386 of file vf_uspp.c.

const vf_info_t* const filters[]
static
Initial value:
={
}
const vf_info_t ff_vf_info_qp
Definition: vf_qp.c:171
const vf_info_t ff_vf_info_softpulldown
const vf_info_t ff_vf_info_phase
Definition: vf_phase.c:295
const vf_info_t ff_vf_info_eq
Definition: vf_eq.c:234
const vf_info_t ff_vf_info_uspp
Definition: vf_uspp.c:386
const vf_info_t ff_vf_info_ilpack
Definition: vf_ilpack.c:451
const vf_info_t ff_vf_info_perspective
const vf_info_t ff_vf_info_mcdeint
Definition: vf_mcdeint.c:333
const vf_info_t ff_vf_info_tinterlace
const vf_info_t ff_vf_info_spp
Definition: vf_spp.c:614
const vf_info_t ff_vf_info_down3dright
const vf_info_t ff_vf_info_fspp
Definition: vf_fspp.c:683
NULL
Definition: eval.c:55
const vf_info_t ff_vf_info_sab
Definition: vf_sab.c:315
const vf_info_t ff_vf_info_dint
Definition: vf_dint.c:207
const vf_info_t ff_vf_info_pp7
Definition: vf_pp7.c:484
const vf_info_t ff_vf_info_ow
Definition: vf_ow.c:315
const vf_info_t ff_vf_info_pullup
Definition: vf_pullup.c:309
const vf_info_t ff_vf_info_eq2
Definition: vf_eq2.c:512
const vf_info_t ff_vf_info_fil
Definition: vf_fil.c:107

Definition at line 147 of file vf_mp.c.

int fmt

Definition at line 50 of file vf_mp.c.

Referenced by config_inprops(), filter_frame(), and query_formats().

const AVFilterPad mp_inputs[]
static
Initial value:
= {
{
.name = "default",
.filter_frame = filter_frame,
.config_props = config_inprops,
},
{ NULL }
}
static int config_inprops(AVFilterLink *inlink)
Definition: vf_mp.c:755
static int filter_frame(AVFilterLink *inlink, AVFrame *inpic)
Definition: vf_mp.c:801
NULL
Definition: eval.c:55

Definition at line 832 of file vf_mp.c.

const AVOption mp_options[]
static
Initial value:
= {
{ "filter", "set MPlayer filter name and parameters", OFFSET(filter), AV_OPT_TYPE_STRING, {.str=NULL}, .flags = FLAGS },
{ NULL }
}
the mask is usually to keep the same permissions Filters should remove permissions on reference they give to output whenever necessary It can be automatically done by setting the rej_perms field on the output pad Here are a few guidelines corresponding to common then the filter should push the output frames on the output link immediately As an exception to the previous rule if the input frame is enough to produce several output frames then the filter needs output only at least one per link The additional frames can be left buffered in the filter
NULL
Definition: eval.c:55
#define FLAGS
Definition: vf_mp.c:267
#define OFFSET(x)
Definition: vf_mp.c:266

Definition at line 268 of file vf_mp.c.

const AVFilterPad mp_outputs[]
static
Initial value:
= {
{
.name = "default",
.request_frame = request_frame,
.config_props = config_outprops,
},
{ NULL }
}
static int request_frame(AVFilterLink *outlink)
Definition: vf_mp.c:784
NULL
Definition: eval.c:55
static int config_outprops(AVFilterLink *outlink)
Definition: vf_mp.c:774

Definition at line 842 of file vf_mp.c.

enum AVPixelFormat pix_fmt

Definition at line 51 of file vf_mp.c.

Referenced by query_formats().