29 #define CDXL_HEADER_SIZE 32
63 if (p->
buf[18] || !p->
buf[19])
92 "Could not parse framerate: %s.\n", cdxl->
framerate);
111 uint32_t current_size, video_size, image_size;
123 if (cdxl->
header[0] != 1) {
133 if (
FFALIGN(width, 16) * (uint64_t)height * cdxl->
header[19] > INT_MAX)
135 image_size =
FFALIGN(width, 16) * height * cdxl->
header[19] / 8;
136 video_size = palette_size + image_size;
138 if (palette_size > 512)
152 if (cdxl->
header[1] & 0x10) {
184 if (audio_size + video_size && cdxl->
filesize > 0) {
185 frames = cdxl->
filesize / (audio_size + video_size);
190 st->
duration = frames * (int64_t)audio_size;
221 #define OFFSET(x) offsetof(CDXLDemuxContext, x)
242 .extensions =
"cdxl,xl",
244 .priv_class = &cdxl_demuxer_class,
#define AVERROR_INVALIDDATA
Invalid data found when processing input.
int64_t avio_size(AVIOContext *s)
Get the filesize.
void av_free_packet(AVPacket *pkt)
Free a packet.
int av_parse_video_rate(AVRational *rate, const char *arg)
Parse str and store the detected values in *rate.
#define LIBAVUTIL_VERSION_INT
int64_t pos
byte position in stream, -1 if unknown
void av_shrink_packet(AVPacket *pkt, int size)
Reduce packet size, correctly zeroing padding.
int index
stream index in AVFormatContext
int64_t avio_skip(AVIOContext *s, int64_t offset)
Skip given number of bytes forward.
#define AV_CH_LAYOUT_STEREO
int ctx_flags
Flags signalling stream properties.
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_RB16
const char * class_name
The name of the class; usually it is the same name as the context structure type to which the AVClass...
AVStream * avformat_new_stream(AVFormatContext *s, const AVCodec *c)
Add a new stream to a media file.
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
#define AVERROR_EOF
End of file.
static av_always_inline int64_t avio_tell(AVIOContext *s)
ftell() equivalent for AVIOContext.
int duration
Duration of this packet in AVStream->time_base units, 0 if unknown.
int avio_read(AVIOContext *s, unsigned char *buf, int size)
Read size bytes from AVIOContext into buf.
#define AV_PKT_FLAG_KEY
The packet contains a keyframe.
int av_new_packet(AVPacket *pkt, int size)
Allocate the payload of a packet and initialize its fields with default values.
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification. ...
int flags
A combination of AV_PKT_FLAG values.
uint64_t channel_layout
Audio channel layout.
AVCodecContext * codec
Codec context associated with this stream.
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.
uint8_t header[CDXL_HEADER_SIZE]
audio channel layout utility functions
int width
picture width / height.
static int read_header(FFV1Context *f)
static int read_packet(void *opaque, uint8_t *buf, int buf_size)
enum AVMediaType codec_type
int sample_rate
samples per second
AVIOContext * pb
I/O context.
unsigned int codec_tag
fourcc (LSB first, so "ABCD" -> ('D'<<24) + ('C'<<16) + ('B'<<8) + 'A').
BYTE int const BYTE int int int height
Describe the class of an AVClass context structure.
rational number numerator/denominator
#define AV_OPT_FLAG_DECODING_PARAM
a generic parameter which can be set by the user for demuxing or decoding
This structure contains the data a format has to probe a file.
int64_t duration
Decoding: duration of the stream, in stream time base.
int64_t start_time
Decoding: pts of the first frame of the stream in presentation order, in stream time base...
int channels
number of audio channels
void * priv_data
Format private data.
int avio_feof(AVIOContext *s)
feof() equivalent for AVIOContext.
#define AV_CH_LAYOUT_MONO
This structure stores compressed data.