Go to the documentation of this file.
39 #define XMV_MIN_HEADER_SIZE 36
42 #define XMV_AUDIO_ADPCM51_FRONTLEFTRIGHT 1
44 #define XMV_AUDIO_ADPCM51_FRONTCENTERLOW 2
46 #define XMV_AUDIO_ADPCM51_REARLEFTRIGHT 4
49 #define XMV_AUDIO_ADPCM51 (XMV_AUDIO_ADPCM51_FRONTLEFTRIGHT | \
50 XMV_AUDIO_ADPCM51_FRONTCENTERLOW | \
51 XMV_AUDIO_ADPCM51_REARLEFTRIGHT)
53 #define XMV_BLOCK_ALIGN_SIZE 36
121 uint32_t file_version;
127 if ((file_version == 0) || (file_version > 4))
130 if (!memcmp(p->
buf + 12,
"xobX", 4))
150 uint32_t file_version;
151 uint32_t this_packet_size;
152 uint16_t audio_track;
164 if ((file_version != 4) && (file_version != 2))
196 packet->block_samples = 64;
200 packet->stream_index = -1;
209 "(0x%04X)\n",
packet->flags);
223 if (this_packet_size < xmv->next_packet_offset)
237 int mspel_bit = !!(
data & 0x01);
239 int abt_flag = !!(
data & 0x04);
240 int j_type_bit = !!(
data & 0x08);
241 int top_left_mv_flag = !!(
data & 0x10);
242 int per_mb_rl_bit = !!(
data & 0x20);
243 int slice_count = (
data >> 6) & 7;
249 data |= mspel_bit << 15;
251 data |= abt_flag << 13;
252 data |= j_type_bit << 12;
253 data |= top_left_mv_flag << 11;
254 data |= per_mb_rl_bit << 10;
255 data |= slice_count << 7;
267 uint16_t audio_track;
268 uint64_t data_offset;
354 if ((
packet->data_size == 0) && (audio_track != 0))
445 uint32_t block_count;
524 video->last_pts = frame_timestamp +
video->pts;
530 video->pts += frame_timestamp;
584 .p.extensions =
"xmv",
#define AV_LOG_WARNING
Something somehow does not look correct.
uint8_t * extradata
Extra binary data needed for initializing the decoder, codec-dependent.
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.
AVStream * avformat_new_stream(AVFormatContext *s, const struct AVCodec *c)
Add a new stream to a media file.
#define AVERROR_EOF
End of file.
XMVAudioPacket * audio
The audio packets contained in each packet.
enum AVCodecID ff_wav_codec_get_id(unsigned int tag, int bps)
uint32_t frame_size
Number of bytes to put into an audio frame.
uint32_t next_packet_size
Size of the next packet.
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 buf_size
Size of buf except extra allocated bytes.
int nb_channels
Number of channels in this layout.
#define AV_PKT_FLAG_KEY
The packet contains a keyframe.
static int xmv_fetch_new_packet(AVFormatContext *s)
A video packet with an XMV file.
static int xmv_read_packet(AVFormatContext *s, AVPacket *pkt)
unsigned block_align
Bytes per compressed block.
static av_cold int read_close(AVFormatContext *ctx)
static av_always_inline int64_t avio_tell(AVIOContext *s)
ftell() equivalent for AVIOContext.
static int xmv_read_header(AVFormatContext *s)
int64_t duration
Decoding: duration of the stream, in stream time base.
uint16_t bits_per_sample
Bits per compressed sample.
unsigned int avio_rl16(AVIOContext *s)
uint32_t data_size
The size of the remaining video data.
uint64_t bit_rate
Bits of compressed data per second.
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
static int read_packet(void *opaque, uint8_t *buf, int buf_size)
An audio packet with an XMV file.
static int xmv_process_packet_header(AVFormatContext *s)
uint64_t this_packet_offset
Offset of the current packet.
uint16_t current_stream
The index of the stream currently handling.
unsigned char * buf
Buffer must have AVPROBE_PADDING_SIZE of extra allocated bytes filled with zero.
uint64_t next_packet_offset
Offset of the next packet.
uint32_t current_frame
The current frame within this video packet.
#define av_assert0(cond)
assert() equivalent, that is always enabled.
int has_extradata
Does the video packet contain extra data?
static int xmv_fetch_audio_packet(AVFormatContext *s, AVPacket *pkt, uint32_t stream)
uint32_t this_packet_size
Size of the current packet.
#define FF_INFMT_FLAG_INIT_CLEANUP
For an FFInputFormat with this flag set read_close() needs to be called by the caller upon read_heade...
AVCodecParameters * codecpar
Codec parameters associated with this stream.
static int read_header(FFV1Context *f)
and forward the result(frame or status change) to the corresponding input. If nothing is possible
uint16_t channels
Number of channels.
uint32_t data_size
The size of the remaining audio data.
This structure contains the data a format has to probe a file.
AVChannelLayout ch_layout
Audio only.
int sample_rate
Audio only.
#define XMV_BLOCK_ALIGN_SIZE
AVCodecID
Identify the syntax and semantics of the bitstream.
int extradata_size
Size of the extradata content in bytes.
unsigned int avio_rl32(AVIOContext *s)
int32_t sample_rate
Sampling rate.
uint16_t block_samples
Decompressed samples per compressed block.
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification.
uint16_t audio_track_count
Number of audio track in this file.
#define AV_NOPTS_VALUE
Undefined timestamp value.
#define MKBETAG(a, b, c, d)
#define XMV_AUDIO_ADPCM51
Audio flag: Any of the ADPCM'd 5.1 stream flags.
#define XMV_MIN_HEADER_SIZE
The min size of an XMV header.
int64_t dts
Decompression timestamp in AVStream->time_base units; the time at which the packet is decompressed.
int stream_index
The decoder stream index for this video packet.
int flags
A combination of AV_PKT_FLAG values.
int64_t last_pts
PTS of the last video frame.
uint64_t data_offset
The offset of the video data within the file.
static void loop_filter(const H264Context *h, H264SliceContext *sl, int start_x, int end_x)
int64_t pts
Presentation timestamp in AVStream->time_base units; the time at which the decompressed packet will b...
int block_align
Audio only.
enum AVPacketSideDataType packet
void * av_calloc(size_t nmemb, size_t size)
int64_t avio_seek(AVIOContext *s, int64_t offset, int whence)
fseek() equivalent for AVIOContext.
const FFInputFormat ff_xmv_demuxer
static int xmv_read_close(AVFormatContext *s)
uint64_t_TMPL AV_WL64 unsigned int_TMPL AV_RL32
int stream_index
The decoder stream index for this audio packet.
int index
stream index in AVFormatContext
static int FUNC() frame_header(CodedBitstreamContext *ctx, RWContext *rw, JPEGRawFrameHeader *current)
Context for demuxing an XMV file.
static void xmv_read_extradata(uint8_t *extradata, AVIOContext *pb)
enum AVCodecID codec_id
The codec ID of the compression scheme.
static int xmv_fetch_video_packet(AVFormatContext *s, AVPacket *pkt)
A Quick Description Of Rate Distortion Theory We want to encode a video
int avio_read(AVIOContext *s, unsigned char *buf, int size)
Read size bytes from AVIOContext into buf.
XMVVideoPacket video
The video packet contained in each packet.
uint64_t data_offset
The offset of the audio data within the file.
uint16_t stream_count
The number of streams in this file.
int64_t avio_skip(AVIOContext *s, int64_t offset)
Skip given number of bytes forward.
static int read_probe(const AVProbeData *p)
uint16_t compression
The type of compression.
int bits_per_coded_sample
The number of bits per sample in the codedwords.
uint8_t extradata[4]
The extra data.
#define avpriv_request_sample(...)
uint32_t frame_count
The amount of frames within this video packet.
enum AVCodecID codec_id
Specific type of the encoded data (the codec used).
This structure stores compressed data.
int64_t pts
PTS of the most current video frame.
int64_t bit_rate
The average bitrate of the encoded data (in bits per second).
#define AVERROR_INVALIDDATA
Invalid data found when processing input.
uint64_t block_count
Running counter of decompressed audio block.
static int xmv_probe(const AVProbeData *p)