Go to the documentation of this file.
27 #define PVA_MAX_PAYLOAD_LENGTH 0x17f8
28 #define PVA_VIDEO_PAYLOAD 0x01
29 #define PVA_AUDIO_PAYLOAD 0x02
30 #define PVA_MAGIC (('A' << 8) + 'V')
45 const unsigned char *buf = pd->
buf;
81 #define pva_log if (read_packet) av_log
87 int syncword, streamid, reserved,
flags, length, pts_flag;
101 pts_flag =
flags & 0x10;
111 if (reserved != 0x55) {
128 int pes_signal, pes_header_data_length, pes_packet_length,
130 unsigned char pes_header_data[256];
136 pes_header_data_length =
avio_r8(pb);
142 if (pes_signal != 1 || pes_header_data_length == 0) {
144 "trying to recover\n");
154 length -= 9 + pes_header_data_length;
156 pes_packet_length -= 3 + pes_header_data_length;
160 if (pes_flags & 0x80 && (pes_header_data[0] & 0xf0) == 0x20) {
161 if (pes_header_data_length < 5) {
190 int ret, length, streamid;
203 int64_t *
pos, int64_t pos_limit) {
206 int length, streamid;
211 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.
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.
static int read_packet(void *opaque, uint8_t *buf, int buf_size)
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...
const AVInputFormat ff_pva_demuxer
int64_t avio_seek(AVIOContext *s, int64_t offset, int whence)
fseek() equivalent for AVIOContext.
unsigned int avio_rb16(AVIOContext *s)
int64_t avio_skip(AVIOContext *s, int64_t offset)
Skip given number of bytes forward.
static int read_probe(const AVProbeData *p)
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.
int ffio_read_size(AVIOContext *s, unsigned char *buf, int size)
Read size bytes from AVIOContext into buf.
static int64_t read_timestamp(AVFormatContext *s, int stream_index, int64_t *ppos, int64_t pos_limit, int64_t(*read_timestamp)(struct AVFormatContext *, int, int64_t *, int64_t))
@ 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.