[vlc-devel] [PATCH 09/42] fourcc: VDPAU surface types

Rémi Denis-Courmont remi at remlab.net
Fri Jun 28 20:29:57 CEST 2013


This define several codec identifiers for each of the VDPAU video
surface types (YUV 4:2:0 and 4:2:2) and one for VDPAU output surfaces
regardless of their internal type. (At this point, it does not seem
that the output surface type affects VLC processes).
VDPAU bitmap surfaces are not included as they do not seem useful.

VDPAU pictures have zero bits per pixel since they only carry picture
infos and handles to GPU resources, no actual pixel data. Nevertheless,
inclusion in chroma description is required for picture setup to work.
---
 include/vlc_fourcc.h |  7 +++++++
 src/misc/fourcc.c    | 11 +++++++++++
 2 files changed, 18 insertions(+)

diff --git a/include/vlc_fourcc.h b/include/vlc_fourcc.h
index c50acac..9fa255e 100644
--- a/include/vlc_fourcc.h
+++ b/include/vlc_fourcc.h
@@ -232,6 +232,13 @@
 /* 2 planes Y/VU 4:2:2 */
 #define VLC_CODEC_NV61            VLC_FOURCC('N','V','6','1')
 
+/* VDPAU video surface YCbCr 4:2:0 */
+#define VLC_CODEC_VDPAU_VIDEO_420 VLC_FOURCC('V','D','V','0')
+/* VDPAU video surface YCbCr 4:2:0 */
+#define VLC_CODEC_VDPAU_VIDEO_422 VLC_FOURCC('V','D','V','2')
+/* VDPAU output surface RGBA */
+#define VLC_CODEC_VDPAU_OUTPUT    VLC_FOURCC('V','D','O','R')
+
 /* Image codec (video) */
 #define VLC_CODEC_PNG             VLC_FOURCC('p','n','g',' ')
 #define VLC_CODEC_PPM             VLC_FOURCC('p','p','m',' ')
diff --git a/src/misc/fourcc.c b/src/misc/fourcc.c
index 1b4b299..9cd195b 100644
--- a/src/misc/fourcc.c
+++ b/src/misc/fourcc.c
@@ -1793,6 +1793,8 @@ static const vlc_fourcc_t p_list_YUV[] = {
     VLC_CODEC_YUV_PLANAR_420_16,
     VLC_CODEC_YUV_PLANAR_422_16,
     VLC_CODEC_YUV_PLANAR_444_16,
+    VLC_CODEC_VDPAU_VIDEO_420,
+    VLC_CODEC_VDPAU_VIDEO_422,
     0,
 };
 
@@ -1924,6 +1926,12 @@ bool vlc_fourcc_IsYUV(vlc_fourcc_t fcc)
       .pixel_size = size, \
       .pixel_bits = bits }
 
+#define FAKE_FMT() \
+    { .plane_count = 0, \
+      .p = { {.w = {1,1}, .h = {1,1}} }, \
+      .pixel_size = 0, \
+      .pixel_bits = 0 }
+
 static const struct
 {
     vlc_fourcc_t             p_fourcc[6];
@@ -1968,6 +1976,9 @@ static const struct
     { { VLC_CODEC_Y211, 0 },                   { 1, { {{1,4}, {1,1}} }, 4, 32 } },
     { { VLC_CODEC_XYZ12,  0 },                 PACKED_FMT(6, 48) },
 
+    { { VLC_CODEC_VDPAU_VIDEO_420, VLC_CODEC_VDPAU_VIDEO_422,
+        VLC_CODEC_VDPAU_OUTPUT, 0 },           FAKE_FMT() },
+
     { {0}, { 0, {}, 0, 0 } }
 };
 
-- 
1.8.3.1




More information about the vlc-devel mailing list