1 /*
2 * 8088flex TMV file demuxer
3 * Copyright (c) 2009 Daniel Verkamp <daniel at drv.nu>
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
22 /**
23 * @file
24 * 8088flex TMV file demuxer
25 * @author Daniel Verkamp
26 * @see http://www.oldskool.org/pc/8088_Corruption
27 */
28
33
34 enum {
37 };
38
39 #define TMV_TAG MKTAG('T', 'M', 'A', 'V')
40
47
48 #define TMV_HEADER_SIZE 12
49
50 #define PROBE_MIN_SAMPLE_RATE 5000
51 #define PROBE_MAX_FPS 120
52 #define PROBE_MIN_AUDIO_SIZE (PROBE_MIN_SAMPLE_RATE / PROBE_MAX_FPS)
53
55 {
59 !p->
buf[8] &&
// compression method
60 p->
buf[9] &&
// char cols
61 p->
buf[10])
// char rows
63 ((p->
buf[9] == 40 && p->
buf[10] == 25) ? 1 : 4);
64 return 0;
65 }
66
68 {
73 unsigned comp_method, char_cols, char_rows, features;
74
76 return -1;
77
80
83
87 return -1;
88 }
89
93 return -1;
94 }
95
97 if (comp_method) {
99 comp_method);
100 return -1;
101 }
102
106
111 return -1;
112 }
113
119 } else {
122 }
127
131
138
143
146
147 return 0;
148 }
149
151 {
156
159
161
164
168
170 }
171
173 int64_t timestamp,
int flags)
174 {
176 int64_t pos;
177
178 if (stream_index)
179 return -1;
180
181 pos = timestamp *
183
185 return -1;
187 return 0;
188 }
189
199 };