Go to the documentation of this file.
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')
116 int compression_type = -1, revision = -1, revision2 = -1;
139 "revision (element 0x80) set to 0x%08x\n", revision);
144 "num_channels (element 0x82) set to 0x%08x\n",
150 "compression_type (element 0x83) set to 0x%08x\n",
156 "sample_rate (element 0x84) set to %i\n",
162 "num_samples (element 0x85) set to 0x%08x\n",
167 "element 0x%02x set to 0x%08"PRIx32
"\n",
175 "revision2 (element 0xA0) set to 0x%08x\n",
180 "end of header block reached (within audio subheader)\n");
186 "element 0x%02x set to 0x%08"PRIx32
"\n",
198 "header element 0x%02x set to 0x%08"PRIx32
"\n",
204 switch (compression_type) {
256 "stream type; compression_type=%i",
273 int compression_type;
278 compression_type =
avio_r8(pb);
281 switch (compression_type) {
301 "stream type; audio compression_type=%i",
336 if (
video->time_base.den <= 0 ||
video->time_base.num <= 0) {
360 uint32_t blockid,
size = 0;
395 }
else if ((blockid & 0xFF) != (
PT00_TAG & 0xFF)) {
398 ea->
platform = (blockid >> 16) & 0xFF;
463 unsigned big_endian,
size;
481 big_endian =
size > 0x000FFFFF;
511 if (
video->time_base.num)
532 "Unsupported number of channels: %d\n", ea->
num_channels);
542 "Invalid number of bytes per sample: %d\n", ea->
bytes);
578 int partial_packet = 0;
580 unsigned int chunk_type, chunk_size;
581 int ret = 0, packet_read = 0,
key = 0;
584 while ((!packet_read && !hit_end) || partial_packet) {
593 switch (chunk_type) {
622 if (partial_packet) {
700 if (chunk_size > INT_MAX - 8)
704 goto get_video_packet;
712 goto get_video_packet;
725 if (partial_packet) {
734 partial_packet = chunk_type ==
MVIh_TAG;
749 if (
ret >= 0 && hit_end && !packet_read)
void av_packet_unref(AVPacket *pkt)
Wipe the packet.
#define AV_LOG_WARNING
Something somehow does not look correct.
static int ea_read_header(AVFormatContext *s)
static int process_video_header_vp6(AVFormatContext *s, VideoProperties *video)
Filter the word “frame” indicates either a video frame or a group of audio as stored in an AVFrame structure Format for each input and each output the list of supported formats For video that means pixel format For audio that means channel sample they are references to shared objects When the negotiation mechanism computes the intersection of the formats supported at each end of a all references to both lists are replaced with a reference to the intersection And when a single format is eventually chosen for a link amongst the remaining all references to the list are updated That means that if a filter requires that its input and output have the same format amongst a supported all it has to do is use a reference to the same list of formats query_formats can leave some formats unset and return AVERROR(EAGAIN) to cause the negotiation mechanism toagain later. That can be used by filters with complex requirements to use the format negotiated on one link to set the formats supported on another. Frame references ownership and permissions
AVStream * avformat_new_stream(AVFormatContext *s, const AVCodec *c)
Add a new stream to a media file.
enum AVMediaType codec_type
General type of the encoded data.
static int init_video_stream(AVFormatContext *s, VideoProperties *video)
#define AVERROR_EOF
End of file.
AVRational avg_frame_rate
Average framerate.
@ AV_CODEC_ID_ADPCM_EA_R3
static void process_audio_header_sead(AVFormatContext *s)
int64_t duration
Duration of this packet in AVStream->time_base units, 0 if unknown.
uint32_t codec_tag
Additional information about the codec (corresponds to the AVI FOURCC).
#define AV_PKT_FLAG_KEY
The packet contains a keyframe.
@ AV_CODEC_ID_PCM_S16LE_PLANAR
static uint32_t read_arbitrary(AVIOContext *pb)
static av_always_inline int64_t avio_tell(AVIOContext *s)
ftell() equivalent for AVIOContext.
@ AV_CODEC_ID_MP3
preferred ID for decoding MPEG audio layer 1, 2 or 3
int64_t duration
Decoding: duration of the stream, in stream time base.
unsigned int avio_rl16(AVIOContext *s)
enum AVCodecID audio_codec
unsigned int avio_rb32(AVIOContext *s)
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
@ AV_CODEC_ID_ADPCM_IMA_EA_SEAD
unsigned char * buf
Buffer must have AVPROBE_PADDING_SIZE of extra allocated bytes filled with zero.
#define AV_LOG_DEBUG
Stuff which is only useful for libav* developers.
enum AVStreamParseType need_parsing
static int process_audio_header_elements(AVFormatContext *s)
static void process_video_header_cmv(AVFormatContext *s, VideoProperties *video)
AVCodecParameters * codecpar
Codec parameters associated with this stream.
static int read_header(FFV1Context *f)
Rational number (pair of numerator and denominator).
@ AV_CODEC_ID_ADPCM_IMA_EA_EACS
This structure contains the data a format has to probe a file.
int sample_rate
Audio only.
int64_t nb_frames
number of frames in this stream if known or 0
AVCodecID
Identify the syntax and semantics of the bitstream.
unsigned int avio_rl32(AVIOContext *s)
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification.
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
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
AVInputFormat ff_ea_demuxer
int avio_r8(AVIOContext *s)
int flags
A combination of AV_PKT_FLAG values.
static int ea_read_packet(AVFormatContext *s, AVPacket *pkt)
#define i(width, name, range_min, range_max)
int block_align
Audio only.
static av_always_inline AVRational av_inv_q(AVRational q)
Invert a rational.
static int read_packet(void *opaque, uint8_t *buf, int buf_size)
static int ea_probe(const AVProbeData *p)
int64_t avio_seek(AVIOContext *s, int64_t offset, int whence)
fseek() equivalent for AVIOContext.
uint64_t_TMPL AV_WL64 unsigned int_TMPL AV_RL32
int index
stream index in AVFormatContext
A Quick Description Of Rate Distortion Theory We want to encode a video
static void process_video_header_mdec(AVFormatContext *s, VideoProperties *video)
@ AV_CODEC_ID_ADPCM_EA_R1
@ AV_CODEC_ID_ADPCM_EA_R2
AVRational r_frame_rate
Real base framerate of the stream.
int64_t avio_skip(AVIOContext *s, int64_t offset)
Skip given number of bytes forward.
static int process_ea_header(AVFormatContext *s)
int bits_per_coded_sample
The number of bits per sample in the codedwords.
#define avpriv_request_sample(...)
enum AVCodecID codec_id
Specific type of the encoded data (the codec used).
This structure stores compressed data.
int64_t bit_rate
The average bitrate of the encoded data (in bits per second).
#define AVERROR_INVALIDDATA
Invalid data found when processing input.
static void process_audio_header_eacs(AVFormatContext *s)
int64_t start_time
Decoding: pts of the first frame of the stream in presentation order, in stream time base.
@ AV_CODEC_ID_MPEG2VIDEO
preferred ID for MPEG-1/2 video decoding
int avio_feof(AVIOContext *s)
Similar to feof() but also returns nonzero on read errors.