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 "libavutil/intreadwrite.h"
29 #include "avformat.h"
30 #include "internal.h"
31 
32 #define SCHl_TAG MKTAG('S', 'C', 'H', 'l')
33 #define SEAD_TAG MKTAG('S', 'E', 'A', 'D') /* Sxxx header */
34 #define SNDC_TAG MKTAG('S', 'N', 'D', 'C') /* Sxxx data */
35 #define SEND_TAG MKTAG('S', 'E', 'N', 'D') /* Sxxx end */
36 #define SHEN_TAG MKTAG('S', 'H', 'E', 'N') /* SxEN header */
37 #define SDEN_TAG MKTAG('S', 'D', 'E', 'N') /* SxEN data */
38 #define SEEN_TAG MKTAG('S', 'E', 'E', 'N') /* SxEN end */
39 #define ISNh_TAG MKTAG('1', 'S', 'N', 'h') /* 1SNx header */
40 #define EACS_TAG MKTAG('E', 'A', 'C', 'S')
41 #define ISNd_TAG MKTAG('1', 'S', 'N', 'd') /* 1SNx data */
42 #define ISNe_TAG MKTAG('1', 'S', 'N', 'e') /* 1SNx end */
43 #define PT00_TAG MKTAG('P', 'T', 0x0, 0x0)
44 #define GSTR_TAG MKTAG('G', 'S', 'T', 'R')
45 #define SCDl_TAG MKTAG('S', 'C', 'D', 'l')
46 #define SCEl_TAG MKTAG('S', 'C', 'E', 'l')
47 #define kVGT_TAG MKTAG('k', 'V', 'G', 'T') /* TGV I-frame */
48 #define fVGT_TAG MKTAG('f', 'V', 'G', 'T') /* TGV P-frame */
49 #define mTCD_TAG MKTAG('m', 'T', 'C', 'D') /* MDEC */
50 #define MADk_TAG MKTAG('M', 'A', 'D', 'k') /* MAD I-frame */
51 #define MADm_TAG MKTAG('M', 'A', 'D', 'm') /* MAD P-frame */
52 #define MADe_TAG MKTAG('M', 'A', 'D', 'e') /* MAD lqp-frame */
53 #define MPCh_TAG MKTAG('M', 'P', 'C', 'h') /* MPEG-2 */
54 #define TGQs_TAG MKTAG('T', 'G', 'Q', 's') /* TGQ I-frame (appears in .TGQ files) */
55 #define pQGT_TAG MKTAG('p', 'Q', 'G', 'T') /* TGQ I-frame (appears in .UV files) */
56 #define pIQT_TAG MKTAG('p', 'I', 'Q', 'T') /* TQI/UV2 I-frame (.UV2/.WVE) */
57 #define MVhd_TAG MKTAG('M', 'V', 'h', 'd')
58 #define MV0K_TAG MKTAG('M', 'V', '0', 'K')
59 #define MV0F_TAG MKTAG('M', 'V', '0', 'F')
60 #define MVIh_TAG MKTAG('M', 'V', 'I', 'h') /* CMV header */
61 #define MVIf_TAG MKTAG('M', 'V', 'I', 'f') /* CMV I-frame */
62 
63 typedef struct EaDemuxContext {
65 
68  int width, height;
70 
73 
74  int bytes;
79 
80 static uint32_t read_arbitrary(AVIOContext *pb)
81 {
82  uint8_t size, byte;
83  int i;
84  uint32_t word;
85 
86  size = avio_r8(pb);
87 
88  word = 0;
89  for (i = 0; i < size; i++) {
90  byte = avio_r8(pb);
91  word <<= 8;
92  word |= byte;
93  }
94 
95  return word;
96 }
97 
99 {
100  EaDemuxContext *ea = s->priv_data;
101  AVIOContext *pb = s->pb;
102  int in_header = 1;
103  int compression_type = -1, revision = -1, revision2 = -1;
104 
105  ea->bytes = 2;
106  ea->sample_rate = -1;
107  ea->num_channels = 1;
108 
109  while (!pb->eof_reached && in_header) {
110  int in_subheader;
111  uint8_t byte;
112  byte = avio_r8(pb);
113 
114  switch (byte) {
115  case 0xFD:
116  av_log(s, AV_LOG_DEBUG, "entered audio subheader\n");
117  in_subheader = 1;
118  while (!pb->eof_reached && in_subheader) {
119  uint8_t subbyte;
120  subbyte = avio_r8(pb);
121 
122  switch (subbyte) {
123  case 0x80:
124  revision = read_arbitrary(pb);
125  av_log(s, AV_LOG_DEBUG,
126  "revision (element 0x80) set to 0x%08x\n", revision);
127  break;
128  case 0x82:
129  ea->num_channels = read_arbitrary(pb);
130  av_log(s, AV_LOG_DEBUG,
131  "num_channels (element 0x82) set to 0x%08x\n",
132  ea->num_channels);
133  break;
134  case 0x83:
135  compression_type = read_arbitrary(pb);
136  av_log(s, AV_LOG_DEBUG,
137  "compression_type (element 0x83) set to 0x%08x\n",
138  compression_type);
139  break;
140  case 0x84:
141  ea->sample_rate = read_arbitrary(pb);
142  av_log(s, AV_LOG_DEBUG,
143  "sample_rate (element 0x84) set to %i\n",
144  ea->sample_rate);
145  break;
146  case 0x85:
147  ea->num_samples = read_arbitrary(pb);
148  av_log(s, AV_LOG_DEBUG,
149  "num_samples (element 0x85) set to 0x%08x\n",
150  ea->num_samples);
151  break;
152  case 0x8A:
153  av_log(s, AV_LOG_DEBUG,
154  "element 0x%02x set to 0x%08x\n",
155  subbyte, read_arbitrary(pb));
156  av_log(s, AV_LOG_DEBUG, "exited audio subheader\n");
157  in_subheader = 0;
158  break;
159  case 0xA0:
160  revision2 = read_arbitrary(pb);
161  av_log(s, AV_LOG_DEBUG,
162  "revision2 (element 0xA0) set to 0x%08x\n",
163  revision2);
164  break;
165  case 0xFF:
166  av_log(s, AV_LOG_DEBUG,
167  "end of header block reached (within audio subheader)\n");
168  in_subheader = 0;
169  in_header = 0;
170  break;
171  default:
172  av_log(s, AV_LOG_DEBUG,
173  "element 0x%02x set to 0x%08x\n",
174  subbyte, read_arbitrary(pb));
175  break;
176  }
177  }
178  break;
179  case 0xFF:
180  av_log(s, AV_LOG_DEBUG, "end of header block reached\n");
181  in_header = 0;
182  break;
183  default:
184  av_log(s, AV_LOG_DEBUG,
185  "header element 0x%02x set to 0x%08x\n",
186  byte, read_arbitrary(pb));
187  break;
188  }
189  }
190 
191  switch (compression_type) {
192  case 0:
194  break;
195  case 7:
197  break;
198  case -1:
199  switch (revision) {
200  case 1:
202  break;
203  case 2:
205  break;
206  case 3:
208  break;
209  case -1:
210  break;
211  default:
212  av_log(s, AV_LOG_ERROR,
213  "unsupported stream type; revision=%i\n", revision);
214  return 0;
215  }
216  switch (revision2) {
217  case 8:
219  break;
220  case 10:
222  break;
223  case 16:
225  break;
226  case -1:
227  break;
228  default:
230  av_log(s, AV_LOG_ERROR,
231  "unsupported stream type; revision2=%i\n", revision2);
232  return 0;
233  }
234  break;
235  default:
236  av_log(s, AV_LOG_ERROR,
237  "unsupported stream type; compression_type=%i\n",
238  compression_type);
239  return 0;
240  }
241 
242  if (ea->sample_rate == -1)
243  ea->sample_rate = revision == 3 ? 48000 : 22050;
244 
245  return 1;
246 }
247 
249 {
250  EaDemuxContext *ea = s->priv_data;
251  AVIOContext *pb = s->pb;
252  int compression_type;
253 
254  ea->sample_rate = ea->big_endian ? avio_rb32(pb) : avio_rl32(pb);
255  ea->bytes = avio_r8(pb); /* 1=8-bit, 2=16-bit */
256  ea->num_channels = avio_r8(pb);
257  compression_type = avio_r8(pb);
258  avio_skip(pb, 13);
259 
260  switch (compression_type) {
261  case 0:
262  switch (ea->bytes) {
263  case 1:
265  break;
266  case 2:
268  break;
269  }
270  break;
271  case 1:
273  ea->bytes = 1;
274  break;
275  case 2:
277  break;
278  default:
279  av_log(s, AV_LOG_ERROR,
280  "unsupported stream type; audio compression_type=%i\n",
281  compression_type);
282  }
283 }
284 
286 {
287  EaDemuxContext *ea = s->priv_data;
288  AVIOContext *pb = s->pb;
289 
290  ea->sample_rate = avio_rl32(pb);
291  ea->bytes = avio_rl32(pb); /* 1=8-bit, 2=16-bit */
292  ea->num_channels = avio_rl32(pb);
294 }
295 
297 {
298  EaDemuxContext *ea = s->priv_data;
299  AVIOContext *pb = s->pb;
300  avio_skip(pb, 4);
301  ea->width = avio_rl16(pb);
302  ea->height = avio_rl16(pb);
303  ea->time_base = (AVRational) { 1, 15 };
305 }
306 
308 {
309  EaDemuxContext *ea = s->priv_data;
310  AVIOContext *pb = s->pb;
311 
312  avio_skip(pb, 16);
313  ea->time_base.den = avio_rl32(pb);
314  ea->time_base.num = avio_rl32(pb);
316 }
317 
319 {
320  EaDemuxContext *ea = s->priv_data;
321  int fps;
322 
323  avio_skip(s->pb, 10);
324  fps = avio_rl16(s->pb);
325  if (fps)
326  ea->time_base = (AVRational) { 1, fps };
328 }
329 
330 /* Process EA file header.
331  * Return 1 if the EA file is valid and successfully opened, 0 otherwise. */
333 {
334  uint32_t blockid, size = 0;
335  EaDemuxContext *ea = s->priv_data;
336  AVIOContext *pb = s->pb;
337  int i;
338 
339  for (i = 0; i < 5 && (!ea->audio_codec || !ea->video_codec); i++) {
340  unsigned int startpos = avio_tell(pb);
341  int err = 0;
342 
343  blockid = avio_rl32(pb);
344  size = avio_rl32(pb);
345  if (i == 0)
346  ea->big_endian = size > 0x000FFFFF;
347  if (ea->big_endian)
348  size = av_bswap32(size);
349 
350  switch (blockid) {
351  case ISNh_TAG:
352  if (avio_rl32(pb) != EACS_TAG) {
353  av_log(s, AV_LOG_ERROR, "unknown 1SNh headerid\n");
354  return 0;
355  }
357  break;
358 
359  case SCHl_TAG:
360  case SHEN_TAG:
361  blockid = avio_rl32(pb);
362  if (blockid == GSTR_TAG) {
363  avio_skip(pb, 4);
364  } else if ((blockid & 0xFFFF) != PT00_TAG) {
365  av_log(s, AV_LOG_ERROR, "unknown SCHl headerid\n");
366  return 0;
367  }
369  break;
370 
371  case SEAD_TAG:
373  break;
374 
375  case MVIh_TAG:
377  break;
378 
379  case kVGT_TAG:
381  ea->time_base = (AVRational) { 1, 15 };
382  break;
383 
384  case mTCD_TAG:
386  break;
387 
388  case MPCh_TAG:
390  break;
391 
392  case pQGT_TAG:
393  case TGQs_TAG:
395  break;
396 
397  case pIQT_TAG:
399  break;
400 
401  case MADk_TAG:
403  break;
404 
405  case MVhd_TAG:
407  break;
408  }
409 
410  if (err < 0) {
411  av_log(s, AV_LOG_ERROR, "error parsing header: %i\n", err);
412  return err;
413  }
414 
415  avio_seek(pb, startpos + size, SEEK_SET);
416  }
417 
418  avio_seek(pb, 0, SEEK_SET);
419 
420  return 1;
421 }
422 
423 static int ea_probe(AVProbeData *p)
424 {
425  switch (AV_RL32(&p->buf[0])) {
426  case ISNh_TAG:
427  case SCHl_TAG:
428  case SEAD_TAG:
429  case SHEN_TAG:
430  case kVGT_TAG:
431  case MADk_TAG:
432  case MPCh_TAG:
433  case MVhd_TAG:
434  case MVIh_TAG:
435  break;
436  default:
437  return 0;
438  }
439  if (AV_RL32(&p->buf[4]) > 0xfffff && AV_RB32(&p->buf[4]) > 0xfffff)
440  return 0;
441 
442  return AVPROBE_SCORE_MAX;
443 }
444 
446 {
447  EaDemuxContext *ea = s->priv_data;
448  AVStream *st;
449 
450  if (!process_ea_header(s))
451  return AVERROR(EIO);
452 
453  if (ea->video_codec) {
454  /* initialize the video decoder stream */
455  st = avformat_new_stream(s, NULL);
456  if (!st)
457  return AVERROR(ENOMEM);
458  ea->video_stream_index = st->index;
460  st->codec->codec_id = ea->video_codec;
461  st->codec->codec_tag = 0; /* no fourcc */
462  st->codec->width = ea->width;
463  st->codec->height = ea->height;
464  avpriv_set_pts_info(st, 33, ea->time_base.num, ea->time_base.den);
465  st->avg_frame_rate = (AVRational) { ea->time_base.den,
466  ea->time_base.num };
467  }
468 
469  if (ea->audio_codec) {
470  if (ea->num_channels <= 0 || ea->num_channels > 2) {
472  "Unsupported number of channels: %d\n", ea->num_channels);
473  ea->audio_codec = 0;
474  return 1;
475  }
476  if (ea->sample_rate <= 0) {
477  av_log(s, AV_LOG_ERROR,
478  "Unsupported sample rate: %d\n", ea->sample_rate);
479  ea->audio_codec = 0;
480  return 1;
481  }
482  if (ea->bytes <= 0) {
483  av_log(s, AV_LOG_ERROR,
484  "Invalid number of bytes per sample: %d\n", ea->bytes);
486  return 1;
487  }
488 
489  /* initialize the audio decoder stream */
490  st = avformat_new_stream(s, NULL);
491  if (!st)
492  return AVERROR(ENOMEM);
493  avpriv_set_pts_info(st, 33, 1, ea->sample_rate);
495  st->codec->codec_id = ea->audio_codec;
496  st->codec->codec_tag = 0; /* no tag */
497  st->codec->channels = ea->num_channels;
498  st->codec->sample_rate = ea->sample_rate;
499  st->codec->bits_per_coded_sample = ea->bytes * 8;
500  st->codec->bit_rate = st->codec->channels *
501  st->codec->sample_rate *
502  st->codec->bits_per_coded_sample / 4;
503  st->codec->block_align = st->codec->channels *
505  ea->audio_stream_index = st->index;
506  st->start_time = 0;
507  }
508 
509  return 1;
510 }
511 
513 {
514  EaDemuxContext *ea = s->priv_data;
515  AVIOContext *pb = s->pb;
516  unsigned int chunk_type, chunk_size;
517  int ret = 0, packet_read = 0, key = 0;
518  int av_uninit(num_samples);
519 
520  while (!packet_read) {
521  chunk_type = avio_rl32(pb);
522  chunk_size = ea->big_endian ? avio_rb32(pb) : avio_rl32(pb);
523  if (chunk_size <= 8)
524  return AVERROR_INVALIDDATA;
525  chunk_size -= 8;
526 
527  switch (chunk_type) {
528  /* audio data */
529  case ISNh_TAG:
530  /* header chunk also contains data; skip over the header portion */
531  if (chunk_size < 32)
532  return AVERROR_INVALIDDATA;
533  avio_skip(pb, 32);
534  chunk_size -= 32;
535  case ISNd_TAG:
536  case SCDl_TAG:
537  case SNDC_TAG:
538  case SDEN_TAG:
539  if (!ea->audio_codec) {
540  avio_skip(pb, chunk_size);
541  break;
542  } else if (ea->audio_codec == AV_CODEC_ID_PCM_S16LE_PLANAR ||
543  ea->audio_codec == AV_CODEC_ID_MP3) {
544  num_samples = avio_rl32(pb);
545  avio_skip(pb, 8);
546  chunk_size -= 12;
547  }
548  ret = av_get_packet(pb, pkt, chunk_size);
549  if (ret < 0)
550  return ret;
551  pkt->stream_index = ea->audio_stream_index;
552 
553  switch (ea->audio_codec) {
559  if (pkt->size < 4) {
560  av_log(s, AV_LOG_ERROR, "Packet is too short\n");
561  av_free_packet(pkt);
562  return AVERROR_INVALIDDATA;
563  }
565  pkt->duration = AV_RB32(pkt->data);
566  else
567  pkt->duration = AV_RL32(pkt->data);
568  break;
570  pkt->duration = ret * 2 / ea->num_channels;
571  break;
573  case AV_CODEC_ID_MP3:
574  pkt->duration = num_samples;
575  break;
576  default:
577  pkt->duration = chunk_size / (ea->bytes * ea->num_channels);
578  }
579 
580  packet_read = 1;
581  break;
582 
583  /* ending tag */
584  case 0:
585  case ISNe_TAG:
586  case SCEl_TAG:
587  case SEND_TAG:
588  case SEEN_TAG:
589  ret = AVERROR(EIO);
590  packet_read = 1;
591  break;
592 
593  case MVIh_TAG:
594  case kVGT_TAG:
595  case pQGT_TAG:
596  case TGQs_TAG:
597  case MADk_TAG:
598  key = AV_PKT_FLAG_KEY;
599  case MVIf_TAG:
600  case fVGT_TAG:
601  case MADm_TAG:
602  case MADe_TAG:
603  avio_seek(pb, -8, SEEK_CUR); // include chunk preamble
604  chunk_size += 8;
605  goto get_video_packet;
606 
607  case mTCD_TAG:
608  avio_skip(pb, 8); // skip ea DCT header
609  chunk_size -= 8;
610  goto get_video_packet;
611 
612  case MV0K_TAG:
613  case MPCh_TAG:
614  case pIQT_TAG:
615  key = AV_PKT_FLAG_KEY;
616  case MV0F_TAG:
617 get_video_packet:
618  ret = av_get_packet(pb, pkt, chunk_size);
619  if (ret < 0)
620  return ret;
621  pkt->stream_index = ea->video_stream_index;
622  pkt->flags |= key;
623  packet_read = 1;
624  break;
625 
626  default:
627  avio_skip(pb, chunk_size);
628  break;
629  }
630  }
631 
632  return ret;
633 }
634 
636  .name = "ea",
637  .long_name = NULL_IF_CONFIG_SMALL("Electronic Arts Multimedia"),
638  .priv_data_size = sizeof(EaDemuxContext),
639  .read_probe = ea_probe,
642 };
#define SEEN_TAG
static int process_ea_header(AVFormatContext *s)
Bytestream IO Context.
Definition: avio.h:68
#define AVERROR_INVALIDDATA
Invalid data found when processing input.
Definition: error.h:54
static uint32_t read_arbitrary(AVIOContext *pb)
int size
void av_free_packet(AVPacket *pkt)
Free a packet.
Definition: avpacket.c:242
#define SCDl_TAG
#define pIQT_TAG
#define AV_LOG_WARNING
Something somehow does not look correct.
Definition: log.h:129
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:3208
#define mTCD_TAG
int num
numerator
Definition: rational.h:44
int index
stream index in AVFormatContext
Definition: avformat.h:684
int size
Definition: avcodec.h:974
int64_t avio_seek(AVIOContext *s, int64_t offset, int whence)
fseek() equivalent for AVIOContext.
Definition: aviobuf.c:186
#define MV0F_TAG
static void process_video_header_mdec(AVFormatContext *s)
AVRational time_base
enum AVCodecID audio_codec
#define fVGT_TAG
#define SCEl_TAG
int block_align
number of bytes per packet if constant and known or 0 Used by some WAV based audio codecs...
Definition: avcodec.h:1816
#define pQGT_TAG
enum AVCodecID video_codec
#define ISNe_TAG
#define TGQs_TAG
Format I/O context.
Definition: avformat.h:871
#define MPCh_TAG
#define PT00_TAG
uint8_t
#define MADm_TAG
unsigned int avio_rb32(AVIOContext *s)
Definition: aviobuf.c:589
#define AV_RB32
Definition: intreadwrite.h:130
uint8_t * data
Definition: avcodec.h:973
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:118
static av_always_inline int64_t avio_tell(AVIOContext *s)
ftell() equivalent for AVIOContext.
Definition: avio.h:219
int bits_per_coded_sample
bits per sample/pixel from the demuxer (needed for huffyuv).
Definition: avcodec.h:2481
int duration
Duration of this packet in AVStream->time_base units, 0 if unknown.
Definition: avcodec.h:995
#define SEND_TAG
#define AV_PKT_FLAG_KEY
The packet contains a keyframe.
Definition: avcodec.h:1023
AVCodecID
Identify the syntax and semantics of the bitstream.
Definition: avcodec.h:105
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
Definition: log.h:123
#define SCHl_TAG
#define MADk_TAG
unsigned int avio_rl32(AVIOContext *s)
Definition: aviobuf.c:558
#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:142
#define AV_LOG_DEBUG
Stuff which is only useful for libav* developers.
Definition: log.h:144
preferred ID for decoding MPEG audio layer 1, 2 or 3
Definition: avcodec.h:369
void av_log(void *avcl, int level, const char *fmt,...)
Definition: log.c:148
AVStream * avformat_new_stream(AVFormatContext *s, AVCodec *c)
Add a new stream to a media file.
Definition: utils.c:2662
AVRational avg_frame_rate
Average framerate.
Definition: avformat.h:754
int flags
A combination of AV_PKT_FLAG values.
Definition: avcodec.h:979
int avio_r8(AVIOContext *s)
Definition: aviobuf.c:437
AVCodecContext * codec
Codec context associated with this stream.
Definition: avformat.h:702
#define SDEN_TAG
unsigned char * buf
Buffer must have AVPROBE_PADDING_SIZE of extra allocated bytes filled with zero.
Definition: avformat.h:390
static void process_audio_header_eacs(AVFormatContext *s)
int bit_rate
the average bitrate
Definition: avcodec.h:1112
#define SNDC_TAG
static int process_audio_header_elements(AVFormatContext *s)
static int read_probe(AVProbeData *pd)
Definition: jvdec.c:55
int width
picture width / height.
Definition: avcodec.h:1217
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:210
#define AV_RL32
Definition: intreadwrite.h:146
preferred ID for MPEG-1/2 video decoding
Definition: avcodec.h:110
static int read_header(FFV1Context *f)
Definition: ffv1dec.c:536
Stream structure.
Definition: avformat.h:683
#define ISNd_TAG
NULL
Definition: eval.c:55
#define av_bswap32
Definition: bswap.h:33
enum AVMediaType codec_type
Definition: avcodec.h:1062
#define SEAD_TAG
enum AVCodecID codec_id
Definition: avcodec.h:1065
#define EACS_TAG
int sample_rate
samples per second
Definition: avcodec.h:1779
AVIOContext * pb
I/O context.
Definition: avformat.h:913
#define kVGT_TAG
unsigned int codec_tag
fourcc (LSB first, so "ABCD" -> ('D'<<24) + ('C'<<16) + ('B'<<8) + 'A').
Definition: avcodec.h:1080
#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:388
static int ea_probe(AVProbeData *p)
#define SHEN_TAG
#define AVPROBE_SCORE_MAX
maximum score
Definition: avformat.h:395
#define MV0K_TAG
unsigned int avio_rl16(AVIOContext *s)
Definition: aviobuf.c:542
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:727
#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:96
#define MVIf_TAG
int channels
number of audio channels
Definition: avcodec.h:1780
void * priv_data
Format private data.
Definition: avformat.h:899
static void process_video_header_cmv(AVFormatContext *s)
#define av_uninit(x)
Definition: attributes.h:109
const char * name
A comma separated list of short names for the format.
Definition: avformat.h:516
static int ea_read_packet(AVFormatContext *s, AVPacket *pkt)
static void process_video_header_vp6(AVFormatContext *s)
int stream_index
Definition: avcodec.h:975
AVInputFormat ff_ea_demuxer
This structure stores compressed data.
Definition: avcodec.h:950