31 #include "libavutil/channel_layout.h"
32 #include "libavutil/intreadwrite.h"
42 #define BINK_EXTRADATA_SIZE 1
43 #define BINK_MAX_AUDIO_TRACKS 256
44 #define BINK_MAX_WIDTH 7680
45 #define BINK_MAX_HEIGHT 4800
62 if ( b[0] ==
'B' && b[1] ==
'I' && b[2] ==
'K' &&
63 (b[3] ==
'b' || b[3] ==
'f' || b[3] ==
'g' || b[3] ==
'h' || b[3] ==
'i') &&
76 uint32_t fps_num, fps_den;
79 uint32_t pos, next_pos;
99 "invalid header: largest frame size greater than file size\n");
110 if (fps_num == 0 || fps_den == 0) {
164 for (i = 0; i < vst->
duration; i++) {
176 if (next_pos <= pos) {
205 if (index_entry < 0) {
207 "could not find index entry for frame %"PRId64
"\n",
220 "frame %"PRId64
": audio size in header (%u) > size of packet left (%u)\n",
226 if (audio_size >= 4) {
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.
static int64_t audio_size
AVCodecContext * codec
Codec context associated with this stream.
void av_log(void *avcl, int level, const char *fmt,...) av_printf_format(3
Send the specified message to the log if the level is less than or equal to the current av_log_level...
#define AV_CH_LAYOUT_STEREO
uint8_t * extradata
some codecs need / can use extradata like Huffman tables.
uint32_t num_audio_tracks
int current_track
audio track to return in next packet
unsigned char * buf
Buffer must have AVPROBE_PADDING_SIZE of extra allocated bytes filled with zero.
int id
Format-specific stream ID.
AVIndexEntry * index_entries
Only used if the format does not support seeking natively.
AVStream * avformat_new_stream(AVFormatContext *s, const AVCodec *c)
Add a new stream to a media file.
#define AV_PKT_FLAG_KEY
The packet contains a keyframe.
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
int av_index_search_timestamp(AVStream *st, int64_t timestamp, int flags)
Get the index for a specific timestamp.
void * priv_data
Format private data.
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification. ...
AVRational avg_frame_rate
Average framerate.
int flags
A combination of AV_PKT_FLAG values.
uint64_t channel_layout
Audio channel layout.
int seekable
A combination of AVIO_SEEKABLE_ flags or 0 when the stream is not seekable.
int width
picture width / height.
enum AVMediaType codec_type
int sample_rate
samples per second
unsigned int codec_tag
fourcc (LSB first, so "ABCD" -> ('D'<<24) + ('C'<<16) + ('B'<<8) + 'A').
AVIOContext * pb
I/O context.
This structure contains the data a format has to probe a file.
int64_t audio_pts[BINK_MAX_AUDIO_TRACKS]
static av_always_inline AVRational av_inv_q(AVRational q)
Invert a rational.
int64_t duration
Decoding: duration of the stream, in stream time base.
uint32_t remain_packet_size
int channels
number of audio channels
AVRational time_base
This is the fundamental unit of time (in seconds) in terms of which frame timestamps are represented...
#define AV_CH_LAYOUT_MONO
This structure stores compressed data.
int64_t pts
Presentation timestamp in AVStream->time_base units; the time at which the decompressed packet will b...