annotate c93.c @ 2023:a3e79d6e4e3c libavformat

add an enum for need_parsing
author aurel
date Sun, 15 Apr 2007 13:51:57 +0000
parents 1a3c9056982a
children 06083249909c
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
1987
1d9048ba2ce3 Interplay C93 demuxer and video decoder
diego
parents:
diff changeset
1 /*
1d9048ba2ce3 Interplay C93 demuxer and video decoder
diego
parents:
diff changeset
2 * Interplay C93 demuxer
1d9048ba2ce3 Interplay C93 demuxer and video decoder
diego
parents:
diff changeset
3 * Copyright (c) 2007 Anssi Hannula <anssi.hannula@gmail.com>
1d9048ba2ce3 Interplay C93 demuxer and video decoder
diego
parents:
diff changeset
4 *
1d9048ba2ce3 Interplay C93 demuxer and video decoder
diego
parents:
diff changeset
5 * This file is part of FFmpeg.
1d9048ba2ce3 Interplay C93 demuxer and video decoder
diego
parents:
diff changeset
6 *
1d9048ba2ce3 Interplay C93 demuxer and video decoder
diego
parents:
diff changeset
7 * FFmpeg is free software; you can redistribute it and/or
1d9048ba2ce3 Interplay C93 demuxer and video decoder
diego
parents:
diff changeset
8 * modify it under the terms of the GNU Lesser General Public
1d9048ba2ce3 Interplay C93 demuxer and video decoder
diego
parents:
diff changeset
9 * License as published by the Free Software Foundation; either
1d9048ba2ce3 Interplay C93 demuxer and video decoder
diego
parents:
diff changeset
10 * version 2.1 of the License, or (at your option) any later version.
1d9048ba2ce3 Interplay C93 demuxer and video decoder
diego
parents:
diff changeset
11 *
1d9048ba2ce3 Interplay C93 demuxer and video decoder
diego
parents:
diff changeset
12 * FFmpeg is distributed in the hope that it will be useful,
1d9048ba2ce3 Interplay C93 demuxer and video decoder
diego
parents:
diff changeset
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
1d9048ba2ce3 Interplay C93 demuxer and video decoder
diego
parents:
diff changeset
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
1d9048ba2ce3 Interplay C93 demuxer and video decoder
diego
parents:
diff changeset
15 * Lesser General Public License for more details.
1d9048ba2ce3 Interplay C93 demuxer and video decoder
diego
parents:
diff changeset
16 *
1d9048ba2ce3 Interplay C93 demuxer and video decoder
diego
parents:
diff changeset
17 * You should have received a copy of the GNU Lesser General Public
1d9048ba2ce3 Interplay C93 demuxer and video decoder
diego
parents:
diff changeset
18 * License along with FFmpeg; if not, write to the Free Software
1d9048ba2ce3 Interplay C93 demuxer and video decoder
diego
parents:
diff changeset
19 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
1d9048ba2ce3 Interplay C93 demuxer and video decoder
diego
parents:
diff changeset
20 * MA 02110-1301 USA
1d9048ba2ce3 Interplay C93 demuxer and video decoder
diego
parents:
diff changeset
21 */
1d9048ba2ce3 Interplay C93 demuxer and video decoder
diego
parents:
diff changeset
22
1d9048ba2ce3 Interplay C93 demuxer and video decoder
diego
parents:
diff changeset
23 #include "avformat.h"
1d9048ba2ce3 Interplay C93 demuxer and video decoder
diego
parents:
diff changeset
24 #include "voc.h"
1d9048ba2ce3 Interplay C93 demuxer and video decoder
diego
parents:
diff changeset
25
1d9048ba2ce3 Interplay C93 demuxer and video decoder
diego
parents:
diff changeset
26 typedef struct {
1d9048ba2ce3 Interplay C93 demuxer and video decoder
diego
parents:
diff changeset
27 uint16_t index;
1d9048ba2ce3 Interplay C93 demuxer and video decoder
diego
parents:
diff changeset
28 uint8_t length;
1d9048ba2ce3 Interplay C93 demuxer and video decoder
diego
parents:
diff changeset
29 uint8_t frames;
1d9048ba2ce3 Interplay C93 demuxer and video decoder
diego
parents:
diff changeset
30 } C93BlockRecord;
1d9048ba2ce3 Interplay C93 demuxer and video decoder
diego
parents:
diff changeset
31
1d9048ba2ce3 Interplay C93 demuxer and video decoder
diego
parents:
diff changeset
32 typedef struct {
1d9048ba2ce3 Interplay C93 demuxer and video decoder
diego
parents:
diff changeset
33 voc_dec_context_t voc;
1d9048ba2ce3 Interplay C93 demuxer and video decoder
diego
parents:
diff changeset
34
1d9048ba2ce3 Interplay C93 demuxer and video decoder
diego
parents:
diff changeset
35 C93BlockRecord block_records[512];
1d9048ba2ce3 Interplay C93 demuxer and video decoder
diego
parents:
diff changeset
36 int current_block;
1d9048ba2ce3 Interplay C93 demuxer and video decoder
diego
parents:
diff changeset
37
1d9048ba2ce3 Interplay C93 demuxer and video decoder
diego
parents:
diff changeset
38 uint32_t frame_offsets[32];
1d9048ba2ce3 Interplay C93 demuxer and video decoder
diego
parents:
diff changeset
39 int current_frame;
1d9048ba2ce3 Interplay C93 demuxer and video decoder
diego
parents:
diff changeset
40 int next_pkt_is_audio;
1d9048ba2ce3 Interplay C93 demuxer and video decoder
diego
parents:
diff changeset
41
1d9048ba2ce3 Interplay C93 demuxer and video decoder
diego
parents:
diff changeset
42 AVStream *audio;
1d9048ba2ce3 Interplay C93 demuxer and video decoder
diego
parents:
diff changeset
43 } C93DemuxContext;
1d9048ba2ce3 Interplay C93 demuxer and video decoder
diego
parents:
diff changeset
44
2000
ce51095f383b also remove c93_ prefix for static function in the c93 demuxer
michael
parents: 1987
diff changeset
45 static int probe(AVProbeData *p)
1987
1d9048ba2ce3 Interplay C93 demuxer and video decoder
diego
parents:
diff changeset
46 {
1d9048ba2ce3 Interplay C93 demuxer and video decoder
diego
parents:
diff changeset
47 if (p->buf[0] == 0x01 && p->buf[1] == 0x00 &&
1d9048ba2ce3 Interplay C93 demuxer and video decoder
diego
parents:
diff changeset
48 p->buf[4] == 0x01 + p->buf[2] &&
1d9048ba2ce3 Interplay C93 demuxer and video decoder
diego
parents:
diff changeset
49 p->buf[8] == p->buf[4] + p->buf[6] &&
1d9048ba2ce3 Interplay C93 demuxer and video decoder
diego
parents:
diff changeset
50 p->buf[12] == p->buf[8] + p->buf[10])
1d9048ba2ce3 Interplay C93 demuxer and video decoder
diego
parents:
diff changeset
51 return AVPROBE_SCORE_MAX;
1d9048ba2ce3 Interplay C93 demuxer and video decoder
diego
parents:
diff changeset
52
1d9048ba2ce3 Interplay C93 demuxer and video decoder
diego
parents:
diff changeset
53 return 0;
1d9048ba2ce3 Interplay C93 demuxer and video decoder
diego
parents:
diff changeset
54 }
1d9048ba2ce3 Interplay C93 demuxer and video decoder
diego
parents:
diff changeset
55
2000
ce51095f383b also remove c93_ prefix for static function in the c93 demuxer
michael
parents: 1987
diff changeset
56 static int read_header(AVFormatContext *s,
1987
1d9048ba2ce3 Interplay C93 demuxer and video decoder
diego
parents:
diff changeset
57 AVFormatParameters *ap)
1d9048ba2ce3 Interplay C93 demuxer and video decoder
diego
parents:
diff changeset
58 {
1d9048ba2ce3 Interplay C93 demuxer and video decoder
diego
parents:
diff changeset
59 AVStream *video;
1d9048ba2ce3 Interplay C93 demuxer and video decoder
diego
parents:
diff changeset
60 ByteIOContext *pb = &s->pb;
1d9048ba2ce3 Interplay C93 demuxer and video decoder
diego
parents:
diff changeset
61 C93DemuxContext *c93 = s->priv_data;
1d9048ba2ce3 Interplay C93 demuxer and video decoder
diego
parents:
diff changeset
62 int i;
1d9048ba2ce3 Interplay C93 demuxer and video decoder
diego
parents:
diff changeset
63 int framecount = 0;
1d9048ba2ce3 Interplay C93 demuxer and video decoder
diego
parents:
diff changeset
64
1d9048ba2ce3 Interplay C93 demuxer and video decoder
diego
parents:
diff changeset
65 for (i = 0; i < 512; i++) {
1d9048ba2ce3 Interplay C93 demuxer and video decoder
diego
parents:
diff changeset
66 c93->block_records[i].index = get_le16(pb);
1d9048ba2ce3 Interplay C93 demuxer and video decoder
diego
parents:
diff changeset
67 c93->block_records[i].length = get_byte(pb);
1d9048ba2ce3 Interplay C93 demuxer and video decoder
diego
parents:
diff changeset
68 c93->block_records[i].frames = get_byte(pb);
1d9048ba2ce3 Interplay C93 demuxer and video decoder
diego
parents:
diff changeset
69 if (c93->block_records[i].frames > 32) {
1d9048ba2ce3 Interplay C93 demuxer and video decoder
diego
parents:
diff changeset
70 av_log(s, AV_LOG_ERROR, "too many frames in block\n");
1d9048ba2ce3 Interplay C93 demuxer and video decoder
diego
parents:
diff changeset
71 return AVERROR_INVALIDDATA;
1d9048ba2ce3 Interplay C93 demuxer and video decoder
diego
parents:
diff changeset
72 }
1d9048ba2ce3 Interplay C93 demuxer and video decoder
diego
parents:
diff changeset
73 framecount += c93->block_records[i].frames;
1d9048ba2ce3 Interplay C93 demuxer and video decoder
diego
parents:
diff changeset
74 }
1d9048ba2ce3 Interplay C93 demuxer and video decoder
diego
parents:
diff changeset
75
1d9048ba2ce3 Interplay C93 demuxer and video decoder
diego
parents:
diff changeset
76 /* Audio streams are added if audio packets are found */
1d9048ba2ce3 Interplay C93 demuxer and video decoder
diego
parents:
diff changeset
77 s->ctx_flags |= AVFMTCTX_NOHEADER;
1d9048ba2ce3 Interplay C93 demuxer and video decoder
diego
parents:
diff changeset
78
1d9048ba2ce3 Interplay C93 demuxer and video decoder
diego
parents:
diff changeset
79 video = av_new_stream(s, 0);
1d9048ba2ce3 Interplay C93 demuxer and video decoder
diego
parents:
diff changeset
80 if (!video)
1d9048ba2ce3 Interplay C93 demuxer and video decoder
diego
parents:
diff changeset
81 return AVERROR_NOMEM;
1d9048ba2ce3 Interplay C93 demuxer and video decoder
diego
parents:
diff changeset
82
1d9048ba2ce3 Interplay C93 demuxer and video decoder
diego
parents:
diff changeset
83 video->codec->codec_type = CODEC_TYPE_VIDEO;
1d9048ba2ce3 Interplay C93 demuxer and video decoder
diego
parents:
diff changeset
84 video->codec->codec_id = CODEC_ID_C93;
1d9048ba2ce3 Interplay C93 demuxer and video decoder
diego
parents:
diff changeset
85 video->codec->width = 320;
1d9048ba2ce3 Interplay C93 demuxer and video decoder
diego
parents:
diff changeset
86 video->codec->height = 192;
1d9048ba2ce3 Interplay C93 demuxer and video decoder
diego
parents:
diff changeset
87 /* 4:3 320x200 with 8 empty lines */
1d9048ba2ce3 Interplay C93 demuxer and video decoder
diego
parents:
diff changeset
88 video->codec->sample_aspect_ratio = (AVRational) { 5, 6 };
1d9048ba2ce3 Interplay C93 demuxer and video decoder
diego
parents:
diff changeset
89 video->time_base = (AVRational) { 2, 25 };
1d9048ba2ce3 Interplay C93 demuxer and video decoder
diego
parents:
diff changeset
90 video->nb_frames = framecount;
1d9048ba2ce3 Interplay C93 demuxer and video decoder
diego
parents:
diff changeset
91 video->duration = framecount;
1d9048ba2ce3 Interplay C93 demuxer and video decoder
diego
parents:
diff changeset
92 video->start_time = 0;
1d9048ba2ce3 Interplay C93 demuxer and video decoder
diego
parents:
diff changeset
93
1d9048ba2ce3 Interplay C93 demuxer and video decoder
diego
parents:
diff changeset
94 c93->current_block = 0;
1d9048ba2ce3 Interplay C93 demuxer and video decoder
diego
parents:
diff changeset
95 c93->current_frame = 0;
1d9048ba2ce3 Interplay C93 demuxer and video decoder
diego
parents:
diff changeset
96 c93->next_pkt_is_audio = 0;
1d9048ba2ce3 Interplay C93 demuxer and video decoder
diego
parents:
diff changeset
97 return 0;
1d9048ba2ce3 Interplay C93 demuxer and video decoder
diego
parents:
diff changeset
98 }
1d9048ba2ce3 Interplay C93 demuxer and video decoder
diego
parents:
diff changeset
99
1d9048ba2ce3 Interplay C93 demuxer and video decoder
diego
parents:
diff changeset
100 #define C93_HAS_PALETTE 0x01
1d9048ba2ce3 Interplay C93 demuxer and video decoder
diego
parents:
diff changeset
101 #define C93_FIRST_FRAME 0x02
1d9048ba2ce3 Interplay C93 demuxer and video decoder
diego
parents:
diff changeset
102
2000
ce51095f383b also remove c93_ prefix for static function in the c93 demuxer
michael
parents: 1987
diff changeset
103 static int read_packet(AVFormatContext *s, AVPacket *pkt)
1987
1d9048ba2ce3 Interplay C93 demuxer and video decoder
diego
parents:
diff changeset
104 {
1d9048ba2ce3 Interplay C93 demuxer and video decoder
diego
parents:
diff changeset
105 ByteIOContext *pb = &s->pb;
1d9048ba2ce3 Interplay C93 demuxer and video decoder
diego
parents:
diff changeset
106 C93DemuxContext *c93 = s->priv_data;
1d9048ba2ce3 Interplay C93 demuxer and video decoder
diego
parents:
diff changeset
107 C93BlockRecord *br = &c93->block_records[c93->current_block];
1d9048ba2ce3 Interplay C93 demuxer and video decoder
diego
parents:
diff changeset
108 int datasize;
1d9048ba2ce3 Interplay C93 demuxer and video decoder
diego
parents:
diff changeset
109 int ret, i;
1d9048ba2ce3 Interplay C93 demuxer and video decoder
diego
parents:
diff changeset
110
1d9048ba2ce3 Interplay C93 demuxer and video decoder
diego
parents:
diff changeset
111 if (c93->next_pkt_is_audio) {
1d9048ba2ce3 Interplay C93 demuxer and video decoder
diego
parents:
diff changeset
112 c93->current_frame++;
1d9048ba2ce3 Interplay C93 demuxer and video decoder
diego
parents:
diff changeset
113 c93->next_pkt_is_audio = 0;
1d9048ba2ce3 Interplay C93 demuxer and video decoder
diego
parents:
diff changeset
114 datasize = get_le16(pb);
1d9048ba2ce3 Interplay C93 demuxer and video decoder
diego
parents:
diff changeset
115 if (datasize > 42) {
1d9048ba2ce3 Interplay C93 demuxer and video decoder
diego
parents:
diff changeset
116 if (!c93->audio) {
1d9048ba2ce3 Interplay C93 demuxer and video decoder
diego
parents:
diff changeset
117 c93->audio = av_new_stream(s, 1);
1d9048ba2ce3 Interplay C93 demuxer and video decoder
diego
parents:
diff changeset
118 if (!c93->audio)
1d9048ba2ce3 Interplay C93 demuxer and video decoder
diego
parents:
diff changeset
119 return AVERROR_NOMEM;
1d9048ba2ce3 Interplay C93 demuxer and video decoder
diego
parents:
diff changeset
120 c93->audio->codec->codec_type = CODEC_TYPE_AUDIO;
1d9048ba2ce3 Interplay C93 demuxer and video decoder
diego
parents:
diff changeset
121 }
1d9048ba2ce3 Interplay C93 demuxer and video decoder
diego
parents:
diff changeset
122 url_fskip(pb, 26); /* VOC header */
1d9048ba2ce3 Interplay C93 demuxer and video decoder
diego
parents:
diff changeset
123 ret = voc_get_packet(s, pkt, c93->audio, datasize - 26);
1d9048ba2ce3 Interplay C93 demuxer and video decoder
diego
parents:
diff changeset
124 if (ret > 0) {
1d9048ba2ce3 Interplay C93 demuxer and video decoder
diego
parents:
diff changeset
125 pkt->stream_index = 1;
1d9048ba2ce3 Interplay C93 demuxer and video decoder
diego
parents:
diff changeset
126 pkt->flags |= PKT_FLAG_KEY;
1d9048ba2ce3 Interplay C93 demuxer and video decoder
diego
parents:
diff changeset
127 return ret;
1d9048ba2ce3 Interplay C93 demuxer and video decoder
diego
parents:
diff changeset
128 }
1d9048ba2ce3 Interplay C93 demuxer and video decoder
diego
parents:
diff changeset
129 }
1d9048ba2ce3 Interplay C93 demuxer and video decoder
diego
parents:
diff changeset
130 }
1d9048ba2ce3 Interplay C93 demuxer and video decoder
diego
parents:
diff changeset
131 if (c93->current_frame >= br->frames) {
1d9048ba2ce3 Interplay C93 demuxer and video decoder
diego
parents:
diff changeset
132 if (c93->current_block >= 511 || !br[1].length)
1d9048ba2ce3 Interplay C93 demuxer and video decoder
diego
parents:
diff changeset
133 return AVERROR_IO;
1d9048ba2ce3 Interplay C93 demuxer and video decoder
diego
parents:
diff changeset
134 br++;
1d9048ba2ce3 Interplay C93 demuxer and video decoder
diego
parents:
diff changeset
135 c93->current_block++;
1d9048ba2ce3 Interplay C93 demuxer and video decoder
diego
parents:
diff changeset
136 c93->current_frame = 0;
1d9048ba2ce3 Interplay C93 demuxer and video decoder
diego
parents:
diff changeset
137 }
1d9048ba2ce3 Interplay C93 demuxer and video decoder
diego
parents:
diff changeset
138
1d9048ba2ce3 Interplay C93 demuxer and video decoder
diego
parents:
diff changeset
139 if (c93->current_frame == 0) {
1d9048ba2ce3 Interplay C93 demuxer and video decoder
diego
parents:
diff changeset
140 url_fseek(pb, br->index * 2048, SEEK_SET);
1d9048ba2ce3 Interplay C93 demuxer and video decoder
diego
parents:
diff changeset
141 for (i = 0; i < 32; i++) {
1d9048ba2ce3 Interplay C93 demuxer and video decoder
diego
parents:
diff changeset
142 c93->frame_offsets[i] = get_le32(pb);
1d9048ba2ce3 Interplay C93 demuxer and video decoder
diego
parents:
diff changeset
143 }
1d9048ba2ce3 Interplay C93 demuxer and video decoder
diego
parents:
diff changeset
144 }
1d9048ba2ce3 Interplay C93 demuxer and video decoder
diego
parents:
diff changeset
145
1d9048ba2ce3 Interplay C93 demuxer and video decoder
diego
parents:
diff changeset
146 url_fseek(pb,br->index * 2048 +
1d9048ba2ce3 Interplay C93 demuxer and video decoder
diego
parents:
diff changeset
147 c93->frame_offsets[c93->current_frame], SEEK_SET);
1d9048ba2ce3 Interplay C93 demuxer and video decoder
diego
parents:
diff changeset
148 datasize = get_le16(pb); /* video frame size */
1d9048ba2ce3 Interplay C93 demuxer and video decoder
diego
parents:
diff changeset
149
1d9048ba2ce3 Interplay C93 demuxer and video decoder
diego
parents:
diff changeset
150 ret = av_new_packet(pkt, datasize + 768 + 1);
1d9048ba2ce3 Interplay C93 demuxer and video decoder
diego
parents:
diff changeset
151 if (ret < 0)
1d9048ba2ce3 Interplay C93 demuxer and video decoder
diego
parents:
diff changeset
152 return ret;
1d9048ba2ce3 Interplay C93 demuxer and video decoder
diego
parents:
diff changeset
153 pkt->data[0] = 0;
1d9048ba2ce3 Interplay C93 demuxer and video decoder
diego
parents:
diff changeset
154 pkt->size = datasize + 1;
1d9048ba2ce3 Interplay C93 demuxer and video decoder
diego
parents:
diff changeset
155
1d9048ba2ce3 Interplay C93 demuxer and video decoder
diego
parents:
diff changeset
156 ret = get_buffer(pb, pkt->data + 1, datasize);
1d9048ba2ce3 Interplay C93 demuxer and video decoder
diego
parents:
diff changeset
157 if (ret < datasize) {
1d9048ba2ce3 Interplay C93 demuxer and video decoder
diego
parents:
diff changeset
158 ret = AVERROR_IO;
1d9048ba2ce3 Interplay C93 demuxer and video decoder
diego
parents:
diff changeset
159 goto fail;
1d9048ba2ce3 Interplay C93 demuxer and video decoder
diego
parents:
diff changeset
160 }
1d9048ba2ce3 Interplay C93 demuxer and video decoder
diego
parents:
diff changeset
161
1d9048ba2ce3 Interplay C93 demuxer and video decoder
diego
parents:
diff changeset
162 datasize = get_le16(pb); /* palette size */
1d9048ba2ce3 Interplay C93 demuxer and video decoder
diego
parents:
diff changeset
163 if (datasize) {
1d9048ba2ce3 Interplay C93 demuxer and video decoder
diego
parents:
diff changeset
164 if (datasize != 768) {
1d9048ba2ce3 Interplay C93 demuxer and video decoder
diego
parents:
diff changeset
165 av_log(s, AV_LOG_ERROR, "invalid palette size %u\n", datasize);
1d9048ba2ce3 Interplay C93 demuxer and video decoder
diego
parents:
diff changeset
166 ret = AVERROR_INVALIDDATA;
1d9048ba2ce3 Interplay C93 demuxer and video decoder
diego
parents:
diff changeset
167 goto fail;
1d9048ba2ce3 Interplay C93 demuxer and video decoder
diego
parents:
diff changeset
168 }
1d9048ba2ce3 Interplay C93 demuxer and video decoder
diego
parents:
diff changeset
169 pkt->data[0] |= C93_HAS_PALETTE;
1d9048ba2ce3 Interplay C93 demuxer and video decoder
diego
parents:
diff changeset
170 ret = get_buffer(pb, pkt->data + pkt->size, datasize);
1d9048ba2ce3 Interplay C93 demuxer and video decoder
diego
parents:
diff changeset
171 if (ret < datasize) {
1d9048ba2ce3 Interplay C93 demuxer and video decoder
diego
parents:
diff changeset
172 ret = AVERROR_IO;
1d9048ba2ce3 Interplay C93 demuxer and video decoder
diego
parents:
diff changeset
173 goto fail;
1d9048ba2ce3 Interplay C93 demuxer and video decoder
diego
parents:
diff changeset
174 }
1d9048ba2ce3 Interplay C93 demuxer and video decoder
diego
parents:
diff changeset
175 pkt->size += 768;
1d9048ba2ce3 Interplay C93 demuxer and video decoder
diego
parents:
diff changeset
176 }
1d9048ba2ce3 Interplay C93 demuxer and video decoder
diego
parents:
diff changeset
177 pkt->stream_index = 0;
1d9048ba2ce3 Interplay C93 demuxer and video decoder
diego
parents:
diff changeset
178 c93->next_pkt_is_audio = 1;
1d9048ba2ce3 Interplay C93 demuxer and video decoder
diego
parents:
diff changeset
179
1d9048ba2ce3 Interplay C93 demuxer and video decoder
diego
parents:
diff changeset
180 /* only the first frame is guaranteed to not reference previous frames */
1d9048ba2ce3 Interplay C93 demuxer and video decoder
diego
parents:
diff changeset
181 if (c93->current_block == 0 && c93->current_frame == 0) {
1d9048ba2ce3 Interplay C93 demuxer and video decoder
diego
parents:
diff changeset
182 pkt->flags |= PKT_FLAG_KEY;
1d9048ba2ce3 Interplay C93 demuxer and video decoder
diego
parents:
diff changeset
183 pkt->data[0] |= C93_FIRST_FRAME;
1d9048ba2ce3 Interplay C93 demuxer and video decoder
diego
parents:
diff changeset
184 }
1d9048ba2ce3 Interplay C93 demuxer and video decoder
diego
parents:
diff changeset
185 return 0;
1d9048ba2ce3 Interplay C93 demuxer and video decoder
diego
parents:
diff changeset
186
1d9048ba2ce3 Interplay C93 demuxer and video decoder
diego
parents:
diff changeset
187 fail:
1d9048ba2ce3 Interplay C93 demuxer and video decoder
diego
parents:
diff changeset
188 av_free_packet(pkt);
1d9048ba2ce3 Interplay C93 demuxer and video decoder
diego
parents:
diff changeset
189 return ret;
1d9048ba2ce3 Interplay C93 demuxer and video decoder
diego
parents:
diff changeset
190 }
1d9048ba2ce3 Interplay C93 demuxer and video decoder
diego
parents:
diff changeset
191
1d9048ba2ce3 Interplay C93 demuxer and video decoder
diego
parents:
diff changeset
192 AVInputFormat c93_demuxer = {
1d9048ba2ce3 Interplay C93 demuxer and video decoder
diego
parents:
diff changeset
193 "c93",
1d9048ba2ce3 Interplay C93 demuxer and video decoder
diego
parents:
diff changeset
194 "Interplay C93",
1d9048ba2ce3 Interplay C93 demuxer and video decoder
diego
parents:
diff changeset
195 sizeof(C93DemuxContext),
2000
ce51095f383b also remove c93_ prefix for static function in the c93 demuxer
michael
parents: 1987
diff changeset
196 probe,
ce51095f383b also remove c93_ prefix for static function in the c93 demuxer
michael
parents: 1987
diff changeset
197 read_header,
ce51095f383b also remove c93_ prefix for static function in the c93 demuxer
michael
parents: 1987
diff changeset
198 read_packet,
1987
1d9048ba2ce3 Interplay C93 demuxer and video decoder
diego
parents:
diff changeset
199 };