MCPcopy Create free account
hub / github.com/FFmpeg/FFmpeg / input_packet_process

Function input_packet_process

fftools/ffmpeg_demux.c:463–505  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

461}
462
463static int input_packet_process(Demuxer *d, AVPacket *pkt, unsigned *send_flags)
464{
465 InputFile *f = &d->f;
466 InputStream *ist = f->streams[pkt->stream_index];
467 DemuxStream *ds = ds_from_ist(ist);
468 FrameData *fd;
469 int ret = 0;
470
471 fd = packet_data(pkt);
472 if (!fd)
473 return AVERROR(ENOMEM);
474
475 ret = ts_fixup(d, pkt, fd);
476 if (ret < 0)
477 return ret;
478
479 if (d->recording_time != INT64_MAX) {
480 int64_t start_time = 0;
481 if (copy_ts) {
482 start_time += f->start_time != AV_NOPTS_VALUE ? f->start_time : 0;
483 start_time += start_at_zero ? 0 : f->start_time_effective;
484 }
485 if (ds->dts >= d->recording_time + start_time)
486 *send_flags |= DEMUX_SEND_STREAMCOPY_EOF;
487 }
488
489 ds->data_size += pkt->size;
490 ds->nb_packets++;
491
492 fd->wallclock[LATENCY_PROBE_DEMUX] = av_gettime_relative();
493
494 if (debug_ts) {
495 av_log(ist, AV_LOG_INFO, "demuxer+ffmpeg -> ist_index:%d:%d type:%s pkt_pts:%s pkt_pts_time:%s pkt_dts:%s pkt_dts_time:%s duration:%s duration_time:%s off:%s off_time:%s\n",
496 f->index, pkt->stream_index,
497 av_get_media_type_string(ist->par->codec_type),
498 av_ts2str(pkt->pts), av_ts2timestr(pkt->pts, &pkt->time_base),
499 av_ts2str(pkt->dts), av_ts2timestr(pkt->dts, &pkt->time_base),
500 av_ts2str(pkt->duration), av_ts2timestr(pkt->duration, &pkt->time_base),
501 av_ts2str(f->ts_offset), av_ts2timestr(f->ts_offset, &AV_TIME_BASE_Q));
502 }
503
504 return 0;
505}
506
507static void readrate_sleep(Demuxer *d)
508{

Callers 1

input_threadFunction · 0.85

Calls 6

ds_from_istFunction · 0.85
packet_dataFunction · 0.85
ts_fixupFunction · 0.85
av_gettime_relativeFunction · 0.85
av_logFunction · 0.85
av_get_media_type_stringFunction · 0.85

Tested by

no test coverage detected