1 /*
2 * VQF demuxer
3 * Copyright (c) 2009 Vitor Sessak
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
28
34
36 {
38 return 0;
39
40 if (!memcmp(probe_packet->
buf + 4,
"97012000", 8))
42
43 if (!memcmp(probe_packet->
buf + 4,
"00052200", 8))
45
48
50 }
51
53 unsigned int tag_len, unsigned int remaining)
54 {
56 char *
buf, key[5] = {0};
57
58 if (len == UINT_MAX)
59 return;
60
62 if (!buf)
63 return;
68 }
69
71 { "(c) ", "copyright" },
72 { "ARNG", "arranger" },
73 { "AUTH", "author" },
74 { "BAND", "band" },
75 { "CDCT", "conductor" },
76 { "COMT", "comment" },
77 { "FILE", "filename" },
78 { "GENR", "genre" },
79 { "LABL", "publisher" },
80 { "MUSC", "composer" },
81 { "NAME", "title" },
82 { "NOTE", "note" },
83 { "PROD", "producer" },
84 { "PRSN", "personnel" },
85 { "REMX", "remixer" },
86 { "SING", "singer" },
87 { "TRCK", "track" },
88 { "WORD", "words" },
89 { 0 },
90 };
91
93 {
96 int chunk_tag;
97 int rate_flag = -1;
98 int header_size;
99 int read_bitrate = 0;
102
103 if (!st)
105
107
109
113
114 do {
117
118 if (chunk_tag ==
MKTAG(
'D',
'A',
'T',
'A'))
119 break;
120
122
123 if ((unsigned) len > INT_MAX/2) {
125 return -1;
126 }
127
128 header_size -= 8;
129
130 switch(chunk_tag){
131 case MKTAG(
'C',
'O',
'M',
'M'):
134 read_bitrate =
AV_RB32(comm_chunk + 4);
135 rate_flag =
AV_RB32(comm_chunk + 8);
137
141 }
142
144 break;
145 case MKTAG(
'D',
'S',
'I',
'Z'):
// size of compressed data
146 {
148 }
149 break;
150 case MKTAG(
'Y',
'E',
'A',
'R'):
// recording date
151 case MKTAG(
'E',
'N',
'C',
'D'):
// compression date
152 case MKTAG(
'E',
'X',
'T',
'R'):
// reserved
153 case MKTAG(
'_',
'Y',
'M',
'H'):
// reserved
154 case MKTAG(
'_',
'N',
'T',
'T'):
// reserved
155 case MKTAG(
'_',
'I',
'D',
'3'):
// reserved for ID3 tags
157 break;
158 default:
160 break;
161 }
162
164
166
167 switch (rate_flag) {
168 case -1:
170 return -1;
171 case 44:
173 break;
174 case 22:
176 break;
177 case 11:
179 break;
180 default:
181 if (rate_flag < 8 || rate_flag > 44) {
184 }
186 break;
187 }
188
194 }
195
198 case (11<<8) + 8 :
199 case (8 <<8) + 8 :
200 case (11<<8) + 10:
201 case (22<<8) + 32:
202 size = 512;
203 break;
204 case (16<<8) + 16:
205 case (22<<8) + 20:
206 case (22<<8) + 24:
207 size = 1024;
208 break;
209 case (44<<8) + 40:
210 case (44<<8) + 48:
211 size = 2048;
212 break;
213 default:
216 return -1;
217 }
220
221 /* put first 12 bytes of COMM chunk in extradata */
225
227
228 return 0;
229 }
230
232 {
236
239
243
247
248 if (ret != size) {
251 }
252
255
256 return size+2;
257 }
258
260 int stream_index, int64_t timestamp,
int flags)
261 {
265 int64_t pos;
266
274
277
280
282 return 0;
283 }
284
293 .extensions = "vqf,vql,vqe",
294 };