libavfilter/vf_fade.c File Reference

video fade filter based heavily on vf_negate.c by Bobby Bingham More...

#include "libavutil/avstring.h"
#include "libavutil/common.h"
#include "libavutil/eval.h"
#include "libavutil/opt.h"
#include "libavutil/pixdesc.h"
#include "avfilter.h"
#include "drawutils.h"
#include "internal.h"
#include "formats.h"
#include "video.h"

Go to the source code of this file.

Data Structures

struct  FadeContext

Defines

#define R   0
#define G   1
#define B   2
#define A   3
#define Y   0
#define U   1
#define V   2
#define OFFSET(x)   offsetof(FadeContext, x)
#define FLAGS   AV_OPT_FLAG_VIDEO_PARAM|AV_OPT_FLAG_FILTERING_PARAM

Functions

 AVFILTER_DEFINE_CLASS (fade)
static av_cold int init (AVFilterContext *ctx, const char *args)
static av_cold void uninit (AVFilterContext *ctx)
static int query_formats (AVFilterContext *ctx)
static int config_props (AVFilterLink *inlink)
static void fade_plane (int y, int h, int w, int fade_factor, int black_level, int black_level_scaled, uint8_t offset, uint8_t step, int bytes_per_plane, uint8_t *data, int line_size)
static int draw_slice (AVFilterLink *inlink, int y, int h, int slice_dir)
static int end_frame (AVFilterLink *inlink)

Variables

static const AVOption fade_options []
static const enum PixelFormat studio_level_pix_fmts []
static enum PixelFormat alpha_pix_fmts []
AVFilter avfilter_vf_fade


Detailed Description

video fade filter based heavily on vf_negate.c by Bobby Bingham

Definition in file vf_fade.c.


Define Documentation

#define A   3

Definition at line 43 of file vf_fade.c.

#define B   2

Definition at line 42 of file vf_fade.c.

#define FLAGS   AV_OPT_FLAG_VIDEO_PARAM|AV_OPT_FLAG_FILTERING_PARAM

Definition at line 63 of file vf_fade.c.

#define G   1

Definition at line 41 of file vf_fade.c.

#define OFFSET (  )     offsetof(FadeContext, x)

Definition at line 62 of file vf_fade.c.

#define R   0

Definition at line 40 of file vf_fade.c.

#define U   1

Definition at line 46 of file vf_fade.c.

#define V   2

Definition at line 47 of file vf_fade.c.

#define Y   0

Definition at line 45 of file vf_fade.c.


Function Documentation

AVFILTER_DEFINE_CLASS ( fade   ) 

static int config_props ( AVFilterLink inlink  )  [static]

Definition at line 179 of file vf_fade.c.

static int draw_slice ( AVFilterLink inlink,
int  y,
int  h,
int  slice_dir 
) [static]

Definition at line 219 of file vf_fade.c.

static int end_frame ( AVFilterLink inlink  )  [static]

Definition at line 263 of file vf_fade.c.

static void fade_plane ( int  y,
int  h,
int  w,
int  fade_factor,
int  black_level,
int  black_level_scaled,
uint8_t  offset,
uint8_t  step,
int  bytes_per_plane,
uint8_t data,
int  line_size 
) [static]

Definition at line 200 of file vf_fade.c.

Referenced by draw_slice().

static av_cold int init ( AVFilterContext ctx,
const char *  args 
) [static]

Definition at line 78 of file vf_fade.c.

static int query_formats ( AVFilterContext ctx  )  [static]

Definition at line 147 of file vf_fade.c.

static av_cold void uninit ( AVFilterContext ctx  )  [static]

Definition at line 140 of file vf_fade.c.


Variable Documentation

enum PixelFormat alpha_pix_fmts[] [static]

Initial value:

 {
    .name          = "fade",
    .description   = NULL_IF_CONFIG_SMALL("Fade in/out input video."),
    .init          = init,
    .uninit        = uninit,
    .priv_size     = sizeof(FadeContext),
    .query_formats = query_formats,

    .inputs    = (const AVFilterPad[]) {{ .name            = "default",
                                          .type            = AVMEDIA_TYPE_VIDEO,
                                          .config_props    = config_props,
                                          .get_video_buffer = ff_null_get_video_buffer,
                                          .start_frame      = ff_null_start_frame,
                                          .draw_slice      = draw_slice,
                                          .end_frame       = end_frame,
                                          .min_perms       = AV_PERM_READ | AV_PERM_WRITE },
                                        { .name = NULL}},
    .outputs   = (const AVFilterPad[]) {{ .name            = "default",
                                          .type            = AVMEDIA_TYPE_VIDEO, },
                                        { .name = NULL}},
    .priv_class = &fade_class,
}

Definition at line 279 of file vf_fade.c.

const AVOption fade_options[] [static]

Initial value:

 {
    { "type",        "set the fade direction",                     OFFSET(type),        AV_OPT_TYPE_STRING, {.str = "in" }, CHAR_MIN, CHAR_MAX, FLAGS },
    { "t",           "set the fade direction",                     OFFSET(type),        AV_OPT_TYPE_STRING, {.str = "in" }, CHAR_MIN, CHAR_MAX, FLAGS },
    { "start_frame", "set expression of frame to start fading",    OFFSET(start_frame), AV_OPT_TYPE_INT, {.i64 = 0    }, 0, INT_MAX, FLAGS },
    { "s",           "set expression of frame to start fading",    OFFSET(start_frame), AV_OPT_TYPE_INT, {.i64 = 0    }, 0, INT_MAX, FLAGS },
    { "nb_frames",   "set expression for fade duration in frames", OFFSET(nb_frames),   AV_OPT_TYPE_INT, {.i64 = 25   }, 0, INT_MAX, FLAGS },
    { "n",           "set expression for fade duration in frames", OFFSET(nb_frames),   AV_OPT_TYPE_INT, {.i64 = 25   }, 0, INT_MAX, FLAGS },
    { "alpha",       "fade alpha if it is available on the input", OFFSET(alpha),       AV_OPT_TYPE_INT, {.i64 = 0    }, 0,       1, FLAGS },
    {NULL},
}

Definition at line 65 of file vf_fade.c.

const enum PixelFormat studio_level_pix_fmts[] [static]


Generated on Fri Oct 26 02:50:10 2012 for FFmpeg by  doxygen 1.5.8