Go to the documentation of this file.
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;
100 pts_flag =
flags & 0x10;
110 if (reserved != 0x55) {
127 int pes_signal, pes_header_data_length, pes_packet_length,
129 unsigned char pes_header_data[256];
135 pes_header_data_length =
avio_r8(pb);
141 if (pes_signal != 1 || pes_header_data_length == 0) {
143 "trying to recover\n");
150 ret =
avio_read(pb, pes_header_data, pes_header_data_length);
151 if (
ret != pes_header_data_length)
153 length -= 9 + pes_header_data_length;
155 pes_packet_length -= 3 + pes_header_data_length;
159 if (pes_flags & 0x80 && (pes_header_data[0] & 0xf0) == 0x20) {
160 if (pes_header_data_length < 5) {
189 int ret, length, streamid;
202 int64_t *
pos, int64_t pos_limit) {
205 int length, streamid;
210 while (*
pos < pos_limit) {
static int pva_probe(const AVProbeData *pd)
#define AV_LOG_WARNING
Something somehow does not look correct.
static int pva_read_header(AVFormatContext *s)
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
AVStream * avformat_new_stream(AVFormatContext *s, const AVCodec *c)
Add a new stream to a media file.
enum AVMediaType codec_type
General type of the encoded data.
static int64_t ff_parse_pes_pts(const uint8_t *buf)
Parse MPEG-PES five-byte timestamp.
#define AVERROR_EOF
End of file.
#define PVA_AUDIO_PAYLOAD
int buf_size
Size of buf except extra allocated bytes.
AVInputFormat ff_pva_demuxer
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 int pva_read_packet(AVFormatContext *s, AVPacket *pkt)
static av_always_inline int64_t avio_tell(AVIOContext *s)
ftell() equivalent for AVIOContext.
#define PVA_VIDEO_PAYLOAD
unsigned int avio_rb32(AVIOContext *s)
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
unsigned char * buf
Buffer must have AVPROBE_PADDING_SIZE of extra allocated bytes filled with zero.
enum AVStreamParseType need_parsing
AVCodecParameters * codecpar
Codec parameters associated with this stream.
static int read_header(FFV1Context *f)
static int pva_check(const uint8_t *p)
static int read_part_of_packet(AVFormatContext *s, int64_t *pts, int *len, int *strid, int read_packet)
This structure contains the data a format has to probe a file.
#define PVA_MAX_PAYLOAD_LENGTH
unsigned int avio_rb24(AVIOContext *s)
static int recover(WtvContext *wtv, uint64_t broken_pos)
Try to seek over a broken chunk.
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification.
#define AV_NOPTS_VALUE
Undefined timestamp value.
int avio_r8(AVIOContext *s)
static int64_t pva_read_timestamp(struct AVFormatContext *s, int stream_index, int64_t *pos, int64_t pos_limit)
int64_t pts
Presentation timestamp in AVStream->time_base units; the time at which the decompressed packet will b...
static int read_packet(void *opaque, uint8_t *buf, int buf_size)
int64_t avio_seek(AVIOContext *s, int64_t offset, int whence)
fseek() equivalent for AVIOContext.
unsigned int avio_rb16(AVIOContext *s)
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.
enum AVCodecID codec_id
Specific type of the encoded data (the codec used).
This structure stores compressed data.
#define flags(name, subs,...)
#define AVERROR_INVALIDDATA
Invalid data found when processing input.
@ AV_CODEC_ID_MPEG2VIDEO
preferred ID for MPEG-1/2 video decoding
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
int avio_feof(AVIOContext *s)
Similar to feof() but also returns nonzero on read errors.