Go to the documentation of this file.
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
87 yop->frame_size =
avio_r8(pb) * 2048;
97 yop->palette_size = video_par->
extradata[0] * 3 + 4;
100 video_par->
bit_rate = 8 * (yop->frame_size - yop->audio_block_length) * frame_rate;
103 if (yop->audio_block_length < 920 ||
104 yop->audio_block_length + yop->palette_size >= yop->frame_size) {
122 int actual_video_data_size = yop->frame_size -
123 yop->audio_block_length - yop->palette_size;
125 yop->video_packet.stream_index = 1;
127 if (yop->video_packet.data) {
135 yop->frame_size - yop->audio_block_length);
141 ret =
avio_read(pb, yop->video_packet.data, yop->palette_size);
144 }
else if (ret < yop->palette_size) {
154 pkt->
pos = yop->video_packet.pos;
158 ret =
avio_read(pb, yop->video_packet.data + 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)
202 yop->odd_frame = timestamp & 1;
210 .p.extensions =
"yop",
void av_packet_unref(AVPacket *pkt)
Wipe the packet.
uint8_t * extradata
Extra binary data needed for initializing the decoder, codec-dependent.
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.
This struct describes the properties of an encoded stream.
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 avio_size(AVIOContext *s)
Get the filesize.
#define AV_PKT_FLAG_KEY
The packet contains a keyframe.
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 int read_seek(AVFormatContext *ctx, int stream_index, int64_t timestamp, int flags)
void av_shrink_packet(AVPacket *pkt, int size)
Reduce packet size, correctly zeroing padding.
static av_cold int read_close(AVFormatContext *ctx)
static av_always_inline int64_t avio_tell(AVIOContext *s)
ftell() equivalent for AVIOContext.
unsigned int avio_rl16(AVIOContext *s)
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
static int read_packet(void *opaque, uint8_t *buf, int buf_size)
int av_new_packet(AVPacket *pkt, int size)
Allocate the payload of a packet and initialize its fields with default values.
unsigned char * buf
Buffer must have AVPROBE_PADDING_SIZE of extra allocated bytes filled with zero.
static AVStream * video_stream
@ AV_CODEC_ID_ADPCM_IMA_APC
int64_t data_offset
offset of the first packet
uint64_t_TMPL AV_WL64 unsigned int_TMPL AV_WL32 unsigned int_TMPL AV_WL24 unsigned int_TMPL AV_RL16
AVCodecParameters * codecpar
Codec parameters associated with this stream.
static int read_header(FFV1Context *f)
Rational number (pair of numerator and denominator).
This structure contains the data a format has to probe a file.
AVChannelLayout ch_layout
Audio only.
void av_packet_move_ref(AVPacket *dst, AVPacket *src)
Move every field in src to dst and reset src.
int sample_rate
Audio only.
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification.
An AVChannelLayout holds information about the channel layout of audio data.
static AVStream * audio_stream
AVRational sample_aspect_ratio
sample aspect ratio (0 if unknown)
int avio_r8(AVIOContext *s)
int flags
A combination of AV_PKT_FLAG values.
int64_t avio_seek(AVIOContext *s, int64_t offset, int whence)
fseek() equivalent for AVIOContext.
int avio_read(AVIOContext *s, unsigned char *buf, int size)
Read size bytes from AVIOContext into buf.
int64_t avio_skip(AVIOContext *s, int64_t offset)
Skip given number of bytes forward.
static int read_probe(const AVProbeData *p)
#define AV_CHANNEL_LAYOUT_MONO
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 flags(name, subs,...)
int64_t bit_rate
The average bitrate of the encoded data (in bits per second).
#define AVERROR_INVALIDDATA
Invalid data found when processing input.
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