blob: 7a9a6d3b5002567c46ee5002dbc88f69abfab79a [file] [log] [blame]
Sylvain Munautcca11552010-10-24 18:32:44 +02001/* Codecs handling */
2
3/*
4 * This file is part of gapk (GSM Audio Pocket Knife).
5 *
6 * gapk is free software: you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation, either version 3 of the License, or
9 * (at your option) any later version.
10 *
11 * gapk is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with gapk. If not, see <http://www.gnu.org/licenses/>.
18 */
19
20#include <stdio.h> /* for NULL */
21
22#include <gapk/codecs.h>
23
24/* Extern codec descriptors */
25extern const struct codec_desc codec_pcm_desc;
26extern const struct codec_desc codec_hr_desc;
27extern const struct codec_desc codec_fr_desc;
28extern const struct codec_desc codec_efr_desc;
29
30
31const struct codec_desc *
32codec_get_from_type(enum codec_type type)
33{
34 switch (type) {
35 case CODEC_PCM: return &codec_pcm_desc;
36 case CODEC_HR: return &codec_hr_desc;
37 case CODEC_FR: return &codec_fr_desc;
38 case CODEC_EFR: return &codec_efr_desc;
39 default:
40 return NULL;
41 }
42}