Commit 5ff7862f authored by Rémi Denis-Courmont's avatar Rémi Denis-Courmont

aout: drop remnants of foreign endian support (refs #7764)

Endianess is now converted by the raw decoder/encoder.
parent d95e65c6
...@@ -51,12 +51,10 @@ SOURCES_a52tofloat32 = converter/a52tofloat32.c ...@@ -51,12 +51,10 @@ SOURCES_a52tofloat32 = converter/a52tofloat32.c
SOURCES_dtstospdif = converter/dtstospdif.c SOURCES_dtstospdif = converter/dtstospdif.c
SOURCES_dtstofloat32 = converter/dtstofloat32.c SOURCES_dtstofloat32 = converter/dtstofloat32.c
SOURCES_mpgatofixed32 = converter/mpgatofixed32.c SOURCES_mpgatofixed32 = converter/mpgatofixed32.c
SOURCES_audio_endian = converter/endian.c
SOURCES_audio_format = converter/format.c SOURCES_audio_format = converter/format.c
libvlc_LTLIBRARIES += \ libvlc_LTLIBRARIES += \
liba52tospdif_plugin.la \ liba52tospdif_plugin.la \
libaudio_endian_plugin.la \
libaudio_format_plugin.la \ libaudio_format_plugin.la \
libdtstospdif_plugin.la libdtstospdif_plugin.la
......
/*****************************************************************************
* endian.c : PCM endian converter
*****************************************************************************
* Copyright (C) 2002-2005 VLC authors and VideoLAN
* Copyright (C) 2010 Laurent Aimar
* Copyright (C) 2012 Rémi Denis-Courmont
*
* Authors: Christophe Massiot <massiot@via.ecp.fr>
* Gildas Bazin <gbazin@videolan.org>
* Laurent Aimar <fenrir _AT_ videolan _DOT_ org>
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation; either version 2.1 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
*****************************************************************************/
#ifdef HAVE_CONFIG_H
# include "config.h"
#endif
#include <vlc_common.h>
#include <vlc_plugin.h>
#include <vlc_aout.h>
#include <vlc_block.h>
#include <vlc_filter.h>
static int Open(vlc_object_t *);
vlc_module_begin()
set_description(N_("Audio filter for endian conversion"))
set_category(CAT_AUDIO)
set_subcategory(SUBCAT_AUDIO_MISC)
set_capability("audio converter", 2)
set_callbacks(Open, NULL)
vlc_module_end()
static const vlc_fourcc_t list[][2] = {
};
static int Open(vlc_object_t *object)
{
filter_t *filter = (filter_t *)object;
const audio_sample_format_t *src = &filter->fmt_in.audio;
const audio_sample_format_t *dst = &filter->fmt_out.audio;
if (!AOUT_FMTS_SIMILAR(src, dst))
return VLC_EGENERIC;
for (size_t i = 0; i < sizeof (list) / sizeof (list[0]); i++) {
if (src->i_format == list[i][0]) {
if (dst->i_format == list[i][1])
goto ok;
break;
}
if (src->i_format == list[i][1]) {
if (dst->i_format == list[i][0])
goto ok;
break;
}
}
return VLC_EGENERIC;
ok:
switch (src->i_bitspersample) {
}
return VLC_SUCCESS;
}
...@@ -295,7 +295,6 @@ modules/audio_filter/converter/a52tofloat32.c ...@@ -295,7 +295,6 @@ modules/audio_filter/converter/a52tofloat32.c
modules/audio_filter/converter/a52tospdif.c modules/audio_filter/converter/a52tospdif.c
modules/audio_filter/converter/dtstofloat32.c modules/audio_filter/converter/dtstofloat32.c
modules/audio_filter/converter/dtstospdif.c modules/audio_filter/converter/dtstospdif.c
modules/audio_filter/converter/endian.c
modules/audio_filter/converter/format.c modules/audio_filter/converter/format.c
modules/audio_filter/converter/mpgatofixed32.c modules/audio_filter/converter/mpgatofixed32.c
modules/audio_filter/equalizer.c modules/audio_filter/equalizer.c
......
...@@ -29,7 +29,7 @@ ...@@ -29,7 +29,7 @@
/* Max input rate factor (1/4 -> 4) */ /* Max input rate factor (1/4 -> 4) */
# define AOUT_MAX_INPUT_RATE (4) # define AOUT_MAX_INPUT_RATE (4)
# define AOUT_MAX_FILTERS 12 # define AOUT_MAX_FILTERS 10
enum { enum {
AOUT_RESAMPLING_NONE=0, AOUT_RESAMPLING_NONE=0,
...@@ -123,7 +123,6 @@ void aout_OutputDelete( audio_output_t * p_aout ); ...@@ -123,7 +123,6 @@ void aout_OutputDelete( audio_output_t * p_aout );
/* From common.c : */ /* From common.c : */
vlc_fourcc_t aout_NativeEndian(vlc_fourcc_t);
void aout_FormatsPrint(vlc_object_t *, const char *, void aout_FormatsPrint(vlc_object_t *, const char *,
const audio_sample_format_t *, const audio_sample_format_t *,
const audio_sample_format_t *); const audio_sample_format_t *);
......
...@@ -79,46 +79,6 @@ unsigned int aout_BitsPerSample( vlc_fourcc_t i_format ) ...@@ -79,46 +79,6 @@ unsigned int aout_BitsPerSample( vlc_fourcc_t i_format )
} }
} }
vlc_fourcc_t aout_NativeEndian( vlc_fourcc_t i_format )
{
switch( i_format )
{
case VLC_CODEC_F64B:
case VLC_CODEC_F64L:
return VLC_CODEC_FL64;
case VLC_CODEC_F32B:
case VLC_CODEC_F32L:
return VLC_CODEC_FL32;
case VLC_CODEC_S32B:
case VLC_CODEC_S32L:
return VLC_CODEC_S32N;
case VLC_CODEC_U32B:
case VLC_CODEC_U32L:
return VLC_CODEC_U32N;
case VLC_CODEC_S24B:
case VLC_CODEC_S24L:
return VLC_CODEC_S24N;
case VLC_CODEC_U24B:
case VLC_CODEC_U24L:
return VLC_CODEC_U24N;
case VLC_CODEC_S16B:
case VLC_CODEC_S16L:
return VLC_CODEC_S16N;
case VLC_CODEC_U16B:
case VLC_CODEC_U16L:
return VLC_CODEC_U16N;
}
return 0;
}
/***************************************************************************** /*****************************************************************************
* aout_FormatPrepare : compute the number of bytes per frame & frame length * aout_FormatPrepare : compute the number of bytes per frame & frame length
*****************************************************************************/ *****************************************************************************/
......
...@@ -155,32 +155,9 @@ static int aout_FiltersPipelineCreate(vlc_object_t *obj, filter_t **filters, ...@@ -155,32 +155,9 @@ static int aout_FiltersPipelineCreate(vlc_object_t *obj, filter_t **filters,
} }
assert (AOUT_FMT_LINEAR(&input)); assert (AOUT_FMT_LINEAR(&input));
bool same_mix = infmt->i_physical_channels == outfmt->i_physical_channels
&& infmt->i_original_channels == outfmt->i_original_channels;
/* Native endianess */
if (input.i_format != outfmt->i_format || !same_mix)
{
vlc_fourcc_t native = aout_NativeEndian (input.i_format);
if (native != 0 && native != input.i_format)
{
if (n == max)
goto overflow;
filter_t *f = TryFormat (obj, native, &input);
if (f == NULL)
{
msg_Err (obj, "cannot find %s for conversion pipeline",
"native endian converter");
goto error;
}
filters[n++] = f;
}
}
/* Remix channels */ /* Remix channels */
if (!same_mix) if (infmt->i_physical_channels != outfmt->i_physical_channels
|| infmt->i_original_channels != outfmt->i_original_channels)
{ /* Remixing currently requires FL32... TODO: S16N */ { /* Remixing currently requires FL32... TODO: S16N */
if (input.i_format != VLC_CODEC_FL32) if (input.i_format != VLC_CODEC_FL32)
{ {
...@@ -242,38 +219,18 @@ static int aout_FiltersPipelineCreate(vlc_object_t *obj, filter_t **filters, ...@@ -242,38 +219,18 @@ static int aout_FiltersPipelineCreate(vlc_object_t *obj, filter_t **filters,
} }
/* Format */ /* Format */
vlc_fourcc_t native = aout_NativeEndian (outfmt->i_format); if (input.i_format != outfmt->i_format)
if (native == 0)
native = outfmt->i_format;
if (input.i_format != native)
{ {
if (max == 0) if (max == 0)
goto overflow; goto overflow;
filter_t *f = TryFormat (obj, native, &input);
if (f == NULL)
{
msg_Err (obj, "cannot find %s for conversion pipeline",
"post-mix converter");
goto error;
}
filters[n++] = f;
}
/* Foreign endianess */
if (native != outfmt->i_format)
{
if (n == max)
goto overflow;
filter_t *f = TryFormat (obj, outfmt->i_format, &input); filter_t *f = TryFormat (obj, outfmt->i_format, &input);
if (f == NULL) if (f == NULL)
{ {
msg_Err (obj, "cannot find %s for conversion pipeline", msg_Err (obj, "cannot find %s for conversion pipeline",
"foreign endian converter"); "post-mix converter");
goto error; goto error;
} }
filters[n++] = f; filters[n++] = f;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment