Lines Matching defs:pkt
442 static void write_timestamp(AVFormatContext *s, AVPacket *pkt)
446 AVCodecParameters *par = s->streams[pkt->stream_index]->codecpar;
448 write_chunk_header(s, &ff_timestamp_guid, 56, 0x40000000 | (INDEX_BASE + pkt->stream_index));
450 avio_wl64(pb, pkt->pts == AV_NOPTS_VALUE ? -1 : pkt->pts);
451 avio_wl64(pb, pkt->pts == AV_NOPTS_VALUE ? -1 : pkt->pts);
452 avio_wl64(pb, pkt->pts == AV_NOPTS_VALUE ? -1 : pkt->pts);
454 avio_wl64(pb, par->codec_type == AVMEDIA_TYPE_VIDEO && (pkt->flags & AV_PKT_FLAG_KEY) ? 1 : 0);
460 static int write_packet(AVFormatContext *s, AVPacket *pkt)
464 AVStream *st = s->streams[pkt->stream_index];
467 av_packet_ref(&wctx->thumbnail, pkt);
470 int ret = ff_check_h264_startcode(s, st, pkt);
480 if (pkt->pts != AV_NOPTS_VALUE && pkt->pts - (wctx->nb_st_pairs ? wctx->st_pairs[wctx->nb_st_pairs - 1].value : 0) >= 5000000)
481 add_serial_pair(&wctx->st_pairs, &wctx->nb_st_pairs, wctx->serial, pkt->pts);
483 if (pkt->pts != AV_NOPTS_VALUE && pkt->pts > wctx->last_pts) {
484 wctx->last_pts = pkt->pts;
489 write_timestamp(s, pkt);
491 write_chunk_header(s, &ff_data_guid, pkt->size, INDEX_BASE + pkt->stream_index);
492 avio_write(pb, pkt->data, pkt->size);
493 write_pad(pb, WTV_PAD8(pkt->size) - pkt->size);
664 static int attachment_value_size(const AVPacket *pkt, const AVDictionaryEntry *e)
666 return strlen("image/jpeg")*2 + 2 + 1 + (e ? strlen(e->value)*2 : 0) + 2 + 4 + pkt->size;