Lines Matching defs:pkt

77     int64_t pkt_cnt;         ///< pkt counter for muxed packets
2016 static int mxf_parse_prores_frame(AVFormatContext *s, AVStream *st, AVPacket *pkt)
2035 sc->frame_size = pkt->size;
2067 static int mxf_parse_dnxhd_frame(AVFormatContext *s, AVStream *st, AVPacket *pkt)
2076 if (pkt->size < 43)
2079 cid = AV_RB32(pkt->data + 0x28);
2091 switch (pkt->data[0x21] >> 5) {
2107 sc->frame_size = pkt->size;
2138 static int mxf_parse_dv_frame(AVFormatContext *s, AVStream *st, AVPacket *pkt)
2149 if (pkt->size < 120000)
2152 apt = pkt->data[4] & 0x7;
2153 vs_pack = pkt->data + 80*5 + 48;
2154 vsc_pack = pkt->data + 80*5 + 53;
2194 sc->frame_size = pkt->size;
2232 AVPacket *pkt, MXFIndexEntry *e)
2238 const uint8_t *buf = pkt->data;
2239 const uint8_t *buf_end = pkt->data + pkt->size;
2312 frame_size = pkt->size + extra_size;
2322 sc->frame_size = pkt->size;
2380 AVPacket *pkt, MXFIndexEntry *e)
2386 for(i = 0; i < pkt->size - 4; i++) {
2387 c = (c<<8) + pkt->data[i];
2389 if ((pkt->data[i+1] & 0xf0) == 0x10) { // seq ext
2390 st->codecpar->profile = pkt->data[i+1] & 0x07;
2391 st->codecpar->level = pkt->data[i+2] >> 4;
2392 sc->low_delay = pkt->data[i+6] >> 7;
2393 } else if (i + 5 < pkt->size && (pkt->data[i+1] & 0xf0) == 0x80) { // pict coding ext
2394 sc->interlaced = !(pkt->data[i+5] & 0x80); // progressive frame
2396 sc->field_dominance = 1 + !(pkt->data[i+4] & 0x80); // top field first
2400 if (pkt->data[i+4]>>6 & 0x01) { // closed
2412 switch ((pkt->data[i+4]>>4) & 0xf) {
2421 int pict_type = (pkt->data[i+2]>>3) & 0x07;
2422 e->temporal_ref = (pkt->data[i+1]<<2) | (pkt->data[i+2]>>6);
2804 static void mxf_write_d10_audio_packet(AVFormatContext *s, AVStream *st, AVPacket *pkt)
2808 int frame_size = pkt->size / st->codecpar->block_align;
2809 const uint8_t *samples = pkt->data;
2810 const uint8_t *const end = pkt->data + pkt->size;
2857 static int mxf_write_opatom_packet(AVFormatContext *s, AVPacket *pkt, MXFIndexEntry *ie)
2880 avio_write(pb, pkt->data, pkt->size);
2881 mxf->body_offset += pkt->size;
2907 static int mxf_write_packet(AVFormatContext *s, AVPacket *pkt)
2911 AVStream *st = s->streams[pkt->stream_index];
2916 if (!mxf->header_written && pkt->stream_index != 0 &&
2933 if (!mxf_parse_mpeg2_frame(s, st, pkt, &ie)) {
2938 if (!mxf_parse_dnxhd_frame(s, st, pkt)) {
2943 if (!mxf_parse_prores_frame(s, st, pkt)) {
2948 if (!mxf_parse_dv_frame(s, st, pkt)) {
2953 if (!mxf_parse_h264_frame(s, st, pkt, &ie)) {
2960 if (pkt->size != sc->frame_size && st->codecpar->codec_type == AVMEDIA_TYPE_VIDEO) {
2962 st->index, pkt->size, sc->frame_size);
2970 return mxf_write_opatom_packet(s, pkt, &ie);
3019 mxf_write_d10_audio_packet(s, st, pkt);
3021 klv_encode_ber4_length(pb, pkt->size); // write length
3022 avio_write(pb, pkt->data, pkt->size);
3023 mxf->body_offset += 16+4+pkt->size + klv_fill_size(16+4+pkt->size);
3136 if (!stream_count || pktl->pkt.stream_index == 0)
3139 if (ffstream(s->streams[pktl->pkt.stream_index])->last_in_packet_buffer != pktl)
3140 ffstream(s->streams[pktl->pkt.stream_index])->last_in_packet_buffer = pktl;
3148 av_packet_unref(&pktl->pkt);
3162 if (ffstream(s->streams[pktl->pkt.stream_index])->last_in_packet_buffer == pktl)
3163 ffstream(s->streams[pktl->pkt.stream_index])->last_in_packet_buffer = NULL;
3174 const AVPacket *pkt)
3176 MXFStreamContext *sc = s->streams[pkt ->stream_index]->priv_data;
3179 return next->dts > pkt->dts ||
3180 (next->dts == pkt->dts && sc->order < sc2->order);
3183 static int mxf_interleave(AVFormatContext *s, AVPacket *pkt,
3188 MXFStreamContext *sc = s->streams[pkt->stream_index]->priv_data;
3189 pkt->pts = pkt->dts = sc->pkt_cnt++;
3190 if ((ret = ff_interleave_add_packet(s, pkt, mxf_compare_timestamps)) < 0)
3193 return mxf_interleave_get_packet(s, pkt, flush);