Zebediah Figura : strmbase: Print colorimetry information in strmbase_dump_media_type().

Alexandre Julliard julliard at winehq.org
Wed Oct 14 15:37:20 CDT 2020


Module: wine
Branch: master
Commit: ff01e58f732e027164a95189d29d5c794c32754c
URL:    https://source.winehq.org/git/wine.git/?a=commit;h=ff01e58f732e027164a95189d29d5c794c32754c

Author: Zebediah Figura <z.figura12 at gmail.com>
Date:   Tue Oct 13 23:30:26 2020 -0500

strmbase: Print colorimetry information in strmbase_dump_media_type().

Signed-off-by: Zebediah Figura <z.figura12 at gmail.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 dlls/strmbase/mediatype.c |  9 ++++++
 include/dvdmedia.h        |  1 +
 include/dxva.h            | 82 +++++++++++++++++++++++++++++++++++++++++++++++
 3 files changed, 92 insertions(+)

diff --git a/dlls/strmbase/mediatype.c b/dlls/strmbase/mediatype.c
index c2560352aa..9544d1b8ba 100644
--- a/dlls/strmbase/mediatype.c
+++ b/dlls/strmbase/mediatype.c
@@ -21,6 +21,7 @@
 
 #include "strmbase_private.h"
 #include "dvdmedia.h"
+#include "dxva.h"
 
 WINE_DEFAULT_DEBUG_CHANNEL(strmbase);
 
@@ -132,6 +133,14 @@ void strmbase_dump_media_type(const AM_MEDIA_TYPE *mt)
         if (vih->dwCopyProtectFlags) TRACE("copy-protection flags %#x, ", vih->dwCopyProtectFlags);
         TRACE("aspect ratio %u/%u, ", vih->dwPictAspectRatioX, vih->dwPictAspectRatioY);
         if (vih->u.dwControlFlags) TRACE("control flags %#x, ", vih->u.dwControlFlags);
+        if (vih->u.dwControlFlags & AMCONTROL_COLORINFO_PRESENT)
+        {
+            const DXVA_ExtendedFormat *colorimetry = (const DXVA_ExtendedFormat *)&vih->u.dwControlFlags;
+
+            TRACE("chroma site %#x, range %#x, matrix %#x, lighting %#x, primaries %#x, transfer function %#x, ",
+                    colorimetry->VideoChromaSubsampling, colorimetry->NominalRange, colorimetry->VideoTransferMatrix,
+                    colorimetry->VideoLighting, colorimetry->VideoPrimaries, colorimetry->VideoTransferFunction);
+        }
         TRACE("size %dx%d, %u planes, %u bpp, compression %s, image size %u",
                 vih->bmiHeader.biWidth, vih->bmiHeader.biHeight, vih->bmiHeader.biPlanes,
                 vih->bmiHeader.biBitCount, debugstr_fourcc(vih->bmiHeader.biCompression),
diff --git a/include/dvdmedia.h b/include/dvdmedia.h
index daf1c9d37c..6e625b472f 100644
--- a/include/dvdmedia.h
+++ b/include/dvdmedia.h
@@ -22,6 +22,7 @@
 #define AMCONTROL_USED 0x00000001
 #define AMCONTROL_PAD_TO_4x3 0x00000002
 #define AMCONTROL_PAD_TO_16x9 0x00000004
+#define AMCONTROL_COLORINFO_PRESENT 0x00000080
 
 typedef struct tagVIDEOINFOHEADER2 {
     RECT rcSource;
diff --git a/include/dxva.h b/include/dxva.h
index 25354f5887..4f18f2e60d 100644
--- a/include/dxva.h
+++ b/include/dxva.h
@@ -565,6 +565,88 @@ typedef struct _DXVA_Status_VPx
 
 #include <poppack.h>
 
+typedef enum _DXVA_VideoChromaSubsampling
+{
+    DXVA_VideoChromaSubsampling_Vertically_AlignedChromaPlanes  = 0x1,
+    DXVA_VideoChromaSubsampling_Vertically_Cosited              = 0x2,
+    DXVA_VideoChromaSubsampling_Horizontally_Cosited            = 0x4,
+    DXVA_VideoChromaSubsampling_ProgressiveChroma               = 0x8,
+
+    DXVA_VideoChromaSubsampling_Unknown = 0,
+    DXVA_VideoChromaSubsampling_Cosited = DXVA_VideoChromaSubsampling_Vertically_AlignedChromaPlanes
+            | DXVA_VideoChromaSubsampling_Vertically_Cosited
+            | DXVA_VideoChromaSubsampling_Horizontally_Cosited,
+    DXVA_VideoChromaSubsampling_DV_PAL = DXVA_VideoChromaSubsampling_Vertically_Cosited
+            | DXVA_VideoChromaSubsampling_Horizontally_Cosited,
+    DXVA_VideoChromaSubsampling_MPEG1 = DXVA_VideoChromaSubsampling_Vertically_AlignedChromaPlanes,
+    DXVA_VideoChromaSubsampling_MPEG2 = DXVA_VideoChromaSubsampling_Vertically_AlignedChromaPlanes
+            | DXVA_VideoChromaSubsampling_Horizontally_Cosited,
+} DXVA_VideoChromaSubsampling;
+
+typedef enum _DXVA_NominalRange
+{
+    DXVA_NominalRange_Unknown = 0,
+    DXVA_NominalRange_0_255 = 1,
+    DXVA_NominalRange_16_235 = 2,
+    DXVA_NominalRange_48_208 = 3,
+    DXVA_NominalRange_Normal = DXVA_NominalRange_0_255,
+    DXVA_NominalRange_Wide = DXVA_NominalRange_16_235,
+} DXVA_NominalRange;
+
+typedef enum _DXVA_VideoTransferMatrix
+{
+    DXVA_VideoTransferMatrix_Unknown = 0,
+    DXVA_VideoTransferMatrix_BT709 = 1,
+    DXVA_VideoTransferMatrix_BT601 = 2,
+    DXVA_VideoTransferMatrix_SMPTE240M = 3,
+} DXVA_VideoTransferMatrix;
+
+typedef enum _DXVA_VideoLighting
+{
+    DXVA_VideoLighting_Unknown = 0,
+    DXVA_VideoLighting_bright = 1,
+    DXVA_VideoLighting_office = 2,
+    DXVA_VideoLighting_dim = 3,
+    DXVA_VideoLighting_dark = 4,
+} DXVA_VideoLighting;
+
+typedef enum _DXVA_VideoPrimaries
+{
+    DXVA_VideoPrimaries_Unknown = 0,
+    DXVA_VideoPrimaries_reserved = 1,
+    DXVA_VideoPrimaries_BT709 = 2,
+    DXVA_VideoPrimaries_BT470_2_SysM = 3,
+    DXVA_VideoPrimaries_BT470_2_SysBG = 4,
+    DXVA_VideoPrimaries_SMPTE170M = 5,
+    DXVA_VideoPrimaries_SMPTE420M = 6,
+    DXVA_VideoPrimaries_EBU3213 = 7,
+    DXVA_VideoPrimaries_SMPTE_C = 8,
+} DXVA_VideoPrimaries;
+
+typedef enum _DXVA_VideoTransferFunction
+{
+    DXVA_VideoTransFunc_Unknown = 0,
+    DXVA_VideoTransFunc_10 = 1,
+    DXVA_VideoTransFunc_18 = 2,
+    DXVA_VideoTransFunc_20 = 3,
+    DXVA_VideoTransFunc_22 = 4,
+    DXVA_VideoTransFunc_22_709 = 5,
+    DXVA_VideoTransFunc_22_240M = 6,
+    DXVA_VideoTransFunc_22_8bit_sRGB = 7,
+    DXVA_VideoTransFunc_28 = 8,
+} DXVA_VideoTransferFunction;
+
+typedef struct _DXVA_ExtendedFormat
+{
+    UINT SampleFormat : 8;
+    UINT VideoChromaSubsampling : 4;
+    DXVA_NominalRange NominalRange : 3;
+    DXVA_VideoTransferMatrix VideoTransferMatrix : 3;
+    DXVA_VideoLighting VideoLighting : 4;
+    DXVA_VideoPrimaries VideoPrimaries : 5;
+    DXVA_VideoTransferFunction VideoTransferFunction : 5;
+} DXVA_ExtendedFormat;
+
 #ifdef __cplusplus
 }
 #endif




More information about the wine-cvs mailing list