]> git.sesse.net Git - vlc/blob - modules/audio_filter/converter/endian.c
aout: drop support for U24 and S24I
[vlc] / modules / audio_filter / converter / endian.c
1 /*****************************************************************************
2  * endian.c : PCM endian converter
3  *****************************************************************************
4  * Copyright (C) 2002-2005 VLC authors and VideoLAN
5  * Copyright (C) 2010 Laurent Aimar
6  * Copyright (C) 2012 RĂ©mi Denis-Courmont
7  *
8  * Authors: Christophe Massiot <massiot@via.ecp.fr>
9  *          Gildas Bazin <gbazin@videolan.org>
10  *          Laurent Aimar <fenrir _AT_ videolan _DOT_ org>
11  *
12  * This program is free software; you can redistribute it and/or modify it
13  * under the terms of the GNU Lesser General Public License as published by
14  * the Free Software Foundation; either version 2.1 of the License, or
15  * (at your option) any later version.
16  *
17  * This program is distributed in the hope that it will be useful,
18  * but WITHOUT ANY WARRANTY; without even the implied warranty of
19  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20  * GNU Lesser General Public License for more details.
21  *
22  * You should have received a copy of the GNU Lesser General Public License
23  * along with this program; if not, write to the Free Software Foundation,
24  * Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
25  *****************************************************************************/
26
27 #ifdef HAVE_CONFIG_H
28 # include "config.h"
29 #endif
30
31 #include <vlc_common.h>
32 #include <vlc_plugin.h>
33 #include <vlc_aout.h>
34 #include <vlc_block.h>
35 #include <vlc_filter.h>
36
37 static int  Open(vlc_object_t *);
38
39 vlc_module_begin()
40     set_description(N_("Audio filter for endian conversion"))
41     set_category(CAT_AUDIO)
42     set_subcategory(SUBCAT_AUDIO_MISC)
43     set_capability("audio converter", 2)
44     set_callbacks(Open, NULL)
45 vlc_module_end()
46
47 static const vlc_fourcc_t list[][2] = {
48 };
49
50 static int Open(vlc_object_t *object)
51 {
52     filter_t *filter = (filter_t *)object;
53
54     const audio_sample_format_t *src = &filter->fmt_in.audio;
55     const audio_sample_format_t *dst = &filter->fmt_out.audio;
56
57     if (!AOUT_FMTS_SIMILAR(src, dst))
58         return VLC_EGENERIC;
59
60     for (size_t i = 0; i < sizeof (list) / sizeof (list[0]); i++) {
61         if (src->i_format == list[i][0]) {
62             if (dst->i_format == list[i][1])
63                 goto ok;
64             break;
65         }
66         if (src->i_format == list[i][1]) {
67             if (dst->i_format == list[i][0])
68                 goto ok;
69             break;
70         }
71     }
72     return VLC_EGENERIC;
73
74 ok:
75     switch (src->i_bitspersample) {
76     }
77
78     return VLC_SUCCESS;
79 }