libavfilter/vf_ass.c File Reference

Libass subtitles burning filter. More...

#include <ass/ass.h>
#include "libavutil/avstring.h"
#include "libavutil/imgutils.h"
#include "libavutil/pixdesc.h"
#include "drawutils.h"
#include "avfilter.h"

Go to the source code of this file.

Data Structures

struct  AssContext

Defines

#define R   0
#define G   1
#define B   2
#define A   3
#define SET_PIXEL_RGB(picref, rgba_color, val, x, y, pixel_step, r_off, g_off, b_off)
#define AR(c)   ( (c)>>24)
#define AG(c)   (((c)>>16)&0xFF)
#define AB(c)   (((c)>>8) &0xFF)
#define AA(c)   ((0xFF-c) &0xFF)

Functions

static void ass_log (int ass_level, const char *fmt, va_list args, 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_input (AVFilterLink *inlink)
static void null_draw_slice (AVFilterLink *link, int y, int h, int slice_dir)
static void overlay_ass_image (AVFilterBufferRef *picref, const uint8_t *rgba_map, const int pix_step, const ASS_Image *image)
static void end_frame (AVFilterLink *inlink)

Variables

int ass_libav_log_level_map []
AVFilter avfilter_vf_ass


Detailed Description

Libass subtitles burning filter.

See also:
{http://www.matroska.org/technical/specs/subtitles/ssa.html}

Definition in file vf_ass.c.


Define Documentation

#define A   3

Definition at line 156 of file vf_ass.c.

#define AA ( c   )     ((0xFF-c) &0xFF)

Definition at line 170 of file vf_ass.c.

#define AB ( c   )     (((c)>>8) &0xFF)

Definition at line 169 of file vf_ass.c.

Referenced by overlay_ass_image().

#define AG ( c   )     (((c)>>16)&0xFF)

Definition at line 168 of file vf_ass.c.

Referenced by overlay_ass_image().

#define AR ( c   )     ( (c)>>24)

Definition at line 167 of file vf_ass.c.

Referenced by overlay_ass_image().

#define B   2

Definition at line 155 of file vf_ass.c.

#define G   1

Definition at line 154 of file vf_ass.c.

#define R   0

Definition at line 153 of file vf_ass.c.

#define SET_PIXEL_RGB ( picref,
rgba_color,
val,
x,
y,
pixel_step,
r_off,
g_off,
b_off   ) 

Value:

{ \
    p   = picref->data[0] + (x) * pixel_step + ((y) * picref->linesize[0]);             \
    alpha = rgba_color[A] * (val) * 129;                                                \
    *(p+r_off) = (alpha * rgba_color[R] + (255*255*129 - alpha) * *(p+r_off)) >> 23;    \
    *(p+g_off) = (alpha * rgba_color[G] + (255*255*129 - alpha) * *(p+g_off)) >> 23;    \
    *(p+b_off) = (alpha * rgba_color[B] + (255*255*129 - alpha) * *(p+b_off)) >> 23;    \
}

Definition at line 158 of file vf_ass.c.

Referenced by draw_glyph_rgb(), drawbox(), and overlay_ass_image().


Function Documentation

static void ass_log ( int  ass_level,
const char *  fmt,
va_list  args,
void *  ctx 
) [static]

Definition at line 59 of file vf_ass.c.

Referenced by init().

static int config_input ( AVFilterLink inlink  )  [static]

Definition at line 131 of file vf_ass.c.

static void end_frame ( AVFilterLink inlink  )  [static]

Definition at line 197 of file vf_ass.c.

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

Definition at line 67 of file vf_ass.c.

static void null_draw_slice ( AVFilterLink link,
int  y,
int  h,
int  slice_dir 
) [static]

Definition at line 151 of file vf_ass.c.

static void overlay_ass_image ( AVFilterBufferRef picref,
const uint8_t *  rgba_map,
const int  pix_step,
const ASS_Image *  image 
) [static]

Definition at line 172 of file vf_ass.c.

Referenced by end_frame().

static int query_formats ( AVFilterContext ctx  )  [static]

Definition at line 117 of file vf_ass.c.

static av_cold void uninit ( AVFilterContext ctx  )  [static]

Definition at line 104 of file vf_ass.c.


Variable Documentation

Initial value:

Definition at line 48 of file vf_ass.c.

Referenced by ass_log().

Initial value:

 {
    .name          = "ass",
    .description   = NULL_IF_CONFIG_SMALL("Render subtitles onto input video using the libass library."),
    .priv_size     = sizeof(AssContext),
    .init          = init,
    .uninit        = uninit,
    .query_formats = query_formats,

    .inputs = (const AVFilterPad[]) {
        { .name             = "default",
          .type             = AVMEDIA_TYPE_VIDEO,
          .get_video_buffer = avfilter_null_get_video_buffer,
          .start_frame      = avfilter_null_start_frame,
          .draw_slice       = null_draw_slice,
          .end_frame        = end_frame,
          .config_props     = config_input,
          .min_perms        = AV_PERM_WRITE | AV_PERM_READ,
          .rej_perms        = AV_PERM_PRESERVE },
        { .name = NULL}
    },
    .outputs = (const AVFilterPad[]) {
        { .name             = "default",
          .type             = AVMEDIA_TYPE_VIDEO, },
        { .name = NULL}
    },
}

Definition at line 217 of file vf_ass.c.


Generated on Fri Oct 26 02:43:51 2012 for FFmpeg by  doxygen 1.5.8