313 {
315 <<
MOD_NAME <<
"Format change detected ("
317 << ").\n";
318
319 bool detected_3d = (
flags & bmdDetectedVideoInputDualStream3D) != 0U;
320 if (detected_3d !=
s->
stereo) {
323 << (detected_3d ? "" : "not ") << "detected but "
325 << "enabled! "
326 "Switching automatically. This behavior is "
327 "experimental so please report any problems. "
328 "You can also specify `3D` option explicitly.\n";
331 }
333 unique_lock<mutex> lk(
s->
lock);
334 if (notificationEvents & bmdVideoInputColorspaceChanged && csBitDepth !=
configuredCsBitDepth) {
336 csBitDepth |= bmdDetectedVideoInput8BitDepth;
337 }
340 }
341 unordered_map<BMDDetectedVideoInputFormatFlags, codec_t> m = {
342 {bmdDetectedVideoInputYCbCr422 | bmdDetectedVideoInput8BitDepth,
UYVY},
343 {bmdDetectedVideoInputYCbCr422 | bmdDetectedVideoInput10BitDepth,
v210},
344 {bmdDetectedVideoInputYCbCr422 | bmdDetectedVideoInput12BitDepth,
v210},
345 {bmdDetectedVideoInputRGB444 | bmdDetectedVideoInput8BitDepth,
RGBA},
346 {bmdDetectedVideoInputRGB444 | bmdDetectedVideoInput10BitDepth,
R10k},
347 {bmdDetectedVideoInputRGB444 | bmdDetectedVideoInput12BitDepth,
R12L},
348 };
350 const string &
depth = (
flags & bmdDetectedVideoInput10BitDepth) != 0U ?
"10"s :
"12"s;
353 << "-bit signal, use \":codec=UYVY\" to "
354 "enforce 8-bit capture (old "
355 "behavior).\n";
356 }
357
360 }
361
362 if (notificationEvents & bmdVideoInputDisplayModeChanged) {
364 deckLinkInput->PauseStreams();
365 BMDPixelFormat pf{};
368 return result;
369 }
371 deckLinkInput->FlushStreams();
372 deckLinkInput->StartStreams();
373 }
374
375 return S_OK;
376 }
string bmd_hresult_to_string(HRESULT res)
static constexpr BMDDetectedVideoInputFormatFlags csMask
static auto getNotificationEventsStr(BMDVideoInputFormatChangedEvents notificationEvents, BMDDetectedVideoInputFormatFlags flags) noexcept
static constexpr BMDDetectedVideoInputFormatFlags bitDepthMask
BMDDetectedVideoInputFormatFlags configuredCsBitDepth
#define LOG_LEVEL_NOTICE
information that may be interesting
#define LOG_LEVEL_ERROR
general errors
#define LOG_LEVEL_WARNING
less severe errors
IDeckLinkInput * deckLinkInput
unsigned int requested_bit_depth
void set_codec(codec_t c)
BMDVideoInputFlags enable_flags
@ R10k
RGB 10-bit packed - RGBX, big-endian (2 bit padding)
@ UYVY
YCbCr 422 8-bit - Cb Y0 Cr Y1.
@ R12L
RGB 12-bit packed, little-endian.
@ RGBA
RGBA 8-bit, big-endian.
@ v210
YCbCr 422 10-bit - xVY0U|xY2UY1|xUY3V|xY5VY4, little-endian (2 bit padding /'x'/),...
static HRESULT set_display_mode_properties(struct vidcap_decklink_state *s, struct tile *tile, IDeckLinkDisplayMode *displayMode, BMDPixelFormat *pf)
#define CALL_AND_CHECK(cmd,...)