30 #define SEGA_CD_PCM_NUM 12500000 31 #define SEGA_CD_PCM_DEN 786432 52 int score = 0, sectors = 1;
62 if ((header > 0x07FE && header < 0x8100) ||
63 (header > 0x8200 && header < 0xA100) ||
64 (header > 0xA200 && header < 0xC100)) {
77 if (sectors && header && last_left == 0) {
83 }
else if (sectors && header) {
86 if (header != 0x7FE && left < 7)
91 i += sectors ? 2048 : left + 4;
96 if (sectors && (
i > 0 && left < 0x7fe) &&
98 offset =
i + left + 2;
99 }
else if (sectors &&
i > 0) {
101 last_left -=
FFMIN(last_left, 2046);
108 header =
AV_RB16(src + offset);
109 size =
AV_RB16(src + offset + 2) + 4;
111 while ((header & 0xFF00) == 0) {
115 header =
AV_RB16(src + offset);
116 size =
AV_RB16(src + offset + 2) + 4;
121 if ((header & 0xFF) > 1)
133 new_rate =
AV_RB16(src + offset + 8);
135 sample_rate = new_rate;
136 if (sample_rate == 0 || new_rate != sample_rate)
138 if (src[offset + 10] != 1)
142 }
else if (type == 0xC1 ||
150 int nb_pals = src[offset + 9];
151 int tiles_w = src[offset + 10];
152 int tiles_h = src[offset + 11];
156 if (nb_pals == 0 || nb_pals > 4)
158 if (tiles_w == 0 || tiles_w > 80)
160 if (tiles_h == 0 || tiles_h > 60)
164 }
else if (header == 0x7FE) {
170 i += sectors ? 2048 : size + 4;
171 last_left -=
FFMIN(last_left, 2046);
197 int type = header >> 8;
214 if ((header > 0x07FE && header < 0x8100) ||
215 (header > 0x8200 && header < 0xA100) ||
216 (header > 0xA200 && header < 0xC100)) {
459 int64_t timestamp,
int flags)
#define AVERROR_INVALIDDATA
Invalid data found when processing input.
int64_t pos
byte position in stream, -1 if unknown
static int read_seek(AVFormatContext *ctx, int stream_index, int64_t timestamp, int flags)
enum AVCodecID codec_id
Specific type of the encoded data (the codec used).
int index
stream index in AVFormatContext
int64_t avio_seek(AVIOContext *s, int64_t offset, int whence)
fseek() equivalent for AVIOContext.
int64_t avio_skip(AVIOContext *s, int64_t offset)
Skip given number of bytes forward.
unsigned int avio_rb16(AVIOContext *s)
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_WL16 uint64_t_TMPL AV_WB64 unsigned int_TMPL AV_WB32 unsigned int_TMPL AV_WB24 unsigned int_TMPL AV_RB16
#define av_assert0(cond)
assert() equivalent, that is always enabled.
it s the only field you need to keep assuming you have a context There is some magic you don t need to care about around this just let it vf offset
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 AVERROR_EOF
End of file.
static av_always_inline int64_t avio_tell(AVIOContext *s)
ftell() equivalent for AVIOContext.
static const uint8_t header[24]
uint64_t channel_layout
Audio only.
int avio_read(AVIOContext *s, unsigned char *buf, int size)
Read size bytes from AVIOContext into buf.
#define AV_PKT_FLAG_KEY
The packet contains a keyframe.
int av_new_packet(AVPacket *pkt, int size)
Allocate the payload of a packet and initialize its fields with default values.
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification. ...
#define AV_LOG_DEBUG
Stuff which is only useful for libav* developers.
enum AVMediaType codec_type
General type of the encoded data.
simple assert() macros that are a bit more flexible than ISO C assert().
int flags
A combination of AV_PKT_FLAG values.
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
int seekable
A combination of AVIO_SEEKABLE_ flags or 0 when the stream is not seekable.
int64_t av_rescale(int64_t a, int64_t b, int64_t c)
Rescale a 64-bit integer with rounding to nearest.
static int read_header(FFV1Context *f)
static int read_packet(void *opaque, uint8_t *buf, int buf_size)
#define AVIO_SEEKABLE_NORMAL
Seeking works like for a local file.
AVIOContext * pb
I/O context.
Rational number (pair of numerator and denominator).
This structure contains the data a format has to probe a file.
int ffio_ensure_seekback(AVIOContext *s, int64_t buf_size)
Ensures that the requested seekback buffer size will be available.
int sample_rate
Audio only.
uint64_t_TMPL AV_WL64 unsigned int_TMPL AV_WL32 unsigned int_TMPL AV_WL24 unsigned int_TMPL AV_WL16 uint64_t_TMPL AV_RB64
int64_t start_time
Decoding: pts of the first frame of the stream in presentation order, in stream time base...
void * priv_data
Format private data.
AVCodecParameters * codecpar
Codec parameters associated with this stream.
int avio_feof(AVIOContext *s)
Similar to feof() but also returns nonzero on read errors.
uint32_t codec_tag
Additional information about the codec (corresponds to the AVI FOURCC).
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
#define AV_CH_LAYOUT_MONO
This structure stores compressed data.