mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-06-01 09:27:44 +00:00
Factorize definition of the output_filter defined in both ffplay.c and
ffmpeg.c. Replace it with a more generic definition which can be shared. Originally committed as revision 25453 to svn://svn.ffmpeg.org/ffmpeg/trunk
This commit is contained in:
parent
f5b05b951c
commit
f7ead94c69
4 changed files with 58 additions and 75 deletions
41
cmdutils.c
41
cmdutils.c
|
@ -747,3 +747,44 @@ int64_t guess_correct_pts(PtsCorrectionContext *ctx, int64_t reordered_pts, int6
|
|||
|
||||
return pts;
|
||||
}
|
||||
|
||||
#if CONFIG_AVFILTER
|
||||
|
||||
static int ffsink_init(AVFilterContext *ctx, const char *args, void *opaque)
|
||||
{
|
||||
FFSinkContext *priv = ctx->priv;
|
||||
|
||||
if (!opaque)
|
||||
return AVERROR(EINVAL);
|
||||
*priv = *(FFSinkContext *)opaque;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void null_end_frame(AVFilterLink *inlink) { }
|
||||
|
||||
static int ffsink_query_formats(AVFilterContext *ctx)
|
||||
{
|
||||
FFSinkContext *priv = ctx->priv;
|
||||
enum PixelFormat pix_fmts[] = { priv->pix_fmt, PIX_FMT_NONE };
|
||||
|
||||
avfilter_set_common_formats(ctx, avfilter_make_format_list(pix_fmts));
|
||||
return 0;
|
||||
}
|
||||
|
||||
AVFilter ffsink = {
|
||||
.name = "ffsink",
|
||||
.priv_size = sizeof(FFSinkContext),
|
||||
.init = ffsink_init,
|
||||
|
||||
.query_formats = ffsink_query_formats,
|
||||
|
||||
.inputs = (AVFilterPad[]) {{ .name = "default",
|
||||
.type = AVMEDIA_TYPE_VIDEO,
|
||||
.end_frame = null_end_frame,
|
||||
.min_perms = AV_PERM_READ, },
|
||||
{ .name = NULL }},
|
||||
.outputs = (AVFilterPad[]) {{ .name = NULL }},
|
||||
};
|
||||
|
||||
#endif /* CONFIG_AVFILTER */
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue