blob: 623e80c89010d5538093c05aa2f0022fb0d12275 [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;
Harald Welte8b01f0c2017-05-28 11:04:26 +020029extern const struct codec_desc codec_amr_desc;
Sylvain Munautcca11552010-10-24 18:32:44 +020030
31
32const struct codec_desc *
33codec_get_from_type(enum codec_type type)
34{
35 switch (type) {
36 case CODEC_PCM: return &codec_pcm_desc;
37 case CODEC_HR: return &codec_hr_desc;
38 case CODEC_FR: return &codec_fr_desc;
39 case CODEC_EFR: return &codec_efr_desc;
Harald Welte8b01f0c2017-05-28 11:04:26 +020040 case CODEC_AMR: return &codec_amr_desc;
Sylvain Munautcca11552010-10-24 18:32:44 +020041 default:
42 return NULL;
43 }
44}