From e95ce6c7abc38a9bb5c38d64c816daf290b3377c Mon Sep 17 00:00:00 2001 From: Martin Pulec Date: Tue, 23 Jan 2024 15:26:17 +0100 Subject: [PATCH] vcap/dshow: capture RGB if specified together with mode= --- src/video_capture/DirectShowGrabber.cpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/video_capture/DirectShowGrabber.cpp b/src/video_capture/DirectShowGrabber.cpp index be8fadc8f..f48ebf7b5 100644 --- a/src/video_capture/DirectShowGrabber.cpp +++ b/src/video_capture/DirectShowGrabber.cpp @@ -950,11 +950,10 @@ static int vidcap_dshow_init(struct vidcap_params *params, void **state) { "Cannot read stream capabilities #%d (index is correct)", s->modeNumber); - if (s->desc.color_spec != VIDEO_CODEC_NONE) { - MSG(WARNING, "Mode set explicitly, specified " - "color-space is ignored!\n"); + assert(s->desc.color_spec == VC_NONE || s->desc.color_spec == BGR); + if (s->desc.color_spec == VC_NONE) { + s->desc.color_spec = get_ug_codec(&mediaType->subtype); } - s->desc.color_spec = get_ug_codec(&mediaType->subtype); if (s->desc.color_spec == VC_NONE) { MSG(WARNING, "Pixel format %.4s not supported directly, "