FFmpeg
Loading...
Searching...
No Matches
vf_fsync.c File Reference

Filter for syncing video frames from external source. More...

#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)
 

Functions

static int buf_fill (FsyncContext *ctx)
 Fills the buffer from cur to end, add \0 at EOF.
 
static int buf_reload (FsyncContext *ctx)
 Copies cur to end to the beginning and fills the rest.
 
static void buf_skip_eol (FsyncContext *ctx)
 Skip from cur over eol.
 
static int buf_get_line_count (FsyncContext *ctx)
 Get number of bytes from cur until eol.
 
static int buf_get_zero (FsyncContext *ctx)
 Get number of bytes from cur to '\0'.
 
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 FFFilter 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)
Value:
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 }
}
#define NULL
Definition coverity.c:32
#define OFFSET(x)
#define AV_OPT_FLAG_FILTERING_PARAM
A generic parameter which can be set by the user for filtering.
Definition opt.h:380
#define AV_OPT_FLAG_VIDEO_PARAM
Definition opt.h:357
@ 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:275

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,
},
}
@ AVMEDIA_TYPE_VIDEO
Definition avutil.h:200
static int fsync_config_props(AVFilterLink *outlink)
Definition vf_fsync.c:224

Definition at line 283 of file vf_fsync.c.

◆ ff_vf_fsync

const FFFilter ff_vf_fsync
Initial value:
= {
.p.name = "fsync",
.p.description = NULL_IF_CONFIG_SMALL("Synchronize video frames from external source."),
.p.priv_class = &fsync_class,
.init = fsync_init,
.uninit = fsync_uninit,
.priv_size = sizeof(FsyncContext),
}
#define AVFILTER_FLAG_METADATA_ONLY
The filter is a "metadata" filter - it does not modify the frame data in any way.
Definition avfilter.h:182
static int activate(AVBitStreamFilterContext *ctx)
#define FILTER_INPUTS(array)
Definition filters.h:264
#define FILTER_OUTPUTS(array)
Definition filters.h:265
@ FF_FILTER_FORMATS_PASSTHROUGH
The default value meaning that this filter supports all formats and (for audio) sample rates and chan...
Definition filters.h:229
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification.
Definition internal.h:88
static const AVFilterPad fsync_outputs[]
Definition vf_fsync.c:283
static av_cold int fsync_init(AVFilterContext *ctx)
Definition vf_fsync.c:245
static av_cold void fsync_uninit(AVFilterContext *ctx)
Definition vf_fsync.c:272
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

Definition at line 291 of file vf_fsync.c.