Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
 help / color / mirror / Atom feed
* [FFmpeg-devel] [PATCH] avdevice/dshow: support RGB24 and RGB32
@ 2026-01-21 13:10 haotruongnhat--- via ffmpeg-devel
  0 siblings, 0 replies; only message in thread
From: haotruongnhat--- via ffmpeg-devel @ 2026-01-21 13:10 UTC (permalink / raw)
  To: ffmpeg-devel; +Cc: Hao Truong

From: Hao Truong <haotruongnhat@gmail.com>

Map BI_RGB 24-bit and 32-bit DIB formats to the corresponding pixel formats.
This improves capture on devices that expose only RGB24/RGB32.

Signed-off-by: Hao Truong <haotruongnhat@gmail.com>
---
 libavdevice/dshow.c | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/libavdevice/dshow.c b/libavdevice/dshow.c
index 6e97304850..582b2d05fe 100644
--- a/libavdevice/dshow.c
+++ b/libavdevice/dshow.c
@@ -76,6 +76,14 @@ static enum AVPixelFormat dshow_pixfmt(DWORD biCompression, WORD biBitCount)
             case 32:
                 return AV_PIX_FMT_0RGB32;
         }
+    case 0xe436eb7b:
+        return AV_PIX_FMT_RGB565;
+    case 0xe436eb7c:
+        return AV_PIX_FMT_RGB555;
+    case 0xe436eb7d:
+        return AV_PIX_FMT_RGB24;
+    case 0xe436eb7e:
+        return AV_PIX_FMT_0RGB32;
     }
     return avpriv_pix_fmt_find(PIX_FMT_LIST_RAW, biCompression); // all others
 }
@@ -1581,7 +1589,7 @@ dshow_add_device(AVFormatContext *avctx,
         par->codec_type = AVMEDIA_TYPE_VIDEO;
         par->width      = fmt_info->width;
         par->height     = fmt_info->height;
-        par->codec_tag  = bih->biCompression;
+        par->codec_tag  = fmt_info->pix_fmt == AV_PIX_FMT_NONE ? bih->biCompression : 0;
         par->format     = fmt_info->pix_fmt;
         if (bih->biCompression == MKTAG('H', 'D', 'Y', 'C')) {
             av_log(avctx, AV_LOG_DEBUG, "attempt to use full range for HDYC...\n");
-- 
2.43.0

_______________________________________________
ffmpeg-devel mailing list -- ffmpeg-devel@ffmpeg.org
To unsubscribe send an email to ffmpeg-devel-leave@ffmpeg.org

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2026-01-24 15:56 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-01-21 13:10 [FFmpeg-devel] [PATCH] avdevice/dshow: support RGB24 and RGB32 haotruongnhat--- via ffmpeg-devel

Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

This inbox may be cloned and mirrored by anyone:

	git clone --mirror https://master.gitmailbox.com/ffmpegdev/0 ffmpegdev/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 ffmpegdev ffmpegdev/ https://master.gitmailbox.com/ffmpegdev \
		ffmpegdev@gitmailbox.com
	public-inbox-index ffmpegdev

Example config snippet for mirrors.


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git