1 /*
2 * Interface to libgsm for GSM encoding
3 * Copyright (c) 2005 Alban Bedel <albeu@free.fr>
4 * Copyright (c) 2006, 2007 Michel Bardiaux <mbardiaux@mediaxim.be>
5 *
6 * This file is part of FFmpeg.
7 *
8 * FFmpeg is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU Lesser General Public
10 * License as published by the Free Software Foundation; either
11 * version 2.1 of the License, or (at your option) any later version.
12 *
13 * FFmpeg is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 * Lesser General Public License for more details.
17 *
18 * You should have received a copy of the GNU Lesser General Public
19 * License along with FFmpeg; if not, write to the Free Software
20 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
21 */
22
23 /**
24 * @file
25 * Interface to libgsm for GSM encoding
26 */
27
28 // The idiosyncrasies of GSM-in-WAV are explained at http://kbs.cs.tu-berlin.de/~jutta/toast.html
29
30 #include "config.h"
31 #if HAVE_GSM_H
33 #else
34 #include <gsm/gsm.h>
35 #endif
36
39
44
48 return 0;
49 }
50
55 return -1;
56 }
57
62 return -1;
63 }
64 if (avctx->
bit_rate != 13000
/* Official */ &&
65 avctx->
bit_rate != 13200
/* Very common */ &&
66 avctx->
bit_rate != 0
/* Unknown; a.o. mov does not set bitrate when decoding */ ) {
70 return -1;
71 }
72
76
81 break;
83 int one = 1;
84 gsm_option(avctx->
priv_data, GSM_OPT_WAV49, &one);
87 }
88 }
89
90 return 0;
93 return -1;
94 }
95
98 {
102
105
109 break;
113 }
114
115 *got_packet_ptr = 1;
116 return 0;
117 }
118
120 { "b", "13000" },
122 };
123
124 #if CONFIG_LIBGSM_ENCODER
138 .wrapper_name = "libgsm",
139 };
140 #endif
141 #if CONFIG_LIBGSM_MS_ENCODER
155 .wrapper_name = "libgsm",
156 };
157 #endif