36 #define RIFF_TAG MKTAG('R', 'I', 'F', 'F')
37 #define CDXA_TAG MKTAG('C', 'D', 'X', 'A')
39 #define RAW_CD_SECTOR_SIZE 2352
40 #define RAW_CD_SECTOR_DATA_SIZE 2304
41 #define VIDEO_DATA_CHUNK_SIZE 0x7E0
42 #define VIDEO_DATA_HEADER_SIZE 0x38
43 #define RIFF_HEADER_SIZE 0x2C
45 #define CDXA_TYPE_MASK 0x0E
46 #define CDXA_TYPE_DATA 0x08
47 #define CDXA_TYPE_AUDIO 0x04
48 #define CDXA_TYPE_VIDEO 0x02
50 #define STR_MAGIC (0x80010160)
67 static const char sync_header[12] = {0x00,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x00};
71 uint8_t *sector= p->
buf;
87 if(sector[0x11] >= 32)
143 channel = sector[0x11];
153 int current_sector =
AV_RL16(§or[0x1C]);
154 int sector_count =
AV_RL16(§or[0x1E]);
155 int frame_size =
AV_RL32(§or[0x24]);
158 && current_sector < sector_count
160 av_log(s,
AV_LOG_ERROR,
"Invalid parameters %d %d %d\n", current_sector, sector_count, frame_size);
195 memcpy(pkt->
data + current_sector*VIDEO_DATA_CHUNK_SIZE,
197 VIDEO_DATA_CHUNK_SIZE);
199 if (current_sector == sector_count-1) {
200 pkt->
size= frame_size;
212 int fmt = sector[0x13];
233 memcpy(pkt->
data,sector+24,2304);
#define AVERROR_INVALIDDATA
Invalid data found when processing input.
int64_t pos
byte position in stream, -1 if unknown
int av_new_packet(AVPacket *pkt, int size)
Allocate the payload of a packet and initialize its fields with default values.
static int str_read_header(AVFormatContext *s, AVFormatParameters *ap)
#define AV_LOG_WARNING
Something somehow does not look correct.
int index
stream index in AVFormatContext
int64_t avio_seek(AVIOContext *s, int64_t offset, int whence)
fseek() equivalent for AVIOContext.
int ctx_flags
Format-specific flags, see AVFMTCTX_xx.
int block_align
number of bytes per packet if constant and known or 0 Used by some WAV based audio codecs...
AVInputFormat ff_str_demuxer
#define VIDEO_DATA_HEADER_SIZE
static int read_header(FFV1Context *f)
void av_free_packet(AVPacket *pkt)
Free a packet.
static av_cold int read_close(AVFormatContext *ctx)
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.
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification. ...
void av_log(void *avcl, int level, const char *fmt,...)
AVStream * avformat_new_stream(AVFormatContext *s, AVCodec *c)
Add a new stream to a media file.
#define RAW_CD_SECTOR_SIZE
AVCodecContext * codec
codec context
static const char sync_header[12]
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.
#define VIDEO_DATA_CHUNK_SIZE
struct StrDemuxContext StrDemuxContext
int width
picture width / height.
static int read_probe(AVProbeData *p)
static int str_read_packet(AVFormatContext *s, AVPacket *ret_pkt)
static int str_probe(AVProbeData *p)
enum AVMediaType codec_type
int sample_rate
samples per second
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
unsigned int codec_tag
fourcc (LSB first, so "ABCD" -> ('D'<<24) + ('C'<<16) + ('B'<<8) + 'A').
static int read_packet(AVFormatContext *ctx, AVPacket *pkt)
This structure contains the data a format has to probe a file.
static int str_read_close(AVFormatContext *s)
int eof_reached
true if eof reached
int channels
number of audio channels
void * priv_data
Format private data.
struct StrChannel StrChannel