Lines Matching defs:pkt

195     AVPacket *pkt;
796 static void mpegts_packet_set_cenc_info(AVPacket *pkt, AV_DrmCencInfo *info)
798 AV_DrmCencInfo *cenc_info = (AV_DrmCencInfo *)av_packet_new_side_data(pkt, AV_PKT_DATA_ENCRYPTION_INFO,
833 static void mpegts_packet_add_cenc_info(AVFormatContext *s, AVPacket *pkt)
836 if (pkt == NULL || pkt->data == NULL || pkt->size == 0) {
837 av_log(NULL, AV_LOG_ERROR, "pkt parameter err\n");
840 if ((s == NULL) || (s->streams == NULL) || (pkt->stream_index >= s->nb_streams) ||
841 (s->streams[pkt->stream_index] == NULL) || (s->streams[pkt->stream_index]->codecpar == NULL)) {
845 enum AVCodecID codec_id = s->streams[pkt->stream_index]->codecpar->codec_id;
854 cenc_info.sub_samples[0].clear_header_len = pkt->size;
860 int ret = mpegts_drm_get_cenc_info(s->streams[pkt->stream_index], codec_id, pkt->data, pkt->size, &cenc_info);
862 mpegts_packet_set_cenc_info(pkt, &cenc_info);
863 mpegts_avstream_set_cenc_info(s->streams[pkt->stream_index], &cenc_info);
1597 static void new_data_packet(const uint8_t *buffer, int len, AVPacket *pkt)
1599 av_packet_unref(pkt);
1600 pkt->data = (uint8_t *)buffer;
1601 pkt->size = len;
1604 static int new_pes_packet(PESContext *pes, AVPacket *pkt)
1608 av_packet_unref(pkt);
1610 pkt->buf = pes->buffer;
1611 pkt->data = pes->buffer->data;
1612 pkt->size = pes->data_index;
1620 memset(pkt->data + pkt->size, 0, AV_INPUT_BUFFER_PADDING_SIZE);
1624 pkt->stream_index = pes->sub_st->index;
1626 pkt->stream_index = pes->st->index;
1627 pkt->pts = pes->pts;
1628 pkt->dts = pes->dts;
1630 pkt->pos = pes->ts_packet_pos;
1631 pkt->flags = pes->flags;
1636 sd = av_packet_new_side_data(pkt, AV_PKT_DATA_MPEGTS_STREAM_ID, 1);
1744 if (!ts->pkt)
1749 ret = new_pes_packet(pes, ts->pkt);
1979 ret = new_pes_packet(pes, ts->pkt);
2006 ret = new_pes_packet(pes, ts->pkt);
2371 if (!ts->pkt)
2374 new_data_packet(section, section_len, ts->pkt);
2375 ts->pkt->stream_index = idx;
2380 ts->pkt->pts = ts->pkt->dts = f->last_pcr/300;
3037 if (!ts->pkt)
3302 if (!ts->pkt)
3305 new_data_packet(section, section_len, ts->pkt);
3306 ts->pkt->stream_index = ts->epg_stream->index;
3840 static int mpegts_raw_read_packet(AVFormatContext *s, AVPacket *pkt)
3849 if ((ret = av_new_packet(pkt, TS_PACKET_SIZE)) < 0)
3851 ret = read_packet(s, pkt->data, ts->raw_packet_size, &data);
3852 pkt->pos = avio_tell(s->pb);
3856 if (data != pkt->data)
3857 memcpy(pkt->data, data, TS_PACKET_SIZE);
3861 if (parse_pcr(&pcr_h, &pcr_l, pkt->data) == 0) {
3879 pkt->pts = ts->cur_pcr;
3880 pkt->duration = ts->pcr_incr;
3883 pkt->stream_index = 0;
3887 static int mpegts_read_packet(AVFormatContext *s, AVPacket *pkt)
3892 pkt->size = -1;
3893 ts->pkt = pkt;
3896 av_packet_unref(ts->pkt);
3902 ret = new_pes_packet(pes, pkt);
3913 if (!ret && pkt->size < 0) {
3917 mpegts_packet_add_cenc_info(s, pkt);
3919 if (!ret && pkt->size < 0)
3984 AVPacket *pkt;
3991 pkt = av_packet_alloc();
3992 if (!pkt)
3995 int ret = av_read_frame(s, pkt);
3997 av_packet_free(&pkt);
4000 if (pkt->dts != AV_NOPTS_VALUE && pkt->pos >= 0) {
4001 ff_reduce_index(s, pkt->stream_index);
4002 av_add_index_entry(s->streams[pkt->stream_index], pkt->pos, pkt->dts, 0, 0, AVINDEX_KEYFRAME /* FIXME keyframe? */);
4003 if (pkt->stream_index == stream_index && pkt->pos >= *ppos) {
4004 int64_t dts = pkt->dts;
4005 *ppos = pkt->pos;
4006 av_packet_free(&pkt);
4010 pos = pkt->pos;
4011 av_packet_unref(pkt);
4014 av_packet_free(&pkt);
4043 int avpriv_mpegts_parse_packet(MpegTSContext *ts, AVPacket *pkt,
4049 ts->pkt = pkt;