52#define OFFSET(x) offsetof(FsyncContext, x)
66 int num =
ctx->end -
ctx->cur;
72 *(
ctx->cur + ret) =
'\0';
84 int num =
ctx->end -
ctx->cur;
86 for (
i = 0;
i < num;
i++) {
123 if (*
i ==
'\0' || *
i ==
'\n')
151 if (line_count < 0) {
166 ret =
av_sscanf(
s->cur,
"%"PRId64
" %"PRId64
" %d/%d", &
s->ptsi, &
s->pts, &
s->tb_num, &
s->tb_den);
175 if (
s->last_frame->pts >=
s->ptsi) {
190 s->cur += line_count;
198 }
else if (
s->last_frame->pts <
s->ptsi) {
232 ret =
av_sscanf(
s->cur,
"%"PRId64
" %"PRId64
" %d/%d", &
s->ptsi, &
s->pts, &
s->tb_num, &
s->tb_den);
294 .p.priv_class = &fsync_class,
const FFFilter ff_vf_fsync
int ff_inoutlink_check_flow(AVFilterLink *inlink, AVFilterLink *outlink)
Check for flow control between input and output.
int ff_filter_frame(AVFilterLink *link, AVFrame *frame)
Send a frame of data to the next filter.
void ff_filter_set_ready(AVFilterContext *filter, unsigned priority)
Mark a filter ready and schedule it for activation.
int ff_inlink_consume_frame(AVFilterLink *link, AVFrame **rframe)
Take a frame from the link's FIFO and update the link's stats.
int avio_open(AVIOContext **s, const char *filename, int flags)
Create and initialize a AVIOContext for accessing the resource indicated by url.
int avio_closep(AVIOContext **s)
Close the resource accessed by the AVIOContext *s, free it and set the pointer pointing to it to NULL...
#define AVIO_FLAG_READ
read-only
int avio_feof(AVIOContext *s)
Similar to feof() but also returns nonzero on read errors.
int avio_read(AVIOContext *s, unsigned char *buf, int size)
Read size bytes from AVIOContext into buf.
int av_sscanf(const char *string, const char *format,...)
#define i(width, name, range_min, range_max)
#define AV_OPT_FLAG_FILTERING_PARAM
A generic parameter which can be set by the user for filtering.
#define AV_OPT_FLAG_VIDEO_PARAM
@ 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...
#define AVFILTER_FLAG_METADATA_ONLY
The filter is a "metadata" filter - it does not modify the frame data in any way.
#define AVERROR_INVALIDDATA
Invalid data found when processing input.
void av_frame_free(AVFrame **frame)
Free the frame and any dynamically allocated objects in it, e.g.
AVFrame * av_frame_clone(const AVFrame *src)
Create a new frame that references the same data as src.
#define AV_LOG_DEBUG
Stuff which is only useful for libav* developers.
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
static AVRational av_make_q(int num, int den)
Create an AVRational.
size_t static size_t av_strnlen(const char *s, size_t len)
Get the count of continuous non zero chars starting from the beginning.
#define AV_NOPTS_VALUE
Undefined timestamp value.
static int activate(AVBitStreamFilterContext *ctx)
#define FILTER_INPUTS(array)
#define FILTER_OUTPUTS(array)
#define FF_FILTER_FORWARD_WANTED(outlink, inlink)
Forward the frame_wanted_out flag from an output link to an input link.
#define FF_FILTER_FORWARD_STATUS(inlink, outlink)
Acknowledge the status on an input link and forward it to an output link.
static void ff_outlink_set_status(AVFilterLink *link, int status, int64_t pts)
Set the status field of a link from the source filter.
#define FFERROR_NOT_READY
Filters implementation helper functions and internal structures.
#define FF_FILTER_FORWARD_STATUS_BACK(outlink, inlink)
Forward the status on an output link to an input link.
static FilterLink * ff_filter_link(AVFilterLink *link)
@ FF_FILTER_FORMATS_PASSTHROUGH
The default value meaning that this filter supports all formats and (for audio) sample rates and chan...
#define AVFILTER_DEFINE_CLASS(fname)
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification.
Memory handling functions.
Describe the class of an AVClass context structure.
A link between two filters.
AVFilterContext * src
source filter
AVRational time_base
Define the time base used by the PTS of the frames/samples which will pass through this link.
A filter pad used for either input or output.
This structure describes decoded (raw) audio or video data.
Link properties exposed to filter code, but not external callers.
AVRational frame_rate
Frame rate of the stream on the link, or 1/0 if unknown or variable.
static AVFormatContext * ctx
static int buf_fill(FsyncContext *ctx)
Fills the buffer from cur to end, add \0 at EOF.
static int buf_get_line_count(FsyncContext *ctx)
Get number of bytes from cur until eol.
static int buf_reload(FsyncContext *ctx)
Copies cur to end to the beginning and fills the rest.
static const AVFilterPad fsync_outputs[]
static int fsync_config_props(AVFilterLink *outlink)
static av_cold int fsync_init(AVFilterContext *ctx)
static av_cold void fsync_uninit(AVFilterContext *ctx)
static void buf_skip_eol(FsyncContext *ctx)
Skip from cur over eol.
static int activate(AVFilterContext *ctx)
static const AVOption fsync_options[]
static int buf_get_zero(FsyncContext *ctx)
Get number of bytes from cur to '\0'.
const AVFilterPad ff_video_default_filterpad[1]
An AVFilterPad array whose only entry has name "default" and is of type AVMEDIA_TYPE_VIDEO.