73 int f, p, i, sbit, ebit, src,
r;
99 r = ((buf[1] & 0x01) << 3) | ((buf[2] & 0xe0) >> 5);
103 if (len < header_size) {
105 "Too short H.263 RTP packet: %d bytes, %d header bytes\n",
114 if (len < header_size) {
116 "Too short H.263 RTP packet: %d bytes, %d header bytes\n",
123 sbit = (buf[0] >> 3) & 0x7;
125 src = (buf[1] & 0xe0) >> 5;
126 if (!(buf[0] & 0xf8)) {
127 if ((src == 0 || src >= 6) &&
r) {
131 "Interpreting H263 RTP data as RFC 2429/4629 even though "
132 "signalled with a static payload type.\n");
145 if (len > 4 &&
AV_RB32(buf) >> 10 == 0x20) {
158 data->
endbyte |= buf[0] & (0xff >> sbit);
186 data->
endbyte = buf[len - 1] & (0xff << ebit);
214 .static_payload_id = 34,
static int h263_handle_packet(AVFormatContext *ctx, PayloadContext *data, AVStream *st, AVPacket *pkt, uint32_t *timestamp, const uint8_t *buf, int len, uint16_t seq, int flags)
#define AVERROR_INVALIDDATA
Invalid data found when processing input.
int avio_close_dyn_buf(AVIOContext *s, uint8_t **pbuffer)
Return the written size and a pointer to the buffer.
static unsigned int get_bits(GetBitContext *s, int n)
Read 1-25 bits.
#define AV_LOG_WARNING
Something somehow does not look correct.
static void h263_free_context(PayloadContext *data)
RTP/JPEG specific private data.
int index
stream index in AVFormatContext
uint8_t * buf
the temporary storage buffer
int avio_open_dyn_buf(AVIOContext **s)
Open a write only memory stream.
enum AVMediaType codec_type
Macro definitions for various function/variable attributes.
enum AVStreamParseType need_parsing
static PayloadContext * h263_new_context(void)
AVStream ** streams
A list of all streams in the file.
bitstream reader API header.
void avio_write(AVIOContext *s, const unsigned char *buf, int size)
#define AV_PKT_FLAG_KEY
The packet contains a keyframe.
static int get_bits_left(GetBitContext *gb)
uint32_t timestamp
current frame timestamp
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
void av_free(void *ptr)
Free a memory block which has been allocated with av_malloc(z)() or av_realloc(). ...
#define RTP_FLAG_MARKER
RTP marker bit was set for this packet.
void av_log(void *avcl, int level, const char *fmt,...)
int flags
A combination of AV_PKT_FLAG values.
RTPDynamicProtocolHandler ff_h263_rfc2190_dynamic_handler
void avio_w8(AVIOContext *s, int b)
static void skip_bits(GetBitContext *s, int n)
static int init_get_bits(GetBitContext *s, const uint8_t *buffer, int bit_size)
Initialize GetBitContext.
int ff_rtp_finalize_packet(AVPacket *pkt, AVIOContext **dyn_buf, int stream_idx)
Close the dynamic buffer and make a packet from it.
static av_cold int h263_init(AVFormatContext *ctx, int st_index, PayloadContext *data)
This structure stores compressed data.
void * av_mallocz(size_t size)
Allocate a block of size bytes with alignment suitable for all memory accesses (including vectors if ...