diff mbox series

[FFmpeg-devel] add MEDIASUBTYPE_RGB8 support

Message ID 20200217001436.23067-1-james@dattrax.co.uk
State New
Headers show
Series [FFmpeg-devel] add MEDIASUBTYPE_RGB8 support
Related show

Checks

Context Check Description
andriy/ffmpeg-patchwork pending
andriy/ffmpeg-patchwork success Applied patch
andriy/ffmpeg-patchwork success Configure finished
andriy/ffmpeg-patchwork success Make finished
andriy/ffmpeg-patchwork success Make fate finished

Commit Message

Jim Hauxwell Feb. 17, 2020, 12:15 a.m. UTC
windows/win32/directshow/uncompressed-rgb-video-subtypes

The Magwell series of HDMI USB capture boards use this format for bgr24
input.
---
 libavcodec/raw.c    | 3 +++
 libavcodec/rawdec.c | 3 ++-
 2 files changed, 5 insertions(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/libavcodec/raw.c b/libavcodec/raw.c
index b6fb91c1c6..f9ad1548c1 100644
--- a/libavcodec/raw.c
+++ b/libavcodec/raw.c
@@ -289,6 +289,9 @@  const PixelFormatTag ff_raw_pix_fmt_tags[] = {
     { AV_PIX_FMT_YUV444P16LE, MKTAG('I', '4', 'F', 'L') },
     { AV_PIX_FMT_YUV444P16BE, MKTAG('I', '4', 'F', 'B') },
 
+    /* directshow */
+    { AV_PIX_FMT_BGR24, MKTAG(0x7D, 0xEB, 0x36, 0xE4) }, /* MEDIASUBTYPE_RGB8 */
+
     /* special */
     { AV_PIX_FMT_RGB565LE,MKTAG( 3 ,  0 ,  0 ,  0 ) }, /* flipped RGB565LE */
     { AV_PIX_FMT_YUV444P, MKTAG('Y', 'V', '2', '4') }, /* YUV444P, swapped UV */
diff --git a/libavcodec/rawdec.c b/libavcodec/rawdec.c
index a110a690f5..43d8e8a5ae 100644
--- a/libavcodec/rawdec.c
+++ b/libavcodec/rawdec.c
@@ -111,7 +111,8 @@  static av_cold int raw_init_decoder(AVCodecContext *avctx)
          !memcmp(avctx->extradata + avctx->extradata_size - 9, "BottomUp", 9)) ||
         avctx->codec_tag == MKTAG('c','y','u','v') ||
         avctx->codec_tag == MKTAG(3, 0, 0, 0) ||
-        avctx->codec_tag == MKTAG('W','R','A','W'))
+        avctx->codec_tag == MKTAG('W','R','A','W') ||
+        avctx->codec_tag == MKTAG(0x7D, 0xEB, 0x36, 0xE4))
         context->flip = 1;
 
     if (avctx->pix_fmt == AV_PIX_FMT_MONOWHITE ||