| 711 | } |
| 712 | |
| 713 | static 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 | |
| 735 | static int get_frame_timecode(AVFormatContext *avctx, decklink_ctx *ctx, AVTimecode *tc, IDeckLinkVideoInputFrame_v14_2_1 *videoFrame) |
| 736 | { |
no test coverage detected