annotate qcp.c @ 5159:e7eb86fbe4c1 libavformat

100l, all avlanguage tables should be both static and const.
author reimar
date Sun, 06 Sep 2009 08:36:25 +0000
parents cd7e342cfaf7
children 536e5527c1e0
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
4945
cd7e342cfaf7 Add QCP demuxer.
kmalaussene
parents:
diff changeset
1 /*
cd7e342cfaf7 Add QCP demuxer.
kmalaussene
parents:
diff changeset
2 * QCP format (.qcp) demuxer
cd7e342cfaf7 Add QCP demuxer.
kmalaussene
parents:
diff changeset
3 * Copyright (c) 2009 Kenan Gillet
cd7e342cfaf7 Add QCP demuxer.
kmalaussene
parents:
diff changeset
4 *
cd7e342cfaf7 Add QCP demuxer.
kmalaussene
parents:
diff changeset
5 * This file is part of FFmpeg.
cd7e342cfaf7 Add QCP demuxer.
kmalaussene
parents:
diff changeset
6 *
cd7e342cfaf7 Add QCP demuxer.
kmalaussene
parents:
diff changeset
7 * FFmpeg is free software; you can redistribute it and/or
cd7e342cfaf7 Add QCP demuxer.
kmalaussene
parents:
diff changeset
8 * modify it under the terms of the GNU Lesser General Public
cd7e342cfaf7 Add QCP demuxer.
kmalaussene
parents:
diff changeset
9 * License as published by the Free Software Foundation; either
cd7e342cfaf7 Add QCP demuxer.
kmalaussene
parents:
diff changeset
10 * version 2.1 of the License, or (at your option) any later version.
cd7e342cfaf7 Add QCP demuxer.
kmalaussene
parents:
diff changeset
11 *
cd7e342cfaf7 Add QCP demuxer.
kmalaussene
parents:
diff changeset
12 * FFmpeg is distributed in the hope that it will be useful,
cd7e342cfaf7 Add QCP demuxer.
kmalaussene
parents:
diff changeset
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
cd7e342cfaf7 Add QCP demuxer.
kmalaussene
parents:
diff changeset
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
cd7e342cfaf7 Add QCP demuxer.
kmalaussene
parents:
diff changeset
15 * Lesser General Public License for more details.
cd7e342cfaf7 Add QCP demuxer.
kmalaussene
parents:
diff changeset
16 *
cd7e342cfaf7 Add QCP demuxer.
kmalaussene
parents:
diff changeset
17 * You should have received a copy of the GNU Lesser General Public
cd7e342cfaf7 Add QCP demuxer.
kmalaussene
parents:
diff changeset
18 * License along with FFmpeg; if not, write to the Free Software
cd7e342cfaf7 Add QCP demuxer.
kmalaussene
parents:
diff changeset
19 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
cd7e342cfaf7 Add QCP demuxer.
kmalaussene
parents:
diff changeset
20 */
cd7e342cfaf7 Add QCP demuxer.
kmalaussene
parents:
diff changeset
21
cd7e342cfaf7 Add QCP demuxer.
kmalaussene
parents:
diff changeset
22 /**
cd7e342cfaf7 Add QCP demuxer.
kmalaussene
parents:
diff changeset
23 * @file libavformat/qcp.c
cd7e342cfaf7 Add QCP demuxer.
kmalaussene
parents:
diff changeset
24 * QCP format (.qcp) demuxer
cd7e342cfaf7 Add QCP demuxer.
kmalaussene
parents:
diff changeset
25 * @author Kenan Gillet
cd7e342cfaf7 Add QCP demuxer.
kmalaussene
parents:
diff changeset
26 * @sa RFC 3625: "The QCP File Format and Media Types for Speech Data"
cd7e342cfaf7 Add QCP demuxer.
kmalaussene
parents:
diff changeset
27 * http://tools.ietf.org/html/rfc3625
cd7e342cfaf7 Add QCP demuxer.
kmalaussene
parents:
diff changeset
28 */
cd7e342cfaf7 Add QCP demuxer.
kmalaussene
parents:
diff changeset
29
cd7e342cfaf7 Add QCP demuxer.
kmalaussene
parents:
diff changeset
30 #include "libavutil/intreadwrite.h"
cd7e342cfaf7 Add QCP demuxer.
kmalaussene
parents:
diff changeset
31 #include "avformat.h"
cd7e342cfaf7 Add QCP demuxer.
kmalaussene
parents:
diff changeset
32
cd7e342cfaf7 Add QCP demuxer.
kmalaussene
parents:
diff changeset
33 typedef struct {
cd7e342cfaf7 Add QCP demuxer.
kmalaussene
parents:
diff changeset
34 uint32_t data_size; ///< size of data chunk
cd7e342cfaf7 Add QCP demuxer.
kmalaussene
parents:
diff changeset
35
cd7e342cfaf7 Add QCP demuxer.
kmalaussene
parents:
diff changeset
36 #define QCP_MAX_MODE 4
cd7e342cfaf7 Add QCP demuxer.
kmalaussene
parents:
diff changeset
37 int16_t rates_per_mode[QCP_MAX_MODE+1]; ///< contains the packet size corresponding
cd7e342cfaf7 Add QCP demuxer.
kmalaussene
parents:
diff changeset
38 ///< to each mode, -1 if no size.
cd7e342cfaf7 Add QCP demuxer.
kmalaussene
parents:
diff changeset
39 } QCPContext;
cd7e342cfaf7 Add QCP demuxer.
kmalaussene
parents:
diff changeset
40
cd7e342cfaf7 Add QCP demuxer.
kmalaussene
parents:
diff changeset
41 /**
cd7e342cfaf7 Add QCP demuxer.
kmalaussene
parents:
diff changeset
42 * Last 15 out of 16 bytes of QCELP-13K GUID, as stored in the file;
cd7e342cfaf7 Add QCP demuxer.
kmalaussene
parents:
diff changeset
43 * the first byte of the GUID can be either 0x41 or 0x42.
cd7e342cfaf7 Add QCP demuxer.
kmalaussene
parents:
diff changeset
44 */
cd7e342cfaf7 Add QCP demuxer.
kmalaussene
parents:
diff changeset
45 static const uint8_t guid_qcelp_13k_part[15] = {
cd7e342cfaf7 Add QCP demuxer.
kmalaussene
parents:
diff changeset
46 0x6d, 0x7f, 0x5e, 0x15, 0xb1, 0xd0, 0x11, 0xba,
cd7e342cfaf7 Add QCP demuxer.
kmalaussene
parents:
diff changeset
47 0x91, 0x00, 0x80, 0x5f, 0xb4, 0xb9, 0x7e
cd7e342cfaf7 Add QCP demuxer.
kmalaussene
parents:
diff changeset
48 };
cd7e342cfaf7 Add QCP demuxer.
kmalaussene
parents:
diff changeset
49
cd7e342cfaf7 Add QCP demuxer.
kmalaussene
parents:
diff changeset
50 /**
cd7e342cfaf7 Add QCP demuxer.
kmalaussene
parents:
diff changeset
51 * EVRC GUID as stored in the file
cd7e342cfaf7 Add QCP demuxer.
kmalaussene
parents:
diff changeset
52 */
cd7e342cfaf7 Add QCP demuxer.
kmalaussene
parents:
diff changeset
53 static const uint8_t guid_evrc[16] = {
cd7e342cfaf7 Add QCP demuxer.
kmalaussene
parents:
diff changeset
54 0x8d, 0xd4, 0x89, 0xe6, 0x76, 0x90, 0xb5, 0x46,
cd7e342cfaf7 Add QCP demuxer.
kmalaussene
parents:
diff changeset
55 0x91, 0xef, 0x73, 0x6a, 0x51, 0x00, 0xce, 0xb4
cd7e342cfaf7 Add QCP demuxer.
kmalaussene
parents:
diff changeset
56 };
cd7e342cfaf7 Add QCP demuxer.
kmalaussene
parents:
diff changeset
57
cd7e342cfaf7 Add QCP demuxer.
kmalaussene
parents:
diff changeset
58 /**
cd7e342cfaf7 Add QCP demuxer.
kmalaussene
parents:
diff changeset
59 * SMV GUID as stored in the file
cd7e342cfaf7 Add QCP demuxer.
kmalaussene
parents:
diff changeset
60 */
cd7e342cfaf7 Add QCP demuxer.
kmalaussene
parents:
diff changeset
61 static const uint8_t guid_smv[16] = {
cd7e342cfaf7 Add QCP demuxer.
kmalaussene
parents:
diff changeset
62 0x75, 0x2b, 0x7c, 0x8d, 0x97, 0xa7, 0x49, 0xed,
cd7e342cfaf7 Add QCP demuxer.
kmalaussene
parents:
diff changeset
63 0x98, 0x5e, 0xd5, 0x3c, 0x8c, 0xc7, 0x5f, 0x84
cd7e342cfaf7 Add QCP demuxer.
kmalaussene
parents:
diff changeset
64 };
cd7e342cfaf7 Add QCP demuxer.
kmalaussene
parents:
diff changeset
65
cd7e342cfaf7 Add QCP demuxer.
kmalaussene
parents:
diff changeset
66 /**
cd7e342cfaf7 Add QCP demuxer.
kmalaussene
parents:
diff changeset
67 * @param guid contains at least 16 bytes
cd7e342cfaf7 Add QCP demuxer.
kmalaussene
parents:
diff changeset
68 * @return 1 if the guid is a qcelp_13k guid, 0 otherwise
cd7e342cfaf7 Add QCP demuxer.
kmalaussene
parents:
diff changeset
69 */
cd7e342cfaf7 Add QCP demuxer.
kmalaussene
parents:
diff changeset
70 static int is_qcelp_13k_guid(const uint8_t *guid) {
cd7e342cfaf7 Add QCP demuxer.
kmalaussene
parents:
diff changeset
71 return (guid[0] == 0x41 || guid[0] == 0x42)
cd7e342cfaf7 Add QCP demuxer.
kmalaussene
parents:
diff changeset
72 && !memcmp(guid+1, guid_qcelp_13k_part, sizeof(guid_qcelp_13k_part));
cd7e342cfaf7 Add QCP demuxer.
kmalaussene
parents:
diff changeset
73 }
cd7e342cfaf7 Add QCP demuxer.
kmalaussene
parents:
diff changeset
74
cd7e342cfaf7 Add QCP demuxer.
kmalaussene
parents:
diff changeset
75 static int qcp_probe(AVProbeData *pd)
cd7e342cfaf7 Add QCP demuxer.
kmalaussene
parents:
diff changeset
76 {
cd7e342cfaf7 Add QCP demuxer.
kmalaussene
parents:
diff changeset
77 if (AV_RL32(pd->buf ) == AV_RL32("RIFF") &&
cd7e342cfaf7 Add QCP demuxer.
kmalaussene
parents:
diff changeset
78 AV_RL64(pd->buf+8) == AV_RL64("QLCMfmt "))
cd7e342cfaf7 Add QCP demuxer.
kmalaussene
parents:
diff changeset
79 return AVPROBE_SCORE_MAX;
cd7e342cfaf7 Add QCP demuxer.
kmalaussene
parents:
diff changeset
80 return 0;
cd7e342cfaf7 Add QCP demuxer.
kmalaussene
parents:
diff changeset
81 }
cd7e342cfaf7 Add QCP demuxer.
kmalaussene
parents:
diff changeset
82
cd7e342cfaf7 Add QCP demuxer.
kmalaussene
parents:
diff changeset
83 static int qcp_read_header(AVFormatContext *s, AVFormatParameters *ap)
cd7e342cfaf7 Add QCP demuxer.
kmalaussene
parents:
diff changeset
84 {
cd7e342cfaf7 Add QCP demuxer.
kmalaussene
parents:
diff changeset
85 ByteIOContext *pb = s->pb;
cd7e342cfaf7 Add QCP demuxer.
kmalaussene
parents:
diff changeset
86 QCPContext *c = s->priv_data;
cd7e342cfaf7 Add QCP demuxer.
kmalaussene
parents:
diff changeset
87 AVStream *st = av_new_stream(s, 0);
cd7e342cfaf7 Add QCP demuxer.
kmalaussene
parents:
diff changeset
88 uint8_t buf[16];
cd7e342cfaf7 Add QCP demuxer.
kmalaussene
parents:
diff changeset
89 int i, nb_rates;
cd7e342cfaf7 Add QCP demuxer.
kmalaussene
parents:
diff changeset
90
cd7e342cfaf7 Add QCP demuxer.
kmalaussene
parents:
diff changeset
91 if (!st)
cd7e342cfaf7 Add QCP demuxer.
kmalaussene
parents:
diff changeset
92 return AVERROR(ENOMEM);
cd7e342cfaf7 Add QCP demuxer.
kmalaussene
parents:
diff changeset
93
cd7e342cfaf7 Add QCP demuxer.
kmalaussene
parents:
diff changeset
94 get_be32(pb); // "RIFF"
cd7e342cfaf7 Add QCP demuxer.
kmalaussene
parents:
diff changeset
95 s->file_size = get_le32(pb) + 8;
cd7e342cfaf7 Add QCP demuxer.
kmalaussene
parents:
diff changeset
96 url_fskip(pb, 8 + 4 + 1 + 1); // "QLCMfmt " + chunk-size + major-version + minor-version
cd7e342cfaf7 Add QCP demuxer.
kmalaussene
parents:
diff changeset
97
cd7e342cfaf7 Add QCP demuxer.
kmalaussene
parents:
diff changeset
98 st->codec->codec_type = CODEC_TYPE_AUDIO;
cd7e342cfaf7 Add QCP demuxer.
kmalaussene
parents:
diff changeset
99 st->codec->channels = 1;
cd7e342cfaf7 Add QCP demuxer.
kmalaussene
parents:
diff changeset
100 get_buffer(pb, buf, 16);
cd7e342cfaf7 Add QCP demuxer.
kmalaussene
parents:
diff changeset
101 if (is_qcelp_13k_guid(buf)) {
cd7e342cfaf7 Add QCP demuxer.
kmalaussene
parents:
diff changeset
102 st->codec->codec_id = CODEC_ID_QCELP;
cd7e342cfaf7 Add QCP demuxer.
kmalaussene
parents:
diff changeset
103 } else if (!memcmp(buf, guid_evrc, 16)) {
cd7e342cfaf7 Add QCP demuxer.
kmalaussene
parents:
diff changeset
104 av_log(s, AV_LOG_ERROR, "EVRC codec is not supported.\n");
cd7e342cfaf7 Add QCP demuxer.
kmalaussene
parents:
diff changeset
105 return AVERROR_PATCHWELCOME;
cd7e342cfaf7 Add QCP demuxer.
kmalaussene
parents:
diff changeset
106 } else if (!memcmp(buf, guid_smv, 16)) {
cd7e342cfaf7 Add QCP demuxer.
kmalaussene
parents:
diff changeset
107 av_log(s, AV_LOG_ERROR, "SMV codec is not supported.\n");
cd7e342cfaf7 Add QCP demuxer.
kmalaussene
parents:
diff changeset
108 return AVERROR_PATCHWELCOME;
cd7e342cfaf7 Add QCP demuxer.
kmalaussene
parents:
diff changeset
109 } else {
cd7e342cfaf7 Add QCP demuxer.
kmalaussene
parents:
diff changeset
110 av_log(s, AV_LOG_ERROR, "Unknown codec GUID.\n");
cd7e342cfaf7 Add QCP demuxer.
kmalaussene
parents:
diff changeset
111 return AVERROR_INVALIDDATA;
cd7e342cfaf7 Add QCP demuxer.
kmalaussene
parents:
diff changeset
112 }
cd7e342cfaf7 Add QCP demuxer.
kmalaussene
parents:
diff changeset
113 url_fskip(pb, 2 + 80); // codec-version + codec-name
cd7e342cfaf7 Add QCP demuxer.
kmalaussene
parents:
diff changeset
114 st->codec->bit_rate = get_le16(pb);
cd7e342cfaf7 Add QCP demuxer.
kmalaussene
parents:
diff changeset
115
cd7e342cfaf7 Add QCP demuxer.
kmalaussene
parents:
diff changeset
116 s->packet_size = get_le16(pb);
cd7e342cfaf7 Add QCP demuxer.
kmalaussene
parents:
diff changeset
117 url_fskip(pb, 2); // block-size
cd7e342cfaf7 Add QCP demuxer.
kmalaussene
parents:
diff changeset
118 st->codec->sample_rate = get_le16(pb);
cd7e342cfaf7 Add QCP demuxer.
kmalaussene
parents:
diff changeset
119 url_fskip(pb, 2); // sample-size
cd7e342cfaf7 Add QCP demuxer.
kmalaussene
parents:
diff changeset
120
cd7e342cfaf7 Add QCP demuxer.
kmalaussene
parents:
diff changeset
121 memset(c->rates_per_mode, -1, sizeof(c->rates_per_mode));
cd7e342cfaf7 Add QCP demuxer.
kmalaussene
parents:
diff changeset
122 nb_rates = get_le32(pb);
cd7e342cfaf7 Add QCP demuxer.
kmalaussene
parents:
diff changeset
123 nb_rates = FFMIN(nb_rates, 8);
cd7e342cfaf7 Add QCP demuxer.
kmalaussene
parents:
diff changeset
124 for (i=0; i<nb_rates; i++) {
cd7e342cfaf7 Add QCP demuxer.
kmalaussene
parents:
diff changeset
125 int size = get_byte(pb);
cd7e342cfaf7 Add QCP demuxer.
kmalaussene
parents:
diff changeset
126 int mode = get_byte(pb);
cd7e342cfaf7 Add QCP demuxer.
kmalaussene
parents:
diff changeset
127 if (mode > QCP_MAX_MODE) {
cd7e342cfaf7 Add QCP demuxer.
kmalaussene
parents:
diff changeset
128 av_log(s, AV_LOG_WARNING, "Unknown entry %d=>%d in rate-map-table.\n ", mode, size);
cd7e342cfaf7 Add QCP demuxer.
kmalaussene
parents:
diff changeset
129 } else
cd7e342cfaf7 Add QCP demuxer.
kmalaussene
parents:
diff changeset
130 c->rates_per_mode[mode] = size;
cd7e342cfaf7 Add QCP demuxer.
kmalaussene
parents:
diff changeset
131 }
cd7e342cfaf7 Add QCP demuxer.
kmalaussene
parents:
diff changeset
132 url_fskip(pb, 16 - 2*nb_rates + 20); // empty entries of rate-map-table + reserved
cd7e342cfaf7 Add QCP demuxer.
kmalaussene
parents:
diff changeset
133
cd7e342cfaf7 Add QCP demuxer.
kmalaussene
parents:
diff changeset
134 return 0;
cd7e342cfaf7 Add QCP demuxer.
kmalaussene
parents:
diff changeset
135 }
cd7e342cfaf7 Add QCP demuxer.
kmalaussene
parents:
diff changeset
136
cd7e342cfaf7 Add QCP demuxer.
kmalaussene
parents:
diff changeset
137 static int qcp_read_packet(AVFormatContext *s, AVPacket *pkt)
cd7e342cfaf7 Add QCP demuxer.
kmalaussene
parents:
diff changeset
138 {
cd7e342cfaf7 Add QCP demuxer.
kmalaussene
parents:
diff changeset
139 ByteIOContext *pb = s->pb;
cd7e342cfaf7 Add QCP demuxer.
kmalaussene
parents:
diff changeset
140 QCPContext *c = s->priv_data;
cd7e342cfaf7 Add QCP demuxer.
kmalaussene
parents:
diff changeset
141 unsigned int chunk_size, tag;
cd7e342cfaf7 Add QCP demuxer.
kmalaussene
parents:
diff changeset
142
cd7e342cfaf7 Add QCP demuxer.
kmalaussene
parents:
diff changeset
143 while(!url_feof(pb)) {
cd7e342cfaf7 Add QCP demuxer.
kmalaussene
parents:
diff changeset
144 if (c->data_size) {
cd7e342cfaf7 Add QCP demuxer.
kmalaussene
parents:
diff changeset
145 int pkt_size, ret, mode = get_byte(pb);
cd7e342cfaf7 Add QCP demuxer.
kmalaussene
parents:
diff changeset
146
cd7e342cfaf7 Add QCP demuxer.
kmalaussene
parents:
diff changeset
147 if (s->packet_size) {
cd7e342cfaf7 Add QCP demuxer.
kmalaussene
parents:
diff changeset
148 pkt_size = s->packet_size - 1;
cd7e342cfaf7 Add QCP demuxer.
kmalaussene
parents:
diff changeset
149 } else if (mode > QCP_MAX_MODE || (pkt_size = c->rates_per_mode[mode]) < 0) {
cd7e342cfaf7 Add QCP demuxer.
kmalaussene
parents:
diff changeset
150 c->data_size--;
cd7e342cfaf7 Add QCP demuxer.
kmalaussene
parents:
diff changeset
151 continue;
cd7e342cfaf7 Add QCP demuxer.
kmalaussene
parents:
diff changeset
152 }
cd7e342cfaf7 Add QCP demuxer.
kmalaussene
parents:
diff changeset
153
cd7e342cfaf7 Add QCP demuxer.
kmalaussene
parents:
diff changeset
154 if (c->data_size <= pkt_size) {
cd7e342cfaf7 Add QCP demuxer.
kmalaussene
parents:
diff changeset
155 av_log(s, AV_LOG_WARNING, "Data chunk is too small.\n");
cd7e342cfaf7 Add QCP demuxer.
kmalaussene
parents:
diff changeset
156 pkt_size = c->data_size - 1;
cd7e342cfaf7 Add QCP demuxer.
kmalaussene
parents:
diff changeset
157 }
cd7e342cfaf7 Add QCP demuxer.
kmalaussene
parents:
diff changeset
158
cd7e342cfaf7 Add QCP demuxer.
kmalaussene
parents:
diff changeset
159 if ((ret = av_get_packet(pb, pkt, pkt_size)) >= 0) {
cd7e342cfaf7 Add QCP demuxer.
kmalaussene
parents:
diff changeset
160 if (pkt_size != ret)
cd7e342cfaf7 Add QCP demuxer.
kmalaussene
parents:
diff changeset
161 av_log(s, AV_LOG_ERROR, "Packet size is too small.\n");
cd7e342cfaf7 Add QCP demuxer.
kmalaussene
parents:
diff changeset
162
cd7e342cfaf7 Add QCP demuxer.
kmalaussene
parents:
diff changeset
163 c->data_size -= pkt_size + 1;
cd7e342cfaf7 Add QCP demuxer.
kmalaussene
parents:
diff changeset
164 }
cd7e342cfaf7 Add QCP demuxer.
kmalaussene
parents:
diff changeset
165 return ret;
cd7e342cfaf7 Add QCP demuxer.
kmalaussene
parents:
diff changeset
166 }
cd7e342cfaf7 Add QCP demuxer.
kmalaussene
parents:
diff changeset
167
cd7e342cfaf7 Add QCP demuxer.
kmalaussene
parents:
diff changeset
168 if (url_ftell(pb) & 1 && get_byte(pb))
cd7e342cfaf7 Add QCP demuxer.
kmalaussene
parents:
diff changeset
169 av_log(s, AV_LOG_WARNING, "Padding should be 0.\n");
cd7e342cfaf7 Add QCP demuxer.
kmalaussene
parents:
diff changeset
170
cd7e342cfaf7 Add QCP demuxer.
kmalaussene
parents:
diff changeset
171 tag = get_le32(pb);
cd7e342cfaf7 Add QCP demuxer.
kmalaussene
parents:
diff changeset
172 chunk_size = get_le32(pb);
cd7e342cfaf7 Add QCP demuxer.
kmalaussene
parents:
diff changeset
173 switch (tag) {
cd7e342cfaf7 Add QCP demuxer.
kmalaussene
parents:
diff changeset
174 case MKTAG('v', 'r', 'a', 't'):
cd7e342cfaf7 Add QCP demuxer.
kmalaussene
parents:
diff changeset
175 if (get_le32(pb)) // var-rate-flag
cd7e342cfaf7 Add QCP demuxer.
kmalaussene
parents:
diff changeset
176 s->packet_size = 0;
cd7e342cfaf7 Add QCP demuxer.
kmalaussene
parents:
diff changeset
177 url_fskip(pb, 4); // size-in-packets
cd7e342cfaf7 Add QCP demuxer.
kmalaussene
parents:
diff changeset
178 break;
cd7e342cfaf7 Add QCP demuxer.
kmalaussene
parents:
diff changeset
179 case MKTAG('d', 'a', 't', 'a'):
cd7e342cfaf7 Add QCP demuxer.
kmalaussene
parents:
diff changeset
180 c->data_size = chunk_size;
cd7e342cfaf7 Add QCP demuxer.
kmalaussene
parents:
diff changeset
181 break;
cd7e342cfaf7 Add QCP demuxer.
kmalaussene
parents:
diff changeset
182
cd7e342cfaf7 Add QCP demuxer.
kmalaussene
parents:
diff changeset
183 default:
cd7e342cfaf7 Add QCP demuxer.
kmalaussene
parents:
diff changeset
184 url_fskip(pb, chunk_size);
cd7e342cfaf7 Add QCP demuxer.
kmalaussene
parents:
diff changeset
185 }
cd7e342cfaf7 Add QCP demuxer.
kmalaussene
parents:
diff changeset
186 }
cd7e342cfaf7 Add QCP demuxer.
kmalaussene
parents:
diff changeset
187 return AVERROR_EOF;
cd7e342cfaf7 Add QCP demuxer.
kmalaussene
parents:
diff changeset
188 }
cd7e342cfaf7 Add QCP demuxer.
kmalaussene
parents:
diff changeset
189
cd7e342cfaf7 Add QCP demuxer.
kmalaussene
parents:
diff changeset
190 AVInputFormat qcp_demuxer = {
cd7e342cfaf7 Add QCP demuxer.
kmalaussene
parents:
diff changeset
191 .name = "qcp",
cd7e342cfaf7 Add QCP demuxer.
kmalaussene
parents:
diff changeset
192 .long_name = NULL_IF_CONFIG_SMALL("QCP format"),
cd7e342cfaf7 Add QCP demuxer.
kmalaussene
parents:
diff changeset
193 .priv_data_size = sizeof(QCPContext),
cd7e342cfaf7 Add QCP demuxer.
kmalaussene
parents:
diff changeset
194 .read_probe = qcp_probe,
cd7e342cfaf7 Add QCP demuxer.
kmalaussene
parents:
diff changeset
195 .read_header = qcp_read_header,
cd7e342cfaf7 Add QCP demuxer.
kmalaussene
parents:
diff changeset
196 .read_packet = qcp_read_packet,
cd7e342cfaf7 Add QCP demuxer.
kmalaussene
parents:
diff changeset
197 };