From: haotruongnhat--- via ffmpeg-devel <ffmpeg-devel@ffmpeg.org>
To: ffmpeg-devel@ffmpeg.org
Cc: Hao Truong <haotruongnhat@gmail.com>
Subject: [FFmpeg-devel] [PATCH] avdevice/dshow: support RGB24 and RGB32
Date: Wed, 21 Jan 2026 20:10:22 +0700
Message-ID: <20260121131022.542105-1-haotruongnhat@gmail.com> (raw)
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
reply other threads:[~2026-01-24 15:56 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260121131022.542105-1-haotruongnhat@gmail.com \
--to=ffmpeg-devel@ffmpeg.org \
--cc=haotruongnhat@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
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