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) {
202 int64_t *
pos, int64_t pos_limit) {
210 while (*pos < pos_limit) {
static int recover(WtvContext *wtv, uint64_t broken_pos)
Try to seek over a broken chunk.
static int pva_read_packet(AVFormatContext *s, AVPacket *pkt)
#define AVERROR_INVALIDDATA
Invalid data found when processing input.
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)
enum AVCodecID codec_id
Specific type of the encoded data (the codec used).
int64_t avio_seek(AVIOContext *s, int64_t offset, int whence)
fseek() equivalent for AVIOContext.
int64_t avio_skip(AVIOContext *s, int64_t offset)
Skip given number of bytes forward.
unsigned int avio_rb16(AVIOContext *s)
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
#define PVA_VIDEO_PAYLOAD
static int read_part_of_packet(AVFormatContext *s, int64_t *pts, int *len, int *strid, int read_packet)
unsigned int avio_rb32(AVIOContext *s)
enum AVStreamParseType need_parsing
AVStream * avformat_new_stream(AVFormatContext *s, const AVCodec *c)
Add a new stream to a media file.
AVStream ** streams
A list of all streams in the file.
#define AVERROR_EOF
End of file.
static av_always_inline int64_t avio_tell(AVIOContext *s)
ftell() equivalent for AVIOContext.
int avio_read(AVIOContext *s, unsigned char *buf, int size)
Read size bytes from AVIOContext into buf.
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
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. ...
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.
int avio_r8(AVIOContext *s)
int buf_size
Size of buf except extra allocated bytes.
unsigned char * buf
Buffer must have AVPROBE_PADDING_SIZE of extra allocated bytes filled with zero.
#define PVA_AUDIO_PAYLOAD
unsigned int avio_rb24(AVIOContext *s)
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
static int read_packet(void *opaque, uint8_t *buf, int buf_size)
AVIOContext * pb
I/O context.
This structure contains the data a format has to probe a file.
#define flags(name, subs,...)
static int pva_probe(const AVProbeData *pd)
void * priv_data
Format private data.
AVCodecParameters * codecpar
Codec parameters associated with this stream.
int avio_feof(AVIOContext *s)
Similar to feof() but also returns nonzero on read errors.
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
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.