29 #define CDXL_HEADER_SIZE 32
64 if (buf[0] == 1 &&
AV_RB16(&buf[20]) > 512)
66 if (buf[0] == 0 &&
AV_RB16(&buf[20]) > 768)
72 if (buf[0] == 0 && (!buf[26] || !
AV_RB16(&buf[24])))
76 if (buf[19] != 6 && buf[19] != 8 && buf[19] != 24)
121 uint32_t current_size, video_size, image_size;
133 if (cdxl->
header[0] > 1) {
147 if (!cdxl->
srate && audio_size)
151 if (cdxl->
header[19] == 0 ||
158 video_size = palette_size + image_size;
160 if ((
type == 1 && palette_size > 512) ||
161 (
type == 0 && palette_size > 768))
187 if (current_size && cdxl->
filesize > 0 && audio_size > 0)
210 if (current_size && cdxl->
filesize > 0)
247 #define OFFSET(x) offsetof(CDXLDemuxContext, x)
270 .extensions =
"cdxl,xl",
static const char *const format[]
int64_t avio_size(AVIOContext *s)
Get the filesize.
int avio_feof(AVIOContext *s)
Similar to feof() but also returns nonzero on read errors.
static av_always_inline int64_t avio_tell(AVIOContext *s)
ftell() equivalent for AVIOContext.
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.
static int read_packet(void *opaque, uint8_t *buf, int buf_size)
#define flags(name, subs,...)
audio channel layout utility functions
static int read_header(FFV1Context *f)
@ AV_OPT_TYPE_VIDEO_RATE
offset must point to AVRational
#define AV_CH_LAYOUT_MONO
#define AV_CH_LAYOUT_STEREO
@ AV_CODEC_ID_PCM_S8_PLANAR
#define AV_PKT_FLAG_KEY
The packet contains a keyframe.
void av_shrink_packet(AVPacket *pkt, int size)
Reduce packet size, correctly zeroing padding.
int av_new_packet(AVPacket *pkt, int size)
Allocate the payload of a packet and initialize its fields with default values.
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_ERROR
Something went wrong and cannot losslessly be recovered.
const char * av_default_item_name(void *ptr)
Return the context name.
#define LIBAVUTIL_VERSION_INT
common internal API header
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification.
#define AV_OPT_FLAG_DECODING_PARAM
a generic parameter which can be set by the user for demuxing or decoding
Describe the class of an AVClass context structure.
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 channel_layout
Audio only.
enum AVMediaType codec_type
General type of the encoded data.
uint32_t codec_tag
Additional information about the codec (corresponds to the AVI FOURCC).
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 pos
byte position in stream, -1 if unknown
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.
Rational number (pair of numerator and denominator).
AVCodecParameters * codecpar
Codec parameters associated with this stream.
int64_t nb_frames
number of frames in this stream if known or 0
int64_t duration
Decoding: duration of the stream, in stream time base.
int index
stream index in AVFormatContext
int64_t start_time
Decoding: pts of the first frame of the stream in presentation order, in stream time base.
uint8_t header[CDXL_HEADER_SIZE]