aout: drop support for U16B, U16L and S16I
authorRémi Denis-Courmont <remi@remlab.net>
Tue, 18 Dec 2012 22:42:24 +0000 (00:42 +0200)
committerRémi Denis-Courmont <remi@remlab.net>
Tue, 18 Dec 2012 22:45:52 +0000 (00:45 +0200)
modules/audio_filter/channel_mixer/remap.c
modules/audio_filter/converter/endian.c
modules/audio_filter/converter/format.c
modules/audio_output/alsa.c
modules/audio_output/file.c
modules/audio_output/oss.c
modules/audio_output/pulse.c
modules/audio_output/sndio.c

index 1c44924..e3aec83 100644 (file)
@@ -215,7 +215,6 @@ static void RemapAdd##name( filter_t *p_filter, \
 }
 
 DEFINE_REMAP( S16N, int16_t  )
-DEFINE_REMAP( U16N, uint16_t )
 DEFINE_REMAP( S32N, int32_t  )
 DEFINE_REMAP( FL32, float    )
 DEFINE_REMAP( FL64, double   )
@@ -230,8 +229,6 @@ static inline remap_fun_t GetRemapFun( audio_format_t *p_format, bool b_add )
         {
             case VLC_CODEC_S16N:
                 return RemapAddS16N;
-            case VLC_CODEC_U16N:
-                return RemapAddU16N;
             case VLC_CODEC_S32N:
                 return RemapAddS32N;
             case VLC_CODEC_FL32:
@@ -246,8 +243,6 @@ static inline remap_fun_t GetRemapFun( audio_format_t *p_format, bool b_add )
         {
             case VLC_CODEC_S16N:
                 return RemapCopyS16N;
-            case VLC_CODEC_U16N:
-                return RemapCopyU16N;
             case VLC_CODEC_S32N:
                 return RemapCopyS32N;
             case VLC_CODEC_FL32:
index d73f1ec..13657b7 100644 (file)
@@ -44,17 +44,6 @@ vlc_module_begin()
     set_callbacks(Open, NULL)
 vlc_module_end()
 
-static block_t *Filter16(filter_t *filter, block_t *block)
-{
-    uint16_t *data = (uint16_t *)block->p_buffer;
-
-    for (size_t i = 0; i < block->i_buffer / 2; i++)
-        data[i] = bswap16 (data[i]);
-
-    (void) filter;
-    return block;
-}
-
 static block_t *Filter24(filter_t *filter, block_t *block)
 {
     uint8_t *data = (uint8_t *)block->p_buffer;
@@ -94,10 +83,8 @@ static block_t *Filter64(filter_t *filter, block_t *block)
 static const vlc_fourcc_t list[][2] = {
     { VLC_CODEC_F64B, VLC_CODEC_F64L },
     { VLC_CODEC_F32B, VLC_CODEC_F32L },
-    { VLC_CODEC_S16B, VLC_CODEC_S16L },
     { VLC_CODEC_S24B, VLC_CODEC_S24L },
     { VLC_CODEC_S32B, VLC_CODEC_S32L },
-    { VLC_CODEC_S16B, VLC_CODEC_S16L },
     { VLC_CODEC_S24B, VLC_CODEC_S24L },
     { VLC_CODEC_S32B, VLC_CODEC_S32L },
 };
@@ -128,9 +115,6 @@ static int Open(vlc_object_t *object)
 
 ok:
     switch (src->i_bitspersample) {
-        case 16:
-            filter->pf_audio_filter = Filter16;
-            break;
         case 24:
             filter->pf_audio_filter = Filter24;
             break;
index 5c74ffa..cd3ecbe 100644 (file)
@@ -190,40 +190,6 @@ static block_t *S16toU8(filter_t *filter, block_t *b)
     return b;
 }
 
-static block_t *U16toU8(filter_t *filter, block_t *b)
-{
-    VLC_UNUSED(filter);
-    uint16_t *src = (uint16_t *)b->p_buffer;
-    uint8_t  *dst = (uint8_t *)src;
-    for (int i = b->i_buffer / 2; i--;)
-        *dst++ = (*src++) >> 8;
-
-    b->i_buffer /= 2;
-    return b;
-}
-
-static block_t *S16toU16(filter_t *filter, block_t *b)
-{
-    VLC_UNUSED(filter);
-    int16_t *src = (int16_t *)b->p_buffer;
-    uint16_t *dst = (uint16_t *)src;
-    for (int i = b->i_buffer / 2; i--;)
-        *dst++ = (*src++) + 32768;
-
-    return b;
-}
-
-static block_t *U16toS16(filter_t *filter, block_t *b)
-{
-    VLC_UNUSED(filter);
-    uint16_t *src = (uint16_t *)b->p_buffer;
-    int16_t  *dst = (int16_t *)src;
-    for (int i = b->i_buffer / 2; i--;)
-        *dst++ = (int)(*src++) - 32768;
-
-    return b;
-}
-
 static block_t *S24toS16(filter_t *filter, block_t *b)
 {
     VLC_UNUSED(filter);
@@ -339,14 +305,6 @@ static block_t *Fi32toS16(filter_t *filter, block_t *b)
 }
 
 /* */
-static void X8toX16(block_t *bdst, const block_t *bsrc)
-{
-    uint8_t  *src = (uint8_t *)bsrc->p_buffer;
-    uint16_t *dst = (uint16_t *)bdst->p_buffer;
-    for (int i = bsrc->i_buffer; i--;)
-        *dst++ = (*src++) << 8;
-}
-
 static void U8toS16(block_t *bdst, const block_t *bsrc)
 {
     uint8_t *src = (uint8_t *)bsrc->p_buffer;
@@ -428,10 +386,6 @@ static const struct {
     { VLC_CODEC_FL32, VLC_CODEC_S16N,   Fl32toS16 },
 
     { VLC_CODEC_S16N, VLC_CODEC_U8,     S16toU8 },
-    { VLC_CODEC_S16N, VLC_CODEC_U16N,   S16toU16 },
-
-    { VLC_CODEC_U16N, VLC_CODEC_U8,     U16toU8 },
-    { VLC_CODEC_U16N, VLC_CODEC_S16N,   U16toS16 },
 
     { 0, 0, NULL }
 };
@@ -447,7 +401,6 @@ static const struct {
     { VLC_CODEC_S16N, VLC_CODEC_S32N, S16toS32 },
     { VLC_CODEC_S16N, VLC_CODEC_FL32, S16toFl32 },
 
-    { VLC_CODEC_U8,   VLC_CODEC_U16N, X8toX16 },
     { VLC_CODEC_U8,   VLC_CODEC_S16N, U8toS16 },
     { 0, 0, NULL }
 };
index 11f1c2f..93d8054 100644 (file)
@@ -336,17 +336,8 @@ static int Start (audio_output_t *aout, audio_sample_format_t *restrict fmt)
         case VLC_CODEC_U24L:
             pcm_format = SND_PCM_FORMAT_U24_3LE;
             break;
-        case VLC_CODEC_S16B:
-            pcm_format = SND_PCM_FORMAT_S16_BE;
-            break;
-        case VLC_CODEC_S16L:
-            pcm_format = SND_PCM_FORMAT_S16_LE;
-            break;
-        case VLC_CODEC_U16B:
-            pcm_format = SND_PCM_FORMAT_U16_BE;
-            break;
-        case VLC_CODEC_U16L:
-            pcm_format = SND_PCM_FORMAT_U16_LE;
+        case VLC_CODEC_S16N:
+            pcm_format = SND_PCM_FORMAT_S16;
             break;
         case VLC_CODEC_U8:
             pcm_format = SND_PCM_FORMAT_U8;
index ef9989a..5034542 100644 (file)
@@ -87,17 +87,9 @@ static void    Flush       ( audio_output_t *, bool );
 #define WAV_LONGTEXT N_("Instead of writing a raw file, you can add a WAV " \
                         "header to the file.")
 
-static const char *const format_list[] = { "u8", "u16", "s16", "u16_le",
-                                     "s16_le", "u16_be", "s16_be",
-                                     "float32", "spdif" };
-static const int format_int[] = { VLC_CODEC_U8,
-                                  VLC_CODEC_U16N, VLC_CODEC_S16N,
-                                  VLC_CODEC_U16L,
-                                  VLC_CODEC_S16L,
-                                  VLC_CODEC_U16B,
-                                  VLC_CODEC_S16B,
-                                  VLC_CODEC_F32L,
-                                  VLC_CODEC_SPDIFL };
+static const char *const format_list[] = { "u8", "s16", "float32", "spdif" };
+static const int format_int[] = { VLC_CODEC_U8, VLC_CODEC_S16N,
+                                  VLC_CODEC_F32L, VLC_CODEC_SPDIFL };
 
 #define FILE_TEXT N_("Output file")
 #define FILE_LONGTEXT N_("File to which the audio samples will be written to. (\"-\" for stdout")
@@ -217,7 +209,6 @@ static int Start( audio_output_t *p_aout, audio_sample_format_t *restrict fmt )
             wh->Format     = WAVE_FORMAT_PCM;
             wh->BitsPerSample = 8;
             break;
-        case VLC_CODEC_S16L:
         default:
             wh->Format     = WAVE_FORMAT_PCM;
             wh->BitsPerSample = 16;
index 60e594c..b0b0b8d 100644 (file)
@@ -124,11 +124,8 @@ static int Start (audio_output_t *aout, audio_sample_format_t *restrict fmt)
         case VLC_CODEC_S32L:
             format = AFMT_S32_LE;
             break;
-        case VLC_CODEC_S16B:
-            format = AFMT_S16_BE;
-            break;
-        case VLC_CODEC_S16L:
-            format = AFMT_S16_LE;
+        case VLC_CODEC_S16N:
+            format = AFMT_S16;
             break;
         case VLC_CODEC_U8:
             format = AFMT_U8;
@@ -154,9 +151,8 @@ static int Start (audio_output_t *aout, audio_sample_format_t *restrict fmt)
 
     switch (format)
     {
-        case AFMT_U8:     fmt->i_format = VLC_CODEC_U8;   break;
-        case AFMT_S16_BE: fmt->i_format = VLC_CODEC_S16B; break;
-        case AFMT_S16_LE: fmt->i_format = VLC_CODEC_S16L; break;
+        case AFMT_U8:    fmt->i_format = VLC_CODEC_U8;   break;
+        case AFMT_S16:   fmt->i_format = VLC_CODEC_S16N; break;
         //case AFMT_S24_BE:
         //case AFMT_S24_LE:
         case AFMT_S32_BE: fmt->i_format = VLC_CODEC_S32B; break;
index 3f9a8b8..d955483 100644 (file)
@@ -676,11 +676,8 @@ static int Start(audio_output_t *aout, audio_sample_format_t *restrict fmt)
         case VLC_CODEC_S24L:
             ss.format = PA_SAMPLE_S24LE;
             break;
-        case VLC_CODEC_S16B:
-            ss.format = PA_SAMPLE_S16BE;
-            break;
-        case VLC_CODEC_S16L:
-            ss.format = PA_SAMPLE_S16LE;
+        case VLC_CODEC_S16N:
+            ss.format = PA_SAMPLE_S16NE;
             break;
         case VLC_CODEC_U8:
             ss.format = PA_SAMPLE_U8;
index aea6ea6..db13812 100644 (file)
@@ -122,19 +122,13 @@ static int Start (audio_output_t *aout, audio_sample_format_t *restrict fmt)
             fmt->i_format = VLC_CODEC_U8;
             break;
         case 16:
-            fmt->i_format = par.sig
-                                 ? (par.le ? VLC_CODEC_S16L : VLC_CODEC_S16B)
-                                 : (par.le ? VLC_CODEC_U16L : VLC_CODEC_U16B);
+            fmt->i_format = VLC_CODEC_S16N;
             break;
         case 24:
-            fmt->i_format = par.sig
-                                 ? (par.le ? VLC_CODEC_S24L : VLC_CODEC_S24B)
-                                 : (par.le ? VLC_CODEC_U24L : VLC_CODEC_U24B);
+            fmt->i_format = VLC_CODEC_S24N;
             break;
         case 32:
-            fmt->i_format = par.sig
-                                 ? (par.le ? VLC_CODEC_S32L : VLC_CODEC_S32B)
-                                 : (par.le ? VLC_CODEC_U32L : VLC_CODEC_U32B);
+            fmt->i_format = VLC_CODEC_S32N;
             break;
         default:
             msg_Err (obj, "unsupported audio sample format (%u bits)",