summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVíctor Manuel Jáquez Leal <vjaquez@igalia.com>2017-08-25 16:22:59 +0200
committerSebastian Dröge <sebastian@centricular.com>2017-10-19 15:25:05 +0200
commit325ecbc1eed2c6a331ea8c94280c1a91613a320d (patch)
tree94a0f8bc08894226f3cd67a01d28186ae5d1fe15
parent520ec3c9a3682aa9068ea60f8f53c010b4c5e7b9 (diff)
libs: encoder: h264: handle deprecated enum
In VA-API 1.0 the enum VAEncPackedHeaderH264_SEI is deprecated, and instead VAEncPackedHeaderRawData should be used. This patch creates a compatibility symbol, VA_ENC_PACKED_HEADER_H264_SEI, to expose the used enum according the VA-API version. https://bugzilla.gnome.org/show_bug.cgi?id=784398
-rw-r--r--gst-libs/gst/vaapi/gstvaapicompat.h6
-rw-r--r--gst-libs/gst/vaapi/gstvaapiencoder_h264.c2
2 files changed, 7 insertions, 1 deletions
diff --git a/gst-libs/gst/vaapi/gstvaapicompat.h b/gst-libs/gst/vaapi/gstvaapicompat.h
index 781e30d6..697046ec 100644
--- a/gst-libs/gst/vaapi/gstvaapicompat.h
+++ b/gst-libs/gst/vaapi/gstvaapicompat.h
@@ -37,6 +37,12 @@
#define vaAssociateSubpicture vaAssociateSubpicture2
#endif
+#if VA_CHECK_VERSION(1,0,0)
+#define VA_ENC_PACKED_HEADER_H264_SEI VAEncPackedHeaderRawData
+#else
+#define VA_ENC_PACKED_HEADER_H264_SEI VAEncPackedHeaderH264_SEI
+#endif
+
/* Compatibility glue with VA-API 0.34 */
#if VA_CHECK_VERSION(0,34,0)
# include <va/va_compat.h>
diff --git a/gst-libs/gst/vaapi/gstvaapiencoder_h264.c b/gst-libs/gst/vaapi/gstvaapiencoder_h264.c
index 0d4d96cc..f091eb98 100644
--- a/gst-libs/gst/vaapi/gstvaapiencoder_h264.c
+++ b/gst-libs/gst/vaapi/gstvaapiencoder_h264.c
@@ -1506,7 +1506,7 @@ add_packed_sei_header (GstVaapiEncoderH264 * encoder,
data_bit_size = GST_BIT_WRITER_BIT_SIZE (&bs);
data = GST_BIT_WRITER_DATA (&bs);
- packed_sei_param.type = VAEncPackedHeaderH264_SEI;
+ packed_sei_param.type = VA_ENC_PACKED_HEADER_H264_SEI;
packed_sei_param.bit_length = data_bit_size;
packed_sei_param.has_emulation_bytes = 0;