Libav
electronicarts.c
Go to the documentation of this file.
1 /* Electronic Arts Multimedia File Demuxer
2  * Copyright (c) 2004 The FFmpeg project
3  * Copyright (c) 2006-2008 Peter Ross
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 
28 #include <inttypes.h>
29 
30 #include "libavutil/intreadwrite.h"
31 #include "avformat.h"
32 #include "internal.h"
33 
34 #define SCHl_TAG MKTAG('S', 'C', 'H', 'l')
35 #define SEAD_TAG MKTAG('S', 'E', 'A', 'D') /* Sxxx header */
36 #define SNDC_TAG MKTAG('S', 'N', 'D', 'C') /* Sxxx data */
37 #define SEND_TAG MKTAG('S', 'E', 'N', 'D') /* Sxxx end */
38 #define SHEN_TAG MKTAG('S', 'H', 'E', 'N') /* SxEN header */
39 #define SDEN_TAG MKTAG('S', 'D', 'E', 'N') /* SxEN data */
40 #define SEEN_TAG MKTAG('S', 'E', 'E', 'N') /* SxEN end */
41 #define ISNh_TAG MKTAG('1', 'S', 'N', 'h') /* 1SNx header */
42 #define EACS_TAG MKTAG('E', 'A', 'C', 'S')
43 #define ISNd_TAG MKTAG('1', 'S', 'N', 'd') /* 1SNx data */
44 #define ISNe_TAG MKTAG('1', 'S', 'N', 'e') /* 1SNx end */
45 #define PT00_TAG MKTAG('P', 'T', 0x0, 0x0)
46 #define GSTR_TAG MKTAG('G', 'S', 'T', 'R')
47 #define SCDl_TAG MKTAG('S', 'C', 'D', 'l')
48 #define SCEl_TAG MKTAG('S', 'C', 'E', 'l')
49 #define kVGT_TAG MKTAG('k', 'V', 'G', 'T') /* TGV I-frame */
50 #define fVGT_TAG MKTAG('f', 'V', 'G', 'T') /* TGV P-frame */
51 #define mTCD_TAG MKTAG('m', 'T', 'C', 'D') /* MDEC */
52 #define MADk_TAG MKTAG('M', 'A', 'D', 'k') /* MAD I-frame */
53 #define MADm_TAG MKTAG('M', 'A', 'D', 'm') /* MAD P-frame */
54 #define MADe_TAG MKTAG('M', 'A', 'D', 'e') /* MAD lqp-frame */
55 #define MPCh_TAG MKTAG('M', 'P', 'C', 'h') /* MPEG-2 */
56 #define TGQs_TAG MKTAG('T', 'G', 'Q', 's') /* TGQ I-frame (appears in .TGQ files) */
57 #define pQGT_TAG MKTAG('p', 'Q', 'G', 'T') /* TGQ I-frame (appears in .UV files) */
58 #define pIQT_TAG MKTAG('p', 'I', 'Q', 'T') /* TQI/UV2 I-frame (.UV2/.WVE) */
59 #define MVhd_TAG MKTAG('M', 'V', 'h', 'd')
60 #define MV0K_TAG MKTAG('M', 'V', '0', 'K')
61 #define MV0F_TAG MKTAG('M', 'V', '0', 'F')
62 #define MVIh_TAG MKTAG('M', 'V', 'I', 'h') /* CMV header */
63 #define MVIf_TAG MKTAG('M', 'V', 'I', 'f') /* CMV I-frame */
64 
65 typedef struct EaDemuxContext {
67 
70  int width, height;
72 
75 
76  int bytes;
81 
82 static uint32_t read_arbitrary(AVIOContext *pb)
83 {
84  uint8_t size, byte;
85  int i;
86  uint32_t word;
87 
88  size = avio_r8(pb);
89 
90  word = 0;
91  for (i = 0; i < size; i++) {
92  byte = avio_r8(pb);
93  word <<= 8;
94  word |= byte;
95  }
96 
97  return word;
98 }
99 
101 {
102  EaDemuxContext *ea = s->priv_data;
103  AVIOContext *pb = s->pb;
104  int in_header = 1;
105  int compression_type = -1, revision = -1, revision2 = -1;
106 
107  ea->bytes = 2;
108  ea->sample_rate = -1;
109  ea->num_channels = 1;
110 
111  while (!pb->eof_reached && in_header) {
112  int in_subheader;
113  uint8_t byte;
114  byte = avio_r8(pb);
115 
116  switch (byte) {
117  case 0xFD:
118  av_log(s, AV_LOG_DEBUG, "entered audio subheader\n");
119  in_subheader = 1;
120  while (!pb->eof_reached && in_subheader) {
121  uint8_t subbyte;
122  subbyte = avio_r8(pb);
123 
124  switch (subbyte) {
125  case 0x80:
126  revision = read_arbitrary(pb);
127  av_log(s, AV_LOG_DEBUG,
128  "revision (element 0x80) set to 0x%08x\n", revision);
129  break;
130  case 0x82:
131  ea->num_channels = read_arbitrary(pb);
132  av_log(s, AV_LOG_DEBUG,
133  "num_channels (element 0x82) set to 0x%08x\n",
134  ea->num_channels);
135  break;
136  case 0x83:
137  compression_type = read_arbitrary(pb);
138  av_log(s, AV_LOG_DEBUG,
139  "compression_type (element 0x83) set to 0x%08x\n",
140  compression_type);
141  break;
142  case 0x84:
143  ea->sample_rate = read_arbitrary(pb);
144  av_log(s, AV_LOG_DEBUG,
145  "sample_rate (element 0x84) set to %i\n",
146  ea->sample_rate);
147  break;
148  case 0x85:
149  ea->num_samples = read_arbitrary(pb);
150  av_log(s, AV_LOG_DEBUG,
151  "num_samples (element 0x85) set to 0x%08x\n",
152  ea->num_samples);
153  break;
154  case 0x8A:
155  av_log(s, AV_LOG_DEBUG,
156  "element 0x%02x set to 0x%08"PRIx32"\n",
157  subbyte, read_arbitrary(pb));
158  av_log(s, AV_LOG_DEBUG, "exited audio subheader\n");
159  in_subheader = 0;
160  break;
161  case 0xA0:
162  revision2 = read_arbitrary(pb);
163  av_log(s, AV_LOG_DEBUG,
164  "revision2 (element 0xA0) set to 0x%08x\n",
165  revision2);
166  break;
167  case 0xFF:
168  av_log(s, AV_LOG_DEBUG,
169  "end of header block reached (within audio subheader)\n");
170  in_subheader = 0;
171  in_header = 0;
172  break;
173  default:
174  av_log(s, AV_LOG_DEBUG,
175  "element 0x%02x set to 0x%08"PRIx32"\n",
176  subbyte, read_arbitrary(pb));
177  break;
178  }
179  }
180  break;
181  case 0xFF:
182  av_log(s, AV_LOG_DEBUG, "end of header block reached\n");
183  in_header = 0;
184  break;
185  default:
186  av_log(s, AV_LOG_DEBUG,
187  "header element 0x%02x set to 0x%08"PRIx32"\n",
188  byte, read_arbitrary(pb));
189  break;
190  }
191  }
192 
193  switch (compression_type) {
194  case 0:
196  break;
197  case 7:
199  break;
200  case -1:
201  switch (revision) {
202  case 1:
204  break;
205  case 2:
207  break;
208  case 3:
210  break;
211  case -1:
212  break;
213  default:
214  av_log(s, AV_LOG_ERROR,
215  "unsupported stream type; revision=%i\n", revision);
216  return 0;
217  }
218  switch (revision2) {
219  case 8:
221  break;
222  case 10:
224  break;
225  case 16:
227  break;
228  case -1:
229  break;
230  default:
232  av_log(s, AV_LOG_ERROR,
233  "unsupported stream type; revision2=%i\n", revision2);
234  return 0;
235  }
236  break;
237  default:
238  av_log(s, AV_LOG_ERROR,
239  "unsupported stream type; compression_type=%i\n",
240  compression_type);
241  return 0;
242  }
243 
244  if (ea->sample_rate == -1)
245  ea->sample_rate = revision == 3 ? 48000 : 22050;
246 
247  return 1;
248 }
249 
251 {
252  EaDemuxContext *ea = s->priv_data;
253  AVIOContext *pb = s->pb;
254  int compression_type;
255 
256  ea->sample_rate = ea->big_endian ? avio_rb32(pb) : avio_rl32(pb);
257  ea->bytes = avio_r8(pb); /* 1=8-bit, 2=16-bit */
258  ea->num_channels = avio_r8(pb);
259  compression_type = avio_r8(pb);
260  avio_skip(pb, 13);
261 
262  switch (compression_type) {
263  case 0:
264  switch (ea->bytes) {
265  case 1:
267  break;
268  case 2:
270  break;
271  }
272  break;
273  case 1:
275  ea->bytes = 1;
276  break;
277  case 2:
279  break;
280  default:
281  av_log(s, AV_LOG_ERROR,
282  "unsupported stream type; audio compression_type=%i\n",
283  compression_type);
284  }
285 }
286 
288 {
289  EaDemuxContext *ea = s->priv_data;
290  AVIOContext *pb = s->pb;
291 
292  ea->sample_rate = avio_rl32(pb);
293  ea->bytes = avio_rl32(pb); /* 1=8-bit, 2=16-bit */
294  ea->num_channels = avio_rl32(pb);
296 }
297 
299 {
300  EaDemuxContext *ea = s->priv_data;
301  AVIOContext *pb = s->pb;
302  avio_skip(pb, 4);
303  ea->width = avio_rl16(pb);
304  ea->height = avio_rl16(pb);
305  ea->time_base = (AVRational) { 1, 15 };
307 }
308 
310 {
311  EaDemuxContext *ea = s->priv_data;
312  AVIOContext *pb = s->pb;
313 
314  avio_skip(pb, 16);
315  ea->time_base.den = avio_rl32(pb);
316  ea->time_base.num = avio_rl32(pb);
318 }
319 
321 {
322  EaDemuxContext *ea = s->priv_data;
323  int fps;
324 
325  avio_skip(s->pb, 10);
326  fps = avio_rl16(s->pb);
327  if (fps)
328  ea->time_base = (AVRational) { 1, fps };
330 }
331 
332 /* Process EA file header.
333  * Return 1 if the EA file is valid and successfully opened, 0 otherwise. */
335 {
336  uint32_t blockid, size = 0;
337  EaDemuxContext *ea = s->priv_data;
338  AVIOContext *pb = s->pb;
339  int i;
340 
341  for (i = 0; i < 5 && (!ea->audio_codec || !ea->video_codec); i++) {
342  unsigned int startpos = avio_tell(pb);
343  int err = 0;
344 
345  blockid = avio_rl32(pb);
346  size = avio_rl32(pb);
347  if (i == 0)
348  ea->big_endian = size > 0x000FFFFF;
349  if (ea->big_endian)
350  size = av_bswap32(size);
351 
352  switch (blockid) {
353  case ISNh_TAG:
354  if (avio_rl32(pb) != EACS_TAG) {
355  av_log(s, AV_LOG_ERROR, "unknown 1SNh headerid\n");
356  return 0;
357  }
359  break;
360 
361  case SCHl_TAG:
362  case SHEN_TAG:
363  blockid = avio_rl32(pb);
364  if (blockid == GSTR_TAG) {
365  avio_skip(pb, 4);
366  } else if ((blockid & 0xFFFF) != PT00_TAG) {
367  av_log(s, AV_LOG_ERROR, "unknown SCHl headerid\n");
368  return 0;
369  }
371  break;
372 
373  case SEAD_TAG:
375  break;
376 
377  case MVIh_TAG:
379  break;
380 
381  case kVGT_TAG:
383  ea->time_base = (AVRational) { 1, 15 };
384  break;
385 
386  case mTCD_TAG:
388  break;
389 
390  case MPCh_TAG:
392  break;
393 
394  case pQGT_TAG:
395  case TGQs_TAG:
397  ea->time_base = (AVRational) { 1, 15 };
398  break;
399 
400  case pIQT_TAG:
402  ea->time_base = (AVRational) { 1, 15 };
403  break;
404 
405  case MADk_TAG:
407  avio_skip(pb, 6);
408  ea->time_base = (AVRational) { avio_rl16(pb), 1000 };
409  break;
410 
411  case MVhd_TAG:
413  break;
414  }
415 
416  if (err < 0) {
417  av_log(s, AV_LOG_ERROR, "error parsing header: %i\n", err);
418  return err;
419  }
420 
421  avio_seek(pb, startpos + size, SEEK_SET);
422  }
423 
424  avio_seek(pb, 0, SEEK_SET);
425 
426  return 1;
427 }
428 
429 static int ea_probe(AVProbeData *p)
430 {
431  switch (AV_RL32(&p->buf[0])) {
432  case ISNh_TAG:
433  case SCHl_TAG:
434  case SEAD_TAG:
435  case SHEN_TAG:
436  case kVGT_TAG:
437  case MADk_TAG:
438  case MPCh_TAG:
439  case MVhd_TAG:
440  case MVIh_TAG:
441  break;
442  default:
443  return 0;
444  }
445  if (AV_RL32(&p->buf[4]) > 0xfffff && AV_RB32(&p->buf[4]) > 0xfffff)
446  return 0;
447 
448  return AVPROBE_SCORE_MAX;
449 }
450 
452 {
453  EaDemuxContext *ea = s->priv_data;
454  AVStream *st;
455 
456  if (!process_ea_header(s))
457  return AVERROR(EIO);
458 
459  if (ea->video_codec) {
460  /* initialize the video decoder stream */
461  st = avformat_new_stream(s, NULL);
462  if (!st)
463  return AVERROR(ENOMEM);
464  ea->video_stream_index = st->index;
466  st->codecpar->codec_id = ea->video_codec;
467  st->codecpar->codec_tag = 0; /* no fourcc */
468  st->codecpar->width = ea->width;
469  st->codecpar->height = ea->height;
470  avpriv_set_pts_info(st, 33, ea->time_base.num, ea->time_base.den);
471  st->avg_frame_rate = (AVRational) { ea->time_base.den,
472  ea->time_base.num };
473  }
474 
475  if (ea->audio_codec) {
476  if (ea->num_channels <= 0 || ea->num_channels > 2) {
478  "Unsupported number of channels: %d\n", ea->num_channels);
479  ea->audio_codec = 0;
480  return 1;
481  }
482  if (ea->sample_rate <= 0) {
483  av_log(s, AV_LOG_ERROR,
484  "Unsupported sample rate: %d\n", ea->sample_rate);
485  ea->audio_codec = 0;
486  return 1;
487  }
488  if (ea->bytes <= 0) {
489  av_log(s, AV_LOG_ERROR,
490  "Invalid number of bytes per sample: %d\n", ea->bytes);
492  return 1;
493  }
494 
495  /* initialize the audio decoder stream */
496  st = avformat_new_stream(s, NULL);
497  if (!st)
498  return AVERROR(ENOMEM);
499  avpriv_set_pts_info(st, 33, 1, ea->sample_rate);
501  st->codecpar->codec_id = ea->audio_codec;
502  st->codecpar->codec_tag = 0; /* no tag */
503  st->codecpar->channels = ea->num_channels;
504  st->codecpar->sample_rate = ea->sample_rate;
505  st->codecpar->bits_per_coded_sample = ea->bytes * 8;
506  st->codecpar->bit_rate = st->codecpar->channels *
507  st->codecpar->sample_rate *
509  st->codecpar->block_align = st->codecpar->channels *
511  ea->audio_stream_index = st->index;
512  st->start_time = 0;
513  }
514 
515  return 1;
516 }
517 
519 {
520  EaDemuxContext *ea = s->priv_data;
521  AVIOContext *pb = s->pb;
522  unsigned int chunk_type, chunk_size;
523  int ret = 0, packet_read = 0, key = 0;
524  int av_uninit(num_samples);
525 
526  while (!packet_read) {
527  chunk_type = avio_rl32(pb);
528  chunk_size = ea->big_endian ? avio_rb32(pb) : avio_rl32(pb);
529  if (chunk_size < 8)
530  return AVERROR_INVALIDDATA;
531  chunk_size -= 8;
532 
533  switch (chunk_type) {
534  /* audio data */
535  case ISNh_TAG:
536  /* header chunk also contains data; skip over the header portion */
537  if (chunk_size < 32)
538  return AVERROR_INVALIDDATA;
539  avio_skip(pb, 32);
540  chunk_size -= 32;
541  case ISNd_TAG:
542  case SCDl_TAG:
543  case SNDC_TAG:
544  case SDEN_TAG:
545  if (!ea->audio_codec) {
546  avio_skip(pb, chunk_size);
547  break;
548  } else if (ea->audio_codec == AV_CODEC_ID_PCM_S16LE_PLANAR ||
549  ea->audio_codec == AV_CODEC_ID_MP3) {
550  num_samples = avio_rl32(pb);
551  avio_skip(pb, 8);
552  chunk_size -= 12;
553  }
554  if (!chunk_size)
555  continue;
556 
557  ret = av_get_packet(pb, pkt, chunk_size);
558  if (ret < 0)
559  return ret;
560  pkt->stream_index = ea->audio_stream_index;
561 
562  switch (ea->audio_codec) {
568  if (pkt->size < 4) {
569  av_log(s, AV_LOG_ERROR, "Packet is too short\n");
570  av_packet_unref(pkt);
571  return AVERROR_INVALIDDATA;
572  }
574  pkt->duration = AV_RB32(pkt->data);
575  else
576  pkt->duration = AV_RL32(pkt->data);
577  break;
579  pkt->duration = ret * 2 / ea->num_channels;
580  break;
582  case AV_CODEC_ID_MP3:
583  pkt->duration = num_samples;
584  break;
585  default:
586  pkt->duration = chunk_size / (ea->bytes * ea->num_channels);
587  }
588 
589  packet_read = 1;
590  break;
591 
592  /* ending tag */
593  case 0:
594  case ISNe_TAG:
595  case SCEl_TAG:
596  case SEND_TAG:
597  case SEEN_TAG:
598  ret = AVERROR(EIO);
599  packet_read = 1;
600  break;
601 
602  case MVIh_TAG:
603  case kVGT_TAG:
604  case pQGT_TAG:
605  case TGQs_TAG:
606  case MADk_TAG:
607  key = AV_PKT_FLAG_KEY;
608  case MVIf_TAG:
609  case fVGT_TAG:
610  case MADm_TAG:
611  case MADe_TAG:
612  avio_seek(pb, -8, SEEK_CUR); // include chunk preamble
613  chunk_size += 8;
614  goto get_video_packet;
615 
616  case mTCD_TAG:
617  if (chunk_size < 8)
618  return AVERROR_INVALIDDATA;
619 
620  avio_skip(pb, 8); // skip ea DCT header
621  chunk_size -= 8;
622  goto get_video_packet;
623 
624  case MV0K_TAG:
625  case MPCh_TAG:
626  case pIQT_TAG:
627  key = AV_PKT_FLAG_KEY;
628  case MV0F_TAG:
629 get_video_packet:
630  if (!chunk_size)
631  continue;
632 
633  ret = av_get_packet(pb, pkt, chunk_size);
634  if (ret < 0)
635  return ret;
636  pkt->stream_index = ea->video_stream_index;
637  pkt->flags |= key;
638  packet_read = 1;
639  break;
640 
641  default:
642  avio_skip(pb, chunk_size);
643  break;
644  }
645  }
646 
647  return ret;
648 }
649 
651  .name = "ea",
652  .long_name = NULL_IF_CONFIG_SMALL("Electronic Arts Multimedia"),
653  .priv_data_size = sizeof(EaDemuxContext),
654  .read_probe = ea_probe,
657 };
#define SEEN_TAG
static int process_ea_header(AVFormatContext *s)
Bytestream IO Context.
Definition: avio.h:104
#define AVERROR_INVALIDDATA
Invalid data found when processing input.
Definition: error.h:54
static uint32_t read_arbitrary(AVIOContext *pb)
int size
#define SCDl_TAG
#define pIQT_TAG
#define AV_LOG_WARNING
Something somehow does not look correct.
Definition: log.h:130
void avpriv_set_pts_info(AVStream *s, int pts_wrap_bits, unsigned int pts_num, unsigned int pts_den)
Set the time base and wrapping info for a given stream.
Definition: utils.c:2986
#define mTCD_TAG
enum AVCodecID codec_id
Specific type of the encoded data (the codec used).
Definition: avcodec.h:3483
int num
numerator
Definition: rational.h:44
int index
stream index in AVFormatContext
Definition: avformat.h:706
int size
Definition: avcodec.h:1347
av_log(ac->avr, AV_LOG_TRACE, "%d samples - audio_convert: %s to %s (%s)\, len, av_get_sample_fmt_name(ac->in_fmt), av_get_sample_fmt_name(ac->out_fmt), use_generic ? ac->func_descr_generic :ac->func_descr)
int64_t avio_seek(AVIOContext *s, int64_t offset, int whence)
fseek() equivalent for AVIOContext.
Definition: aviobuf.c:242
#define MV0F_TAG
static void process_video_header_mdec(AVFormatContext *s)
AVRational time_base
enum AVCodecID audio_codec
#define fVGT_TAG
#define SCEl_TAG
#define pQGT_TAG
enum AVCodecID video_codec
#define ISNe_TAG
#define TGQs_TAG
Format I/O context.
Definition: avformat.h:940
#define MPCh_TAG
#define PT00_TAG
uint8_t
int width
Video only.
Definition: avcodec.h:3525
#define MADm_TAG
unsigned int avio_rb32(AVIOContext *s)
Definition: aviobuf.c:696
#define AV_RB32
Definition: intreadwrite.h:130
int64_t duration
Duration of this packet in AVStream->time_base units, 0 if unknown.
Definition: avcodec.h:1364
AVStream * avformat_new_stream(AVFormatContext *s, const AVCodec *c)
Add a new stream to a media file.
Definition: utils.c:2648
uint8_t * data
Definition: avcodec.h:1346
int av_get_packet(AVIOContext *s, AVPacket *pkt, int size)
Allocate and read the payload of a packet and initialize its fields with default values.
Definition: utils.c:117
static av_always_inline int64_t avio_tell(AVIOContext *s)
ftell() equivalent for AVIOContext.
Definition: avio.h:295
#define SEND_TAG
#define AV_PKT_FLAG_KEY
The packet contains a keyframe.
Definition: avcodec.h:1378
AVCodecID
Identify the syntax and semantics of the bitstream.
Definition: avcodec.h:193
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
Definition: log.h:124
#define SCHl_TAG
#define MADk_TAG
unsigned int avio_rl32(AVIOContext *s)
Definition: aviobuf.c:665
#define AVERROR(e)
Definition: error.h:43
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification. ...
Definition: internal.h:148
#define AV_LOG_DEBUG
Stuff which is only useful for libav* developers.
Definition: log.h:145
preferred ID for decoding MPEG audio layer 1, 2 or 3
Definition: avcodec.h:479
enum AVMediaType codec_type
General type of the encoded data.
Definition: avcodec.h:3479
AVRational avg_frame_rate
Average framerate.
Definition: avformat.h:781
int flags
A combination of AV_PKT_FLAG values.
Definition: avcodec.h:1352
int avio_r8(AVIOContext *s)
Definition: aviobuf.c:536
int bit_rate
The average bitrate of the encoded data (in bits per second).
Definition: avcodec.h:3512
#define SDEN_TAG
unsigned char * buf
Buffer must have AVPROBE_PADDING_SIZE of extra allocated bytes filled with zero.
Definition: avformat.h:400
int block_align
Audio only.
Definition: avcodec.h:3571
static void process_audio_header_eacs(AVFormatContext *s)
#define SNDC_TAG
static int process_audio_header_elements(AVFormatContext *s)
static int read_probe(AVProbeData *pd)
Definition: jvdec.c:55
static int ea_read_header(AVFormatContext *s)
static av_always_inline int64_t avio_skip(AVIOContext *s, int64_t offset)
Skip given number of bytes forward.
Definition: avio.h:286
#define AV_RL32
Definition: intreadwrite.h:146
preferred ID for MPEG-1/2 video decoding
Definition: avcodec.h:198
static int read_header(FFV1Context *f)
Definition: ffv1dec.c:546
Stream structure.
Definition: avformat.h:705
#define ISNd_TAG
NULL
Definition: eval.c:55
#define av_bswap32
Definition: bswap.h:33
#define SEAD_TAG
#define EACS_TAG
AVIOContext * pb
I/O context.
Definition: avformat.h:982
#define kVGT_TAG
void av_packet_unref(AVPacket *pkt)
Wipe the packet.
Definition: avpacket.c:347
#define GSTR_TAG
static int read_packet(AVFormatContext *ctx, AVPacket *pkt)
Definition: libcdio.c:114
#define MVIh_TAG
rational number numerator/denominator
Definition: rational.h:43
#define MVhd_TAG
This structure contains the data a format has to probe a file.
Definition: avformat.h:398
static int ea_probe(AVProbeData *p)
#define SHEN_TAG
int sample_rate
Audio only.
Definition: avcodec.h:3564
#define AVPROBE_SCORE_MAX
maximum score
Definition: avformat.h:407
#define MV0K_TAG
unsigned int avio_rl16(AVIOContext *s)
Definition: aviobuf.c:649
Main libavformat public API header.
int64_t start_time
Decoding: pts of the first frame of the stream, in stream time base.
Definition: avformat.h:750
#define MADe_TAG
static void process_audio_header_sead(AVFormatContext *s)
int den
denominator
Definition: rational.h:45
#define ISNh_TAG
int eof_reached
true if eof reached
Definition: avio.h:132
#define MVIf_TAG
void * priv_data
Format private data.
Definition: avformat.h:968
static void process_video_header_cmv(AVFormatContext *s)
int bits_per_coded_sample
Definition: avcodec.h:3514
int channels
Audio only.
Definition: avcodec.h:3560
#define av_uninit(x)
Definition: attributes.h:109
const char * name
A comma separated list of short names for the format.
Definition: avformat.h:529
static int ea_read_packet(AVFormatContext *s, AVPacket *pkt)
AVCodecParameters * codecpar
Definition: avformat.h:831
uint32_t codec_tag
Additional information about the codec (corresponds to the AVI FOURCC).
Definition: avcodec.h:3487
static void process_video_header_vp6(AVFormatContext *s)
int stream_index
Definition: avcodec.h:1348
AVInputFormat ff_ea_demuxer
This structure stores compressed data.
Definition: avcodec.h:1323