2 * Interplay MVE File Demuxer
3 * Copyright (c) 2003 The FFmpeg project
5 * This file is part of FFmpeg.
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.
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.
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
24 * Interplay MVE file demuxer
25 * by Mike Melanson (melanson@pcisys.net)
26 * For more information regarding the Interplay MVE file format, visit:
27 * http://www.pcisys.net/~melanson/codecs/
28 * The aforementioned site also contains a command line utility for parsing
29 * IP MVE files so that you can get a good idea of the typical structure of
30 * such files. This demuxer is not the best example to use if you are trying
31 * to write your own as it uses a rather roundabout approach for splitting
32 * up and sending out the chunks.
35 #include "libavutil/channel_layout.h"
36 #include "libavutil/intreadwrite.h"
40 #define CHUNK_PREAMBLE_SIZE 4
41 #define OPCODE_PREAMBLE_SIZE 4
43 #define CHUNK_INIT_AUDIO 0x0000
44 #define CHUNK_AUDIO_ONLY 0x0001
45 #define CHUNK_INIT_VIDEO 0x0002
46 #define CHUNK_VIDEO 0x0003
47 #define CHUNK_SHUTDOWN 0x0004
48 #define CHUNK_END 0x0005
49 /* these last types are used internally */
50 #define CHUNK_HAVE_PACKET 0xFFFB
51 #define CHUNK_DONE 0xFFFC
52 #define CHUNK_NOMEM 0xFFFD
53 #define CHUNK_EOF 0xFFFE
54 #define CHUNK_BAD 0xFFFF
56 #define OPCODE_END_OF_STREAM 0x00
57 #define OPCODE_END_OF_CHUNK 0x01
58 #define OPCODE_CREATE_TIMER 0x02
59 #define OPCODE_INIT_AUDIO_BUFFERS 0x03
60 #define OPCODE_START_STOP_AUDIO 0x04
61 #define OPCODE_INIT_VIDEO_BUFFERS 0x05
62 #define OPCODE_VIDEO_DATA_06 0x06
63 #define OPCODE_SEND_BUFFER 0x07
64 #define OPCODE_AUDIO_FRAME 0x08
65 #define OPCODE_SILENCE_FRAME 0x09
66 #define OPCODE_INIT_VIDEO_MODE 0x0A
67 #define OPCODE_CREATE_GRADIENT 0x0B
68 #define OPCODE_SET_PALETTE 0x0C
69 #define OPCODE_SET_PALETTE_COMPRESSED 0x0D
70 #define OPCODE_SET_SKIP_MAP 0x0E
71 #define OPCODE_SET_DECODING_MAP 0x0F
72 #define OPCODE_VIDEO_DATA_10 0x10
73 #define OPCODE_VIDEO_DATA_11 0x11
74 #define OPCODE_UNKNOWN_12 0x12
75 #define OPCODE_UNKNOWN_13 0x13
76 #define OPCODE_UNKNOWN_14 0x14
77 #define OPCODE_UNKNOWN_15 0x15
79 #define PALETTE_COUNT 256
81 typedef struct IPMVEContext {
86 uint64_t frame_pts_inc;
88 unsigned int video_bpp;
89 unsigned int video_width;
90 unsigned int video_height;
92 uint32_t palette[256];
98 unsigned int audio_bits;
99 unsigned int audio_channels;
100 unsigned int audio_sample_rate;
101 enum AVCodecID audio_type;
102 unsigned int audio_frame_count;
104 int video_stream_index;
105 int audio_stream_index;
107 int64_t audio_chunk_offset;
108 int audio_chunk_size;
109 int64_t video_chunk_offset;
110 int video_chunk_size;
111 int64_t skip_map_chunk_offset;
112 int skip_map_chunk_size;
113 int64_t decode_map_chunk_offset;
114 int decode_map_chunk_size;
116 int64_t next_chunk_offset;
120 static int load_ipmovie_packet(IPMVEContext *s, AVIOContext *pb,
125 if (s->audio_chunk_offset && s->audio_channels && s->audio_bits) {
126 if (s->audio_type == AV_CODEC_ID_NONE) {
127 av_log(s->avf, AV_LOG_ERROR, "Can not read audio packet before"
128 "audio codec is known\n");
132 /* adjust for PCM audio by skipping chunk header */
133 if (s->audio_type != AV_CODEC_ID_INTERPLAY_DPCM) {
134 s->audio_chunk_offset += 6;
135 s->audio_chunk_size -= 6;
138 avio_seek(pb, s->audio_chunk_offset, SEEK_SET);
139 s->audio_chunk_offset = 0;
141 if (s->audio_chunk_size != av_get_packet(pb, pkt, s->audio_chunk_size))
144 pkt->stream_index = s->audio_stream_index;
145 pkt->pts = s->audio_frame_count;
147 /* audio frame maintenance */
148 if (s->audio_type != AV_CODEC_ID_INTERPLAY_DPCM)
149 s->audio_frame_count +=
150 (s->audio_chunk_size / s->audio_channels / (s->audio_bits / 8));
152 s->audio_frame_count +=
153 (s->audio_chunk_size - 6 - s->audio_channels) / s->audio_channels;
155 av_log(s->avf, AV_LOG_TRACE, "sending audio frame with pts %"PRId64" (%d audio frames)\n",
156 pkt->pts, s->audio_frame_count);
158 chunk_type = CHUNK_HAVE_PACKET;
160 } else if (s->frame_format) {
162 /* send the frame format, decode map, the video data, skip map, and the send_buffer flag together */
164 if (av_new_packet(pkt, 8 + s->decode_map_chunk_size + s->video_chunk_size + s->skip_map_chunk_size))
167 if (s->has_palette) {
170 pal = av_packet_new_side_data(pkt, AV_PKT_DATA_PALETTE,
173 memcpy(pal, s->palette, AVPALETTE_SIZE);
179 ff_add_param_change(pkt, 0, 0, 0, s->video_width, s->video_height);
183 AV_WL8(pkt->data, s->frame_format);
184 AV_WL8(pkt->data + 1, s->send_buffer);
185 AV_WL16(pkt->data + 2, s->video_chunk_size);
186 AV_WL16(pkt->data + 4, s->decode_map_chunk_size);
187 AV_WL16(pkt->data + 6, s->skip_map_chunk_size);
192 pkt->pos = s->video_chunk_offset;
193 avio_seek(pb, s->video_chunk_offset, SEEK_SET);
194 s->video_chunk_offset = 0;
196 if (avio_read(pb, pkt->data + 8, s->video_chunk_size) !=
197 s->video_chunk_size) {
201 if (s->decode_map_chunk_size) {
202 pkt->pos = s->decode_map_chunk_offset;
203 avio_seek(pb, s->decode_map_chunk_offset, SEEK_SET);
204 s->decode_map_chunk_offset = 0;
206 if (avio_read(pb, pkt->data + 8 + s->video_chunk_size,
207 s->decode_map_chunk_size) != s->decode_map_chunk_size) {
212 if (s->skip_map_chunk_size) {
213 pkt->pos = s->skip_map_chunk_offset;
214 avio_seek(pb, s->skip_map_chunk_offset, SEEK_SET);
215 s->skip_map_chunk_offset = 0;
217 if (avio_read(pb, pkt->data + 8 + s->video_chunk_size + s->decode_map_chunk_size,
218 s->skip_map_chunk_size) != s->skip_map_chunk_size) {
223 s->video_chunk_size = 0;
224 s->decode_map_chunk_size = 0;
225 s->skip_map_chunk_size = 0;
227 pkt->stream_index = s->video_stream_index;
228 pkt->pts = s->video_pts;
230 av_log(s->avf, AV_LOG_TRACE, "sending video frame with pts %"PRId64"\n", pkt->pts);
232 s->video_pts += s->frame_pts_inc;
234 chunk_type = CHUNK_HAVE_PACKET;
238 avio_seek(pb, s->next_chunk_offset, SEEK_SET);
239 chunk_type = CHUNK_DONE;
246 static int init_audio(AVFormatContext *s)
248 IPMVEContext *ipmovie = s->priv_data;
249 AVStream *st = avformat_new_stream(s, NULL);
251 return AVERROR(ENOMEM);
252 avpriv_set_pts_info(st, 32, 1, ipmovie->audio_sample_rate);
253 ipmovie->audio_stream_index = st->index;
254 st->codecpar->codec_type = AVMEDIA_TYPE_AUDIO;
255 st->codecpar->codec_id = ipmovie->audio_type;
256 st->codecpar->codec_tag = 0; /* no tag */
257 st->codecpar->channels = ipmovie->audio_channels;
258 st->codecpar->channel_layout = st->codecpar->channels == 1 ? AV_CH_LAYOUT_MONO :
260 st->codecpar->sample_rate = ipmovie->audio_sample_rate;
261 st->codecpar->bits_per_coded_sample = ipmovie->audio_bits;
262 st->codecpar->bit_rate = st->codecpar->channels * st->codecpar->sample_rate *
263 st->codecpar->bits_per_coded_sample;
264 if (st->codecpar->codec_id == AV_CODEC_ID_INTERPLAY_DPCM)
265 st->codecpar->bit_rate /= 2;
266 st->codecpar->block_align = st->codecpar->channels * st->codecpar->bits_per_coded_sample;
271 /* This function loads and processes a single chunk in an IP movie file.
272 * It returns the type of chunk that was processed. */
273 static int process_ipmovie_chunk(IPMVEContext *s, AVIOContext *pb,
276 unsigned char chunk_preamble[CHUNK_PREAMBLE_SIZE];
279 unsigned char opcode_preamble[OPCODE_PREAMBLE_SIZE];
280 unsigned char opcode_type;
281 unsigned char opcode_version;
283 unsigned char scratch[1024];
285 int first_color, last_color;
287 unsigned char r, g, b;
288 unsigned int width, height;
290 /* see if there are any pending packets */
291 chunk_type = load_ipmovie_packet(s, pb, pkt);
292 if (chunk_type != CHUNK_DONE)
295 /* read the next chunk, wherever the file happens to be pointing */
298 if (avio_read(pb, chunk_preamble, CHUNK_PREAMBLE_SIZE) !=
301 chunk_size = AV_RL16(&chunk_preamble[0]);
302 chunk_type = AV_RL16(&chunk_preamble[2]);
304 av_log(s->avf, AV_LOG_TRACE, "chunk type 0x%04X, 0x%04X bytes: ", chunk_type, chunk_size);
306 switch (chunk_type) {
308 case CHUNK_INIT_AUDIO:
309 av_log(s->avf, AV_LOG_TRACE, "initialize audio\n");
312 case CHUNK_AUDIO_ONLY:
313 av_log(s->avf, AV_LOG_TRACE, "audio only\n");
316 case CHUNK_INIT_VIDEO:
317 av_log(s->avf, AV_LOG_TRACE, "initialize video\n");
321 av_log(s->avf, AV_LOG_TRACE, "video (and audio)\n");
325 av_log(s->avf, AV_LOG_TRACE, "shutdown\n");
329 av_log(s->avf, AV_LOG_TRACE, "end\n");
333 av_log(s->avf, AV_LOG_TRACE, "invalid chunk\n");
334 chunk_type = CHUNK_BAD;
339 while ((chunk_size > 0) && (chunk_type != CHUNK_BAD)) {
341 /* read the next chunk, wherever the file happens to be pointing */
343 chunk_type = CHUNK_EOF;
346 if (avio_read(pb, opcode_preamble, CHUNK_PREAMBLE_SIZE) !=
347 CHUNK_PREAMBLE_SIZE) {
348 chunk_type = CHUNK_BAD;
352 opcode_size = AV_RL16(&opcode_preamble[0]);
353 opcode_type = opcode_preamble[2];
354 opcode_version = opcode_preamble[3];
356 chunk_size -= OPCODE_PREAMBLE_SIZE;
357 chunk_size -= opcode_size;
358 if (chunk_size < 0) {
359 av_log(s->avf, AV_LOG_TRACE, "chunk_size countdown just went negative\n");
360 chunk_type = CHUNK_BAD;
364 av_log(s->avf, AV_LOG_TRACE, " opcode type %02X, version %d, 0x%04X bytes: ",
365 opcode_type, opcode_version, opcode_size);
366 switch (opcode_type) {
368 case OPCODE_END_OF_STREAM:
369 av_log(s->avf, AV_LOG_TRACE, "end of stream\n");
370 avio_skip(pb, opcode_size);
373 case OPCODE_END_OF_CHUNK:
374 av_log(s->avf, AV_LOG_TRACE, "end of chunk\n");
375 avio_skip(pb, opcode_size);
378 case OPCODE_CREATE_TIMER:
379 av_log(s->avf, AV_LOG_TRACE, "create timer\n");
380 if ((opcode_version > 0) || (opcode_size != 6)) {
381 av_log(s->avf, AV_LOG_TRACE, "bad create_timer opcode\n");
382 chunk_type = CHUNK_BAD;
385 if (avio_read(pb, scratch, opcode_size) !=
387 chunk_type = CHUNK_BAD;
390 s->frame_pts_inc = ((uint64_t)AV_RL32(&scratch[0])) * AV_RL16(&scratch[4]);
393 case OPCODE_INIT_AUDIO_BUFFERS:
394 av_log(s->avf, AV_LOG_TRACE, "initialize audio buffers\n");
395 if (opcode_version > 1 || opcode_size > 10 || opcode_size < 6) {
396 av_log(s->avf, AV_LOG_TRACE, "bad init_audio_buffers opcode\n");
397 chunk_type = CHUNK_BAD;
400 if (avio_read(pb, scratch, opcode_size) !=
402 chunk_type = CHUNK_BAD;
405 s->audio_sample_rate = AV_RL16(&scratch[4]);
406 audio_flags = AV_RL16(&scratch[2]);
407 /* bit 0 of the flags: 0 = mono, 1 = stereo */
408 s->audio_channels = (audio_flags & 1) + 1;
409 /* bit 1 of the flags: 0 = 8 bit, 1 = 16 bit */
410 s->audio_bits = (((audio_flags >> 1) & 1) + 1) * 8;
411 /* bit 2 indicates compressed audio in version 1 opcode */
412 if ((opcode_version == 1) && (audio_flags & 0x4))
413 s->audio_type = AV_CODEC_ID_INTERPLAY_DPCM;
414 else if (s->audio_bits == 16)
415 s->audio_type = AV_CODEC_ID_PCM_S16LE;
417 s->audio_type = AV_CODEC_ID_PCM_U8;
418 av_log(s->avf, AV_LOG_TRACE, "audio: %d bits, %d Hz, %s, %s format\n",
419 s->audio_bits, s->audio_sample_rate,
420 (s->audio_channels == 2) ? "stereo" : "mono",
421 (s->audio_type == AV_CODEC_ID_INTERPLAY_DPCM) ?
422 "Interplay audio" : "PCM");
425 case OPCODE_START_STOP_AUDIO:
426 av_log(s->avf, AV_LOG_TRACE, "start/stop audio\n");
427 avio_skip(pb, opcode_size);
430 case OPCODE_INIT_VIDEO_BUFFERS:
431 av_log(s->avf, AV_LOG_TRACE, "initialize video buffers\n");
432 if ((opcode_version > 2) || (opcode_size > 8) || opcode_size < 4
433 || opcode_version == 2 && opcode_size < 8
435 av_log(s->avf, AV_LOG_TRACE, "bad init_video_buffers opcode\n");
436 chunk_type = CHUNK_BAD;
439 if (avio_read(pb, scratch, opcode_size) !=
441 chunk_type = CHUNK_BAD;
444 width = AV_RL16(&scratch[0]) * 8;
445 height = AV_RL16(&scratch[2]) * 8;
446 if (width != s->video_width) {
447 s->video_width = width;
450 if (height != s->video_height) {
451 s->video_height = height;
454 if (opcode_version < 2 || !AV_RL16(&scratch[6])) {
459 av_log(s->avf, AV_LOG_TRACE, "video resolution: %d x %d\n",
460 s->video_width, s->video_height);
463 case OPCODE_UNKNOWN_12:
464 case OPCODE_UNKNOWN_13:
465 case OPCODE_UNKNOWN_14:
466 case OPCODE_UNKNOWN_15:
467 av_log(s->avf, AV_LOG_TRACE, "unknown (but documented) opcode %02X\n", opcode_type);
468 avio_skip(pb, opcode_size);
471 case OPCODE_SEND_BUFFER:
472 av_log(s->avf, AV_LOG_TRACE, "send buffer\n");
473 avio_skip(pb, opcode_size);
477 case OPCODE_AUDIO_FRAME:
478 av_log(s->avf, AV_LOG_TRACE, "audio frame\n");
480 /* log position and move on for now */
481 s->audio_chunk_offset = avio_tell(pb);
482 s->audio_chunk_size = opcode_size;
483 avio_skip(pb, opcode_size);
486 case OPCODE_SILENCE_FRAME:
487 av_log(s->avf, AV_LOG_TRACE, "silence frame\n");
488 avio_skip(pb, opcode_size);
491 case OPCODE_INIT_VIDEO_MODE:
492 av_log(s->avf, AV_LOG_TRACE, "initialize video mode\n");
493 avio_skip(pb, opcode_size);
496 case OPCODE_CREATE_GRADIENT:
497 av_log(s->avf, AV_LOG_TRACE, "create gradient\n");
498 avio_skip(pb, opcode_size);
501 case OPCODE_SET_PALETTE:
502 av_log(s->avf, AV_LOG_TRACE, "set palette\n");
503 /* check for the logical maximum palette size
504 * (3 * 256 + 4 bytes) */
505 if (opcode_size > 0x304 || opcode_size < 4) {
506 av_log(s->avf, AV_LOG_TRACE, "demux_ipmovie: set_palette opcode with invalid size\n");
507 chunk_type = CHUNK_BAD;
510 if (avio_read(pb, scratch, opcode_size) != opcode_size) {
511 chunk_type = CHUNK_BAD;
515 /* load the palette into internal data structure */
516 first_color = AV_RL16(&scratch[0]);
517 last_color = first_color + AV_RL16(&scratch[2]) - 1;
518 /* sanity check (since they are 16 bit values) */
519 if ( (first_color > 0xFF) || (last_color > 0xFF)
520 || (last_color - first_color + 1)*3 + 4 > opcode_size) {
521 av_log(s->avf, AV_LOG_TRACE, "demux_ipmovie: set_palette indexes out of range (%d -> %d)\n",
522 first_color, last_color);
523 chunk_type = CHUNK_BAD;
526 j = 4; /* offset of first palette data */
527 for (i = first_color; i <= last_color; i++) {
528 /* the palette is stored as a 6-bit VGA palette, thus each
529 * component is shifted up to a 8-bit range */
530 r = scratch[j++] * 4;
531 g = scratch[j++] * 4;
532 b = scratch[j++] * 4;
533 s->palette[i] = (0xFFU << 24) | (r << 16) | (g << 8) | (b);
534 s->palette[i] |= s->palette[i] >> 6 & 0x30303;
539 case OPCODE_SET_PALETTE_COMPRESSED:
540 av_log(s->avf, AV_LOG_TRACE, "set palette compressed\n");
541 avio_skip(pb, opcode_size);
544 case OPCODE_SET_SKIP_MAP:
545 av_log(s->avf, AV_LOG_TRACE, "set skip map\n");
547 /* log position and move on for now */
548 s->skip_map_chunk_offset = avio_tell(pb);
549 s->skip_map_chunk_size = opcode_size;
550 avio_skip(pb, opcode_size);
553 case OPCODE_SET_DECODING_MAP:
554 av_log(s->avf, AV_LOG_TRACE, "set decoding map\n");
556 /* log position and move on for now */
557 s->decode_map_chunk_offset = avio_tell(pb);
558 s->decode_map_chunk_size = opcode_size;
559 avio_skip(pb, opcode_size);
562 case OPCODE_VIDEO_DATA_06:
563 case OPCODE_VIDEO_DATA_10:
564 case OPCODE_VIDEO_DATA_11:
565 s->frame_format = opcode_type;
566 av_log(s->avf, AV_LOG_TRACE, "set video data format 0x%02X\n",
569 /* log position and move on for now */
570 s->video_chunk_offset = avio_tell(pb);
571 s->video_chunk_size = opcode_size;
572 avio_skip(pb, opcode_size);
576 av_log(s->avf, AV_LOG_TRACE, "*** unknown opcode type\n");
577 chunk_type = CHUNK_BAD;
583 if (s->avf->nb_streams == 1 && s->audio_type)
586 /* make a note of where the stream is sitting */
587 s->next_chunk_offset = avio_tell(pb);
592 static const char signature[] = "Interplay MVE File\x1A\0\x1A";
594 static int ipmovie_probe(const AVProbeData *p)
596 const uint8_t *b = p->buf;
597 const uint8_t *b_end = p->buf + p->buf_size - sizeof(signature);
599 if (b[0] == signature[0] && memcmp(b, signature, sizeof(signature)) == 0)
600 return AVPROBE_SCORE_MAX;
607 static int ipmovie_read_header(AVFormatContext *s)
609 IPMVEContext *ipmovie = s->priv_data;
610 AVIOContext *pb = s->pb;
612 unsigned char chunk_preamble[CHUNK_PREAMBLE_SIZE];
614 uint8_t signature_buffer[sizeof(signature)];
618 avio_read(pb, signature_buffer, sizeof(signature_buffer));
619 while (memcmp(signature_buffer, signature, sizeof(signature))) {
620 memmove(signature_buffer, signature_buffer + 1, sizeof(signature_buffer) - 1);
621 signature_buffer[sizeof(signature_buffer) - 1] = avio_r8(pb);
626 /* on the first read, this will position the stream at the first chunk */
627 ipmovie->next_chunk_offset = avio_tell(pb) + 4;
629 for (i = 0; i < 256; i++)
630 ipmovie->palette[i] = 0xFFU << 24;
632 /* process the first chunk which should be CHUNK_INIT_VIDEO */
633 if (process_ipmovie_chunk(ipmovie, pb, NULL) != CHUNK_INIT_VIDEO) {
634 return AVERROR_INVALIDDATA;
637 /* peek ahead to the next chunk-- if it is an init audio chunk, process
638 * it; if it is the first video chunk, this is a silent file */
639 if (avio_read(pb, chunk_preamble, CHUNK_PREAMBLE_SIZE) !=
642 chunk_type = AV_RL16(&chunk_preamble[2]);
643 avio_seek(pb, -CHUNK_PREAMBLE_SIZE, SEEK_CUR);
645 if (chunk_type == CHUNK_VIDEO)
646 ipmovie->audio_type = AV_CODEC_ID_NONE; /* no audio */
647 else if (process_ipmovie_chunk(ipmovie, pb, s->internal->parse_pkt) != CHUNK_INIT_AUDIO) {
648 return AVERROR_INVALIDDATA;
651 /* initialize the stream decoders */
652 st = avformat_new_stream(s, NULL);
654 return AVERROR(ENOMEM);
655 avpriv_set_pts_info(st, 63, 1, 1000000);
656 ipmovie->video_stream_index = st->index;
657 st->codecpar->codec_type = AVMEDIA_TYPE_VIDEO;
658 st->codecpar->codec_id = AV_CODEC_ID_INTERPLAY_VIDEO;
659 st->codecpar->codec_tag = 0; /* no fourcc */
660 st->codecpar->width = ipmovie->video_width;
661 st->codecpar->height = ipmovie->video_height;
662 st->codecpar->bits_per_coded_sample = ipmovie->video_bpp;
664 if (ipmovie->audio_type) {
665 return init_audio(s);
667 s->ctx_flags |= AVFMTCTX_NOHEADER;
672 static int ipmovie_read_packet(AVFormatContext *s,
675 IPMVEContext *ipmovie = s->priv_data;
676 AVIOContext *pb = s->pb;
680 ret = process_ipmovie_chunk(ipmovie, pb, pkt);
681 /* dispatch the first of any pending packets */
682 if ((ret == CHUNK_VIDEO) || (ret == CHUNK_AUDIO_ONLY))
683 ret = load_ipmovie_packet(ipmovie, pb, pkt);
685 if (ret == CHUNK_BAD)
686 ret = AVERROR_INVALIDDATA;
687 else if (ret == CHUNK_EOF)
689 else if (ret == CHUNK_NOMEM)
690 ret = AVERROR(ENOMEM);
691 else if (ret == CHUNK_END || ret == CHUNK_SHUTDOWN)
693 else if (ret == CHUNK_HAVE_PACKET)
695 else if (ret == CHUNK_INIT_VIDEO || ret == CHUNK_INIT_AUDIO)
704 const AVInputFormat ff_ipmovie_demuxer = {
706 .long_name = NULL_IF_CONFIG_SMALL("Interplay MVE"),
707 .priv_data_size = sizeof(IPMVEContext),
708 .read_probe = ipmovie_probe,
709 .read_header = ipmovie_read_header,
710 .read_packet = ipmovie_read_packet,