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/eval.h"
#include "libavutil/opt.h"
#include "libavutil/pixdesc.h"
#include "avfilter.h"
#include "drawutils.h"
#include "internal.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)

Functions

static const char * fade_get_name (void *ctx)
static av_cold int init (AVFilterContext *ctx, const char *args, void *opaque)
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 void draw_slice (AVFilterLink *inlink, int y, int h, int slice_dir)
static void end_frame (AVFilterLink *inlink)

Variables

static const AVOption fade_options []
static const AVClass fade_class
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 39 of file vf_fade.c.

#define B   2

Definition at line 38 of file vf_fade.c.

#define G   1

Definition at line 37 of file vf_fade.c.

#define OFFSET (  )     offsetof(FadeContext, x)

Definition at line 58 of file vf_fade.c.

#define R   0

Definition at line 36 of file vf_fade.c.

#define U   1

Definition at line 42 of file vf_fade.c.

#define V   2

Definition at line 43 of file vf_fade.c.

#define Y   0

Definition at line 41 of file vf_fade.c.


Function Documentation

static int config_props ( AVFilterLink inlink  )  [static]

Definition at line 182 of file vf_fade.c.

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

Definition at line 222 of file vf_fade.c.

static void end_frame ( AVFilterLink inlink  )  [static]

Definition at line 266 of file vf_fade.c.

static const char* fade_get_name ( void *  ctx  )  [static]

Definition at line 71 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 203 of file vf_fade.c.

Referenced by draw_slice().

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

Definition at line 82 of file vf_fade.c.

static int query_formats ( AVFilterContext ctx  )  [static]

Definition at line 150 of file vf_fade.c.

static av_cold void uninit ( AVFilterContext ctx  )  [static]

Definition at line 143 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 = avfilter_null_get_video_buffer,
                                    .start_frame      = avfilter_null_start_frame,
                                    .draw_slice      = draw_slice,
                                    .end_frame       = end_frame,
                                    .min_perms       = AV_PERM_READ | AV_PERM_WRITE,
                                    .rej_perms       = AV_PERM_PRESERVE, },
                                  { .name = NULL}},
    .outputs   = (const AVFilterPad[]) {{ .name      = "default",
                                    .type            = AVMEDIA_TYPE_VIDEO, },
                                  { .name = NULL}},
}

Definition at line 279 of file vf_fade.c.

const AVClass fade_class [static]

Initial value:

 {
    "FadeContext",
    fade_get_name,
    fade_options
}

Definition at line 76 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 },
    { "t",           "set the fade direction",                     OFFSET(type),        AV_OPT_TYPE_STRING, {.str = "in" }, CHAR_MIN, CHAR_MAX },
    { "start_frame", "set expression of frame to start fading",    OFFSET(start_frame), AV_OPT_TYPE_INT, {.dbl = 0    }, 0, INT_MAX },
    { "s",           "set expression of frame to start fading",    OFFSET(start_frame), AV_OPT_TYPE_INT, {.dbl = 0    }, 0, INT_MAX },
    { "nb_frames",   "set expression for fade duration in frames", OFFSET(nb_frames),   AV_OPT_TYPE_INT, {.dbl = 25   }, 0, INT_MAX },
    { "n",           "set expression for fade duration in frames", OFFSET(nb_frames),   AV_OPT_TYPE_INT, {.dbl = 25   }, 0, INT_MAX },
    { "alpha",       "fade alpha if it is available on the input", OFFSET(alpha),       AV_OPT_TYPE_INT, {.dbl = 0    }, 0,       1 },
    {NULL},
}

Definition at line 60 of file vf_fade.c.

const enum PixelFormat studio_level_pix_fmts[] [static]


Generated on Fri Oct 26 02:46:12 2012 for FFmpeg by  doxygen 1.5.8