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

Function get_video_frame

fftools/ffplay.c:1827–1858  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1825}
1826
1827static int get_video_frame(VideoState *is, AVFrame *frame)
1828{
1829 int got_picture;
1830
1831 if ((got_picture = decoder_decode_frame(&is->viddec, frame, NULL)) < 0)
1832 return -1;
1833
1834 if (got_picture) {
1835 double dpts = NAN;
1836
1837 if (frame->pts != AV_NOPTS_VALUE)
1838 dpts = av_q2d(is->video_st->time_base) * frame->pts;
1839
1840 frame->sample_aspect_ratio = av_guess_sample_aspect_ratio(is->ic, is->video_st, frame);
1841
1842 if (framedrop>0 || (framedrop && get_master_sync_type(is) != AV_SYNC_VIDEO_MASTER)) {
1843 if (frame->pts != AV_NOPTS_VALUE) {
1844 double diff = dpts - get_master_clock(is);
1845 if (!isnan(diff) && fabs(diff) < AV_NOSYNC_THRESHOLD &&
1846 diff - is->frame_last_filter_delay < 0 &&
1847 is->viddec.pkt_serial == is->vidclk.serial &&
1848 is->videoq.nb_packets) {
1849 is->frame_drops_early++;
1850 av_frame_unref(frame);
1851 got_picture = 0;
1852 }
1853 }
1854 }
1855 }
1856
1857 return got_picture;
1858}
1859
1860static int configure_filtergraph(AVFilterGraph *graph, const char *filtergraph,
1861 AVFilterContext *source_ctx, AVFilterContext *sink_ctx)

Callers 1

video_threadFunction · 0.70

Calls 7

decoder_decode_frameFunction · 0.85
av_q2dFunction · 0.85
get_master_sync_typeFunction · 0.85
get_master_clockFunction · 0.85
fabsFunction · 0.85
av_frame_unrefFunction · 0.85

Tested by

no test coverage detected