Lines Matching defs:rtp_h261_ctx
46 static int h261_handle_packet(AVFormatContext *ctx, PayloadContext *rtp_h261_ctx,
55 if (rtp_h261_ctx->buf && rtp_h261_ctx->timestamp != *timestamp) {
56 ffio_free_dyn_buf(&rtp_h261_ctx->buf);
57 rtp_h261_ctx->endbyte_bits = 0;
97 if (!rtp_h261_ctx->buf) {
100 res = avio_open_dyn_buf(&rtp_h261_ctx->buf);
104 rtp_h261_ctx->timestamp = *timestamp;
112 if (rtp_h261_ctx->endbyte_bits || sbit) {
113 if (rtp_h261_ctx->endbyte_bits == sbit) {
114 rtp_h261_ctx->endbyte |= buf[0] & (0xff >> sbit);
115 rtp_h261_ctx->endbyte_bits = 0;
118 avio_w8(rtp_h261_ctx->buf, rtp_h261_ctx->endbyte);
126 if (rtp_h261_ctx->endbyte_bits) {
127 rtp_h261_ctx->endbyte |= get_bits(&gb, 8 - rtp_h261_ctx->endbyte_bits);
128 avio_w8(rtp_h261_ctx->buf, rtp_h261_ctx->endbyte);
131 avio_w8(rtp_h261_ctx->buf, get_bits(&gb, 8));
132 rtp_h261_ctx->endbyte_bits = get_bits_left(&gb);
133 if (rtp_h261_ctx->endbyte_bits)
134 rtp_h261_ctx->endbyte = get_bits(&gb, rtp_h261_ctx->endbyte_bits) <<
135 (8 - rtp_h261_ctx->endbyte_bits);
142 avio_write(rtp_h261_ctx->buf, buf, len - 1);
143 rtp_h261_ctx->endbyte_bits = 8 - ebit;
144 rtp_h261_ctx->endbyte = buf[len - 1] & (0xff << ebit);
146 avio_write(rtp_h261_ctx->buf, buf, len);
155 if (rtp_h261_ctx->endbyte_bits)
156 avio_w8(rtp_h261_ctx->buf, rtp_h261_ctx->endbyte);
157 rtp_h261_ctx->endbyte_bits = 0;
160 res = ff_rtp_finalize_packet(pkt, &rtp_h261_ctx->buf, st->index);