1 /*
2 * SBC parser
3 *
4 * Copyright (C) 2017 Aurelien Jacobs <aurel@gnuage.org>
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
25
32
34 const uint8_t *
data,
size_t len)
35 {
36 static const int sample_rates[4] = { 16000, 32000, 44100, 48000 };
38 int length;
39
41 return -1;
42
50 return 57;
51 }
52
54 return -2;
55
56 sr = (
data[1] >> 6) & 0x03;
57 blocks = (((
data[1] >> 4) & 0x03) + 1) << 2;
61
64
68
75 return length;
76 }
77
79 const uint8_t **poutbuf, int *poutbuf_size,
80 const uint8_t *buf, int buf_size)
81 {
83 int next;
84
86 next = buf_size;
87 } else {
94 } else {
96 if (next >= buf_size)
97 next = -1;
98 }
99
100 if (next < 0) {
105 }
106
109 *poutbuf_size = 0;
110 return buf_size;
111 }
112 }
113
114 *poutbuf = buf;
115 *poutbuf_size = buf_size;
116 return next;
117 }
118
124 };