Lines Matching refs:pl_ctx

45 static void fill_parse_info_header(PayloadContext *pl_ctx, uint8_t *buf,  in fill_parse_info_header()  argument
51 AV_WB32(&buf[9], pl_ctx->last_unit_size); in fill_parse_info_header()
53 pl_ctx->last_unit_size = data_unit_size; in fill_parse_info_header()
56 static int vc2hq_handle_sequence_header(PayloadContext *pl_ctx, AVStream *st, AVPacket *pkt, in vc2hq_handle_sequence_header() argument
65 fill_parse_info_header(pl_ctx, pkt->data, 0x00, size); in vc2hq_handle_sequence_header()
70 pl_ctx->seen_sequence_header = 1; in vc2hq_handle_sequence_header()
75 static int vc2hq_mark_end_of_sequence(PayloadContext *pl_ctx, AVStream *st, AVPacket *pkt) in vc2hq_mark_end_of_sequence() argument
84 fill_parse_info_header(pl_ctx, pkt->data, 0x10, size); in vc2hq_mark_end_of_sequence()
87 pl_ctx->seen_sequence_header = 0; in vc2hq_mark_end_of_sequence()
92 static int vc2hq_handle_frame_fragment(AVFormatContext *ctx, PayloadContext *pl_ctx, AVStream *st, in vc2hq_handle_frame_fragment() argument
111 if (pl_ctx->buf && pl_ctx->frame_nr != pic_nr) { in vc2hq_handle_frame_fragment()
113 ffio_free_dyn_buf(&pl_ctx->buf); in vc2hq_handle_frame_fragment()
124 if (!pl_ctx->buf) { in vc2hq_handle_frame_fragment()
126 res = avio_open_dyn_buf(&pl_ctx->buf); in vc2hq_handle_frame_fragment()
131 res = avio_seek(pl_ctx->buf, DIRAC_DATA_UNIT_HEADER_SIZE + DIRAC_PIC_NR_SIZE, SEEK_SET); in vc2hq_handle_frame_fragment()
135 pl_ctx->frame_nr = pic_nr; in vc2hq_handle_frame_fragment()
136 pl_ctx->timestamp = *timestamp; in vc2hq_handle_frame_fragment()
137 pl_ctx->frame_size = DIRAC_DATA_UNIT_HEADER_SIZE + DIRAC_PIC_NR_SIZE; in vc2hq_handle_frame_fragment()
140 avio_write(pl_ctx->buf, buf + 16 /* skip pl header */, frag_len); in vc2hq_handle_frame_fragment()
141 pl_ctx->frame_size += frag_len; in vc2hq_handle_frame_fragment()
151 if (!pl_ctx->buf) in vc2hq_handle_frame_fragment()
154 avio_write(pl_ctx->buf, buf + 20 /* skip pl header */, frag_len); in vc2hq_handle_frame_fragment()
155 pl_ctx->frame_size += frag_len; in vc2hq_handle_frame_fragment()
164 res = ff_rtp_finalize_packet(pkt, &pl_ctx->buf, st->index); in vc2hq_handle_frame_fragment()
168 fill_parse_info_header(pl_ctx, pkt->data, DIRAC_PCODE_PICTURE_HQ, pl_ctx->frame_size); in vc2hq_handle_frame_fragment()
169 AV_WB32(&pkt->data[13], pl_ctx->frame_nr); in vc2hq_handle_frame_fragment()
171 pl_ctx->frame_size = 0; in vc2hq_handle_frame_fragment()
176 static int vc2hq_handle_packet(AVFormatContext *ctx, PayloadContext *pl_ctx, in vc2hq_handle_packet() argument
184 if (pl_ctx->buf && pl_ctx->timestamp != *timestamp) { in vc2hq_handle_packet()
186 ffio_free_dyn_buf(&pl_ctx->buf); in vc2hq_handle_packet()
187 pl_ctx->frame_size = 0; in vc2hq_handle_packet()
199 if (pl_ctx->seen_sequence_header || parse_code == DIRAC_PCODE_SEQ_HEADER) { in vc2hq_handle_packet()
203 …res = vc2hq_handle_sequence_header(pl_ctx, st, pkt, buf + RTP_VC2HQ_PL_HEADER_SIZE, len - RTP_VC2H… in vc2hq_handle_packet()
207 res = vc2hq_mark_end_of_sequence(pl_ctx, st, pkt); in vc2hq_handle_packet()
211 res = vc2hq_handle_frame_fragment(ctx, pl_ctx, st, pkt, timestamp, buf, len, flags); in vc2hq_handle_packet()