From 2a74a77992523f0f03fd8d2bb336170701065ff4 Mon Sep 17 00:00:00 2001 From: Martin Pulec Date: Tue, 6 Jun 2017 14:55:15 +0200 Subject: [PATCH] DeckLink cap.: opt. to override interlacing (I->P) Can be used when incoming signal is PsF interpreted as interlaced and should be reinterpreted as progressive. --- src/video_capture/decklink.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/video_capture/decklink.cpp b/src/video_capture/decklink.cpp index f69714d77..505861a3e 100644 --- a/src/video_capture/decklink.cpp +++ b/src/video_capture/decklink.cpp @@ -120,6 +120,7 @@ struct vidcap_decklink_state { bool detect_format; bool is_10b; + bool p_not_i; }; static HRESULT set_display_mode_properties(struct vidcap_decklink_state *s, struct tile *tile, IDeckLinkDisplayMode* displayMode, /* out */ BMDPixelFormat *pf); @@ -344,6 +345,8 @@ decklink_help() printf("detect-format\n"); printf("\tTry to detect input video format even if the device doesn't support autodetect.\n"); printf("\tSource interface still has to be given, eg. \"-t decklink:connection=HDMI:detect-format\".\n"); + printf("p_not_i\n"); + printf("\tIncoming signal should be treated as progressive even if detected as interlaced (PsF).\n"); printf("\n"); @@ -502,6 +505,8 @@ static bool parse_option(struct vidcap_decklink_state *s, const char *opt) } } else if (strcasecmp(opt, "detect-format") == 0) { s->detect_format = true; + } else if (strcasecmp(opt, "p_not_i") == 0) { + s->p_not_i = true; } else { log_msg(LOG_LEVEL_WARNING, "[DeckLink] Warning, unrecognized trailing options in init string: %s\n", opt); return false; @@ -708,6 +713,10 @@ static HRESULT set_display_mode_properties(struct vidcap_decklink_state *s, stru break; } + if (s->p_not_i) { + s->frame->interlacing = PROGRESSIVE; + } + displayModeCString = get_cstr_from_bmd_api_str(displayModeString); debug_msg("%-20s \t %d x %d \t %g FPS \t %d AVAREGE TIME BETWEEN FRAMES\n", displayModeCString, tile->width, tile->height, s->frame->fps, s->next_frame_time); /* TOREMOVE */