[FFmpeg-devel] [PATCH] lavu/opt: change the way default pixel and sample format value is set

Michael Niedermayer michaelni at gmx.at
Sun Nov 25 17:49:05 CET 2012


On Sun, Nov 25, 2012 at 04:34:48PM +0100, Stefano Sabatini wrote:
> On date Sunday 2012-11-25 16:10:05 +0100, Michael Niedermayer encoded:
> > On Sun, Nov 25, 2012 at 04:00:20PM +0100, Stefano Sabatini wrote:
> > > Use the i64 field rather than the string value. Use a string to set a
> > > default sample/pixel format is weird, also this is more consistent with
> > > the rest of the API.
> > > 
> > 
> > > This is technically an API break, but hopefully there are no applications
> > > using this feature outside of FFmpeg.
> > > 
> > > TODO: bump micro
> > > ---
> > >  libavdevice/dshow.c |    2 +-
> > >  libavutil/opt.c     |   10 +++++++---
> > >  2 files changed, 8 insertions(+), 4 deletions(-)
> > > 
> > > diff --git a/libavdevice/dshow.c b/libavdevice/dshow.c
> > > index 3bd90b0..3e141e8 100644
> > > --- a/libavdevice/dshow.c
> > > +++ b/libavdevice/dshow.c
> > > @@ -1018,7 +1018,7 @@ static int dshow_read_packet(AVFormatContext *s, AVPacket *pkt)
> > >  #define DEC AV_OPT_FLAG_DECODING_PARAM
> > >  static const AVOption options[] = {
> > >      { "video_size", "set video size given a string such as 640x480 or hd720.", OFFSET(requested_width), AV_OPT_TYPE_IMAGE_SIZE, {.str = NULL}, 0, 0, DEC },
> > > -    { "pixel_format", "set video pixel format", OFFSET(pixel_format), AV_OPT_TYPE_PIXEL_FMT, {.str = NULL}, 0, 0, DEC },
> > 
> > > +    { "pixel_format", "set video pixel format", OFFSET(pixel_format), AV_OPT_TYPE_PIXEL_FMT, {.str = AV_PIX_FMT_NONE}, 0, 0, DEC },
> >                                                                                                  ^^^^
> > this doesnt look right
> 
> Updated.
> -- 
> FFmpeg = Fundamentalist Fundamentalist Magnificient Power Evangelical Gigant

>  libavcodec/options_table.h |    2 +-
>  libavdevice/dshow.c        |    2 +-
>  libavutil/opt.c            |   10 +++++++---
>  3 files changed, 9 insertions(+), 5 deletions(-)
> 5309293af20bd9ff05d635fe35ed16c48301310d  0004-lavu-opt-change-the-way-default-pixel-and-sample-for.patch
> From d2a809dd847922a2f91d4f6f94e52e70ccc2eeb4 Mon Sep 17 00:00:00 2001
> From: Stefano Sabatini <stefasab at gmail.com>
> Date: Sun, 25 Nov 2012 15:45:58 +0100
> Subject: [PATCH] lavu/opt: change the way default pixel and sample format
>  value is set
> 
> Use the i64 field rather than the string value. Using a string to set a
> default sample/pixel format is weird, also the new interface is more
> consistent with the rest of the API.
> 

> This is technically an API break, but hopefully there are no applications
> using this feature outside of FFmpeg.

what about a system that has mixed libs ? for example one updates
libavutil but leaves libavfilter and ffmpeg at old revissions.
This can happen with binary distributions that have the libs in
seperate packages.

maybe you could check the version field from the AVClass in the 2
cases that touch it

otherwise LGTM

[...]

-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

The worst form of inequality is to try to make unequal things equal.
-- Aristotle
-------------- 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/20121125/52357e14/attachment.asc>


More information about the ffmpeg-devel mailing list