31typedef struct yop_dec_context {
43 probe_packet->
buf[2]<10 &&
44 probe_packet->
buf[3]<10 &&
45 probe_packet->
buf[6] &&
46 probe_packet->
buf[7] &&
47 !(probe_packet->
buf[8] & 1) &&
48 !(probe_packet->
buf[10] & 1) &&
50 AV_RL16(probe_packet->
buf + 12 + 6) < probe_packet->
buf[12] * 3 + 4 + probe_packet->
buf[7] * 2048
122 int actual_video_data_size = yop->
frame_size -
144 }
else if (ret < yop->palette_size) {
159 actual_video_data_size);
162 else if (ret < actual_video_data_size)
184 int64_t frame_pos, pos_min, pos_max;
192 frame_count = (pos_max - pos_min) / yop->
frame_size;
194 timestamp =
FFMAX(0,
FFMIN(frame_count, timestamp));
196 frame_pos = timestamp * yop->
frame_size + pos_min;
198 if (
avio_seek(
s->pb, frame_pos, SEEK_SET) < 0)
210 .p.extensions =
"yop",
int64_t avio_seek(AVIOContext *s, int64_t offset, int whence)
fseek() equivalent for AVIOContext.
int64_t avio_size(AVIOContext *s)
Get the filesize.
static av_always_inline int64_t avio_tell(AVIOContext *s)
ftell() equivalent for AVIOContext.
unsigned int avio_rl16(AVIOContext *s)
int64_t avio_skip(AVIOContext *s, int64_t offset)
Skip given number of bytes forward.
int avio_read(AVIOContext *s, unsigned char *buf, int size)
Read size bytes from AVIOContext into buf.
int avio_r8(AVIOContext *s)
static int read_packet(void *opaque, uint8_t *buf, int buf_size)
#define flags(name, subs,...)
static int read_probe(const AVProbeData *p)
Public libavutil channel layout APIs header.
int ff_get_extradata(void *logctx, AVCodecParameters *par, AVIOContext *pb, int size)
Allocate extradata with additional AV_INPUT_BUFFER_PADDING_SIZE at end which is always set to 0 and f...
static AVStream * video_stream
static AVStream * audio_stream
static int read_header(FFV1Context *f, RangeCoder *c)
@ AV_CODEC_ID_ADPCM_IMA_APC
void av_packet_unref(AVPacket *pkt)
Wipe the packet.
#define AV_PKT_FLAG_KEY
The packet contains a keyframe.
void av_packet_move_ref(AVPacket *dst, AVPacket *src)
Move every field in src to dst and reset src.
void av_shrink_packet(AVPacket *pkt, int size)
Reduce packet size, correctly zeroing padding.
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.
#define AV_CHANNEL_LAYOUT_MONO
#define AVERROR_INVALIDDATA
Invalid data found when processing input.
#define AVERROR_EOF
End of file.
#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.
static av_cold int read_close(AVFormatContext *ctx)
static int read_seek(AVFormatContext *ctx, int stream_index, int64_t timestamp, int flags)
An AVChannelLayout holds information about the channel layout of audio data.
This struct describes the properties of an encoded stream.
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.
int64_t bit_rate
The average bitrate of the encoded data (in bits per second).
enum AVMediaType codec_type
General type of the encoded data.
uint8_t * extradata
Extra binary data needed for initializing the decoder, codec-dependent.
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.
int64_t pos
byte position in stream, -1 if unknown
This structure contains the data a format has to probe a file.
unsigned char * buf
Buffer must have AVPROBE_PADDING_SIZE of extra allocated bytes filled with zero.
Rational number (pair of numerator and denominator).
int64_t data_offset
offset of the first packet