26 #define PVA_MAX_PAYLOAD_LENGTH 0x17f8
27 #define PVA_VIDEO_PAYLOAD 0x01
28 #define PVA_AUDIO_PAYLOAD 0x02
29 #define PVA_MAGIC (('A' << 8) + 'V')
44 const unsigned char *
buf = pd->
buf;
80 #define pva_log if (read_packet) av_log
86 int syncword, streamid, reserved,
flags,
length, pts_flag;
99 pts_flag = flags & 0x10;
109 if (reserved != 0x55) {
126 int pes_signal, pes_header_data_length, pes_packet_length,
128 unsigned char pes_header_data[256];
134 pes_header_data_length =
avio_r8(pb);
136 if (pes_signal != 1) {
138 "trying to recover\n");
145 avio_read(pb, pes_header_data, pes_header_data_length);
146 length -= 9 + pes_header_data_length;
148 pes_packet_length -= 3 + pes_header_data_length;
152 if (pes_flags & 0x80 && (pes_header_data[0] & 0xf0) == 0x20)
189 int64_t *pos, int64_t pos_limit) {
197 while (*pos < pos_limit) {
static int pva_read_packet(AVFormatContext *s, AVPacket *pkt)
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.
#define AV_LOG_WARNING
Something somehow does not look correct.
static int pva_read_header(AVFormatContext *s)
AVCodecContext * codec
Codec context associated with this stream.
#define PVA_VIDEO_PAYLOAD
static int read_part_of_packet(AVFormatContext *s, int64_t *pts, int *len, int *strid, int read_packet)
unsigned char * buf
Buffer must have AVPROBE_PADDING_SIZE of extra allocated bytes filled with zero.
enum AVStreamParseType need_parsing
AVStream * avformat_new_stream(AVFormatContext *s, const AVCodec *c)
Add a new stream to a media file.
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
void * priv_data
Format private data.
static int pva_check(const uint8_t *p)
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification. ...
static int64_t ff_parse_pes_pts(const uint8_t *buf)
Parse MPEG-PES five-byte timestamp.
int buf_size
Size of buf except extra allocated bytes.
#define PVA_AUDIO_PAYLOAD
static int64_t pva_read_timestamp(struct AVFormatContext *s, int stream_index, int64_t *pos, int64_t pos_limit)
AVInputFormat ff_pva_demuxer
preferred ID for MPEG-1/2 video decoding
static int read_header(FFV1Context *f)
#define PVA_MAX_PAYLOAD_LENGTH
enum AVMediaType codec_type
AVIOContext * pb
I/O context.
static int read_packet(AVFormatContext *ctx, AVPacket *pkt)
This structure contains the data a format has to probe a file.
static int pva_probe(AVProbeData *pd)
This structure stores compressed data.
int64_t pts
Presentation timestamp in AVStream->time_base units; the time at which the decompressed packet will b...
#define AV_NOPTS_VALUE
Undefined timestamp value.