1 /*
2 * Bitmap Brothers JV demuxer
3 * Copyright (c) 2005, 2011 Peter Ross <pross@xvid.org>
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 * Bitmap Brothers JV demuxer
25 * @author Peter Ross <pross@xvid.org>
26 */
27
30
33
34 #define JV_PREAMBLE_SIZE 5
35
42
45 enum {
52
53 #define MAGIC " Compression by John M Phillips Copyright (C) 1995 The Bitmap Brothers Ltd."
54
56 {
60 return 0;
61 }
62
64 {
66
68
69 return 0;
70 }
71
73 {
77 int64_t audio_pts = 0;
79 int i;
80
82
85 if (!ast || !vst)
87
97
99
107
109
114
118
123
124 /* total frame size including audio, video, palette data and padding */
129
133
141 }
145 }
146
149
152
155
157 }
158
159 jv->
state = JV_AUDIO;
160 return 0;
161 }
162
164 {
168
172
174 case JV_AUDIO:
182 return 0;
183 }
184 case JV_VIDEO:
187 int ret;
191
195 if (ret < 0)
196 return ret;
197 if (ret < size) {
201 }
207 return 0;
208 }
209 case JV_PADDING:
212 jv->
state = JV_AUDIO;
214 }
215 }
216
219
221 }
222
224 int64_t ts,
int flags)
225 {
228 int i;
229
232
233 switch (stream_index) {
234 case 0:
236 break;
237 case 1:
238 i = ts;
239 break;
240 default:
241 return 0;
242 }
243
245 return 0;
247 return -1;
248
249 jv->
state = JV_AUDIO;
251 return 0;
252 }
253
263 };
int video_type
per-frame video compression type
#define AVERROR_INVALIDDATA
Invalid data found when processing input.
#define AV_LOG_WARNING
Something somehow does not look correct.
enum AVCodecID codec_id
Specific type of the encoded data (the codec used).
int64_t avio_seek(AVIOContext *s, int64_t offset, int whence)
fseek() equivalent for AVIOContext.
AVIndexEntry * index_entries
Only used if the format does not support seeking natively.
int64_t avio_skip(AVIOContext *s, int64_t offset)
Skip given number of bytes forward.
AVStream * avformat_new_stream(AVFormatContext *s, const AVCodec *c)
Add a new stream to a media file.
AVStream ** streams
A list of all streams in the file.
#define AVERROR_EOF
End of file.
uint64_t channel_layout
Audio only.
int avio_read(AVIOContext *s, unsigned char *buf, int size)
Read size bytes from AVIOContext into buf.
#define AV_PKT_FLAG_KEY
The packet contains a keyframe.
int av_new_packet(AVPacket *pkt, int size)
Allocate the payload of a packet and initialize its fields with default values.
int av_index_search_timestamp(AVStream *st, int64_t timestamp, int flags)
Get the index for a specific timestamp.
unsigned int avio_rl32(AVIOContext *s)
int64_t timestamp
Timestamp in AVStream.time_base units, preferably the time from which on correctly decoded frames are...
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification. ...
enum AVMediaType codec_type
General type of the encoded data.
enum JVDemuxContext::@223 state
static const uint8_t offset[127][2]
int flags
A combination of AV_PKT_FLAG values.
int avio_r8(AVIOContext *s)
int buf_size
Size of buf except extra allocated bytes.
unsigned char * buf
Buffer must have AVPROBE_PADDING_SIZE of extra allocated bytes filled with zero.
audio channel layout utility functions
#define AV_EF_EXPLODE
abort decoding on minor error detection
int palette_size
palette size (bytes)
AVIOContext * pb
I/O context.
This structure contains the data a format has to probe a file.
int64_t duration
Decoding: duration of the stream, in stream time base.
int sample_rate
Audio only.
unsigned int avio_rl16(AVIOContext *s)
int video_size
video packet size (bytes)
int error_recognition
Error recognition; higher values will detect more errors but may misdetect some more or less valid pa...
int64_t nb_frames
number of frames in this stream if known or 0
#define AV_PKT_FLAG_CORRUPT
The packet content is corrupted.
#define AV_INPUT_BUFFER_PADDING_SIZE
Required number of additionally allocated bytes at the end of the input bitstream for decoding...
int eof_reached
true if eof reached
void * priv_data
Format private data.
AVCodecParameters * codecpar
Codec parameters associated with this stream.
int avio_feof(AVIOContext *s)
feof() equivalent for AVIOContext.
uint32_t codec_tag
Additional information about the codec (corresponds to the AVI FOURCC).
#define AV_CH_LAYOUT_MONO
This structure stores compressed data.
int64_t pts
Presentation timestamp in AVStream->time_base units; the time at which the decompressed packet will b...
#define AV_NOPTS_VALUE
Undefined timestamp value.
int audio_size
audio packet size (bytes)