37#define SCHl_TAG MKTAG('S', 'C', 'H', 'l')
38#define SEAD_TAG MKTAG('S', 'E', 'A', 'D')
39#define SNDC_TAG MKTAG('S', 'N', 'D', 'C')
40#define SEND_TAG MKTAG('S', 'E', 'N', 'D')
41#define SHEN_TAG MKTAG('S', 'H', 'E', 'N')
42#define SDEN_TAG MKTAG('S', 'D', 'E', 'N')
43#define SEEN_TAG MKTAG('S', 'E', 'E', 'N')
44#define ISNh_TAG MKTAG('1', 'S', 'N', 'h')
45#define EACS_TAG MKTAG('E', 'A', 'C', 'S')
46#define ISNd_TAG MKTAG('1', 'S', 'N', 'd')
47#define ISNe_TAG MKTAG('1', 'S', 'N', 'e')
48#define PT00_TAG MKTAG('P', 'T', 0x0, 0x0)
49#define GSTR_TAG MKTAG('G', 'S', 'T', 'R')
50#define SCDl_TAG MKTAG('S', 'C', 'D', 'l')
51#define SCEl_TAG MKTAG('S', 'C', 'E', 'l')
52#define kVGT_TAG MKTAG('k', 'V', 'G', 'T')
53#define fVGT_TAG MKTAG('f', 'V', 'G', 'T')
54#define mTCD_TAG MKTAG('m', 'T', 'C', 'D')
55#define MADk_TAG MKTAG('M', 'A', 'D', 'k')
56#define MADm_TAG MKTAG('M', 'A', 'D', 'm')
57#define MADe_TAG MKTAG('M', 'A', 'D', 'e')
58#define MPCh_TAG MKTAG('M', 'P', 'C', 'h')
59#define TGQs_TAG MKTAG('T', 'G', 'Q', 's')
60#define pQGT_TAG MKTAG('p', 'Q', 'G', 'T')
61#define pIQT_TAG MKTAG('p', 'I', 'Q', 'T')
62#define MVhd_TAG MKTAG('M', 'V', 'h', 'd')
63#define MV0K_TAG MKTAG('M', 'V', '0', 'K')
64#define MV0F_TAG MKTAG('M', 'V', '0', 'F')
65#define AVhd_TAG MKTAG('A', 'V', 'h', 'd')
66#define AV0K_TAG MKTAG('A', 'V', '0', 'K')
67#define AV0F_TAG MKTAG('A', 'V', '0', 'F')
68#define MVIh_TAG MKTAG('M', 'V', 'I', 'h')
69#define MVIf_TAG MKTAG('M', 'V', 'I', 'f')
70#define AVP6_TAG MKTAG('A', 'V', 'P', '6')
122 int compression_type = -1, revision = -1, revision2 = -1;
145 "revision (element 0x80) set to 0x%08x\n", revision);
150 "num_channels (element 0x82) set to 0x%08x\n",
156 "compression_type (element 0x83) set to 0x%08x\n",
162 "sample_rate (element 0x84) set to %i\n",
168 "num_samples (element 0x85) set to 0x%08x\n",
173 "element 0x%02x set to 0x%08"PRIx32
"\n",
181 "revision2 (element 0xA0) set to 0x%08x\n",
186 "end of header block reached (within audio subheader)\n");
192 "element 0x%02x set to 0x%08"PRIx32
"\n",
208 "header element 0x%02x set to 0x%08"PRIx32
"\n",
214 switch (compression_type) {
266 "stream type; compression_type=%i",
283 int compression_type;
288 compression_type =
avio_r8(pb);
291 switch (compression_type) {
311 "stream type; audio compression_type=%i",
371 uint32_t blockid,
size = 0;
406 }
else if ((blockid & 0xFF) != (
PT00_TAG & 0xFF)) {
409 ea->
platform = (blockid >> 16) & 0xFF;
480 unsigned big_endian,
size;
498 big_endian =
size > 0x000FFFFF;
549 "Unsupported number of channels: %d\n", ea->
num_channels);
559 "Invalid number of bytes per sample: %d\n", ea->
bytes);
595 int partial_packet = 0;
597 unsigned int chunk_type, chunk_size;
598 int ret = 0, packet_read = 0,
key = 0, vp6a;
601 while ((!packet_read && !hit_end) || partial_packet) {
610 switch (chunk_type) {
640 if (partial_packet) {
674 pkt->duration = num_samples;
719 if (chunk_size > INT_MAX - 8)
723 goto get_video_packet;
731 goto get_video_packet;
744 if (chunk_size > INT_MAX - 3)
749 if (partial_packet) {
755 if (ret >= 0 && vp6a)
764 partial_packet = vp6a || chunk_type ==
MVIh_TAG;
778 if (ret >= 0 && hit_end && !packet_read)
784#define OFFSET(x) offsetof(EaDemuxContext, x)
785#define FLAGS AV_OPT_FLAG_VIDEO_PARAM | AV_OPT_FLAG_DECODING_PARAM
792 .class_name =
"ea demuxer",
int64_t avio_seek(AVIOContext *s, int64_t offset, int whence)
fseek() equivalent for AVIOContext.
int avio_feof(AVIOContext *s)
Similar to feof() but also returns nonzero on read errors.
static av_always_inline int64_t avio_tell(AVIOContext *s)
ftell() equivalent for AVIOContext.
unsigned int avio_rl16(AVIOContext *s)
int64_t avio_skip(AVIOContext *s, int64_t offset)
Skip given number of bytes forward.
unsigned int avio_rl32(AVIOContext *s)
unsigned int avio_rb32(AVIOContext *s)
int avio_r8(AVIOContext *s)
static int read_packet(void *opaque, uint8_t *buf, int buf_size)
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
#define i(width, name, range_min, range_max)
static int read_probe(const AVProbeData *p)
static int process_ea_header(AVFormatContext *s)
static void process_audio_header_eacs(AVFormatContext *s)
static int init_video_stream(AVFormatContext *s, VideoProperties *video)
static int ea_probe(const AVProbeData *p)
static void process_video_header_cmv(AVFormatContext *s, VideoProperties *video)
static int ea_read_packet(AVFormatContext *s, AVPacket *pkt)
static void process_video_header_mdec(AVFormatContext *s, VideoProperties *video)
static int process_video_header_vp6(AVFormatContext *s, VideoProperties *video)
static uint32_t read_arbitrary(AVIOContext *pb)
static const AVClass ea_class
static int ea_read_header(AVFormatContext *s)
static int process_audio_header_elements(AVFormatContext *s)
static void process_audio_header_sead(AVFormatContext *s)
static int read_header(FFV1Context *f, RangeCoder *c)
@ AV_OPT_TYPE_BOOL
Underlying C type is int.
AVCodecID
Identify the syntax and semantics of the bitstream.
@ AV_CODEC_ID_ADPCM_EA_R1
@ AV_CODEC_ID_ADPCM_IMA_EA_EACS
@ AV_CODEC_ID_ADPCM_IMA_EA_SEAD
@ AV_CODEC_ID_ADPCM_EA_R2
@ AV_CODEC_ID_PCM_S16LE_PLANAR
@ AV_CODEC_ID_ADPCM_EA_R3
@ AV_CODEC_ID_MP3
preferred ID for decoding MPEG audio layer 1, 2 or 3
@ AV_CODEC_ID_MPEG2VIDEO
preferred ID for MPEG-1/2 video decoding
void av_packet_unref(AVPacket *pkt)
Wipe the packet.
#define AV_PKT_FLAG_KEY
The packet contains a keyframe.
AVStream * avformat_new_stream(AVFormatContext *s, const struct AVCodec *c)
Add a new stream to a media file.
#define AVERROR_INVALIDDATA
Invalid data found when processing input.
#define AVERROR_EOF
End of file.
#define AV_LOG_DEBUG
Stuff which is only useful for libav* developers.
#define AV_LOG_WARNING
Something somehow does not look correct.
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
const char * av_default_item_name(void *ptr)
Return the context name.
static av_always_inline AVRational av_inv_q(AVRational q)
Invert a rational.
#define LIBAVUTIL_VERSION_INT
Macro definitions for various function/variable attributes.
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification.
int nb_channels
Number of channels in this layout.
Describe the class of an AVClass context structure.
int height
The height of the video frame in pixels.
int bits_per_coded_sample
The number of bits per sample in the codedwords.
AVChannelLayout ch_layout
The channel layout and number of channels.
int width
The width of the video frame in pixels.
int64_t bit_rate
The average bitrate of the encoded data (in bits per second).
enum AVMediaType codec_type
General type of the encoded data.
int block_align
The number of bytes per coded audio frame, required by some formats.
uint32_t codec_tag
Additional information about the codec (corresponds to the AVI FOURCC).
enum AVCodecID codec_id
Specific type of the encoded data (the codec used).
int sample_rate
The number of audio samples per second.
This structure stores compressed data.
This structure contains the data a format has to probe a file.
Rational number (pair of numerator and denominator).
AVCodecParameters * codecpar
Codec parameters associated with this stream.
int64_t nb_frames
number of frames in this stream if known or 0
int64_t duration
Decoding: duration of the stream, in stream time base.
int index
stream index in AVFormatContext
int64_t start_time
Decoding: pts of the first frame of the stream in presentation order, in stream time base.
AVRational avg_frame_rate
Average framerate.
AVRational r_frame_rate
Real base framerate of the stream.
enum AVCodecID audio_codec
enum AVStreamParseType need_parsing
#define avpriv_request_sample(...)