FFmpeg
Data Structures | Macros | Functions | Variables
vf_fsync.c File Reference
#include "libavutil/avstring.h"
#include "libavutil/error.h"
#include "libavutil/opt.h"
#include "libavformat/avio.h"
#include "video.h"
#include "filters.h"

Go to the source code of this file.

Data Structures

struct  FsyncContext
 

Macros

#define BUF_SIZE   256
 
#define OFFSET(x)   offsetof(FsyncContext, x)
 

Functions

static int buf_fill (FsyncContext *ctx)
 Fills the buffer from cur to end, add \0 at EOF. More...
 
static int buf_reload (FsyncContext *ctx)
 Copies cur to end to the beginning and fills the rest. More...
 
static void buf_skip_eol (FsyncContext *ctx)
 Skip from cur over eol. More...
 
static int buf_get_line_count (FsyncContext *ctx)
 Get number of bytes from cur until eol. More...
 
static int buf_get_zero (FsyncContext *ctx)
 Get number of bytes from cur to '\0'. More...
 
static int activate (AVFilterContext *ctx)
 
static int fsync_config_props (AVFilterLink *outlink)
 
static av_cold int fsync_init (AVFilterContext *ctx)
 
static av_cold void fsync_uninit (AVFilterContext *ctx)
 
 AVFILTER_DEFINE_CLASS (fsync)
 

Variables

static const AVOption fsync_options []
 
static const AVFilterPad fsync_outputs []
 
const AVFilter ff_vf_fsync
 

Detailed Description

Filter for syncing video frames from external source

Author
Thilo Borgmann <thilo.borgmann at mail.de>

Definition in file vf_fsync.c.

Macro Definition Documentation

◆ BUF_SIZE

#define BUF_SIZE   256

Definition at line 35 of file vf_fsync.c.

◆ OFFSET

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

Definition at line 51 of file vf_fsync.c.

Function Documentation

◆ buf_fill()

static int buf_fill ( FsyncContext ctx)
static

Fills the buffer from cur to end, add \0 at EOF.

Definition at line 62 of file vf_fsync.c.

Referenced by buf_reload(), and fsync_init().

◆ buf_reload()

static int buf_reload ( FsyncContext ctx)
static

Copies cur to end to the beginning and fills the rest.

Definition at line 80 of file vf_fsync.c.

Referenced by activate().

◆ buf_skip_eol()

static void buf_skip_eol ( FsyncContext ctx)
static

Skip from cur over eol.

Definition at line 101 of file vf_fsync.c.

Referenced by activate().

◆ buf_get_line_count()

static int buf_get_line_count ( FsyncContext ctx)
static

Get number of bytes from cur until eol.

Returns
>= 0 in case of success, -1 in case there is no line ending before end of buffer

Definition at line 117 of file vf_fsync.c.

Referenced by activate().

◆ buf_get_zero()

static int buf_get_zero ( FsyncContext ctx)
static

Get number of bytes from cur to '\0'.

Definition at line 132 of file vf_fsync.c.

Referenced by activate().

◆ activate()

static int activate ( AVFilterContext ctx)
static

Definition at line 137 of file vf_fsync.c.

◆ fsync_config_props()

static int fsync_config_props ( AVFilterLink outlink)
static

Definition at line 223 of file vf_fsync.c.

◆ fsync_init()

static av_cold int fsync_init ( AVFilterContext ctx)
static

Definition at line 243 of file vf_fsync.c.

◆ fsync_uninit()

static av_cold void fsync_uninit ( AVFilterContext ctx)
static

Definition at line 270 of file vf_fsync.c.

◆ AVFILTER_DEFINE_CLASS()

AVFILTER_DEFINE_CLASS ( fsync  )

Variable Documentation

◆ fsync_options

const AVOption fsync_options[]
static
Initial value:
= {
{ "file", "set the file name to use for frame sync", OFFSET(filename), AV_OPT_TYPE_STRING, { .str = "" }, .flags= AV_OPT_FLAG_VIDEO_PARAM | AV_OPT_FLAG_FILTERING_PARAM },
{ "f", "set the file name to use for frame sync", OFFSET(filename), AV_OPT_TYPE_STRING, { .str = "" }, .flags= AV_OPT_FLAG_VIDEO_PARAM | AV_OPT_FLAG_FILTERING_PARAM },
{ NULL }
}

Definition at line 53 of file vf_fsync.c.

◆ fsync_outputs

const AVFilterPad fsync_outputs[]
static
Initial value:
= {
{
.name = "default",
.config_props = fsync_config_props,
},
}

Definition at line 281 of file vf_fsync.c.

◆ ff_vf_fsync

const AVFilter ff_vf_fsync
Initial value:
= {
.name = "fsync",
.description = NULL_IF_CONFIG_SMALL("Synchronize video frames from external source."),
.init = fsync_init,
.uninit = fsync_uninit,
.priv_size = sizeof(FsyncContext),
.priv_class = &fsync_class,
}

Definition at line 289 of file vf_fsync.c.

activate
static int activate(AVFilterContext *ctx)
Definition: vf_fsync.c:137
ff_video_default_filterpad
const AVFilterPad ff_video_default_filterpad[1]
An AVFilterPad array whose only entry has name "default" and is of type AVMEDIA_TYPE_VIDEO.
Definition: video.c:37
FsyncContext
Definition: vf_fsync.c:37
FILTER_INPUTS
#define FILTER_INPUTS(array)
Definition: internal.h:182
NULL
#define NULL
Definition: coverity.c:32
AV_OPT_FLAG_FILTERING_PARAM
#define AV_OPT_FLAG_FILTERING_PARAM
A generic parameter which can be set by the user for filtering.
Definition: opt.h:298
NULL_IF_CONFIG_SMALL
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification.
Definition: internal.h:106
FF_FILTER_FORMATS_PASSTHROUGH
@ FF_FILTER_FORMATS_PASSTHROUGH
The default value meaning that this filter supports all formats and (for audio) sample rates and chan...
Definition: internal.h:151
fsync_outputs
static const AVFilterPad fsync_outputs[]
Definition: vf_fsync.c:281
AV_OPT_FLAG_VIDEO_PARAM
#define AV_OPT_FLAG_VIDEO_PARAM
Definition: opt.h:275
fsync_init
static av_cold int fsync_init(AVFilterContext *ctx)
Definition: vf_fsync.c:243
OFFSET
#define OFFSET(x)
Definition: vf_fsync.c:51
fsync_config_props
static int fsync_config_props(AVFilterLink *outlink)
Definition: vf_fsync.c:223
AVFILTER_FLAG_METADATA_ONLY
#define AVFILTER_FLAG_METADATA_ONLY
The filter is a "metadata" filter - it does not modify the frame data in any way.
Definition: avfilter.h:133
fsync_uninit
static av_cold void fsync_uninit(AVFilterContext *ctx)
Definition: vf_fsync.c:270
AVMEDIA_TYPE_VIDEO
@ AVMEDIA_TYPE_VIDEO
Definition: avutil.h:201
FILTER_OUTPUTS
#define FILTER_OUTPUTS(array)
Definition: internal.h:183
AV_OPT_TYPE_STRING
@ AV_OPT_TYPE_STRING
Definition: opt.h:239