[Ffmpeg-devel] [PATCH] apple caff demuxer
Michael Niedermayer
michaelni
Wed Apr 4 12:54:07 CEST 2007
Hi
On Wed, Apr 04, 2007 at 12:31:14PM +0200, Baptiste Coudurier wrote:
> Hi
>
> Michael Niedermayer wrote:
> > Hi
> >
> > quick review below (ill leave the final review/approval for caff to
> > baptiste ...)
> >
> >
> > On Wed, Apr 04, 2007 at 02:28:56AM -0400, Justin Ruggles wrote:
> > [...]
> >>>> +
> >>>> +void ff_caff_get_codec_id(CaffContext *ctx)
> >>>> +{
> >>>> + ctx->codec_id = CODEC_ID_NONE;
> >>>> +
> >>>> + /* codec selection for lpcm is chosen using format description and flags */
> >>>> + if(ctx->format_id == MKBETAG('l','p','c','m')) {
> >>>> + /* unpacked 24-bit is not currently supported */
> >>>> + if((ctx->bits_per_channel == 24) &&
> >>>> + (ctx->bytes_per_packet == (ctx->channels_per_frame * 4))) {
> >>>> + return;
> >>>> + }
> >>>> + /* floating-point lpcm is not currently supported */
> >>>> + if(ctx->format_flags & CAFF_LPCM_FLAGS_IS_FLOAT) {
> >>>> + return;
> >>>> + }
> >>>> + if(ctx->bits_per_channel == 8) {
> >>>> + ctx->codec_id = CODEC_ID_PCM_S8;
> >>>> + } else if(ctx->bits_per_channel == 16) {
> >>>> + if(ctx->format_flags & CAFF_LPCM_FLAGS_IS_LITTLEENDIAN) {
> >>>> + ctx->codec_id = CODEC_ID_PCM_S16LE;
> >>>> + } else {
> >>>> + ctx->codec_id = CODEC_ID_PCM_S16BE;
> >>>> + }
> >>>> + } else if(ctx->bits_per_channel == 24) {
> >>>> + if(ctx->format_flags & CAFF_LPCM_FLAGS_IS_LITTLEENDIAN) {
> >>>> + ctx->codec_id = CODEC_ID_PCM_S24LE;
> >>>> + } else {
> >>>> + ctx->codec_id = CODEC_ID_PCM_S24BE;
> >>>> + }
> >>>> + } else if(ctx->bits_per_channel == 32) {
> >>>> + if(ctx->format_flags & CAFF_LPCM_FLAGS_IS_LITTLEENDIAN) {
> >>>> + ctx->codec_id = CODEC_ID_PCM_S32LE;
> >>>> + } else {
> >>>> + ctx->codec_id = CODEC_ID_PCM_S32BE;
> >>>> + }
> >>>
> >>> that mess begins to be duplicated in every demuxer, maybe
> >>> CODEC_ID_RAWAUDIO should be added, how to handle the BE/LE case ?
> >> maybe CODEC_ID_PCM_BE / CODEC_ID_PCM_LE. and actually use the
> >> SampleFormat in AVCodecContext, which would make it easy to implement
> >> floating-point PCM decoding.
> >
> > dunno, why split BE/LE ?
>
> I would be more in favor of not splitting also, but how can we
> differentiate them ?
>
> How can we permute between them without different codec id ? wav only
> accepts LE for example. You'd like to add new sample formats ?
i dont really mind if LE/BE or one or the current system as long as
nothing breaks and its simple
[...]
--
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB
Why not whip the teacher when the pupil misbehaves? -- Diogenes of Sinope
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20070404/77bac2a7/attachment.pgp>
More information about the ffmpeg-devel
mailing list