| 733 | } |
| 734 | |
| 735 | static int get_frame_timecode(AVFormatContext *avctx, decklink_ctx *ctx, AVTimecode *tc, IDeckLinkVideoInputFrame_v14_2_1 *videoFrame) |
| 736 | { |
| 737 | AVRational frame_rate = ctx->video_st->r_frame_rate; |
| 738 | int ret; |
| 739 | /* 50/60 fps content has alternating VITC1 and VITC2 timecode (see SMPTE ST |
| 740 | * 12-2, section 7), so the native ordering of RP188Any (HFR, VITC1, LTC, |
| 741 | * VITC2) would not work because LTC might not contain the field flag. |
| 742 | * Therefore we query the types manually. */ |
| 743 | if (ctx->tc_format == bmdTimecodeRP188Any && av_cmp_q(frame_rate, av_make_q(30, 1)) == 1) { |
| 744 | #if BLACKMAGIC_DECKLINK_API_VERSION >= 0x0b000000 |
| 745 | ret = get_bmd_timecode(avctx, tc, frame_rate, bmdTimecodeRP188HighFrameRate, videoFrame); |
| 746 | if (ret == AVERROR(ENOENT)) |
| 747 | #endif |
| 748 | ret = get_bmd_timecode(avctx, tc, frame_rate, bmdTimecodeRP188VITC1, videoFrame); |
| 749 | if (ret == AVERROR(ENOENT)) |
| 750 | ret = get_bmd_timecode(avctx, tc, frame_rate, bmdTimecodeRP188VITC2, videoFrame); |
| 751 | if (ret == AVERROR(ENOENT)) |
| 752 | ret = get_bmd_timecode(avctx, tc, frame_rate, bmdTimecodeRP188LTC, videoFrame); |
| 753 | } else { |
| 754 | ret = get_bmd_timecode(avctx, tc, frame_rate, ctx->tc_format, videoFrame); |
| 755 | } |
| 756 | return ret; |
| 757 | } |
| 758 | |
| 759 | HRESULT decklink_input_callback::VideoInputFrameArrived( |
| 760 | IDeckLinkVideoInputFrame_v14_2_1 *videoFrame, IDeckLinkAudioInputPacket *audioFrame) |
no test coverage detected