[FFmpeg-devel] [PATCH] Add asrc_anullsrc - null audio source
Stefano Sabatini
stefano.sabatini-lala
Wed Sep 15 00:56:38 CEST 2010
On date Monday 2010-08-23 23:45:39 +0200, Stefano Sabatini encoded:
> On date Monday 2010-08-23 13:35:32 -0700, S.N. Hemanth Meenakshisundaram encoded:
> > > On date Monday 2010-08-23 20:24:10 +0200, Michael Niedermayer encoded:
> > >> On Sat, Aug 21, 2010 at 12:25:24AM +0200, Stefano Sabatini wrote:
> > >> > On date Friday 2010-08-20 01:06:04 +0200, Michael Niedermayer encoded:
> > >> > > On Fri, Aug 20, 2010 at 01:03:27AM +0200, Stefano Sabatini wrote:
> > >> > [...]
> > >> > > > > > + priv->channel_layout = CH_LAYOUT_STEREO;
> > >> > > > > > +
> > >> > > > > > + if (args)
> > >> > > > > > + sscanf(args, "%ld:%ld", &priv->sample_rate,
> > >> &priv->channel_layout);
> > >> > > > >
> > >> > > > > reading channel layout like this is maybe not ideal
> > >> > > >
> > >> > > > Please elaborate.
> > >> > >
> > >> > > 7
> > >> > >
> > >> > > you want an english awnser instead of a number?
> > >> > > the user also wants to specify his speaker configuration be listing
> > >> > > speakers and not just their number
> > >> >
> > >> > I suppose this means that the user should be able to specify a string
> > >> > rather than a number? I had the same concern, but I'm not sure we have
> > >> > an API right now for doing the string <-> number mapping.
> > >>
> > >> yes
> > >> but not only that, x channels is ambigous, there can be several layouts
> > >> with x channels
> > >
> > > OK now I see, channel_layout contains flags, these the values:
> > > #define CH_FRONT_LEFT 0x00000001
> > > #define CH_FRONT_RIGHT 0x00000002
> > > #define CH_FRONT_CENTER 0x00000004
> > > #define CH_LOW_FREQUENCY 0x00000008
> > > #define CH_BACK_LEFT 0x00000010
> > > #define CH_BACK_RIGHT 0x00000020
> > > #define CH_FRONT_LEFT_OF_CENTER 0x00000040
> > > #define CH_FRONT_RIGHT_OF_CENTER 0x00000080
> > > #define CH_BACK_CENTER 0x00000100
> > > #define CH_SIDE_LEFT 0x00000200
> > > #define CH_SIDE_RIGHT 0x00000400
> > > #define CH_TOP_CENTER 0x00000800
> > > #define CH_TOP_FRONT_LEFT 0x00001000
> > > #define CH_TOP_FRONT_CENTER 0x00002000
> > > #define CH_TOP_FRONT_RIGHT 0x00004000
> > > #define CH_TOP_BACK_LEFT 0x00008000
> > > #define CH_TOP_BACK_CENTER 0x00010000
> > > #define CH_TOP_BACK_RIGHT 0x00020000
> > > #define CH_STEREO_LEFT 0x20000000 ///< Stereo downmix.
> > > #define CH_STEREO_RIGHT 0x40000000 ///< See CH_STEREO_LEFT.
> > >
> > > Since they are so much, I'd prefer to keep it as an integer, then when
> > > we will have an options API for doing flags <-> string conversion that
> > > may be used instead.
> > >
> >
> > There is already a flags to string mapping in libavcodec/audioconvert.c,
> > is there a problem with using those?
> > I had posted a patch for converting these strings to flags a couple of
> > days ago.
>
> After reading again the avcodec_get_channel_layout_string(), yes that
> should be fine.
>
> > Also, the code above currently reads in the channel layout flag and not
> > the number of channels, since number of channels map to more than one
> > layout.
Ping.
--
FFmpeg = Frenzy and Fascinating Mournful Programmable Elected Gnome
More information about the ffmpeg-devel
mailing list