|
9 | 9 | * Dalibor Matura <255899@mail.muni.cz> |
10 | 10 | * Ian Wesley-Smith <iwsmith@cct.lsu.edu> |
11 | 11 | * |
12 | | - * Copyright (c) 2005-2025 CESNET, zájmové sdružení právnických osob |
| 12 | + * Copyright (c) 2005-2026 CESNET, zájmové sdružení právnických osob |
13 | 13 | * |
14 | 14 | * Redistribution and use in source and binary forms, with or without |
15 | 15 | * modification, is permitted provided that the following conditions |
@@ -204,6 +204,7 @@ struct vidcap_decklink_state { |
204 | 204 | { bmdDeckLinkConfigCapturePassThroughMode, bmd_option((int64_t) bmdDeckLinkCapturePassthroughModeDisabled, false) }, |
205 | 205 | }; |
206 | 206 | bool detect_format = false; |
| 207 | + bool autodetect_once = true; |
207 | 208 | unsigned int requested_bit_depth = 0; // 0, bmdDetectedVideoInput8BitDepth, bmdDetectedVideoInput10BitDepth or bmdDetectedVideoInput12BitDepth |
208 | 209 | bool p_not_i = false; |
209 | 210 |
|
@@ -380,6 +381,10 @@ class VideoDelegate : public IDeckLinkInputCallback { |
380 | 381 | deckLinkInput->FlushStreams(); |
381 | 382 | deckLinkInput->StartStreams(); |
382 | 383 |
|
| 384 | + if (s->autodetect_once) { |
| 385 | + s->enable_flags ^= bmdVideoInputEnableFormatDetection; |
| 386 | + } |
| 387 | + |
383 | 388 | return S_OK; |
384 | 389 | } |
385 | 390 | virtual HRESULT STDMETHODCALLTYPE VideoInputFrameArrived(IDeckLinkVideoInputFrame*, IDeckLinkAudioInputPacket*) override; |
@@ -610,6 +615,9 @@ decklink_help(bool full, const char *query_prop_fcc = nullptr) |
610 | 615 | "autodetect, eg. \"-t " |
611 | 616 | "decklink:connection=HDMI:detect-format\".\n"; |
612 | 617 |
|
| 618 | + col() << "\t" SBOLD("autodetect-once") |
| 619 | + << " autodetect the format just once (eg. to prevent flipping P/PsF)\n"; |
| 620 | + |
613 | 621 | col() << "\t" SBOLD("profile=<FourCC>") << " - use desired device profile:\n"; |
614 | 622 | print_bmd_device_profiles("\t\t"); |
615 | 623 | col() << "\t" SBOLD("sync_timecode") << " try to synchronize inputs based on timecode (for multiple inputs, eg. tiled 4K)\n"; |
@@ -764,6 +772,8 @@ static bool parse_option(struct vidcap_decklink_state *s, const char *opt) |
764 | 772 | s->profile.parse(strchr(opt, '=') + 1); |
765 | 773 | } else if (strcasecmp(opt, "detect-format") == 0) { |
766 | 774 | s->detect_format = true; |
| 775 | + } else if (strcasecmp(opt, "autodetect-once") == 0) { |
| 776 | + s->autodetect_once = true; |
767 | 777 | } else if (strcasecmp(opt, "p_not_i") == 0) { |
768 | 778 | s->p_not_i = true; |
769 | 779 | } else if (strstr(opt, "Use1080PsF") != nullptr) { |
|
0 commit comments