4bd3580bc2dba0bf55869050d5fce539b16fb7e7
[libav.git] / libavformat / ipmovie.c
1 /*
2 * Interplay MVE File Demuxer
3 * Copyright (c) 2003 The ffmpeg Project
4 *
5 * This file is part of Libav.
6 *
7 * Libav 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 * Libav 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 Libav; 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 * 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.
33 */
34
35 #include "libavutil/intreadwrite.h"
36 #include "avformat.h"
37 #include "internal.h"
38
39 #define CHUNK_PREAMBLE_SIZE 4
40 #define OPCODE_PREAMBLE_SIZE 4
41
42 #define CHUNK_INIT_AUDIO 0x0000
43 #define CHUNK_AUDIO_ONLY 0x0001
44 #define CHUNK_INIT_VIDEO 0x0002
45 #define CHUNK_VIDEO 0x0003
46 #define CHUNK_SHUTDOWN 0x0004
47 #define CHUNK_END 0x0005
48 /* these last types are used internally */
49 #define CHUNK_DONE 0xFFFC
50 #define CHUNK_NOMEM 0xFFFD
51 #define CHUNK_EOF 0xFFFE
52 #define CHUNK_BAD 0xFFFF
53
54 #define OPCODE_END_OF_STREAM 0x00
55 #define OPCODE_END_OF_CHUNK 0x01
56 #define OPCODE_CREATE_TIMER 0x02
57 #define OPCODE_INIT_AUDIO_BUFFERS 0x03
58 #define OPCODE_START_STOP_AUDIO 0x04
59 #define OPCODE_INIT_VIDEO_BUFFERS 0x05
60 #define OPCODE_UNKNOWN_06 0x06
61 #define OPCODE_SEND_BUFFER 0x07
62 #define OPCODE_AUDIO_FRAME 0x08
63 #define OPCODE_SILENCE_FRAME 0x09
64 #define OPCODE_INIT_VIDEO_MODE 0x0A
65 #define OPCODE_CREATE_GRADIENT 0x0B
66 #define OPCODE_SET_PALETTE 0x0C
67 #define OPCODE_SET_PALETTE_COMPRESSED 0x0D
68 #define OPCODE_UNKNOWN_0E 0x0E
69 #define OPCODE_SET_DECODING_MAP 0x0F
70 #define OPCODE_UNKNOWN_10 0x10
71 #define OPCODE_VIDEO_DATA 0x11
72 #define OPCODE_UNKNOWN_12 0x12
73 #define OPCODE_UNKNOWN_13 0x13
74 #define OPCODE_UNKNOWN_14 0x14
75 #define OPCODE_UNKNOWN_15 0x15
76
77 #define PALETTE_COUNT 256
78
79 typedef struct IPMVEContext {
80
81 unsigned char *buf;
82 int buf_size;
83
84 uint64_t frame_pts_inc;
85
86 unsigned int video_bpp;
87 unsigned int video_width;
88 unsigned int video_height;
89 int64_t video_pts;
90 uint32_t palette[256];
91 int has_palette;
92
93 unsigned int audio_bits;
94 unsigned int audio_channels;
95 unsigned int audio_sample_rate;
96 enum CodecID audio_type;
97 unsigned int audio_frame_count;
98
99 int video_stream_index;
100 int audio_stream_index;
101
102 int64_t audio_chunk_offset;
103 int audio_chunk_size;
104 int64_t video_chunk_offset;
105 int video_chunk_size;
106 int64_t decode_map_chunk_offset;
107 int decode_map_chunk_size;
108
109 int64_t next_chunk_offset;
110
111 } IPMVEContext;
112
113 static int load_ipmovie_packet(IPMVEContext *s, AVIOContext *pb,
114 AVPacket *pkt) {
115
116 int chunk_type;
117
118 if (s->audio_chunk_offset) {
119
120 /* adjust for PCM audio by skipping chunk header */
121 if (s->audio_type != CODEC_ID_INTERPLAY_DPCM) {
122 s->audio_chunk_offset += 6;
123 s->audio_chunk_size -= 6;
124 }
125
126 avio_seek(pb, s->audio_chunk_offset, SEEK_SET);
127 s->audio_chunk_offset = 0;
128
129 if (s->audio_chunk_size != av_get_packet(pb, pkt, s->audio_chunk_size))
130 return CHUNK_EOF;
131
132 pkt->stream_index = s->audio_stream_index;
133 pkt->pts = s->audio_frame_count;
134
135 /* audio frame maintenance */
136 if (s->audio_type != CODEC_ID_INTERPLAY_DPCM)
137 s->audio_frame_count +=
138 (s->audio_chunk_size / s->audio_channels / (s->audio_bits / 8));
139 else
140 s->audio_frame_count +=
141 (s->audio_chunk_size - 6) / s->audio_channels;
142
143 av_dlog(NULL, "sending audio frame with pts %"PRId64" (%d audio frames)\n",
144 pkt->pts, s->audio_frame_count);
145
146 chunk_type = CHUNK_VIDEO;
147
148 } else if (s->decode_map_chunk_offset) {
149
150 /* send both the decode map and the video data together */
151
152 if (av_new_packet(pkt, s->decode_map_chunk_size + s->video_chunk_size))
153 return CHUNK_NOMEM;
154
155 if (s->has_palette) {
156 uint8_t *pal;
157
158 pal = av_packet_new_side_data(pkt, AV_PKT_DATA_PALETTE,
159 AVPALETTE_SIZE);
160 if (pal) {
161 memcpy(pal, s->palette, AVPALETTE_SIZE);
162 s->has_palette = 0;
163 }
164 }
165
166 pkt->pos= s->decode_map_chunk_offset;
167 avio_seek(pb, s->decode_map_chunk_offset, SEEK_SET);
168 s->decode_map_chunk_offset = 0;
169
170 if (avio_read(pb, pkt->data, s->decode_map_chunk_size) !=
171 s->decode_map_chunk_size) {
172 av_free_packet(pkt);
173 return CHUNK_EOF;
174 }
175
176 avio_seek(pb, s->video_chunk_offset, SEEK_SET);
177 s->video_chunk_offset = 0;
178
179 if (avio_read(pb, pkt->data + s->decode_map_chunk_size,
180 s->video_chunk_size) != s->video_chunk_size) {
181 av_free_packet(pkt);
182 return CHUNK_EOF;
183 }
184
185 pkt->stream_index = s->video_stream_index;
186 pkt->pts = s->video_pts;
187
188 av_dlog(NULL, "sending video frame with pts %"PRId64"\n", pkt->pts);
189
190 s->video_pts += s->frame_pts_inc;
191
192 chunk_type = CHUNK_VIDEO;
193
194 } else {
195
196 avio_seek(pb, s->next_chunk_offset, SEEK_SET);
197 chunk_type = CHUNK_DONE;
198
199 }
200
201 return chunk_type;
202 }
203
204 /* This function loads and processes a single chunk in an IP movie file.
205 * It returns the type of chunk that was processed. */
206 static int process_ipmovie_chunk(IPMVEContext *s, AVIOContext *pb,
207 AVPacket *pkt)
208 {
209 unsigned char chunk_preamble[CHUNK_PREAMBLE_SIZE];
210 int chunk_type;
211 int chunk_size;
212 unsigned char opcode_preamble[OPCODE_PREAMBLE_SIZE];
213 unsigned char opcode_type;
214 unsigned char opcode_version;
215 int opcode_size;
216 unsigned char scratch[1024];
217 int i, j;
218 int first_color, last_color;
219 int audio_flags;
220 unsigned char r, g, b;
221
222 /* see if there are any pending packets */
223 chunk_type = load_ipmovie_packet(s, pb, pkt);
224 if (chunk_type != CHUNK_DONE)
225 return chunk_type;
226
227 /* read the next chunk, wherever the file happens to be pointing */
228 if (pb->eof_reached)
229 return CHUNK_EOF;
230 if (avio_read(pb, chunk_preamble, CHUNK_PREAMBLE_SIZE) !=
231 CHUNK_PREAMBLE_SIZE)
232 return CHUNK_BAD;
233 chunk_size = AV_RL16(&chunk_preamble[0]);
234 chunk_type = AV_RL16(&chunk_preamble[2]);
235
236 av_dlog(NULL, "chunk type 0x%04X, 0x%04X bytes: ", chunk_type, chunk_size);
237
238 switch (chunk_type) {
239
240 case CHUNK_INIT_AUDIO:
241 av_dlog(NULL, "initialize audio\n");
242 break;
243
244 case CHUNK_AUDIO_ONLY:
245 av_dlog(NULL, "audio only\n");
246 break;
247
248 case CHUNK_INIT_VIDEO:
249 av_dlog(NULL, "initialize video\n");
250 break;
251
252 case CHUNK_VIDEO:
253 av_dlog(NULL, "video (and audio)\n");
254 break;
255
256 case CHUNK_SHUTDOWN:
257 av_dlog(NULL, "shutdown\n");
258 break;
259
260 case CHUNK_END:
261 av_dlog(NULL, "end\n");
262 break;
263
264 default:
265 av_dlog(NULL, "invalid chunk\n");
266 chunk_type = CHUNK_BAD;
267 break;
268
269 }
270
271 while ((chunk_size > 0) && (chunk_type != CHUNK_BAD)) {
272
273 /* read the next chunk, wherever the file happens to be pointing */
274 if (pb->eof_reached) {
275 chunk_type = CHUNK_EOF;
276 break;
277 }
278 if (avio_read(pb, opcode_preamble, CHUNK_PREAMBLE_SIZE) !=
279 CHUNK_PREAMBLE_SIZE) {
280 chunk_type = CHUNK_BAD;
281 break;
282 }
283
284 opcode_size = AV_RL16(&opcode_preamble[0]);
285 opcode_type = opcode_preamble[2];
286 opcode_version = opcode_preamble[3];
287
288 chunk_size -= OPCODE_PREAMBLE_SIZE;
289 chunk_size -= opcode_size;
290 if (chunk_size < 0) {
291 av_dlog(NULL, "chunk_size countdown just went negative\n");
292 chunk_type = CHUNK_BAD;
293 break;
294 }
295
296 av_dlog(NULL, " opcode type %02X, version %d, 0x%04X bytes: ",
297 opcode_type, opcode_version, opcode_size);
298 switch (opcode_type) {
299
300 case OPCODE_END_OF_STREAM:
301 av_dlog(NULL, "end of stream\n");
302 avio_skip(pb, opcode_size);
303 break;
304
305 case OPCODE_END_OF_CHUNK:
306 av_dlog(NULL, "end of chunk\n");
307 avio_skip(pb, opcode_size);
308 break;
309
310 case OPCODE_CREATE_TIMER:
311 av_dlog(NULL, "create timer\n");
312 if ((opcode_version > 0) || (opcode_size > 6)) {
313 av_dlog(NULL, "bad create_timer opcode\n");
314 chunk_type = CHUNK_BAD;
315 break;
316 }
317 if (avio_read(pb, scratch, opcode_size) !=
318 opcode_size) {
319 chunk_type = CHUNK_BAD;
320 break;
321 }
322 s->frame_pts_inc = ((uint64_t)AV_RL32(&scratch[0])) * AV_RL16(&scratch[4]);
323 av_dlog(NULL, " %.2f frames/second (timer div = %d, subdiv = %d)\n",
324 1000000.0 / s->frame_pts_inc, AV_RL32(&scratch[0]),
325 AV_RL16(&scratch[4]));
326 break;
327
328 case OPCODE_INIT_AUDIO_BUFFERS:
329 av_dlog(NULL, "initialize audio buffers\n");
330 if ((opcode_version > 1) || (opcode_size > 10)) {
331 av_dlog(NULL, "bad init_audio_buffers opcode\n");
332 chunk_type = CHUNK_BAD;
333 break;
334 }
335 if (avio_read(pb, scratch, opcode_size) !=
336 opcode_size) {
337 chunk_type = CHUNK_BAD;
338 break;
339 }
340 s->audio_sample_rate = AV_RL16(&scratch[4]);
341 audio_flags = AV_RL16(&scratch[2]);
342 /* bit 0 of the flags: 0 = mono, 1 = stereo */
343 s->audio_channels = (audio_flags & 1) + 1;
344 /* bit 1 of the flags: 0 = 8 bit, 1 = 16 bit */
345 s->audio_bits = (((audio_flags >> 1) & 1) + 1) * 8;
346 /* bit 2 indicates compressed audio in version 1 opcode */
347 if ((opcode_version == 1) && (audio_flags & 0x4))
348 s->audio_type = CODEC_ID_INTERPLAY_DPCM;
349 else if (s->audio_bits == 16)
350 s->audio_type = CODEC_ID_PCM_S16LE;
351 else
352 s->audio_type = CODEC_ID_PCM_U8;
353 av_dlog(NULL, "audio: %d bits, %d Hz, %s, %s format\n",
354 s->audio_bits, s->audio_sample_rate,
355 (s->audio_channels == 2) ? "stereo" : "mono",
356 (s->audio_type == CODEC_ID_INTERPLAY_DPCM) ?
357 "Interplay audio" : "PCM");
358 break;
359
360 case OPCODE_START_STOP_AUDIO:
361 av_dlog(NULL, "start/stop audio\n");
362 avio_skip(pb, opcode_size);
363 break;
364
365 case OPCODE_INIT_VIDEO_BUFFERS:
366 av_dlog(NULL, "initialize video buffers\n");
367 if ((opcode_version > 2) || (opcode_size > 8)) {
368 av_dlog(NULL, "bad init_video_buffers opcode\n");
369 chunk_type = CHUNK_BAD;
370 break;
371 }
372 if (avio_read(pb, scratch, opcode_size) !=
373 opcode_size) {
374 chunk_type = CHUNK_BAD;
375 break;
376 }
377 s->video_width = AV_RL16(&scratch[0]) * 8;
378 s->video_height = AV_RL16(&scratch[2]) * 8;
379 if (opcode_version < 2 || !AV_RL16(&scratch[6])) {
380 s->video_bpp = 8;
381 } else {
382 s->video_bpp = 16;
383 }
384 av_dlog(NULL, "video resolution: %d x %d\n",
385 s->video_width, s->video_height);
386 break;
387
388 case OPCODE_UNKNOWN_06:
389 case OPCODE_UNKNOWN_0E:
390 case OPCODE_UNKNOWN_10:
391 case OPCODE_UNKNOWN_12:
392 case OPCODE_UNKNOWN_13:
393 case OPCODE_UNKNOWN_14:
394 case OPCODE_UNKNOWN_15:
395 av_dlog(NULL, "unknown (but documented) opcode %02X\n", opcode_type);
396 avio_skip(pb, opcode_size);
397 break;
398
399 case OPCODE_SEND_BUFFER:
400 av_dlog(NULL, "send buffer\n");
401 avio_skip(pb, opcode_size);
402 break;
403
404 case OPCODE_AUDIO_FRAME:
405 av_dlog(NULL, "audio frame\n");
406
407 /* log position and move on for now */
408 s->audio_chunk_offset = avio_tell(pb);
409 s->audio_chunk_size = opcode_size;
410 avio_skip(pb, opcode_size);
411 break;
412
413 case OPCODE_SILENCE_FRAME:
414 av_dlog(NULL, "silence frame\n");
415 avio_skip(pb, opcode_size);
416 break;
417
418 case OPCODE_INIT_VIDEO_MODE:
419 av_dlog(NULL, "initialize video mode\n");
420 avio_skip(pb, opcode_size);
421 break;
422
423 case OPCODE_CREATE_GRADIENT:
424 av_dlog(NULL, "create gradient\n");
425 avio_skip(pb, opcode_size);
426 break;
427
428 case OPCODE_SET_PALETTE:
429 av_dlog(NULL, "set palette\n");
430 /* check for the logical maximum palette size
431 * (3 * 256 + 4 bytes) */
432 if (opcode_size > 0x304) {
433 av_dlog(NULL, "demux_ipmovie: set_palette opcode too large\n");
434 chunk_type = CHUNK_BAD;
435 break;
436 }
437 if (avio_read(pb, scratch, opcode_size) != opcode_size) {
438 chunk_type = CHUNK_BAD;
439 break;
440 }
441
442 /* load the palette into internal data structure */
443 first_color = AV_RL16(&scratch[0]);
444 last_color = first_color + AV_RL16(&scratch[2]) - 1;
445 /* sanity check (since they are 16 bit values) */
446 if ((first_color > 0xFF) || (last_color > 0xFF)) {
447 av_dlog(NULL, "demux_ipmovie: set_palette indexes out of range (%d -> %d)\n",
448 first_color, last_color);
449 chunk_type = CHUNK_BAD;
450 break;
451 }
452 j = 4; /* offset of first palette data */
453 for (i = first_color; i <= last_color; i++) {
454 /* the palette is stored as a 6-bit VGA palette, thus each
455 * component is shifted up to a 8-bit range */
456 r = scratch[j++] * 4;
457 g = scratch[j++] * 4;
458 b = scratch[j++] * 4;
459 s->palette[i] = (r << 16) | (g << 8) | (b);
460 }
461 s->has_palette = 1;
462 break;
463
464 case OPCODE_SET_PALETTE_COMPRESSED:
465 av_dlog(NULL, "set palette compressed\n");
466 avio_skip(pb, opcode_size);
467 break;
468
469 case OPCODE_SET_DECODING_MAP:
470 av_dlog(NULL, "set decoding map\n");
471
472 /* log position and move on for now */
473 s->decode_map_chunk_offset = avio_tell(pb);
474 s->decode_map_chunk_size = opcode_size;
475 avio_skip(pb, opcode_size);
476 break;
477
478 case OPCODE_VIDEO_DATA:
479 av_dlog(NULL, "set video data\n");
480
481 /* log position and move on for now */
482 s->video_chunk_offset = avio_tell(pb);
483 s->video_chunk_size = opcode_size;
484 avio_skip(pb, opcode_size);
485 break;
486
487 default:
488 av_dlog(NULL, "*** unknown opcode type\n");
489 chunk_type = CHUNK_BAD;
490 break;
491
492 }
493 }
494
495 /* make a note of where the stream is sitting */
496 s->next_chunk_offset = avio_tell(pb);
497
498 /* dispatch the first of any pending packets */
499 if ((chunk_type == CHUNK_VIDEO) || (chunk_type == CHUNK_AUDIO_ONLY))
500 chunk_type = load_ipmovie_packet(s, pb, pkt);
501
502 return chunk_type;
503 }
504
505 static const char signature[] = "Interplay MVE File\x1A\0\x1A";
506
507 static int ipmovie_probe(AVProbeData *p)
508 {
509 uint8_t *b = p->buf;
510 uint8_t *b_end = p->buf + p->buf_size - sizeof(signature);
511 do {
512 if (memcmp(b++, signature, sizeof(signature)) == 0)
513 return AVPROBE_SCORE_MAX;
514 } while (b < b_end);
515
516 return 0;
517 }
518
519 static int ipmovie_read_header(AVFormatContext *s,
520 AVFormatParameters *ap)
521 {
522 IPMVEContext *ipmovie = s->priv_data;
523 AVIOContext *pb = s->pb;
524 AVPacket pkt;
525 AVStream *st;
526 unsigned char chunk_preamble[CHUNK_PREAMBLE_SIZE];
527 int chunk_type;
528 uint8_t signature_buffer[sizeof(signature)];
529
530 avio_read(pb, signature_buffer, sizeof(signature_buffer));
531 while (memcmp(signature_buffer, signature, sizeof(signature))) {
532 memmove(signature_buffer, signature_buffer + 1, sizeof(signature_buffer) - 1);
533 signature_buffer[sizeof(signature_buffer) - 1] = avio_r8(pb);
534 if (pb->eof_reached)
535 return AVERROR_EOF;
536 }
537 /* initialize private context members */
538 ipmovie->video_pts = ipmovie->audio_frame_count = 0;
539 ipmovie->audio_chunk_offset = ipmovie->video_chunk_offset =
540 ipmovie->decode_map_chunk_offset = 0;
541
542 /* on the first read, this will position the stream at the first chunk */
543 ipmovie->next_chunk_offset = avio_tell(pb) + 4;
544
545 /* process the first chunk which should be CHUNK_INIT_VIDEO */
546 if (process_ipmovie_chunk(ipmovie, pb, &pkt) != CHUNK_INIT_VIDEO)
547 return AVERROR_INVALIDDATA;
548
549 /* peek ahead to the next chunk-- if it is an init audio chunk, process
550 * it; if it is the first video chunk, this is a silent file */
551 if (avio_read(pb, chunk_preamble, CHUNK_PREAMBLE_SIZE) !=
552 CHUNK_PREAMBLE_SIZE)
553 return AVERROR(EIO);
554 chunk_type = AV_RL16(&chunk_preamble[2]);
555 avio_seek(pb, -CHUNK_PREAMBLE_SIZE, SEEK_CUR);
556
557 if (chunk_type == CHUNK_VIDEO)
558 ipmovie->audio_type = CODEC_ID_NONE; /* no audio */
559 else if (process_ipmovie_chunk(ipmovie, pb, &pkt) != CHUNK_INIT_AUDIO)
560 return AVERROR_INVALIDDATA;
561
562 /* initialize the stream decoders */
563 st = avformat_new_stream(s, NULL);
564 if (!st)
565 return AVERROR(ENOMEM);
566 avpriv_set_pts_info(st, 63, 1, 1000000);
567 ipmovie->video_stream_index = st->index;
568 st->codec->codec_type = AVMEDIA_TYPE_VIDEO;
569 st->codec->codec_id = CODEC_ID_INTERPLAY_VIDEO;
570 st->codec->codec_tag = 0; /* no fourcc */
571 st->codec->width = ipmovie->video_width;
572 st->codec->height = ipmovie->video_height;
573 st->codec->bits_per_coded_sample = ipmovie->video_bpp;
574
575 if (ipmovie->audio_type) {
576 st = avformat_new_stream(s, NULL);
577 if (!st)
578 return AVERROR(ENOMEM);
579 avpriv_set_pts_info(st, 32, 1, ipmovie->audio_sample_rate);
580 ipmovie->audio_stream_index = st->index;
581 st->codec->codec_type = AVMEDIA_TYPE_AUDIO;
582 st->codec->codec_id = ipmovie->audio_type;
583 st->codec->codec_tag = 0; /* no tag */
584 st->codec->channels = ipmovie->audio_channels;
585 st->codec->sample_rate = ipmovie->audio_sample_rate;
586 st->codec->bits_per_coded_sample = ipmovie->audio_bits;
587 st->codec->bit_rate = st->codec->channels * st->codec->sample_rate *
588 st->codec->bits_per_coded_sample;
589 if (st->codec->codec_id == CODEC_ID_INTERPLAY_DPCM)
590 st->codec->bit_rate /= 2;
591 st->codec->block_align = st->codec->channels * st->codec->bits_per_coded_sample;
592 }
593
594 return 0;
595 }
596
597 static int ipmovie_read_packet(AVFormatContext *s,
598 AVPacket *pkt)
599 {
600 IPMVEContext *ipmovie = s->priv_data;
601 AVIOContext *pb = s->pb;
602 int ret;
603
604 ret = process_ipmovie_chunk(ipmovie, pb, pkt);
605 if (ret == CHUNK_BAD)
606 ret = AVERROR_INVALIDDATA;
607 else if (ret == CHUNK_EOF)
608 ret = AVERROR(EIO);
609 else if (ret == CHUNK_NOMEM)
610 ret = AVERROR(ENOMEM);
611 else if (ret == CHUNK_VIDEO)
612 ret = 0;
613 else
614 ret = -1;
615
616 return ret;
617 }
618
619 AVInputFormat ff_ipmovie_demuxer = {
620 .name = "ipmovie",
621 .long_name = NULL_IF_CONFIG_SMALL("Interplay MVE format"),
622 .priv_data_size = sizeof(IPMVEContext),
623 .read_probe = ipmovie_probe,
624 .read_header = ipmovie_read_header,
625 .read_packet = ipmovie_read_packet,
626 };