1 /*
2 * Brute Force & Ignorance (BFI) demuxer
3 * Copyright (c) 2008 Sisir Koppaka
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 * @brief Brute Force & Ignorance (.bfi) file demuxer
25 * @author Sisir Koppaka ( sisir.koppaka at gmail dot com )
26 * @see http://wiki.multimedia.cx/index.php?title=BFI
27 */
28
33
41
43 {
44 /* Check file header */
47 else
48 return 0;
49 }
50
52 {
57 int ret, fps, chunk_header;
58
59 /* Initialize the video codec... */
61 if (!vstream)
63
64 /* Initialize the audio codec... */
66 if (!astream)
68
69 /* Set the total number of frames. */
72 if (chunk_header < 3)
74
85
86 /*Load the palette to extradata */
91
96 }
97
98 /* Set up the video codec... */
105
106 /* Set up the audio codec now... */
114 avio_seek(pb, chunk_header - 3, SEEK_SET);
116 return 0;
117 }
118
119
121 {
124 int ret, audio_offset, video_offset, chunk_size, audio_size = 0;
127 }
128
129 /* If all previous chunks were completely read, then find a new one... */
136 }
137 /* Now that the chunk's location is confirmed, we proceed... */
143 audio_size = video_offset - audio_offset;
145 if (audio_size < 0 || bfi->video_size < 0) {
148 }
149
150 //Tossing an audio packet at the audio decoder.
154
158
159 //Tossing a video packet at the video decoder.
163
166
167 /* One less frame to read. A cursory decrement. */
169 } else {
170 /* Empty video packet */
172 }
173
177 }
178
186 };