45#define BINK_EXTRADATA_SIZE 1
46#define BINK_MAX_AUDIO_TRACKS 256
47#define BINK_MAX_WIDTH 7680
48#define BINK_MAX_HEIGHT 4800
49#define SMUSH_BLOCK_SIZE 512
66 const uint8_t *
b = p->buf;
70 if (((
b[0] ==
'B' &&
b[1] ==
'I' &&
b[2] ==
'K' &&
71 (
b[3] ==
'b' ||
b[3] ==
'f' ||
b[3] ==
'g' ||
b[3] ==
'h' ||
b[3] ==
'i' ||
73 (
b[0] ==
'K' &&
b[1] ==
'B' &&
b[2] ==
'2' &&
74 (
b[3] ==
'a' ||
b[3] ==
'd' ||
b[3] ==
'f' ||
b[3] ==
'g' ||
b[3] ==
'h' ||
75 b[3] ==
'i' ||
b[3] ==
'j' ||
b[3] ==
'k'))) &&
82 }
while (smush &&
b < p->buf + p->buf_size - 32);
90 uint32_t fps_num, fps_den;
94 uint32_t
pos, next_pos;
96 int next_keyframe = 1;
128 "invalid header: largest frame size greater than file size\n");
139 if (fps_num == 0 || fps_den == 0) {
141 "invalid header: invalid fps (%"PRIu32
"/%"PRIu32
")\n",
172 (
signature ==
AV_RL32(
"KB2") && (revision ==
'i' || revision ==
'j' || revision ==
'k')))
207 keyframe = next_keyframe;
213 next_keyframe = next_pos & 1;
218 if (next_pos <=
pos) {
252 if (index_entry < 0) {
254 "could not find index entry for frame %"PRId64
"\n",
268 "frame %"PRId64
": audio size in header (%"PRIu32
") > size of packet left (%"PRIu32
")\n",
274 if (audio_size >= 4) {
295 pkt->stream_index = 0;
static int probe(const AVProbeData *p)
int64_t avio_seek(AVIOContext *s, int64_t offset, int whence)
fseek() equivalent for AVIOContext.
#define AVIO_SEEKABLE_NORMAL
Seeking works like for a local file.
int avio_feof(AVIOContext *s)
Similar to feof() but also returns nonzero on read errors.
unsigned int avio_rl16(AVIOContext *s)
int64_t avio_skip(AVIOContext *s, int64_t offset)
Skip given number of bytes forward.
unsigned int avio_rl32(AVIOContext *s)
static int read_packet(void *opaque, uint8_t *buf, int buf_size)
#define flags(name, subs,...)
#define i(width, name, range_min, range_max)
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 int read_header(FFV1Context *f, RangeCoder *c)
@ AV_CODEC_ID_BINKAUDIO_DCT
@ AV_CODEC_ID_BINKAUDIO_RDFT
#define AV_PKT_FLAG_KEY
The packet contains a keyframe.
AVStream * avformat_new_stream(AVFormatContext *s, const struct AVCodec *c)
Add a new stream to a media file.
int av_add_index_entry(AVStream *st, int64_t pos, int64_t timestamp, int size, int distance, int flags)
Add an index entry into a sorted list.
int av_index_search_timestamp(AVStream *st, int64_t timestamp, int flags)
Get the index for a specific timestamp.
#define AV_CHANNEL_LAYOUT_STEREO
#define AV_CHANNEL_LAYOUT_MONO
#define AVERROR_INVALIDDATA
Invalid data found when processing input.
#define AVERROR_EOF
End of file.
#define AV_LOG_WARNING
Something somehow does not look correct.
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
static av_always_inline AVRational av_inv_q(AVRational q)
Invert a rational.
static const char signature[]
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification.
static int read_seek(AVFormatContext *ctx, int stream_index, int64_t timestamp, int flags)
#define MKTAG(a, b, c, d)
An AVChannelLayout holds information about the channel layout of audio data.
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.
enum AVMediaType codec_type
General type of the encoded data.
uint32_t codec_tag
Additional information about the codec (corresponds to the AVI FOURCC).
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.
This structure contains the data a format has to probe a file.
AVCodecParameters * codecpar
Codec parameters associated with this stream.
int64_t duration
Decoding: duration of the stream, in stream time base.
AVRational avg_frame_rate
Average framerate.
AVRational time_base
This is the fundamental unit of time (in seconds) in terms of which frame timestamps are represented.
int64_t audio_pts[BINK_MAX_AUDIO_TRACKS]
uint32_t remain_packet_size
int current_track
audio track to return in next packet
uint32_t num_audio_tracks
AVIndexEntry * index_entries
Only used if the format does not support seeking natively.