38 #define RIFF_TAG MKTAG('R', 'I', 'F', 'F')
39 #define CDXA_TAG MKTAG('C', 'D', 'X', 'A')
41 #define RAW_CD_SECTOR_SIZE 2352
42 #define RAW_CD_SECTOR_DATA_SIZE 2304
43 #define VIDEO_DATA_CHUNK_SIZE 0x7E0
44 #define VIDEO_DATA_HEADER_SIZE 0x38
45 #define RIFF_HEADER_SIZE 0x2C
47 #define CDXA_TYPE_MASK 0x0E
48 #define CDXA_TYPE_DATA 0x08
49 #define CDXA_TYPE_AUDIO 0x04
50 #define CDXA_TYPE_VIDEO 0x02
52 #define STR_MAGIC (0x80010160)
69 static const uint8_t sync_header[12] = {0x00,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x00};
92 if (sector[0x11] >= 32)
98 int current_sector =
AV_RL16(§or[0x1C]);
99 int sector_count =
AV_RL16(§or[0x1E]);
103 && current_sector < sector_count
112 if(sector[0x13]&0x2A)
117 if(sector[0x12] & CDXA_TYPE_MASK)
125 else if(vid+aud)
return 1;
172 channel = sector[0x11];
182 int current_sector =
AV_RL16(§or[0x1C]);
183 int sector_count =
AV_RL16(§or[0x1E]);
187 && current_sector < sector_count
189 av_log(s,
AV_LOG_ERROR,
"Invalid parameters %d %d %d\n", current_sector, sector_count, frame_size);
218 memset(pkt->
data, 0, sector_count*VIDEO_DATA_CHUNK_SIZE);
225 memcpy(pkt->
data + current_sector*VIDEO_DATA_CHUNK_SIZE,
227 VIDEO_DATA_CHUNK_SIZE);
229 if (current_sector == sector_count-1) {
243 int fmt = sector[0x13];
272 memcpy(pkt->
data,sector+24,2304);
#define AVERROR_INVALIDDATA
Invalid data found when processing input.
#define AV_LOG_WARNING
Something somehow does not look correct.
int64_t pos
byte position in stream, -1 if unknown
enum AVCodecID codec_id
Specific type of the encoded data (the codec used).
int index
stream index in AVFormatContext
static int str_read_header(AVFormatContext *s)
int64_t avio_seek(AVIOContext *s, int64_t offset, int whence)
fseek() equivalent for AVIOContext.
#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_RL16
static av_cold int end(AVCodecContext *avctx)
AVInputFormat ff_str_demuxer
int64_t duration
Duration of this packet in AVStream->time_base units, 0 if unknown.
AVStream * avformat_new_stream(AVFormatContext *s, const AVCodec *c)
Add a new stream to a media file.
#define VIDEO_DATA_HEADER_SIZE
static av_cold int read_close(AVFormatContext *ctx)
static av_always_inline int64_t avio_tell(AVIOContext *s)
ftell() equivalent for AVIOContext.
uint64_t channel_layout
Audio only.
int avio_read(AVIOContext *s, unsigned char *buf, int size)
Read size bytes from AVIOContext into buf.
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. ...
enum AVMediaType codec_type
General type of the encoded data.
AVBufferRef * buf
A reference to the reference-counted buffer where the packet data is stored.
#define RAW_CD_SECTOR_SIZE
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.
common internal API header
#define VIDEO_DATA_CHUNK_SIZE
int block_align
Audio only.
audio channel layout utility functions
static int read_header(FFV1Context *f)
static int read_packet(void *opaque, uint8_t *buf, int buf_size)
static int str_read_packet(AVFormatContext *s, AVPacket *ret_pkt)
static int str_probe(AVProbeData *p)
AVIOContext * pb
I/O context.
void av_packet_unref(AVPacket *pkt)
Wipe the packet.
static int FUNC() aud(CodedBitstreamContext *ctx, RWContext *rw, H264RawAUD *current)
static const uint8_t sync_header[12]
This structure contains the data a format has to probe a file.
#define flags(name, subs,...)
int sample_rate
Audio only.
int64_t start_time
Decoding: pts of the first frame of the stream in presentation order, in stream time base...
channel
Use these values when setting the channel map with ebur128_set_channel().
static int str_read_close(AVFormatContext *s)
void * priv_data
Format private data.
AVCodecParameters * codecpar
Codec parameters associated with this stream.
int avio_feof(AVIOContext *s)
feof() equivalent for AVIOContext.
uint32_t codec_tag
Additional information about the codec (corresponds to the AVI FOURCC).
#define AV_CH_LAYOUT_MONO
uint64_t_TMPL AV_WL64 unsigned int_TMPL AV_RL32
This structure stores compressed data.