[SCM] libav/experimental: Modify all codecs to report their supported input and output sample format(s).

siretart at users.alioth.debian.org siretart at users.alioth.debian.org
Sun Jun 30 16:26:23 UTC 2013


The following commit has been merged in the experimental branch:
commit fd76c37fd9f564b4e979fbe20ecfcfad13f8b4f4
Author: Peter Ross <pross at xvid.org>
Date:   Thu Jul 31 10:47:31 2008 +0000

    Modify all codecs to report their supported input and output sample format(s).
    
    Originally committed as revision 14482 to svn://svn.ffmpeg.org/ffmpeg/trunk

diff --git a/libavcodec/8svx.c b/libavcodec/8svx.c
index 660f00c..4a7f5d9 100644
--- a/libavcodec/8svx.c
+++ b/libavcodec/8svx.c
@@ -86,6 +86,7 @@ static av_cold int eightsvx_decode_init(AVCodecContext *avctx)
         default:
           return -1;
     }
+    avctx->sample_fmt = SAMPLE_FMT_S16;
     return 0;
 }
 
diff --git a/libavcodec/ac3dec.c b/libavcodec/ac3dec.c
index d76597a..51cda0b 100644
--- a/libavcodec/ac3dec.c
+++ b/libavcodec/ac3dec.c
@@ -221,6 +221,7 @@ static av_cold int ac3_decode_init(AVCodecContext *avctx)
             return AVERROR_NOMEM;
     }
 
+    avctx->sample_fmt = SAMPLE_FMT_S16;
     return 0;
 }
 
diff --git a/libavcodec/ac3enc.c b/libavcodec/ac3enc.c
index 86ccb49..b373b26 100644
--- a/libavcodec/ac3enc.c
+++ b/libavcodec/ac3enc.c
@@ -1364,5 +1364,6 @@ AVCodec ac3_encoder = {
     AC3_encode_frame,
     AC3_encode_close,
     NULL,
+    .sample_fmts = (enum SampleFormat[]){SAMPLE_FMT_S16,SAMPLE_FMT_NONE},
     .long_name = NULL_IF_CONFIG_SMALL("ATSC A/52 / AC-3"),
 };
diff --git a/libavcodec/adpcm.c b/libavcodec/adpcm.c
index 9cd03fe..c4fb3ee 100644
--- a/libavcodec/adpcm.c
+++ b/libavcodec/adpcm.c
@@ -698,6 +698,7 @@ static av_cold int adpcm_decode_init(AVCodecContext * avctx)
     default:
         break;
     }
+    avctx->sample_fmt = SAMPLE_FMT_S16;
     return 0;
 }
 
@@ -1599,6 +1600,7 @@ AVCodec name ## _encoder = {                    \
     adpcm_encode_frame,                         \
     adpcm_encode_close,                         \
     NULL,                                       \
+    .sample_fmts = (enum SampleFormat[]){SAMPLE_FMT_S16,SAMPLE_FMT_NONE}, \
     .long_name = NULL_IF_CONFIG_SMALL(long_name_), \
 };
 #else
diff --git a/libavcodec/adxdec.c b/libavcodec/adxdec.c
index 91331c0..8765a45 100644
--- a/libavcodec/adxdec.c
+++ b/libavcodec/adxdec.c
@@ -30,6 +30,12 @@
  * adx2wav & wav2adx http://www.geocities.co.jp/Playtown/2004/
  */
 
+static av_cold void adx_decode_init(AVCodecContext *avctx)
+{
+    avctx->sample_fmt = SAMPLE_FMT_S16;
+    return 0;
+}
+
 /* 18 bytes <-> 32 samples */
 
 static void adx_decode(short *out,const unsigned char *in,PREV *prev)
@@ -161,7 +167,7 @@ AVCodec adpcm_adx_decoder = {
     CODEC_TYPE_AUDIO,
     CODEC_ID_ADPCM_ADX,
     sizeof(ADXContext),
-    NULL,
+    adx_decode_init,
     NULL,
     NULL,
     adx_decode_frame,
diff --git a/libavcodec/adxenc.c b/libavcodec/adxenc.c
index 927ecd7..6bce31a 100644
--- a/libavcodec/adxenc.c
+++ b/libavcodec/adxenc.c
@@ -190,5 +190,6 @@ AVCodec adpcm_adx_encoder = {
     adx_encode_frame,
     adx_encode_close,
     NULL,
+    .sample_fmts = (enum SampleFormat[]){SAMPLE_FMT_S16,SAMPLE_FMT_NONE},
     .long_name = NULL_IF_CONFIG_SMALL("SEGA CRI ADX"),
 };
diff --git a/libavcodec/alac.c b/libavcodec/alac.c
index 6815fa1..cb710a6 100644
--- a/libavcodec/alac.c
+++ b/libavcodec/alac.c
@@ -594,6 +594,7 @@ static av_cold int alac_decode_init(AVCodecContext * avctx)
 
     alac->numchannels = alac->avctx->channels;
     alac->bytespersample = (avctx->bits_per_sample / 8) * alac->numchannels;
+    avctx->sample_fmt = SAMPLE_FMT_S16;
 
     return 0;
 }
diff --git a/libavcodec/apedec.c b/libavcodec/apedec.c
index c4aa38f..40fb1f3 100644
--- a/libavcodec/apedec.c
+++ b/libavcodec/apedec.c
@@ -198,6 +198,7 @@ static av_cold int ape_decode_init(AVCodecContext * avctx)
     }
 
     dsputil_init(&s->dsp, avctx);
+    avctx->sample_fmt = SAMPLE_FMT_S16;
     return 0;
 }
 
diff --git a/libavcodec/atrac3.c b/libavcodec/atrac3.c
index 7bf3ec2..9a03bbe 100644
--- a/libavcodec/atrac3.c
+++ b/libavcodec/atrac3.c
@@ -1058,6 +1058,7 @@ static int atrac3_decode_init(AVCodecContext *avctx)
         return AVERROR(ENOMEM);
     }
 
+    avctx->sample_fmt = SAMPLE_FMT_S16;
     return 0;
 }
 
diff --git a/libavcodec/cook.c b/libavcodec/cook.c
index cbf1c9c..3a16c77 100644
--- a/libavcodec/cook.c
+++ b/libavcodec/cook.c
@@ -1178,6 +1178,8 @@ static int cook_decode_init(AVCodecContext *avctx)
         return -1;
     }
 
+    avctx->sample_fmt = SAMPLE_FMT_S16;
+
 #ifdef COOKDEBUG
     dump_cook_context(q);
 #endif
diff --git a/libavcodec/dca.c b/libavcodec/dca.c
index 8770def..8cca01a 100644
--- a/libavcodec/dca.c
+++ b/libavcodec/dca.c
@@ -1253,6 +1253,7 @@ static av_cold int dca_decode_init(AVCodecContext * avctx)
         avctx->channels = avctx->request_channels;
     }
 
+    avctx->sample_fmt = SAMPLE_FMT_S16;
     return 0;
 }
 
diff --git a/libavcodec/dpcm.c b/libavcodec/dpcm.c
index e31f180..ff684ae 100644
--- a/libavcodec/dpcm.c
+++ b/libavcodec/dpcm.c
@@ -154,6 +154,7 @@ static av_cold int dpcm_decode_init(AVCodecContext *avctx)
         break;
     }
 
+    avctx->sample_fmt = SAMPLE_FMT_S16;
     return 0;
 }
 
diff --git a/libavcodec/dsicinav.c b/libavcodec/dsicinav.c
index 2cd5db8..039b0ad 100644
--- a/libavcodec/dsicinav.c
+++ b/libavcodec/dsicinav.c
@@ -305,6 +305,7 @@ static av_cold int cinaudio_decode_init(AVCodecContext *avctx)
     cin->avctx = avctx;
     cin->initial_decode_frame = 1;
     cin->delta = 0;
+    avctx->sample_fmt = SAMPLE_FMT_S16;
 
     return 0;
 }
diff --git a/libavcodec/flac.c b/libavcodec/flac.c
index fc1e0ec..60b35a3 100644
--- a/libavcodec/flac.c
+++ b/libavcodec/flac.c
@@ -113,6 +113,7 @@ static av_cold int flac_decode_init(AVCodecContext * avctx)
         }
     }
 
+    avctx->sample_fmt = SAMPLE_FMT_S16;
     return 0;
 }
 
diff --git a/libavcodec/flacenc.c b/libavcodec/flacenc.c
index 622db4b..c6751aa 100644
--- a/libavcodec/flacenc.c
+++ b/libavcodec/flacenc.c
@@ -1485,5 +1485,6 @@ AVCodec flac_encoder = {
     flac_encode_close,
     NULL,
     .capabilities = CODEC_CAP_SMALL_LAST_FRAME,
+    .sample_fmts = (enum SampleFormat[]){SAMPLE_FMT_S16,SAMPLE_FMT_NONE},
     .long_name = NULL_IF_CONFIG_SMALL("FLAC (Free Lossless Audio Codec)"),
 };
diff --git a/libavcodec/g726.c b/libavcodec/g726.c
index bace3d0..463d993 100644
--- a/libavcodec/g726.c
+++ b/libavcodec/g726.c
@@ -323,6 +323,9 @@ static av_cold int g726_init(AVCodecContext * avctx)
         return AVERROR(ENOMEM);
     avctx->coded_frame->key_frame = 1;
 
+    if (avctx->codec->decode)
+        avctx->sample_fmt = SAMPLE_FMT_S16;
+
     return 0;
 }
 
@@ -381,6 +384,7 @@ AVCodec adpcm_g726_encoder = {
     g726_encode_frame,
     g726_close,
     NULL,
+    .sample_fmts = (enum SampleFormat[]){SAMPLE_FMT_S16,SAMPLE_FMT_NONE},
     .long_name = NULL_IF_CONFIG_SMALL("G.726 ADPCM"),
 };
 #endif //CONFIG_ENCODERS
diff --git a/libavcodec/imc.c b/libavcodec/imc.c
index d316ba4..436a5c9 100644
--- a/libavcodec/imc.c
+++ b/libavcodec/imc.c
@@ -154,6 +154,7 @@ static av_cold int imc_decode_init(AVCodecContext * avctx)
 
     ff_fft_init(&q->fft, 7, 1);
     dsputil_init(&q->dsp, avctx);
+    avctx->sample_fmt = SAMPLE_FMT_S16;
     return 0;
 }
 
diff --git a/libavcodec/liba52.c b/libavcodec/liba52.c
index becae1d..ec0a252 100644
--- a/libavcodec/liba52.c
+++ b/libavcodec/liba52.c
@@ -119,6 +119,7 @@ static av_cold int a52_decode_init(AVCodecContext *avctx)
         avctx->channels = avctx->request_channels;
     }
 
+    avctx->sample_fmt = SAMPLE_FMT_S16;
     return 0;
 }
 
diff --git a/libavcodec/libamr.c b/libavcodec/libamr.c
index 0e23de1..4f56e4d 100644
--- a/libavcodec/libamr.c
+++ b/libavcodec/libamr.c
@@ -134,6 +134,7 @@ static void amr_decode_fix_avctx(AVCodecContext * avctx)
     }
 
     avctx->frame_size = 160 * is_amr_wb;
+    avctx->sample_fmt = SAMPLE_FMT_S16;
 }
 
 #ifdef CONFIG_LIBAMR_NB_FIXED
@@ -516,6 +517,7 @@ AVCodec libamr_nb_encoder =
     amr_nb_encode_frame,
     amr_nb_encode_close,
     NULL,
+    .sample_fmts = (enum SampleFormat[]){SAMPLE_FMT_S16,SAMPLE_FMT_NONE},
     .long_name = NULL_IF_CONFIG_SMALL("libamr-nb Adaptive Multi-Rate (AMR) Narrow-Band"),
 };
 
@@ -710,6 +712,7 @@ AVCodec libamr_wb_encoder =
     amr_wb_encode_frame,
     amr_wb_encode_close,
     NULL,
+    .sample_fmts = (enum SampleFormat[]){SAMPLE_FMT_S16,SAMPLE_FMT_NONE},
     .long_name = NULL_IF_CONFIG_SMALL("libamr-wb Adaptive Multi-Rate (AMR) Wide-Band"),
 };
 
diff --git a/libavcodec/libfaac.c b/libavcodec/libfaac.c
index a66ac2e..2ed4f76 100644
--- a/libavcodec/libfaac.c
+++ b/libavcodec/libfaac.c
@@ -151,5 +151,6 @@ AVCodec libfaac_encoder = {
     Faac_encode_init,
     Faac_encode_frame,
     Faac_encode_close,
+    .sample_fmts = (enum SampleFormat[]){SAMPLE_FMT_S16,SAMPLE_FMT_NONE},
     .long_name = NULL_IF_CONFIG_SMALL("libfaac AAC (Advanced Audio Codec)"),
 };
diff --git a/libavcodec/libfaad.c b/libavcodec/libfaad.c
index bb901f9..3e7339d 100644
--- a/libavcodec/libfaad.c
+++ b/libavcodec/libfaad.c
@@ -313,6 +313,7 @@ static av_cold int faac_decode_init(AVCodecContext *avctx)
     if(!s->init && avctx->channels > 0)
         channel_setup(avctx);
 
+    avctx->sample_fmt = SAMPLE_FMT_S16;
     return 0;
 }
 
diff --git a/libavcodec/libgsm.c b/libavcodec/libgsm.c
index ef2f5e7..09578b4 100644
--- a/libavcodec/libgsm.c
+++ b/libavcodec/libgsm.c
@@ -48,6 +48,8 @@ static av_cold int libgsm_init(AVCodecContext *avctx) {
 
         if(!avctx->sample_rate)
             avctx->sample_rate= 8000;
+
+        avctx->sample_fmt = SAMPLE_FMT_S16;
     }else{
         if (avctx->sample_rate != 8000) {
             av_log(avctx, AV_LOG_ERROR, "Sample rate 8000Hz required for GSM, got %dHz\n",
@@ -117,6 +119,7 @@ AVCodec libgsm_encoder = {
     libgsm_init,
     libgsm_encode_frame,
     libgsm_close,
+    .sample_fmts = (enum SampleFormat[]){SAMPLE_FMT_S16,SAMPLE_FMT_NONE},
     .long_name = NULL_IF_CONFIG_SMALL("libgsm GSM"),
 };
 
@@ -128,6 +131,7 @@ AVCodec libgsm_ms_encoder = {
     libgsm_init,
     libgsm_encode_frame,
     libgsm_close,
+    .sample_fmts = (enum SampleFormat[]){SAMPLE_FMT_S16,SAMPLE_FMT_NONE},
     .long_name = NULL_IF_CONFIG_SMALL("libgsm GSM Microsoft variant"),
 };
 
diff --git a/libavcodec/libmp3lame.c b/libavcodec/libmp3lame.c
index 13a658a..ab22038 100644
--- a/libavcodec/libmp3lame.c
+++ b/libavcodec/libmp3lame.c
@@ -218,5 +218,6 @@ AVCodec libmp3lame_encoder = {
     MP3lame_encode_frame,
     MP3lame_encode_close,
     .capabilities= CODEC_CAP_DELAY,
+    .sample_fmts = (enum SampleFormat[]){SAMPLE_FMT_S16,SAMPLE_FMT_NONE},
     .long_name= NULL_IF_CONFIG_SMALL("libmp3lame MP3 (MPEG audio layer 3)"),
 };
diff --git a/libavcodec/libvorbis.c b/libavcodec/libvorbis.c
index f1eb5a1..ce796a0 100644
--- a/libavcodec/libvorbis.c
+++ b/libavcodec/libvorbis.c
@@ -217,5 +217,6 @@ AVCodec libvorbis_encoder = {
     oggvorbis_encode_frame,
     oggvorbis_encode_close,
     .capabilities= CODEC_CAP_DELAY,
+    .sample_fmts = (enum SampleFormat[]){SAMPLE_FMT_S16,SAMPLE_FMT_NONE},
     .long_name= NULL_IF_CONFIG_SMALL("libvorbis Vorbis"),
 } ;
diff --git a/libavcodec/mace.c b/libavcodec/mace.c
index 2e15e91..c789984 100644
--- a/libavcodec/mace.c
+++ b/libavcodec/mace.c
@@ -396,6 +396,7 @@ static av_cold int mace_decode_init(AVCodecContext * avctx)
 {
     if (avctx->channels > 2)
         return -1;
+    avctx->sample_fmt = SAMPLE_FMT_S16;
     return 0;
 }
 
diff --git a/libavcodec/mlpdec.c b/libavcodec/mlpdec.c
index f4d7313..03dbec0 100644
--- a/libavcodec/mlpdec.c
+++ b/libavcodec/mlpdec.c
@@ -336,6 +336,7 @@ static av_cold int mlp_decode_init(AVCodecContext *avctx)
     m->avctx = avctx;
     for (substr = 0; substr < MAX_SUBSTREAMS; substr++)
         m->substream[substr].lossless_check_data = 0xffffffff;
+    avctx->sample_fmt = SAMPLE_FMT_S16;
     return 0;
 }
 
diff --git a/libavcodec/mpc7.c b/libavcodec/mpc7.c
index a975db3..565b858 100644
--- a/libavcodec/mpc7.c
+++ b/libavcodec/mpc7.c
@@ -108,6 +108,7 @@ static av_cold int mpc7_decode_init(AVCodecContext * avctx)
         }
     }
     vlc_initialized = 1;
+    avctx->sample_fmt = SAMPLE_FMT_S16;
     return 0;
 }
 
diff --git a/libavcodec/mpc8.c b/libavcodec/mpc8.c
index 55fe942..0d4f128 100644
--- a/libavcodec/mpc8.c
+++ b/libavcodec/mpc8.c
@@ -177,6 +177,7 @@ static av_cold int mpc8_decode_init(AVCodecContext * avctx)
                  &mpc8_q8_codes[i], 1, 1, INIT_VLC_USE_STATIC);
     }
     vlc_initialized = 1;
+    avctx->sample_fmt = SAMPLE_FMT_S16;
     return 0;
 }
 
diff --git a/libavcodec/mpegaudioenc.c b/libavcodec/mpegaudioenc.c
index 07b5509..c061d7f 100644
--- a/libavcodec/mpegaudioenc.c
+++ b/libavcodec/mpegaudioenc.c
@@ -796,6 +796,7 @@ AVCodec mp2_encoder = {
     MPA_encode_frame,
     MPA_encode_close,
     NULL,
+    .sample_fmts = (enum SampleFormat[]){SAMPLE_FMT_S16,SAMPLE_FMT_NONE},
     .long_name = NULL_IF_CONFIG_SMALL("MP2 (MPEG audio layer 2)"),
 };
 
diff --git a/libavcodec/nellymoserdec.c b/libavcodec/nellymoserdec.c
index 8045e4b..a4c74ea 100644
--- a/libavcodec/nellymoserdec.c
+++ b/libavcodec/nellymoserdec.c
@@ -149,6 +149,7 @@ static av_cold int decode_init(AVCodecContext * avctx) {
     if (!sine_window[0])
         ff_sine_window_init(sine_window, 128);
 
+    avctx->sample_fmt = SAMPLE_FMT_S16;
     return 0;
 }
 
diff --git a/libavcodec/pcm.c b/libavcodec/pcm.c
index 8f02fda..2935d01 100644
--- a/libavcodec/pcm.c
+++ b/libavcodec/pcm.c
@@ -553,7 +553,7 @@ static int pcm_decode_frame(AVCodecContext *avctx,
 }
 
 #ifdef CONFIG_ENCODERS
-#define PCM_ENCODER(id,name,long_name_)         \
+#define PCM_ENCODER(id,sample_fmt_,name,long_name_) \
 AVCodec name ## _encoder = {                    \
     #name,                                      \
     CODEC_TYPE_AUDIO,                           \
@@ -563,10 +563,11 @@ AVCodec name ## _encoder = {                    \
     pcm_encode_frame,                           \
     pcm_encode_close,                           \
     NULL,                                       \
+    .sample_fmts = (enum SampleFormat[]){sample_fmt_,SAMPLE_FMT_NONE}, \
     .long_name = NULL_IF_CONFIG_SMALL(long_name_), \
 };
 #else
-#define PCM_ENCODER(id,name,long_name_)
+#define PCM_ENCODER(id,sample_fmt_,name,long_name_)
 #endif
 
 #ifdef CONFIG_DECODERS
@@ -586,28 +587,28 @@ AVCodec name ## _decoder = {                    \
 #define PCM_DECODER(id,name,long_name_)
 #endif
 
-#define PCM_CODEC(id, name, long_name_)         \
-    PCM_ENCODER(id,name,long_name_) PCM_DECODER(id,name,long_name_)
+#define PCM_CODEC(id, sample_fmt_, name, long_name_)         \
+    PCM_ENCODER(id,sample_fmt_,name,long_name_) PCM_DECODER(id,name,long_name_)
 
 /* Note: Do not forget to add new entries to the Makefile as well. */
-PCM_CODEC  (CODEC_ID_PCM_ALAW, pcm_alaw, "A-law PCM");
-PCM_CODEC  (CODEC_ID_PCM_DVD, pcm_dvd, "signed 16|20|24-bit big-endian PCM");
-PCM_CODEC  (CODEC_ID_PCM_F32BE, pcm_f32be, "32-bit floating point big-endian PCM");
-PCM_CODEC  (CODEC_ID_PCM_MULAW, pcm_mulaw, "mu-law PCM");
-PCM_CODEC  (CODEC_ID_PCM_S8, pcm_s8, "signed 8-bit PCM");
-PCM_CODEC  (CODEC_ID_PCM_S16BE, pcm_s16be, "signed 16-bit big-endian PCM");
-PCM_CODEC  (CODEC_ID_PCM_S16LE, pcm_s16le, "signed 16-bit little-endian PCM");
+PCM_CODEC  (CODEC_ID_PCM_ALAW,  SAMPLE_FMT_S16, pcm_alaw, "A-law PCM");
+PCM_CODEC  (CODEC_ID_PCM_DVD,   SAMPLE_FMT_S16, pcm_dvd, "signed 16|20|24-bit big-endian PCM");
+PCM_CODEC  (CODEC_ID_PCM_F32BE, SAMPLE_FMT_FLT, pcm_f32be, "32-bit floating point big-endian PCM");
+PCM_CODEC  (CODEC_ID_PCM_MULAW, SAMPLE_FMT_S16, pcm_mulaw, "mu-law PCM");
+PCM_CODEC  (CODEC_ID_PCM_S8,    SAMPLE_FMT_S16, pcm_s8, "signed 8-bit PCM");
+PCM_CODEC  (CODEC_ID_PCM_S16BE, SAMPLE_FMT_S16, pcm_s16be, "signed 16-bit big-endian PCM");
+PCM_CODEC  (CODEC_ID_PCM_S16LE, SAMPLE_FMT_S16, pcm_s16le, "signed 16-bit little-endian PCM");
 PCM_DECODER(CODEC_ID_PCM_S16LE_PLANAR, pcm_s16le_planar, "16-bit little-endian planar PCM");
-PCM_CODEC  (CODEC_ID_PCM_S24BE, pcm_s24be, "signed 24-bit big-endian PCM");
-PCM_CODEC  (CODEC_ID_PCM_S24DAUD, pcm_s24daud, "D-Cinema audio signed 24-bit PCM");
-PCM_CODEC  (CODEC_ID_PCM_S24LE, pcm_s24le, "signed 24-bit little-endian PCM");
-PCM_CODEC  (CODEC_ID_PCM_S32BE, pcm_s32be, "signed 32-bit big-endian PCM");
-PCM_CODEC  (CODEC_ID_PCM_S32LE, pcm_s32le, "signed 32-bit little-endian PCM");
-PCM_CODEC  (CODEC_ID_PCM_U8, pcm_u8, "unsigned 8-bit PCM");
-PCM_CODEC  (CODEC_ID_PCM_U16BE, pcm_u16be, "unsigned 16-bit big-endian PCM");
-PCM_CODEC  (CODEC_ID_PCM_U16LE, pcm_u16le, "unsigned 16-bit little-endian PCM");
-PCM_CODEC  (CODEC_ID_PCM_U24BE, pcm_u24be, "unsigned 24-bit big-endian PCM");
-PCM_CODEC  (CODEC_ID_PCM_U24LE, pcm_u24le, "unsigned 24-bit little-endian PCM");
-PCM_CODEC  (CODEC_ID_PCM_U32BE, pcm_u32be, "unsigned 32-bit big-endian PCM");
-PCM_CODEC  (CODEC_ID_PCM_U32LE, pcm_u32le, "unsigned 32-bit little-endian PCM");
-PCM_CODEC  (CODEC_ID_PCM_ZORK, pcm_zork, "Zork PCM");
+PCM_CODEC  (CODEC_ID_PCM_S24BE, SAMPLE_FMT_S16, pcm_s24be, "signed 24-bit big-endian PCM");
+PCM_CODEC  (CODEC_ID_PCM_S24DAUD, SAMPLE_FMT_S16,  pcm_s24daud, "D-Cinema audio signed 24-bit PCM");
+PCM_CODEC  (CODEC_ID_PCM_S24LE, SAMPLE_FMT_S16, pcm_s24le, "signed 24-bit little-endian PCM");
+PCM_CODEC  (CODEC_ID_PCM_S32BE, SAMPLE_FMT_S16, pcm_s32be, "signed 32-bit big-endian PCM");
+PCM_CODEC  (CODEC_ID_PCM_S32LE, SAMPLE_FMT_S16, pcm_s32le, "signed 32-bit little-endian PCM");
+PCM_CODEC  (CODEC_ID_PCM_U8,    SAMPLE_FMT_S16, pcm_u8, "unsigned 8-bit PCM");
+PCM_CODEC  (CODEC_ID_PCM_U16BE, SAMPLE_FMT_S16, pcm_u16be, "unsigned 16-bit big-endian PCM");
+PCM_CODEC  (CODEC_ID_PCM_U16LE, SAMPLE_FMT_S16, pcm_u16le, "unsigned 16-bit little-endian PCM");
+PCM_CODEC  (CODEC_ID_PCM_U24BE, SAMPLE_FMT_S16, pcm_u24be, "unsigned 24-bit big-endian PCM");
+PCM_CODEC  (CODEC_ID_PCM_U24LE, SAMPLE_FMT_S16, pcm_u24le, "unsigned 24-bit little-endian PCM");
+PCM_CODEC  (CODEC_ID_PCM_U32BE, SAMPLE_FMT_S16, pcm_u32be, "unsigned 32-bit big-endian PCM");
+PCM_CODEC  (CODEC_ID_PCM_U32LE, SAMPLE_FMT_S16, pcm_u32le, "unsigned 32-bit little-endian PCM");
+PCM_CODEC  (CODEC_ID_PCM_ZORK,  SAMPLE_FMT_S16, pcm_zork, "Zork PCM");
diff --git a/libavcodec/qdm2.c b/libavcodec/qdm2.c
index 2033121..e1b67d0 100644
--- a/libavcodec/qdm2.c
+++ b/libavcodec/qdm2.c
@@ -1931,6 +1931,8 @@ static int qdm2_decode_init(AVCodecContext *avctx)
 
     qdm2_init(s);
 
+    avctx->sample_fmt = SAMPLE_FMT_S16;
+
 //    dump_context(s);
     return 0;
 }
diff --git a/libavcodec/ra144.c b/libavcodec/ra144.c
index 3b243b4..fc99655 100644
--- a/libavcodec/ra144.c
+++ b/libavcodec/ra144.c
@@ -58,6 +58,7 @@ static int ra144_decode_init(AVCodecContext * avctx)
     ractx->lpc_coef[0] = ractx->lpc_tables[0];
     ractx->lpc_coef[1] = ractx->lpc_tables[1];
 
+    avctx->sample_fmt = SAMPLE_FMT_S16;
     return 0;
 }
 
diff --git a/libavcodec/ra288.c b/libavcodec/ra288.c
index 6930cf5..f3e8af4 100644
--- a/libavcodec/ra288.c
+++ b/libavcodec/ra288.c
@@ -42,6 +42,12 @@ typedef struct {
     float gain_block[10];  ///< Gain data of four blocks (spec: GSTATE)
 } RA288Context;
 
+static av_cold int ra288_decode_init(AVCodecContext *avctx)
+{
+    avctx->sample_fmt = SAMPLE_FMT_S16;
+    return 0;
+}
+
 static inline float scalar_product_float(const float * v1, const float * v2,
                                          int size)
 {
@@ -258,7 +264,7 @@ AVCodec ra_288_decoder =
     CODEC_TYPE_AUDIO,
     CODEC_ID_RA_288,
     sizeof(RA288Context),
-    NULL,
+    ra288_decode_init,
     NULL,
     NULL,
     ra288_decode_frame,
diff --git a/libavcodec/roqaudioenc.c b/libavcodec/roqaudioenc.c
index 6c40e90..df014a4 100644
--- a/libavcodec/roqaudioenc.c
+++ b/libavcodec/roqaudioenc.c
@@ -174,5 +174,6 @@ AVCodec roq_dpcm_encoder = {
     roq_dpcm_encode_frame,
     roq_dpcm_encode_close,
     NULL,
+    .sample_fmts = (enum SampleFormat[]){SAMPLE_FMT_S16,SAMPLE_FMT_NONE},
     .long_name = NULL_IF_CONFIG_SMALL("id RoQ DPCM"),
 };
diff --git a/libavcodec/shorten.c b/libavcodec/shorten.c
index 7516c65..7f8ef81 100644
--- a/libavcodec/shorten.c
+++ b/libavcodec/shorten.c
@@ -104,6 +104,7 @@ static av_cold int shorten_decode_init(AVCodecContext * avctx)
 {
     ShortenContext *s = avctx->priv_data;
     s->avctx = avctx;
+    avctx->sample_fmt = SAMPLE_FMT_S16;
 
     return 0;
 }
diff --git a/libavcodec/smacker.c b/libavcodec/smacker.c
index 5e3b6df..1690518 100644
--- a/libavcodec/smacker.c
+++ b/libavcodec/smacker.c
@@ -558,6 +558,7 @@ static av_cold int decode_end(AVCodecContext *avctx)
 
 static av_cold int smka_decode_init(AVCodecContext *avctx)
 {
+    avctx->sample_fmt = SAMPLE_FMT_S16;
     return 0;
 }
 
diff --git a/libavcodec/sonic.c b/libavcodec/sonic.c
index 9d594ef..60d36a5 100644
--- a/libavcodec/sonic.c
+++ b/libavcodec/sonic.c
@@ -828,6 +828,7 @@ static av_cold int sonic_decode_init(AVCodecContext *avctx)
     }
     s->int_samples = av_mallocz(4* s->frame_size);
 
+    avctx->sample_fmt = SAMPLE_FMT_S16;
     return 0;
 }
 
diff --git a/libavcodec/truespeech.c b/libavcodec/truespeech.c
index 8311835..3df71cb 100644
--- a/libavcodec/truespeech.c
+++ b/libavcodec/truespeech.c
@@ -54,6 +54,7 @@ static av_cold int truespeech_decode_init(AVCodecContext * avctx)
 {
 //    TSContext *c = avctx->priv_data;
 
+    avctx->sample_fmt = SAMPLE_FMT_S16;
     return 0;
 }
 
diff --git a/libavcodec/vmdav.c b/libavcodec/vmdav.c
index e3a8144..b6e10d7 100644
--- a/libavcodec/vmdav.c
+++ b/libavcodec/vmdav.c
@@ -446,6 +446,7 @@ static av_cold int vmdaudio_decode_init(AVCodecContext *avctx)
     s->channels = avctx->channels;
     s->bits = avctx->bits_per_sample;
     s->block_align = avctx->block_align;
+    avctx->sample_fmt = SAMPLE_FMT_S16;
 
     av_log(s->avctx, AV_LOG_DEBUG, "%d channels, %d bits/sample, block align = %d, sample rate = %d\n",
             s->channels, s->bits, s->block_align, avctx->sample_rate);
diff --git a/libavcodec/vorbis_dec.c b/libavcodec/vorbis_dec.c
index 4e74b14..46ec7b6 100644
--- a/libavcodec/vorbis_dec.c
+++ b/libavcodec/vorbis_dec.c
@@ -971,6 +971,7 @@ static av_cold int vorbis_decode_init(AVCodecContext *avccontext) {
     avccontext->channels = vc->audio_channels;
     avccontext->sample_rate = vc->audio_samplerate;
     avccontext->frame_size  = FFMIN(vc->blocksize[0], vc->blocksize[1])>>2;
+    avccontext->sample_fmt = SAMPLE_FMT_S16;
 
     return 0 ;
 }
diff --git a/libavcodec/vorbis_enc.c b/libavcodec/vorbis_enc.c
index 0a997a6..5add7a9 100644
--- a/libavcodec/vorbis_enc.c
+++ b/libavcodec/vorbis_enc.c
@@ -1084,5 +1084,6 @@ AVCodec vorbis_encoder = {
     vorbis_encode_frame,
     vorbis_encode_close,
     .capabilities= CODEC_CAP_DELAY,
+    .sample_fmts = (enum SampleFormat[]){SAMPLE_FMT_S16,SAMPLE_FMT_NONE},
     .long_name = NULL_IF_CONFIG_SMALL("Vorbis"),
 };
diff --git a/libavcodec/wavpack.c b/libavcodec/wavpack.c
index 660c78a..e8703b3 100644
--- a/libavcodec/wavpack.c
+++ b/libavcodec/wavpack.c
@@ -360,6 +360,7 @@ static av_cold int wavpack_decode_init(AVCodecContext *avctx)
 
     s->avctx = avctx;
     s->stereo = (avctx->channels == 2);
+    avctx->sample_fmt = SAMPLE_FMT_S16;
 
     return 0;
 }
diff --git a/libavcodec/wmadec.c b/libavcodec/wmadec.c
index 4d892ce..fa98751 100644
--- a/libavcodec/wmadec.c
+++ b/libavcodec/wmadec.c
@@ -126,6 +126,7 @@ static int wma_decode_init(AVCodecContext * avctx)
         wma_lsp_to_curve_init(s, s->frame_len);
     }
 
+    avctx->sample_fmt = SAMPLE_FMT_S16;
     return 0;
 }
 
diff --git a/libavcodec/wmaenc.c b/libavcodec/wmaenc.c
index 0fa17e2..b2ea90e 100644
--- a/libavcodec/wmaenc.c
+++ b/libavcodec/wmaenc.c
@@ -387,6 +387,7 @@ AVCodec wmav1_encoder =
     encode_init,
     encode_superframe,
     ff_wma_end,
+    .sample_fmts = (enum SampleFormat[]){SAMPLE_FMT_S16,SAMPLE_FMT_NONE},
     .long_name = NULL_IF_CONFIG_SMALL("Windows Media Audio 1"),
 };
 
@@ -399,5 +400,6 @@ AVCodec wmav2_encoder =
     encode_init,
     encode_superframe,
     ff_wma_end,
+    .sample_fmts = (enum SampleFormat[]){SAMPLE_FMT_S16,SAMPLE_FMT_NONE},
     .long_name = NULL_IF_CONFIG_SMALL("Windows Media Audio 2"),
 };
diff --git a/libavcodec/ws-snd1.c b/libavcodec/ws-snd1.c
index 18911c7..24753b0 100644
--- a/libavcodec/ws-snd1.c
+++ b/libavcodec/ws-snd1.c
@@ -40,6 +40,7 @@ static av_cold int ws_snd_decode_init(AVCodecContext * avctx)
 {
 //    WSSNDContext *c = avctx->priv_data;
 
+    avctx->sample_fmt = SAMPLE_FMT_S16;
     return 0;
 }
 

-- 
Libav/FFmpeg packaging



More information about the pkg-multimedia-commits mailing list