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

Filter for reading the vertical interval timecode (VITC). More...

#include "libavutil/common.h"
#include "libavutil/internal.h"
#include "libavutil/opt.h"
#include "libavutil/pixdesc.h"
#include "libavutil/timecode.h"
#include "avfilter.h"
#include "formats.h"
#include "internal.h"

Go to the source code of this file.

Data Structures

struct  ReadVitcContext
 

Macros

#define LINE_DATA_SIZE   9
 
#define OFFSET(x)   offsetof(ReadVitcContext, x)
 
#define FLAGS   AV_OPT_FLAG_VIDEO_PARAM|AV_OPT_FLAG_FILTERING_PARAM
 

Functions

 AVFILTER_DEFINE_CLASS (readvitc)
 
static uint8_t get_vitc_crc (uint8_t *line)
 
static uint8_t get_pit_avg3 (uint8_t *line, int i)
 
static int read_vitc_line (ReadVitcContext *ctx, uint8_t *src, int line_size, int width, int height)
 
static unsigned bcd2uint (uint8_t high, uint8_t low)
 
static char * make_vitc_tc_string (char *buf, uint8_t *line)
 
static av_cold int init (AVFilterContext *ctx)
 
static int config_props (AVFilterLink *inlink)
 
static int query_formats (AVFilterContext *ctx)
 
static int filter_frame (AVFilterLink *inlink, AVFrame *frame)
 

Variables

static const AVOption readvitc_options []
 
static const AVFilterPad inputs []
 
static const AVFilterPad outputs []
 
AVFilter ff_vf_readvitc
 

Detailed Description

Filter for reading the vertical interval timecode (VITC).

See also https://en.wikipedia.org/wiki/Vertical_interval_timecode

Definition in file vf_readvitc.c.

Macro Definition Documentation

#define LINE_DATA_SIZE   9

Definition at line 36 of file vf_readvitc.c.

Referenced by read_vitc_line().

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

Definition at line 53 of file vf_readvitc.c.

Definition at line 54 of file vf_readvitc.c.

Function Documentation

AVFILTER_DEFINE_CLASS ( readvitc  )
static uint8_t get_vitc_crc ( uint8_t line)
static

Definition at line 65 of file vf_readvitc.c.

Referenced by read_vitc_line().

static uint8_t get_pit_avg3 ( uint8_t line,
int  i 
)
inlinestatic

Definition at line 83 of file vf_readvitc.c.

Referenced by read_vitc_line().

static int read_vitc_line ( ReadVitcContext ctx,
uint8_t src,
int  line_size,
int  width,
int  height 
)
static

Definition at line 87 of file vf_readvitc.c.

Referenced by filter_frame().

static unsigned bcd2uint ( uint8_t  high,
uint8_t  low 
)
static

Definition at line 139 of file vf_readvitc.c.

Referenced by make_vitc_tc_string().

static char* make_vitc_tc_string ( char *  buf,
uint8_t line 
)
static

Definition at line 146 of file vf_readvitc.c.

Referenced by filter_frame().

static av_cold int init ( AVFilterContext ctx)
static

Definition at line 158 of file vf_readvitc.c.

static int config_props ( AVFilterLink inlink)
static

Definition at line 176 of file vf_readvitc.c.

static int query_formats ( AVFilterContext ctx)
static

Definition at line 187 of file vf_readvitc.c.

static int filter_frame ( AVFilterLink inlink,
AVFrame frame 
)
static

Definition at line 216 of file vf_readvitc.c.

Variable Documentation

const AVOption readvitc_options[]
static
Initial value:
= {
{ "scan_max", "maximum line numbers to scan for VITC data", OFFSET(scan_max), AV_OPT_TYPE_INT, {.i64 = 45 }, -1, INT_MAX, FLAGS },
{ "thr_b", "black color threshold", OFFSET(thr_b), AV_OPT_TYPE_DOUBLE, {.dbl = 0.2 }, 0, 1.0, FLAGS },
{ "thr_w", "white color threshold", OFFSET(thr_w), AV_OPT_TYPE_DOUBLE, {.dbl = 0.6 }, 0, 1.0, FLAGS },
{ NULL }
}
#define NULL
Definition: coverity.c:32
#define OFFSET(x)
Definition: vf_readvitc.c:53
#define FLAGS
Definition: vf_readvitc.c:54

Definition at line 56 of file vf_readvitc.c.

const AVFilterPad inputs[]
static
Initial value:
= {
{
.name = "default",
.filter_frame = filter_frame,
.config_props = config_props,
},
{ NULL }
}
#define NULL
Definition: coverity.c:32
static int filter_frame(AVFilterLink *inlink, AVFrame *frame)
Definition: vf_readvitc.c:216
static int config_props(AVFilterLink *inlink)
Definition: vf_readvitc.c:176

Definition at line 231 of file vf_readvitc.c.

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

Definition at line 241 of file vf_readvitc.c.

AVFilter ff_vf_readvitc
Initial value:
= {
.name = "readvitc",
.description = NULL_IF_CONFIG_SMALL("Read vertical interval timecode and write it to frame metadata."),
.priv_size = sizeof(ReadVitcContext),
.priv_class = &readvitc_class,
.init = init,
}
static int query_formats(AVFilterContext *ctx)
Definition: vf_readvitc.c:187
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification. ...
Definition: internal.h:186
static const AVFilterPad inputs[]
Definition: vf_readvitc.c:231
static av_cold int init(AVFilterContext *ctx)
Definition: vf_readvitc.c:158
static const AVFilterPad outputs[]
Definition: vf_readvitc.c:241

Definition at line 249 of file vf_readvitc.c.