blob: 3fa547be03349d575d2205c9efd714dd06218876 [file] [log] [blame]
Harald Welte8b01f0c2017-05-28 11:04:26 +02001/* Input format to libopencore-amrnb: Exactly like our canonical AMR */
2/* (C) 2017 Harald Welte <laforge@gnumonks.org> */
3
4/*
5 * This file is part of gapk (GSM Audio Pocket Knife).
6 *
7 * gapk is free software: you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation, either version 3 of the License, or
10 * (at your option) any later version.
11 *
12 * gapk is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with gapk. If not, see <http://www.gnu.org/licenses/>.
19 */
20
21#include <stdint.h>
22#include <string.h>
23
24#include <gapk/codecs.h>
25#include <gapk/formats.h>
26#include <gapk/utils.h>
27
28static int
29amr_opencore_from_canon(uint8_t *dst, const uint8_t *src, unsigned int src_len)
30{
31 memcpy(dst, src, src_len);
32 return src_len;
33}
34
35static int
36amr_opencore_to_canon(uint8_t *dst, const uint8_t *src, unsigned int src_len)
37{
38 memcpy(dst, src, src_len);
39 return src_len;
40}
41
42const struct format_desc fmt_amr_opencore = {
43 .type = FMT_AMR_OPENCORE,
44 .codec_type = CODEC_AMR,
45 .name = "amr-opencore",
46 .description = "Input format to libopencore-amrnb",
47
48 .frame_len = 0,
49 .conv_from_canon = amr_opencore_from_canon,
50 .conv_to_canon = amr_opencore_to_canon,
51};