summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthew Waters <matthew@centricular.com>2016-03-31 01:21:42 +1100
committerMatthew Waters <matthew@centricular.com>2016-03-31 17:28:03 +1100
commit5b5d995d2108d3c37d09e8ab9c668b9550e808ec (patch)
treebb5b3c128ee69a2f9e78b95079adccf9d45db254
parentedfe4887667f48da55a956bc3ae7dad08c026071 (diff)
nvenc: add support for building against version 6 of the SDK
While mostly API compatible, the ABI has changed so binaries will not work across header versions (and ultimately nvidia driver releases). https://bugzilla.gnome.org/show_bug.cgi?id=763324
-rw-r--r--sys/nvenc/gstnvbaseenc.c22
1 files changed, 21 insertions, 1 deletions
diff --git a/sys/nvenc/gstnvbaseenc.c b/sys/nvenc/gstnvbaseenc.c
index 1bbdfe3b7..2bc1ef351 100644
--- a/sys/nvenc/gstnvbaseenc.c
+++ b/sys/nvenc/gstnvbaseenc.c
@@ -38,6 +38,9 @@
* - reset last_flow on FLUSH_STOP (seeking)
*/
+/* This currently supports both 5.x and 6.x versions of the NvEncodeAPI.h
+ * header which are mostly API compatible. */
+
#define N_BUFFERS_PER_FRAME 1
#define SUPPORTED_GL_APIS GST_GL_API_OPENGL3
@@ -173,23 +176,40 @@ _get_supported_input_formats (GstNvBaseEnc * nvenc)
* it the respective untiled planar format instead ?! */
switch (formats[i]) {
case NV_ENC_BUFFER_FORMAT_NV12_PL:
+#if defined (NV_ENC_BUFFER_FORMAT_NV12_TILED16x16)
case NV_ENC_BUFFER_FORMAT_NV12_TILED16x16:
+#endif
+#if defined (NV_ENC_BUFFER_FORMAT_NV12_TILED64x16)
case NV_ENC_BUFFER_FORMAT_NV12_TILED64x16:
+#endif
format_mask |= (1 << GST_VIDEO_FORMAT_NV12);
break;
case NV_ENC_BUFFER_FORMAT_YV12_PL:
+#if defined(NV_ENC_BUFFER_FORMAT_YV12_TILED16x16)
case NV_ENC_BUFFER_FORMAT_YV12_TILED16x16:
+#endif
+#if defined (NV_ENC_BUFFER_FORMAT_YV12_TILED64x16)
case NV_ENC_BUFFER_FORMAT_YV12_TILED64x16:
+#endif
format_mask |= (1 << GST_VIDEO_FORMAT_YV12);
break;
case NV_ENC_BUFFER_FORMAT_IYUV_PL:
+#if defined (NV_ENC_BUFFER_FORMAT_IYUV_TILED16x16)
case NV_ENC_BUFFER_FORMAT_IYUV_TILED16x16:
+#endif
+#if defined (NV_ENC_BUFFER_FORMAT_IYUV_TILED64x16)
case NV_ENC_BUFFER_FORMAT_IYUV_TILED64x16:
+#endif
format_mask |= (1 << GST_VIDEO_FORMAT_I420);
break;
case NV_ENC_BUFFER_FORMAT_YUV444_PL:
+#if defined (NV_ENC_BUFFER_FORMAT_YUV444_TILED16x16)
case NV_ENC_BUFFER_FORMAT_YUV444_TILED16x16:
- case NV_ENC_BUFFER_FORMAT_YUV444_TILED64x16:{
+#endif
+#if defined (NV_ENC_BUFFER_FORMAT_YUV444_TILED64x16)
+ case NV_ENC_BUFFER_FORMAT_YUV444_TILED64x16:
+#endif
+ {
NV_ENC_CAPS_PARAM caps_param = { 0, };
int yuv444_supported = 0;