34 #define SCHl_TAG MKTAG('S', 'C', 'H', 'l')
35 #define SEAD_TAG MKTAG('S', 'E', 'A', 'D')
36 #define SNDC_TAG MKTAG('S', 'N', 'D', 'C')
37 #define SEND_TAG MKTAG('S', 'E', 'N', 'D')
38 #define SHEN_TAG MKTAG('S', 'H', 'E', 'N')
39 #define SDEN_TAG MKTAG('S', 'D', 'E', 'N')
40 #define SEEN_TAG MKTAG('S', 'E', 'E', 'N')
41 #define ISNh_TAG MKTAG('1', 'S', 'N', 'h')
42 #define EACS_TAG MKTAG('E', 'A', 'C', 'S')
43 #define ISNd_TAG MKTAG('1', 'S', 'N', 'd')
44 #define ISNe_TAG MKTAG('1', 'S', 'N', 'e')
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')
50 #define fVGT_TAG MKTAG('f', 'V', 'G', 'T')
51 #define mTCD_TAG MKTAG('m', 'T', 'C', 'D')
52 #define MADk_TAG MKTAG('M', 'A', 'D', 'k')
53 #define MADm_TAG MKTAG('M', 'A', 'D', 'm')
54 #define MADe_TAG MKTAG('M', 'A', 'D', 'e')
55 #define MPCh_TAG MKTAG('M', 'P', 'C', 'h')
56 #define TGQs_TAG MKTAG('T', 'G', 'Q', 's')
57 #define pQGT_TAG MKTAG('p', 'Q', 'G', 'T')
58 #define pIQT_TAG MKTAG('p', 'I', 'Q', 'T')
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 AVhd_TAG MKTAG('A', 'V', 'h', 'd')
63 #define AV0K_TAG MKTAG('A', 'V', '0', 'K')
64 #define AV0F_TAG MKTAG('A', 'V', '0', 'F')
65 #define MVIh_TAG MKTAG('M', 'V', 'I', 'h')
66 #define MVIf_TAG MKTAG('M', 'V', 'I', 'f')
67 #define AVP6_TAG MKTAG('A', 'V', 'P', '6')
100 for (i = 0; i <
size; i++) {
114 int compression_type = -1, revision = -1, revision2 = -1;
137 "revision (element 0x80) set to 0x%08x\n", revision);
142 "num_channels (element 0x82) set to 0x%08x\n",
148 "compression_type (element 0x83) set to 0x%08x\n",
154 "sample_rate (element 0x84) set to %i\n",
160 "num_samples (element 0x85) set to 0x%08x\n",
165 "element 0x%02x set to 0x%08"PRIx32
"\n",
173 "revision2 (element 0xA0) set to 0x%08x\n",
178 "end of header block reached (within audio subheader)\n");
184 "element 0x%02x set to 0x%08"PRIx32
"\n",
196 "header element 0x%02x set to 0x%08"PRIx32
"\n",
202 switch (compression_type) {
253 "stream type; compression_type=%i",
268 int compression_type;
273 compression_type =
avio_r8(pb);
276 switch (compression_type) {
296 "stream type; audio compression_type=%i",
355 uint32_t blockid,
size = 0;
390 }
else if ((blockid & 0xFFFF) !=
PT00_TAG) {
448 avio_seek(pb, startpos + size, SEEK_SET);
458 unsigned big_endian,
size;
476 big_endian = size > 0x000FFFFF;
479 if (size > 0xfffff || size < 8)
527 "Unsupported number of channels: %d\n", ea->
num_channels);
537 if (ea->
bytes <= 0) {
539 "Invalid number of bytes per sample: %d\n", ea->
bytes);
571 int partial_packet = 0;
572 unsigned int chunk_type, chunk_size;
573 int ret = 0, packet_read = 0, key = 0;
576 while (!packet_read || partial_packet) {
583 switch (chunk_type) {
605 if (partial_packet) {
671 goto get_video_packet;
679 goto get_video_packet;
692 if (partial_packet) {
700 partial_packet = chunk_type ==
MVIh_TAG;
715 if (ret < 0 && partial_packet)
static int process_ea_header(AVFormatContext *s)
#define AVERROR_INVALIDDATA
Invalid data found when processing input.
static uint32_t read_arbitrary(AVIOContext *pb)
void av_free_packet(AVPacket *pkt)
Free a packet.
static void process_video_header_cmv(AVFormatContext *s, VideoProperties *video)
#define AV_LOG_WARNING
Something somehow does not look correct.
int index
stream index in AVFormatContext
int64_t avio_seek(AVIOContext *s, int64_t offset, int whence)
fseek() equivalent for AVIOContext.
enum AVCodecID audio_codec
int64_t avio_skip(AVIOContext *s, int64_t offset)
Skip given number of bytes forward.
int block_align
number of bytes per packet if constant and known or 0 Used by some WAV based audio codecs...
void void avpriv_request_sample(void *avc, const char *msg,...) av_printf_format(2
Log a generic warning message about a missing feature.
unsigned int avio_rb32(AVIOContext *s)
enum AVStreamParseType need_parsing
AVStream * avformat_new_stream(AVFormatContext *s, const AVCodec *c)
Add a new stream to a media file.
uint64_t_TMPL AV_WL64 unsigned int_TMPL AV_WL32 unsigned int_TMPL AV_WL24 unsigned int_TMPL AV_WL16 uint64_t_TMPL AV_WB64 unsigned int_TMPL AV_RB32
static int init_video_stream(AVFormatContext *s, VideoProperties *video)
static av_always_inline int64_t avio_tell(AVIOContext *s)
ftell() equivalent for AVIOContext.
int bits_per_coded_sample
bits per sample/pixel from the demuxer (needed for huffyuv).
int duration
Duration of this packet in AVStream->time_base units, 0 if unknown.
#define AV_PKT_FLAG_KEY
The packet contains a keyframe.
AVCodecID
Identify the syntax and semantics of the bitstream.
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
unsigned int avio_rl32(AVIOContext *s)
static int process_video_header_vp6(AVFormatContext *s, VideoProperties *video)
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification. ...
#define AV_LOG_DEBUG
Stuff which is only useful for libav* developers.
preferred ID for decoding MPEG audio layer 1, 2 or 3
AVRational avg_frame_rate
Average framerate.
int flags
A combination of AV_PKT_FLAG values.
int avio_r8(AVIOContext *s)
AVCodecContext * codec
Codec context associated with this stream.
unsigned char * buf
Buffer must have AVPROBE_PADDING_SIZE of extra allocated bytes filled with zero.
static void process_audio_header_eacs(AVFormatContext *s)
int bit_rate
the average bitrate
static void process_video_header_mdec(AVFormatContext *s, VideoProperties *video)
static int process_audio_header_elements(AVFormatContext *s)
int width
picture width / height.
static int ea_read_header(AVFormatContext *s)
preferred ID for MPEG-1/2 video decoding
static int read_header(FFV1Context *f)
static int read_packet(void *opaque, uint8_t *buf, int buf_size)
enum AVMediaType codec_type
uint64_t_TMPL AV_WL64 unsigned int_TMPL AV_WL32 unsigned int_TMPL AV_WL24 unsigned int_TMPL AV_WL16 uint64_t_TMPL AV_WB64 unsigned int_TMPL AV_WB32 unsigned int_TMPL AV_WB24 unsigned int_TMPL AV_WB16 unsigned int_TMPL byte
int sample_rate
samples per second
AVIOContext * pb
I/O context.
unsigned int codec_tag
fourcc (LSB first, so "ABCD" -> ('D'<<24) + ('C'<<16) + ('B'<<8) + 'A').
rational number numerator/denominator
This structure contains the data a format has to probe a file.
static int ea_probe(AVProbeData *p)
static av_always_inline AVRational av_inv_q(AVRational q)
Invert a rational.
int64_t duration
Decoding: duration of the stream, in stream time base.
unsigned int avio_rl16(AVIOContext *s)
int64_t start_time
Decoding: pts of the first frame of the stream in presentation order, in stream time base...
static void process_audio_header_sead(AVFormatContext *s)
int64_t nb_frames
number of frames in this stream if known or 0
int channels
number of audio channels
void * priv_data
Format private data.
static int ea_read_packet(AVFormatContext *s, AVPacket *pkt)
int avio_feof(AVIOContext *s)
feof() equivalent for AVIOContext.
AVInputFormat ff_ea_demuxer
AVRational r_frame_rate
Real base framerate of the stream.
uint64_t_TMPL AV_WL64 unsigned int_TMPL AV_RL32
This structure stores compressed data.