37#define FILM_TAG MKBETAG('F', 'I', 'L', 'M')
38#define FDSC_TAG MKBETAG('F', 'D', 'S', 'C')
39#define STAB_TAG MKBETAG('S', 'T', 'A', 'B')
40#define CVID_TAG MKBETAG('c', 'v', 'i', 'd')
41#define RAW_TAG MKBETAG('r', 'a', 'w', ' ')
94 unsigned char scratch[256];
96 unsigned int data_offset;
97 unsigned int audio_frame_counter;
98 unsigned int video_frame_counter;
106 data_offset =
AV_RB32(&scratch[4]);
166 if (film->
version == 0 || scratch[20] == 24) {
211 for (
i = 0;
i <
s->nb_streams;
i++) {
219 audio_frame_counter = video_frame_counter = 0;
225 data_offset +
AV_RB32(&scratch[0]);
229 if (
AV_RB32(&scratch[8]) == 0xFFFFFFFF) {
244 video_frame_counter++;
283 while (next_sample ==
NULL) {
298 if (ret !=
sample->sample_size)
305 if (next_sample !=
NULL)
332 .p.name =
"film_cpk",
int64_t avio_seek(AVIOContext *s, int64_t offset, int whence)
fseek() equivalent for AVIOContext.
int ffio_read_size(AVIOContext *s, unsigned char *buf, int size)
Read size bytes from AVIOContext into buf.
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)
#define FF_INFMT_FLAG_INIT_CLEANUP
For an FFInputFormat with this flag set read_close() needs to be called by the caller upon read_heade...
static int read_header(FFV1Context *f, RangeCoder *c)
AVCodecID
Identify the syntax and semantics of the bitstream.
@ AV_CODEC_ID_PCM_S16BE_PLANAR
@ AV_CODEC_ID_PCM_S8_PLANAR
#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 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)
Memory handling functions.
@ AV_PIX_FMT_RGB24
packed RGB 8:8:8, 24bpp, RGBRGB...
static int film_read_seek(AVFormatContext *s, int stream_index, int64_t timestamp, int flags)
static int film_probe(const AVProbeData *p)
static int film_read_header(AVFormatContext *s)
static int film_read_packet(AVFormatContext *s, AVPacket *pkt)
static int film_read_close(AVFormatContext *s)
int nb_channels
Number of channels in this layout.
int height
The height of the video frame in pixels.
int bits_per_coded_sample
The number of bits per sample in the codedwords.
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.
int block_align
The number of bytes per coded audio frame, required by some formats.
uint32_t codec_tag
Additional information about the codec (corresponds to the AVI FOURCC).
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.
int index
stream index in AVFormatContext
enum AVStreamParseType need_parsing
unsigned int audio_samplerate
film_sample * sample_table
unsigned int sample_count
unsigned int current_sample
unsigned int audio_channels
enum AVCodecID audio_type
enum AVCodecID video_type
#define av_malloc_array(a, b)