1 /*
2 * NIST Sphere demuxer
3 * Copyright (c) 2012 Paul B Mahol
4 *
5 * This file is part of FFmpeg.
6 *
7 * FFmpeg is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU Lesser General Public
9 * License as published by the Free Software Foundation; either
10 * version 2.1 of the License, or (at your option) any later version.
11 *
12 * FFmpeg 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 GNU
15 * Lesser General Public License for more details.
16 *
17 * You should have received a copy of the GNU Lesser General Public
18 * License along with FFmpeg; if not, write to the Free Software
19 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
20 */
21
27
29 {
32 return 0;
33 }
34
36 {
37 char buffer[32], coding[32] =
"pcm", format[32] =
"01";
41
43 if (!st)
45
47
50 sscanf(buffer, "%"SCNd32, &header_size);
51 if (header_size <= 0)
53
56
59
60 if (!memcmp(buffer, "end_head", 8)) {
63
66 0, be, 0xFFFF);
72 } else {
74 }
75
77
79
82
84
85 return 0;
86 } else if (!memcmp(buffer, "channel_count", 13)) {
88 } else if (!memcmp(buffer, "sample_byte_format", 18)) {
89 sscanf(buffer, "%*s %*s %31s", format);
90
92 be = 0;
94 be = 1;
98 }
99 } else if (!memcmp(buffer, "sample_coding", 13)) {
100 sscanf(buffer, "%*s %*s %31s", coding);
101 } else if (!memcmp(buffer, "sample_count", 12)) {
102 sscanf(buffer,
"%*s %*s %"SCNd64, &st->
duration);
103 } else if (!memcmp(buffer, "sample_n_bytes", 14)) {
104 sscanf(buffer, "%*s %*s %"SCNd32, &bps);
105 } else if (!memcmp(buffer, "sample_rate", 11)) {
107 } else if (!memcmp(buffer, "sample_sig_bits", 15)) {
109 } else {
110 char key[32],
value[32];
111 if (sscanf(buffer, "%31s %*s %31s", key, value) == 3) {
113 } else {
115 }
116 }
117 }
118
120 }
121
123 .
name =
"nistsphere",
129 .extensions = "nist,sph",
131 };