Go to the documentation of this file.
35 #define SCHl_TAG MKTAG('S', 'C', 'H', 'l')
36 #define SEAD_TAG MKTAG('S', 'E', 'A', 'D')
37 #define SNDC_TAG MKTAG('S', 'N', 'D', 'C')
38 #define SEND_TAG MKTAG('S', 'E', 'N', 'D')
39 #define SHEN_TAG MKTAG('S', 'H', 'E', 'N')
40 #define SDEN_TAG MKTAG('S', 'D', 'E', 'N')
41 #define SEEN_TAG MKTAG('S', 'E', 'E', 'N')
42 #define ISNh_TAG MKTAG('1', 'S', 'N', 'h')
43 #define EACS_TAG MKTAG('E', 'A', 'C', 'S')
44 #define ISNd_TAG MKTAG('1', 'S', 'N', 'd')
45 #define ISNe_TAG MKTAG('1', 'S', 'N', 'e')
46 #define PT00_TAG MKTAG('P', 'T', 0x0, 0x0)
47 #define GSTR_TAG MKTAG('G', 'S', 'T', 'R')
48 #define SCDl_TAG MKTAG('S', 'C', 'D', 'l')
49 #define SCEl_TAG MKTAG('S', 'C', 'E', 'l')
50 #define kVGT_TAG MKTAG('k', 'V', 'G', 'T')
51 #define fVGT_TAG MKTAG('f', 'V', 'G', 'T')
52 #define mTCD_TAG MKTAG('m', 'T', 'C', 'D')
53 #define MADk_TAG MKTAG('M', 'A', 'D', 'k')
54 #define MADm_TAG MKTAG('M', 'A', 'D', 'm')
55 #define MADe_TAG MKTAG('M', 'A', 'D', 'e')
56 #define MPCh_TAG MKTAG('M', 'P', 'C', 'h')
57 #define TGQs_TAG MKTAG('T', 'G', 'Q', 's')
58 #define pQGT_TAG MKTAG('p', 'Q', 'G', 'T')
59 #define pIQT_TAG MKTAG('p', 'I', 'Q', 'T')
60 #define MVhd_TAG MKTAG('M', 'V', 'h', 'd')
61 #define MV0K_TAG MKTAG('M', 'V', '0', 'K')
62 #define MV0F_TAG MKTAG('M', 'V', '0', 'F')
63 #define AVhd_TAG MKTAG('A', 'V', 'h', 'd')
64 #define AV0K_TAG MKTAG('A', 'V', '0', 'K')
65 #define AV0F_TAG MKTAG('A', 'V', '0', 'F')
66 #define MVIh_TAG MKTAG('M', 'V', 'I', 'h')
67 #define MVIf_TAG MKTAG('M', 'V', 'I', 'f')
68 #define AVP6_TAG MKTAG('A', 'V', 'P', '6')
120 int compression_type = -1, revision = -1, revision2 = -1;
143 "revision (element 0x80) set to 0x%08x\n", revision);
148 "num_channels (element 0x82) set to 0x%08x\n",
154 "compression_type (element 0x83) set to 0x%08x\n",
160 "sample_rate (element 0x84) set to %i\n",
166 "num_samples (element 0x85) set to 0x%08x\n",
171 "element 0x%02x set to 0x%08"PRIx32
"\n",
179 "revision2 (element 0xA0) set to 0x%08x\n",
184 "end of header block reached (within audio subheader)\n");
190 "element 0x%02x set to 0x%08"PRIx32
"\n",
202 "header element 0x%02x set to 0x%08"PRIx32
"\n",
208 switch (compression_type) {
260 "stream type; compression_type=%i",
277 int compression_type;
282 compression_type =
avio_r8(pb);
285 switch (compression_type) {
305 "stream type; audio compression_type=%i",
340 if (
video->time_base.den <= 0 ||
video->time_base.num <= 0) {
364 uint32_t blockid,
size = 0;
399 }
else if ((blockid & 0xFF) != (
PT00_TAG & 0xFF)) {
402 ea->
platform = (blockid >> 16) & 0xFF;
471 unsigned big_endian,
size;
489 big_endian =
size > 0x000FFFFF;
519 if (
video->time_base.num)
540 "Unsupported number of channels: %d\n", ea->
num_channels);
550 "Invalid number of bytes per sample: %d\n", ea->
bytes);
586 int partial_packet = 0;
588 unsigned int chunk_type, chunk_size;
589 int ret = 0, packet_read = 0,
key = 0, vp6a;
592 while ((!packet_read && !hit_end) || partial_packet) {
601 switch (chunk_type) {
630 if (partial_packet) {
708 if (chunk_size > INT_MAX - 8)
712 goto get_video_packet;
720 goto get_video_packet;
732 if (chunk_size > INT_MAX - 3)
737 if (partial_packet) {
743 if (
ret >= 0 && vp6a)
752 partial_packet = vp6a || chunk_type ==
MVIh_TAG;
766 if (
ret >= 0 && hit_end && !packet_read)
772 #define OFFSET(x) offsetof(EaDemuxContext, x)
773 #define FLAGS AV_OPT_FLAG_VIDEO_PARAM | AV_OPT_FLAG_DECODING_PARAM
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
enum AVMediaType codec_type
General type of the encoded data.
static const AVClass ea_class
AVStream * avformat_new_stream(AVFormatContext *s, const struct AVCodec *c)
Add a new stream to a media file.
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).
int nb_channels
Number of channels in this layout.
#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.
static int read_packet(void *opaque, uint8_t *buf, int buf_size)
@ 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.
static int process_audio_header_elements(AVFormatContext *s)
static void process_video_header_cmv(AVFormatContext *s, VideoProperties *video)
enum AVStreamParseType need_parsing
AVCodecParameters * codecpar
Codec parameters associated with this stream.
#define LIBAVUTIL_VERSION_INT
static int read_header(FFV1Context *f)
Describe the class of an AVClass context structure.
Rational number (pair of numerator and denominator).
@ AV_CODEC_ID_ADPCM_IMA_EA_EACS
const char * av_default_item_name(void *ptr)
Return the context name.
This structure contains the data a format has to probe a file.
AVChannelLayout ch_layout
Audio only.
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
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)
const AVInputFormat ff_ea_demuxer
int block_align
Audio only.
static av_always_inline AVRational av_inv_q(AVRational q)
Invert a rational.
static const AVOption options[]
static int ea_probe(const AVProbeData *p)
int64_t avio_seek(AVIOContext *s, int64_t offset, int whence)
fseek() equivalent for AVIOContext.
const char * class_name
The name of the class; usually it is the same name as the context structure type to which the AVClass...
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 read_probe(const AVProbeData *p)
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.