[vlc-commits] fourcc: add nvdec opaque formats
Steve Lhomme
git at videolan.org
Wed Sep 18 09:05:23 CEST 2019
vlc | branch: master | Steve Lhomme <robux4 at ycbcr.xyz> | Fri Sep 6 16:48:00 2019 +0200| [e3b74165458147a1fc8c4fc56a6b8fd905154ad2] | committer: Steve Lhomme
fourcc: add nvdec opaque formats
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=e3b74165458147a1fc8c4fc56a6b8fd905154ad2
---
include/vlc_fourcc.h | 5 +++++
src/misc/fourcc.c | 26 ++++++++++++++++++++++++++
src/misc/fourcc_list.h | 9 +++++++++
3 files changed, 40 insertions(+)
diff --git a/include/vlc_fourcc.h b/include/vlc_fourcc.h
index c84466575c..691e493eb7 100644
--- a/include/vlc_fourcc.h
+++ b/include/vlc_fourcc.h
@@ -403,6 +403,11 @@
#define VLC_CODEC_D3D11_OPAQUE_RGBA VLC_FOURCC('D','X','R','G')
#define VLC_CODEC_D3D11_OPAQUE_BGRA VLC_FOURCC('D','A','G','R')
+/* NVDEC opaque video format for use the NVDec API */
+#define VLC_CODEC_NVDEC_OPAQUE VLC_FOURCC('N','V','D','8') /* 4:2:0 8 bpc */
+#define VLC_CODEC_NVDEC_OPAQUE_10B VLC_FOURCC('N','V','D','0') /* 4:2:0 10 bpc */
+#define VLC_CODEC_NVDEC_OPAQUE_16B VLC_FOURCC('N','V','D','6') /* 4:2:0 16 bpc */
+
/* CVPixelBuffer opaque buffer type */
#define VLC_CODEC_CVPX_NV12 VLC_FOURCC('C','V','P','N')
#define VLC_CODEC_CVPX_UYVY VLC_FOURCC('C','V','P','Y')
diff --git a/src/misc/fourcc.c b/src/misc/fourcc.c
index 7ce049d087..c29fb5deeb 100644
--- a/src/misc/fourcc.c
+++ b/src/misc/fourcc.c
@@ -420,6 +420,22 @@ static const vlc_fourcc_t p_D3D11_OPAQUE_RGBA_fallback[] = {
VLC_CODEC_D3D11_OPAQUE_RGBA, VLC_CODEC_RGBA, 0,
};
+static const vlc_fourcc_t p_NVDEC_OPAQUE_fallback[] = {
+ VLC_CODEC_NVDEC_OPAQUE, VLC_CODEC_NV12, 0,
+};
+
+static const vlc_fourcc_t p_NVDEC_OPAQUE_10B_fallback[] = {
+ VLC_CODEC_NVDEC_OPAQUE_10B,
+ VLC_CODEC_P010,
+ VLC_CODEC_I420_10L, 0,
+};
+
+static const vlc_fourcc_t p_NVDEC_OPAQUE_16B_fallback[] = {
+ VLC_CODEC_NVDEC_OPAQUE_16B,
+ VLC_CODEC_P016, VLC_CODEC_P010,
+ VLC_CODEC_I420_16L, VLC_CODEC_I420_12L, VLC_CODEC_I420_10L, 0,
+};
+
static const vlc_fourcc_t p_I440_fallback[] = {
VLC_CODEC_I440,
VLC_CODEC_YUV_PLANAR_420,
@@ -510,6 +526,9 @@ static const vlc_fourcc_t *pp_YUV_fallback[] = {
p_D3D9_OPAQUE_10B_fallback,
p_D3D11_OPAQUE_fallback,
p_D3D11_OPAQUE_10B_fallback,
+ p_NVDEC_OPAQUE_fallback,
+ p_NVDEC_OPAQUE_10B_fallback,
+ p_NVDEC_OPAQUE_16B_fallback,
NULL,
};
@@ -541,6 +560,9 @@ static const vlc_fourcc_t p_list_YUV[] = {
VLC_CODEC_D3D9_OPAQUE_10B,
VLC_CODEC_D3D11_OPAQUE,
VLC_CODEC_D3D11_OPAQUE_10B,
+ VLC_CODEC_NVDEC_OPAQUE,
+ VLC_CODEC_NVDEC_OPAQUE_10B,
+ VLC_CODEC_NVDEC_OPAQUE_16B,
0,
};
@@ -793,6 +815,10 @@ static const struct
VLC_CODEC_D3D11_OPAQUE_RGBA, VLC_CODEC_D3D11_OPAQUE_BGRA },
FAKE_FMT() },
+ { { VLC_CODEC_NVDEC_OPAQUE_16B,
+ VLC_CODEC_NVDEC_OPAQUE_10B, VLC_CODEC_NVDEC_OPAQUE },
+ FAKE_FMT() },
+
{ { VLC_CODEC_CVPX_NV12, VLC_CODEC_CVPX_UYVY,
VLC_CODEC_CVPX_I420, VLC_CODEC_CVPX_BGRA },
FAKE_FMT() },
diff --git a/src/misc/fourcc_list.h b/src/misc/fourcc_list.h
index fbf810b61d..1dff2af335 100644
--- a/src/misc/fourcc_list.h
+++ b/src/misc/fourcc_list.h
@@ -1214,6 +1214,15 @@ static const staticentry_t p_list_video[] = {
B(VLC_CODEC_D3D11_OPAQUE_BGRA, "BGRA D3D11 opaque"),
A("DAGR"),
+ B(VLC_CODEC_NVDEC_OPAQUE, "4:2:0 NVDEC opaque"),
+ A("NVD8"),
+
+ B(VLC_CODEC_NVDEC_OPAQUE_10B, "4:2:0 10bits NVDEC opaque"),
+ A("NVD0"),
+
+ B(VLC_CODEC_NVDEC_OPAQUE_16B, "4:2:0 16bits NVDEC opaque"),
+ A("NVD6"),
+
B(VLC_CODEC_AGM, "AmuseGraphics Movie"),
A("AGM0"),
A("AGM1"),
More information about the vlc-commits
mailing list