40#define RIFF_TAG MKTAG('R', 'I', 'F', 'F')
41#define CDXA_TAG MKTAG('C', 'D', 'X', 'A')
43#define RAW_CD_SECTOR_SIZE 2352
44#define RAW_CD_SECTOR_DATA_SIZE 2304
45#define VIDEO_DATA_CHUNK_SIZE 0x7E0
46#define VIDEO_DATA_HEADER_SIZE 0x38
47#define RIFF_HEADER_SIZE 0x2C
49#define CDXA_TYPE_MASK 0x0E
50#define CDXA_TYPE_DATA 0x08
51#define CDXA_TYPE_AUDIO 0x04
52#define CDXA_TYPE_VIDEO 0x02
53#define CDXA_TYPE_EMPTY 0x00
55#define STR_MAGIC (0x80010160)
72static const uint8_t
sync_header[12] = {0x00,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x00};
76 const uint8_t *sector= p->buf;
77 const uint8_t *end= sector + p->buf_size;
95 if (sector[0x11] >= 32)
101 int current_sector =
AV_RL16(§or[0x1C]);
102 int sector_count =
AV_RL16(§or[0x1E]);
106 && current_sector < sector_count
115 if(sector[0x13]&0x2A)
128 else if(vid+
aud)
return 1;
190 int current_sector =
AV_RL16(§or[0x1C]);
191 int sector_count =
AV_RL16(§or[0x1E]);
195 && current_sector < sector_count
238 if (current_sector == sector_count-1) {
252 int fmt = sector[0x13];
275 memcpy(
pkt->data,sector+24,2304);
int64_t avio_seek(AVIOContext *s, int64_t offset, int whence)
fseek() equivalent for AVIOContext.
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.
int avio_read(AVIOContext *s, unsigned char *buf, int size)
Read size bytes from AVIOContext into buf.
int ffio_read_size(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)
static uint32_t BS_FUNC read(BSCTX *bc, unsigned int n)
Return n bits from the buffer, n has to be in the 0-32 range.
#define i(width, name, range_min, range_max)
static int FUNC aud(CodedBitstreamContext *ctx, RWContext *rw, H264RawAUD *current)
static int read_probe(const AVProbeData *p)
Public libavutil channel layout APIs header.
channel
Use these values when setting the channel map with ebur128_set_channel().
static int read_header(FFV1Context *f, RangeCoder *c)
static const uint8_t frame_size[4]
void av_packet_unref(AVPacket *pkt)
Wipe the packet.
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 struct AVCodec *c)
Add a new stream to a media file.
void av_channel_layout_default(AVChannelLayout *ch_layout, int nb_channels)
Get the default channel layout for a given number of channels.
#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.
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)
static const uint8_t sync_header[12]
static int str_read_header(AVFormatContext *s)
#define RAW_CD_SECTOR_SIZE
static int str_probe(const AVProbeData *p)
static int str_read_close(AVFormatContext *s)
#define VIDEO_DATA_CHUNK_SIZE
#define VIDEO_DATA_HEADER_SIZE
static int str_read_packet(AVFormatContext *s, AVPacket *ret_pkt)
int nb_channels
Number of channels in this layout.
int height
The height of the video frame in pixels.
AVChannelLayout ch_layout
The channel layout and number of channels.
int width
The width of the video frame in pixels.
enum AVMediaType codec_type
General type of the encoded data.
int block_align
The number of bytes per coded audio frame, required by some formats.
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
The number of audio samples per second.
This structure stores compressed data.
This structure contains the data a format has to probe a file.
AVCodecParameters * codecpar
Codec parameters associated with this stream.
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.