Sylvain Munaut | cca1155 | 2010-10-24 18:32:44 +0200 | [diff] [blame] | 1 | /* 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 */ |
| 25 | extern const struct codec_desc codec_pcm_desc; |
| 26 | extern const struct codec_desc codec_hr_desc; |
| 27 | extern const struct codec_desc codec_fr_desc; |
| 28 | extern const struct codec_desc codec_efr_desc; |
| 29 | |
| 30 | |
| 31 | const struct codec_desc * |
| 32 | codec_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 | } |