FFmpeg
Data Structures | Macros | Functions | Variables
vf_fsync.c File Reference
#include "libavutil/avstring.h"
#include "libavutil/error.h"
#include "libavutil/mem.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 36 of file vf_fsync.c.

◆ OFFSET

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

Definition at line 52 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 63 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 81 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 102 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 118 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 133 of file vf_fsync.c.

Referenced by activate().

◆ activate()

static int activate ( AVFilterContext ctx)
static

Definition at line 138 of file vf_fsync.c.

◆ fsync_config_props()

static int fsync_config_props ( AVFilterLink outlink)
static

Definition at line 224 of file vf_fsync.c.

◆ fsync_init()

static av_cold int fsync_init ( AVFilterContext ctx)
static

Definition at line 245 of file vf_fsync.c.

◆ fsync_uninit()

static av_cold void fsync_uninit ( AVFilterContext ctx)
static

Definition at line 272 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 54 of file vf_fsync.c.

◆ fsync_outputs

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

Definition at line 283 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 291 of file vf_fsync.c.

FILTER_INPUTS
#define FILTER_INPUTS(array)
Definition: filters.h:262
activate
static int activate(AVFilterContext *ctx)
Definition: vf_fsync.c:138
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:38
FILTER_OUTPUTS
#define FILTER_OUTPUTS(array)
Definition: filters.h:263
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:381
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:94
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: filters.h:227
fsync_outputs
static const AVFilterPad fsync_outputs[]
Definition: vf_fsync.c:283
AV_OPT_FLAG_VIDEO_PARAM
#define AV_OPT_FLAG_VIDEO_PARAM
Definition: opt.h:358
fsync_init
static av_cold int fsync_init(AVFilterContext *ctx)
Definition: vf_fsync.c:245
OFFSET
#define OFFSET(x)
Definition: vf_fsync.c:52
fsync_config_props
static int fsync_config_props(AVFilterLink *outlink)
Definition: vf_fsync.c:224
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:168
fsync_uninit
static av_cold void fsync_uninit(AVFilterContext *ctx)
Definition: vf_fsync.c:272
AVMEDIA_TYPE_VIDEO
@ AVMEDIA_TYPE_VIDEO
Definition: avutil.h:201
AV_OPT_TYPE_STRING
@ AV_OPT_TYPE_STRING
Underlying C type is a uint8_t* that is either NULL or points to a C string allocated with the av_mal...
Definition: opt.h:276