38 #define XMV_MIN_HEADER_SIZE 36
41 #define XMV_AUDIO_ADPCM51_FRONTLEFTRIGHT 1
43 #define XMV_AUDIO_ADPCM51_FRONTCENTERLOW 2
45 #define XMV_AUDIO_ADPCM51_REARLEFTRIGHT 4
48 #define XMV_AUDIO_ADPCM51 (XMV_AUDIO_ADPCM51_FRONTLEFTRIGHT | \
49 XMV_AUDIO_ADPCM51_FRONTCENTERLOW | \
50 XMV_AUDIO_ADPCM51_REARLEFTRIGHT)
52 #define XMV_BLOCK_ALIGN_SIZE 36
120 uint32_t file_version;
126 if ((file_version == 0) || (file_version > 4))
129 if (!memcmp(p->
buf + 12,
"xobX", 4))
149 uint32_t file_version;
150 uint32_t this_packet_size;
151 uint16_t audio_track;
164 if ((file_version != 4) && (file_version != 2))
211 "(0x%04X)\n", packet->
flags);
242 int mspel_bit = !!(
data & 0x01);
244 int abt_flag = !!(
data & 0x04);
245 int j_type_bit = !!(
data & 0x08);
246 int top_left_mv_flag = !!(
data & 0x10);
247 int per_mb_rl_bit = !!(
data & 0x20);
248 int slice_count = (
data >> 6) & 7;
254 data |= mspel_bit << 15;
256 data |= abt_flag << 13;
257 data |= j_type_bit << 12;
258 data |= top_left_mv_flag << 11;
259 data |= per_mb_rl_bit << 10;
260 data |= slice_count << 7;
272 uint16_t audio_track;
273 uint64_t data_offset;
359 if ((packet->
data_size == 0) && (audio_track != 0))
450 uint32_t block_count;
535 video->
pts += frame_timestamp;
simple assert() macros that are a bit more flexible than ISO C assert().
#define av_assert0(cond)
assert() equivalent, that is always enabled.
int64_t avio_seek(AVIOContext *s, int64_t offset, int whence)
fseek() equivalent for AVIOContext.
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.
int avio_read(AVIOContext *s, unsigned char *buf, int size)
Read size bytes from AVIOContext into buf.
unsigned int avio_rl32(AVIOContext *s)
static int read_packet(void *opaque, uint8_t *buf, int buf_size)
static int FUNC() frame_header(CodedBitstreamContext *ctx, RWContext *rw, JPEGRawFrameHeader *current)
#define MKBETAG(a, b, c, d)
static int read_header(FFV1Context *f)
AVCodecID
Identify the syntax and semantics of the bitstream.
#define AV_PKT_FLAG_KEY
The packet contains a keyframe.
AVStream * avformat_new_stream(AVFormatContext *s, const 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_WARNING
Something somehow does not look correct.
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
void * av_mallocz_array(size_t nmemb, size_t size)
Allocate a memory block for an array with av_mallocz().
#define AV_NOPTS_VALUE
Undefined timestamp value.
static void loop_filter(const H264Context *h, H264SliceContext *sl, int start_x, int end_x)
common internal API header
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification.
static av_cold int read_close(AVFormatContext *ctx)
internal header for RIFF based (de)muxers do NOT include this in end user applications
enum AVCodecID ff_wav_codec_get_id(unsigned int tag, int bps)
int extradata_size
Size of the extradata content in bytes.
int bits_per_coded_sample
The number of bits per sample in the codedwords.
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
Audio only.
uint32_t codec_tag
Additional information about the codec (corresponds to the AVI FOURCC).
uint8_t * extradata
Extra binary data needed for initializing the decoder, codec-dependent.
enum AVCodecID codec_id
Specific type of the encoded data (the codec used).
int sample_rate
Audio only.
This structure stores compressed data.
int flags
A combination of AV_PKT_FLAG values.
int64_t duration
Duration of this packet in AVStream->time_base units, 0 if unknown.
int64_t pts
Presentation timestamp in AVStream->time_base units; the time at which the decompressed packet will b...
int64_t dts
Decompression timestamp in AVStream->time_base units; the time at which the packet is decompressed.
This structure contains the data a format has to probe a file.
int buf_size
Size of buf except extra allocated bytes.
unsigned char * buf
Buffer must have AVPROBE_PADDING_SIZE of extra allocated bytes filled with zero.
AVCodecParameters * codecpar
Codec parameters associated with this stream.
int64_t duration
Decoding: duration of the stream, in stream time base.
int index
stream index in AVFormatContext
An audio packet with an XMV file.
uint16_t channels
Number of channels.
int32_t sample_rate
Sampling rate.
uint64_t bit_rate
Bits of compressed data per second.
uint16_t compression
The type of compression.
unsigned block_align
Bytes per compressed block.
uint64_t data_offset
The offset of the audio data within the file.
uint16_t block_samples
Decompressed samples per compressed block.
int stream_index
The decoder stream index for this audio packet.
uint64_t block_count
Running counter of decompressed audio block.
enum AVCodecID codec_id
The codec ID of the compression scheme.
uint16_t bits_per_sample
Bits per compressed sample.
uint32_t data_size
The size of the remaining audio data.
uint32_t frame_size
Number of bytes to put into an audio frame.
Context for demuxing an XMV file.
uint32_t next_packet_size
Size of the next packet.
XMVVideoPacket video
The video packet contained in each packet.
uint64_t this_packet_offset
Offset of the current packet.
uint16_t audio_track_count
Number of audio track in this file.
uint16_t current_stream
The index of the stream currently handling.
XMVAudioPacket * audio
The audio packets contained in each packet.
uint16_t stream_count
The number of streams in this file.
uint64_t next_packet_offset
Offset of the next packet.
uint32_t this_packet_size
Size of the current packet.
A video packet with an XMV file.
int64_t pts
PTS of the most current video frame.
uint64_t data_offset
The offset of the video data within the file.
int64_t last_pts
PTS of the last video frame.
uint32_t frame_count
The amount of frames within this video packet.
uint8_t extradata[4]
The extra data.
uint32_t data_size
The size of the remaining video data.
uint32_t current_frame
The current frame within this video packet.
int stream_index
The decoder stream index for this video packet.
int has_extradata
Does the video packet contain extra data?
#define avpriv_request_sample(...)
AVInputFormat ff_xmv_demuxer
static int xmv_probe(const AVProbeData *p)
static int xmv_read_close(AVFormatContext *s)
#define XMV_BLOCK_ALIGN_SIZE
static int xmv_fetch_audio_packet(AVFormatContext *s, AVPacket *pkt, uint32_t stream)
static int xmv_fetch_video_packet(AVFormatContext *s, AVPacket *pkt)
#define XMV_MIN_HEADER_SIZE
The min size of an XMV header.
static int xmv_process_packet_header(AVFormatContext *s)
#define XMV_AUDIO_ADPCM51
Audio flag: Any of the ADPCM'd 5.1 stream flags.
static int xmv_fetch_new_packet(AVFormatContext *s)
static int xmv_read_packet(AVFormatContext *s, AVPacket *pkt)
static void xmv_read_extradata(uint8_t *extradata, AVIOContext *pb)
static int xmv_read_header(AVFormatContext *s)