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 #include "config_components.h"
32 #if HAVE_GSM_H
34 #else
35 #include <gsm/gsm.h>
36 #endif
37
40
45
49 return 0;
50 }
51
57 return -1;
58 }
59 if (avctx->
bit_rate != 13000
/* Official */ &&
60 avctx->
bit_rate != 13200
/* Very common */ &&
61 avctx->
bit_rate != 0
/* Unknown; a.o. mov does not set bitrate when decoding */ ) {
65 return -1;
66 }
67
71
76 break;
78 int one = 1;
79 gsm_option(avctx->
priv_data, GSM_OPT_WAV49, &one);
82 }
83 }
84
85 return 0;
88 return -1;
89 }
90
93 {
97
100
104 break;
108 }
109
110 *got_packet_ptr = 1;
111 return 0;
112 }
113
115 { "b", "13000" },
117 };
118
119 #if CONFIG_LIBGSM_ENCODER
130 #if FF_API_OLD_CHANNEL_LAYOUT
132 #endif
136 .p.wrapper_name = "libgsm",
137 };
138 #endif
139 #if CONFIG_LIBGSM_MS_ENCODER
141 .
p.
name =
"libgsm_ms",
150 #if FF_API_OLD_CHANNEL_LAYOUT
152 #endif
156 .p.wrapper_name = "libgsm",
157 };
158 #endif