mirror of
https://git.ffmpeg.org/ffmpeg.git
synced 2025-12-05 14:30:00 +01:00
Compare commits
2 Commits
f46e514491
...
9e3030bc44
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
9e3030bc44 | ||
|
|
a665413248 |
@@ -2,6 +2,9 @@ The last version increases of all libraries were on 2024-03-07
|
||||
|
||||
API changes, most recent first:
|
||||
|
||||
2025-09-xx - xxxxxxxxxx - lavfi 10.5.100 - buffersrc.h
|
||||
Add av_buffersrc_get_status().
|
||||
|
||||
2024-09-23 - 6940a6de2f0 - lavu 59.38.100 - frame.h
|
||||
Add AV_FRAME_DATA_VIEW_ID.
|
||||
|
||||
|
||||
@@ -2365,6 +2365,18 @@ finish:
|
||||
fps->dropped_keyframe |= fps->last_dropped && (frame->flags & AV_FRAME_FLAG_KEY);
|
||||
}
|
||||
|
||||
static void close_input(FilterGraph *fg, int input_idx)
|
||||
{
|
||||
|
||||
InputFilterPriv *ifp = ifp_from_ifilter(fg->inputs[input_idx]);
|
||||
FilterGraphPriv *fgp = fgp_from_fg(ifp->ifilter.graph);
|
||||
|
||||
if (!ifp->eof) {
|
||||
sch_filter_receive_finish(fgp->sch, fgp->sch_idx, input_idx);
|
||||
ifp->eof = 1;
|
||||
}
|
||||
}
|
||||
|
||||
static int close_output(OutputFilterPriv *ofp, FilterGraphThread *fgt)
|
||||
{
|
||||
FilterGraphPriv *fgp = fgp_from_fg(ofp->ofilter.graph);
|
||||
@@ -3035,7 +3047,7 @@ static int filter_thread(void *arg)
|
||||
if (ret == AVERROR_EOF) {
|
||||
av_log(fg, AV_LOG_VERBOSE, "Input %u no longer accepts new data\n",
|
||||
input_idx);
|
||||
sch_filter_receive_finish(fgp->sch, fgp->sch_idx, input_idx);
|
||||
close_input(fg, input_idx);
|
||||
continue;
|
||||
}
|
||||
if (ret < 0)
|
||||
@@ -3052,6 +3064,13 @@ read_frames:
|
||||
av_err2str(ret));
|
||||
goto finish;
|
||||
}
|
||||
|
||||
// ensure all inputs no longer accepting data are closed
|
||||
for (int i = 0; fgt.graph && i < fg->nb_inputs; i++) {
|
||||
InputFilterPriv *ifp = ifp_from_ifilter(fg->inputs[i]);
|
||||
if (av_buffersrc_get_status(ifp->filter))
|
||||
close_input(fg, i);
|
||||
}
|
||||
}
|
||||
|
||||
for (unsigned i = 0; i < fg->nb_outputs; i++) {
|
||||
|
||||
@@ -283,6 +283,16 @@ int av_buffersrc_close(AVFilterContext *ctx, int64_t pts, unsigned flags)
|
||||
return (flags & AV_BUFFERSRC_FLAG_PUSH) ? push_frame(ctx->graph) : 0;
|
||||
}
|
||||
|
||||
int av_buffersrc_get_status(AVFilterContext *ctx)
|
||||
{
|
||||
BufferSourceContext *s = ctx->priv;
|
||||
|
||||
if (!s->eof && ff_outlink_get_status(ctx->outputs[0]))
|
||||
s->eof = 1;
|
||||
|
||||
return s->eof ? AVERROR(EOF) : 0;
|
||||
}
|
||||
|
||||
static av_cold int init_video(AVFilterContext *ctx)
|
||||
{
|
||||
BufferSourceContext *c = ctx->priv;
|
||||
|
||||
@@ -208,6 +208,14 @@ int av_buffersrc_add_frame_flags(AVFilterContext *buffer_src,
|
||||
*/
|
||||
int av_buffersrc_close(AVFilterContext *ctx, int64_t pts, unsigned flags);
|
||||
|
||||
/**
|
||||
* Returns 0 or a negative AVERROR code. Currently, this will only ever
|
||||
* return AVERROR(EOF), to indicate that the buffer source has been closed,
|
||||
* either as a result of av_buffersrc_close(), or because the downstream
|
||||
* filter is no longer accepting new data.
|
||||
*/
|
||||
int av_buffersrc_get_status(AVFilterContext *ctx);
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
@@ -31,7 +31,7 @@
|
||||
|
||||
#include "version_major.h"
|
||||
|
||||
#define LIBAVFILTER_VERSION_MINOR 4
|
||||
#define LIBAVFILTER_VERSION_MINOR 5
|
||||
#define LIBAVFILTER_VERSION_MICRO 100
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user