30 #include "libavutil/intreadwrite.h"
36 #define XMV_MIN_HEADER_SIZE 36
38 #define XMV_AUDIO_ADPCM51_FRONTLEFTRIGHT 1
39 #define XMV_AUDIO_ADPCM51_FRONTCENTERLOW 2
40 #define XMV_AUDIO_ADPCM51_REARLEFTRIGHT 4
42 #define XMV_AUDIO_ADPCM51 (XMV_AUDIO_ADPCM51_FRONTLEFTRIGHT | \
43 XMV_AUDIO_ADPCM51_FRONTCENTERLOW | \
44 XMV_AUDIO_ADPCM51_REARLEFTRIGHT)
46 #define XMV_BLOCK_ALIGN_SIZE 36
116 uint32_t file_version;
122 if ((file_version == 0) || (file_version > 4))
125 if (!memcmp(p->
buf + 12,
"xobX", 4))
147 uint32_t file_version;
148 uint32_t this_packet_size;
149 uint16_t audio_track;
160 if ((file_version != 4) && (file_version != 2))
217 packet->
track = track;
227 "(0x%04X)\n", track->
flags);
279 int mspel_bit = !!(data & 0x01);
281 int abt_flag = !!(data & 0x04);
282 int j_type_bit = !!(data & 0x08);
283 int top_left_mv_flag = !!(data & 0x10);
284 int per_mb_rl_bit = !!(data & 0x20);
285 int slice_count = (data >> 6) & 7;
291 data |= mspel_bit << 15;
292 data |= loop_filter << 14;
293 data |= abt_flag << 13;
294 data |= j_type_bit << 12;
295 data |= top_left_mv_flag << 11;
296 data |= per_mb_rl_bit << 10;
297 data |= slice_count << 7;
308 uint16_t audio_track;
309 uint32_t data_offset;
352 if ((packet->
data_size == 0) && (audio_track != 0))
443 uint32_t block_count;
500 frame_size = (frame_header & 0x1FFFF) * 4 + 4;
501 frame_timestamp = (frame_header >> 17);
528 video->
pts += frame_timestamp;
uint32_t next_packet_size
#define AVERROR_INVALIDDATA
Invalid data found when processing input.
XMVAudioTrack * audio_tracks
#define AV_LOG_WARNING
Something somehow does not look correct.
AVCodecContext * codec
Codec context associated with this stream.
int index
stream index in AVFormatContext
void av_log(void *avcl, int level, const char *fmt,...) av_printf_format(3
Send the specified message to the log if the level is less than or equal to the current av_log_level...
static int xmv_fetch_new_packet(AVFormatContext *s)
static void xmv_read_extradata(uint8_t *extradata, AVIOContext *pb)
static int xmv_probe(AVProbeData *p)
static int xmv_fetch_video_packet(AVFormatContext *s, AVPacket *pkt)
int block_align
number of bytes per packet if constant and known or 0 Used by some WAV based audio codecs...
static int xmv_read_packet(AVFormatContext *s, AVPacket *pkt)
uint8_t * extradata
some codecs need / can use extradata like Huffman tables.
void void avpriv_request_sample(void *avc, const char *msg,...) av_printf_format(2
Log a generic warning message about a missing feature.
#define MKBETAG(a, b, c, d)
unsigned char * buf
Buffer must have AVPROBE_PADDING_SIZE of extra allocated bytes filled with zero.
uint32_t this_packet_size
static av_cold int read_close(AVFormatContext *ctx)
int bits_per_coded_sample
bits per sample/pixel from the demuxer (needed for huffyuv).
AVStream * avformat_new_stream(AVFormatContext *s, const AVCodec *c)
Add a new stream to a media file.
int duration
Duration of this packet in AVStream->time_base units, 0 if unknown.
#define AV_PKT_FLAG_KEY
The packet contains a keyframe.
static const uint8_t frame_size[4]
int av_new_packet(AVPacket *pkt, int size)
Allocate the payload of a packet and initialize its fields with default values.
AVCodecID
Identify the syntax and semantics of the bitstream.
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
void av_free(void *ptr)
Free a memory block which has been allocated with av_malloc(z)() or av_realloc(). ...
void * priv_data
Format private data.
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification. ...
#define XMV_AUDIO_ADPCM51
int flags
A combination of AV_PKT_FLAG values.
int buf_size
Size of buf except extra allocated bytes.
#define FF_INPUT_BUFFER_PADDING_SIZE
Required number of additionally allocated bytes at the end of the input bitstream for decoding...
unsigned int nb_streams
Number of elements in AVFormatContext.streams.
int bit_rate
the average bitrate
static int xmv_read_header(AVFormatContext *s)
int width
picture width / height.
AVInputFormat ff_xmv_demuxer
AVStream ** streams
A list of all streams in the file.
void * av_malloc(size_t size) av_malloc_attrib 1(1)
Allocate a block of size bytes with alignment suitable for all memory accesses (including vectors if ...
internal header for RIFF based (de)muxers do NOT include this in end user applications ...
uint32_t next_packet_offset
#define XMV_MIN_HEADER_SIZE
static void loop_filter(H264Context *h, int start_x, int end_x)
static int xmv_process_packet_header(AVFormatContext *s)
static int read_header(FFV1Context *f)
enum AVMediaType codec_type
int sample_rate
samples per second
static int xmv_fetch_audio_packet(AVFormatContext *s, AVPacket *pkt, uint32_t stream)
unsigned int codec_tag
fourcc (LSB first, so "ABCD" -> ('D'<<24) + ('C'<<16) + ('B'<<8) + 'A').
AVIOContext * pb
I/O context.
#define XMV_BLOCK_ALIGN_SIZE
static int read_packet(AVFormatContext *ctx, AVPacket *pkt)
uint16_t audio_track_count
This structure contains the data a format has to probe a file.
int64_t duration
Decoding: duration of the stream, in stream time base.
enum AVCodecID ff_wav_codec_get_id(unsigned int tag, int bps)
int channels
number of audio channels
int64_t dts
Decompression timestamp in AVStream->time_base units; the time at which the packet is decompressed...
uint32_t this_packet_offset
static int xmv_read_close(AVFormatContext *s)
This structure stores compressed data.
int64_t pts
Presentation timestamp in AVStream->time_base units; the time at which the decompressed packet will b...
#define AV_NOPTS_VALUE
Undefined timestamp value.