[FFmpeg-devel] [PATCH] Add support for sndio to libavdevice
Brad
brad
Wed Aug 11 03:45:50 CEST 2010
On Tuesday 10 August 2010 16:21:47 Stefano Sabatini wrote:
> > + if (is_output)
> > + par.pchan = s->channels;
> > + else
> > + par.rchan = s->channels;
>
> par.pchan = is_output ? ...
> -3 lines
re-read it. its not pchan in both cases on the left hand side. its playback
channels vs recording channels.
> > +AVInputFormat sndio_demuxer = {
> > + "sndio",
> > + NULL_IF_CONFIG_SMALL("sndio audio capture"),
> > + sizeof(AudioData),
> > + NULL,
> > + audio_read_header,
> > + audio_read_packet,
> > + audio_read_close,
> > + .flags = AVFMT_NOFILE,
> > +};
>
> Possibly always use designated inited fields, I mean:
> .name = ...
> .long_name = ...
> .init = ...
> .blah = ...
> ...
Show me an example of this already in the tree.
> > +/* XXX: we make the assumption that the soundcard accepts this format */
> > +/* XXX: find better solution with "preinit" method, needed also in
> > + other formats */
> > +#if HAVE_BIGENDIAN
> > +#define DEFAULT_CODEC_ID CODEC_ID_PCM_S16BE
> > +#else
> > +#define DEFAULT_CODEC_ID CODEC_ID_PCM_S16LE
> > +#endif
>
> possibly better not add a level of indirection, do this in the device
> definition, also we may define a macro (e.g. in
> libavformat/internal.h) for this if it is used in other parts of FFmpeg:
This was copied from ALSA and the macro would be useful for
a few sound backends.
--
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.
More information about the ffmpeg-devel
mailing list