Go to the documentation of this file.
39 #define RIFF_TAG MKTAG('R', 'I', 'F', 'F')
40 #define CDXA_TAG MKTAG('C', 'D', 'X', 'A')
42 #define RAW_CD_SECTOR_SIZE 2352
43 #define RAW_CD_SECTOR_DATA_SIZE 2304
44 #define VIDEO_DATA_CHUNK_SIZE 0x7E0
45 #define VIDEO_DATA_HEADER_SIZE 0x38
46 #define RIFF_HEADER_SIZE 0x2C
48 #define CDXA_TYPE_MASK 0x0E
49 #define CDXA_TYPE_DATA 0x08
50 #define CDXA_TYPE_AUDIO 0x04
51 #define CDXA_TYPE_VIDEO 0x02
52 #define CDXA_TYPE_EMPTY 0x00
54 #define STR_MAGIC (0x80010160)
71 static const uint8_t
sync_header[12] = {0x00,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x00};
75 const uint8_t *sector= p->
buf;
76 const uint8_t *end= sector + p->
buf_size;
94 if (sector[0x11] >= 32)
100 int current_sector =
AV_RL16(§or[0x1C]);
101 int sector_count =
AV_RL16(§or[0x1E]);
105 && current_sector < sector_count
114 if(sector[0x13]&0x2A)
127 else if(vid+
aud)
return 1;
188 int current_sector =
AV_RL16(§or[0x1C]);
189 int sector_count =
AV_RL16(§or[0x1E]);
193 && current_sector < sector_count
236 if (current_sector == sector_count-1) {
250 int fmt = sector[0x13];
273 memcpy(
pkt->
data,sector+24,2304);
void av_packet_unref(AVPacket *pkt)
Wipe the packet.
#define AV_LOG_WARNING
Something somehow does not look correct.
const FFInputFormat ff_str_demuxer
Filter the word “frame” indicates either a video frame or a group of audio as stored in an AVFrame structure Format for each input and each output the list of supported formats For video that means pixel format For audio that means channel sample they are references to shared objects When the negotiation mechanism computes the intersection of the formats supported at each end of a all references to both lists are replaced with a reference to the intersection And when a single format is eventually chosen for a link amongst the remaining all references to the list are updated That means that if a filter requires that its input and output have the same format amongst a supported all it has to do is use a reference to the same list of formats query_formats can leave some formats unset and return AVERROR(EAGAIN) to cause the negotiation mechanism toagain later. That can be used by filters with complex requirements to use the format negotiated on one link to set the formats supported on another. Frame references ownership and permissions
enum AVMediaType codec_type
General type of the encoded data.
AVStream * avformat_new_stream(AVFormatContext *s, const struct AVCodec *c)
Add a new stream to a media file.
#define AVERROR_EOF
End of file.
int64_t duration
Duration of this packet in AVStream->time_base units, 0 if unknown.
uint32_t codec_tag
Additional information about the codec (corresponds to the AVI FOURCC).
int buf_size
Size of buf except extra allocated bytes.
int nb_channels
Number of channels in this layout.
static av_cold int read_close(AVFormatContext *ctx)
static av_always_inline int64_t avio_tell(AVIOContext *s)
ftell() equivalent for AVIOContext.
static int str_read_packet(AVFormatContext *s, AVPacket *ret_pkt)
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
static int read_packet(void *opaque, uint8_t *buf, int buf_size)
static const uint8_t sync_header[12]
int av_new_packet(AVPacket *pkt, int size)
Allocate the payload of a packet and initialize its fields with default values.
static int str_probe(const AVProbeData *p)
unsigned char * buf
Buffer must have AVPROBE_PADDING_SIZE of extra allocated bytes filled with zero.
uint64_t_TMPL AV_WL64 unsigned int_TMPL AV_WL32 unsigned int_TMPL AV_WL24 unsigned int_TMPL AV_RL16
AVBufferRef * buf
A reference to the reference-counted buffer where the packet data is stored.
AVCodecParameters * codecpar
Codec parameters associated with this stream.
static int read_header(FFV1Context *f)
This structure contains the data a format has to probe a file.
AVChannelLayout ch_layout
Audio only.
int sample_rate
Audio only.
static int FUNC() aud(CodedBitstreamContext *ctx, RWContext *rw, H264RawAUD *current)
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification.
#define RAW_CD_SECTOR_SIZE
#define VIDEO_DATA_HEADER_SIZE
#define VIDEO_DATA_CHUNK_SIZE
void av_channel_layout_default(AVChannelLayout *ch_layout, int nb_channels)
Get the default channel layout for a given number of channels.
#define i(width, name, range_min, range_max)
int block_align
Audio only.
int64_t avio_seek(AVIOContext *s, int64_t offset, int whence)
fseek() equivalent for AVIOContext.
uint64_t_TMPL AV_WL64 unsigned int_TMPL AV_RL32
int index
stream index in AVFormatContext
int avio_read(AVIOContext *s, unsigned char *buf, int size)
Read size bytes from AVIOContext into buf.
static int str_read_header(AVFormatContext *s)
static int read_probe(const AVProbeData *p)
enum AVCodecID codec_id
Specific type of the encoded data (the codec used).
This structure stores compressed data.
int64_t pos
byte position in stream, -1 if unknown
#define AVERROR_INVALIDDATA
Invalid data found when processing input.
int64_t start_time
Decoding: pts of the first frame of the stream in presentation order, in stream time base.
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.
int avio_feof(AVIOContext *s)
Similar to feof() but also returns nonzero on read errors.
static int str_read_close(AVFormatContext *s)