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

Function get_bmd_timecode

libavdevice/decklink_dec.cpp:713–733  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

711}
712
713static int get_bmd_timecode(AVFormatContext *avctx, AVTimecode *tc, AVRational frame_rate, BMDTimecodeFormat tc_format, IDeckLinkVideoInputFrame_v14_2_1 *videoFrame)
714{
715 IDeckLinkTimecode *timecode;
716 int ret = AVERROR(ENOENT);
717#if BLACKMAGIC_DECKLINK_API_VERSION >= 0x0b000000
718 int hfr = (tc_format == bmdTimecodeRP188HighFrameRate);
719#else
720 int hfr = 0;
721#endif
722 if (videoFrame->GetTimecode(tc_format, &timecode) == S_OK) {
723 uint8_t hh, mm, ss, ff;
724 if (timecode->GetComponents(&hh, &mm, &ss, &ff) == S_OK) {
725 int flags = (timecode->GetFlags() & bmdTimecodeIsDropFrame) ? AV_TIMECODE_FLAG_DROPFRAME : 0;
726 if (!hfr && av_cmp_q(frame_rate, av_make_q(30, 1)) == 1)
727 ff = ff << 1 | !!(timecode->GetFlags() & bmdTimecodeFieldMark);
728 ret = av_timecode_init_from_components(tc, frame_rate, flags, hh, mm, ss, ff, avctx);
729 }
730 timecode->Release();
731 }
732 return ret;
733}
734
735static int get_frame_timecode(AVFormatContext *avctx, decklink_ctx *ctx, AVTimecode *tc, IDeckLinkVideoInputFrame_v14_2_1 *videoFrame)
736{

Callers 1

get_frame_timecodeFunction · 0.85

Calls 5

av_cmp_qFunction · 0.85
av_make_qFunction · 0.85
GetTimecodeMethod · 0.80
ReleaseMethod · 0.45

Tested by

no test coverage detected