[FFmpeg-devel] [PATCH 1/2] avfilter/buffersrc: specify pixel format min/max
Michael Niedermayer
michaelni at gmx.at
Sat Dec 7 18:59:53 CET 2013
On Sat, Dec 07, 2013 at 04:09:56PM +0100, Nicolas George wrote:
> Le septidi 17 frimaire, an CCXXII, Michael Niedermayer a écrit :
> > Signed-off-by: Michael Niedermayer <michaelni at gmx.at>
> > ---
> > libavfilter/buffersrc.c | 2 +-
> > 1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/libavfilter/buffersrc.c b/libavfilter/buffersrc.c
> > index 6b6210d..8cdbc5d 100644
> > --- a/libavfilter/buffersrc.c
> > +++ b/libavfilter/buffersrc.c
> > @@ -326,7 +326,7 @@ static const AVOption buffer_options[] = {
> > { "width", NULL, OFFSET(w), AV_OPT_TYPE_INT, { .i64 = 0 }, 0, INT_MAX, V },
> > { "video_size", NULL, OFFSET(w), AV_OPT_TYPE_IMAGE_SIZE, .flags = V },
> > { "height", NULL, OFFSET(h), AV_OPT_TYPE_INT, { .i64 = 0 }, 0, INT_MAX, V },
> > - { "pix_fmt", NULL, OFFSET(pix_fmt), AV_OPT_TYPE_PIXEL_FMT, .flags = V },
> > + { "pix_fmt", NULL, OFFSET(pix_fmt), AV_OPT_TYPE_PIXEL_FMT,{ .i64 =-1 },-1, AV_PIX_FMT_NB-1, .flags = V },
> > #if FF_API_OLD_FILTER_OPTS
> > /* those 4 are for compatibility with the old option passing system where each filter
> > * did its own parsing */
>
> Does it make any practical difference? I am a bit unsure about having in the
> lavfi binary a hardcoded value that can become obsolete after a minor
> upgrade of lavu.
i was unsure about it as well
but for example the min value that is allowed could be -1 or 0
depending on if a "not specified" format is allowed
though " min = FFMIN(o->min, -1);" in opt.c looks like it would
prevent that usecase
about the max the current
" max = FFMAX(o->max, nb_fmts-1);" in opt.c would avoid the problem
also iam not sure if the FFMIN/MAX where intended to be what they
are or if they where intended to be the other way around
[...]
--
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB
What does censorship reveal? It reveals fear. -- Julian Assange
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: Digital signature
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20131207/1bc7ba15/attachment.asc>
More information about the ffmpeg-devel
mailing list