summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPhilipp Zabel <p.zabel@pengutronix.de>2020-01-08 17:16:35 +0100
committerVíctor Manuel Jáquez Leal <vjaquez@igalia.com>2020-01-19 14:57:04 +0100
commit209e1b5bf0e13c0059aea4605b916612dbf63718 (patch)
tree0e934aecf7633867410e0bc19fc021e97addb55f
parent38d7297bb62964837ec158fcc4f490e09b59bb23 (diff)
libs: encoder: h264: Add gst_vaapi_encoder_h264_supports_avc()
AVC output requires packed header support in the driver.
-rw-r--r--gst-libs/gst/vaapi/gstvaapiencoder_h264.c8
-rw-r--r--gst-libs/gst/vaapi/gstvaapiencoder_h264.h3
2 files changed, 11 insertions, 0 deletions
diff --git a/gst-libs/gst/vaapi/gstvaapiencoder_h264.c b/gst-libs/gst/vaapi/gstvaapiencoder_h264.c
index 89a6cc19..6e463020 100644
--- a/gst-libs/gst/vaapi/gstvaapiencoder_h264.c
+++ b/gst-libs/gst/vaapi/gstvaapiencoder_h264.c
@@ -4124,3 +4124,11 @@ gst_vaapi_encoder_h264_get_profile_and_level (GstVaapiEncoderH264 * encoder,
*out_level_ptr = encoder->level;
return TRUE;
}
+
+gboolean
+gst_vaapi_encoder_h264_supports_avc (GstVaapiEncoderH264 * encoder)
+{
+ return ((GST_VAAPI_ENCODER_PACKED_HEADERS (encoder) &
+ (VA_ENC_PACKED_HEADER_SEQUENCE | VA_ENC_PACKED_HEADER_PICTURE)) ==
+ (VA_ENC_PACKED_HEADER_SEQUENCE | VA_ENC_PACKED_HEADER_PICTURE));
+}
diff --git a/gst-libs/gst/vaapi/gstvaapiencoder_h264.h b/gst-libs/gst/vaapi/gstvaapiencoder_h264.h
index 31a6f7ae..8a0705b4 100644
--- a/gst-libs/gst/vaapi/gstvaapiencoder_h264.h
+++ b/gst-libs/gst/vaapi/gstvaapiencoder_h264.h
@@ -53,6 +53,9 @@ gboolean
gst_vaapi_encoder_h264_get_profile_and_level (GstVaapiEncoderH264 * encoder,
GstVaapiProfile * out_profile_ptr, GstVaapiLevelH264 * out_level_ptr);
+gboolean
+gst_vaapi_encoder_h264_supports_avc (GstVaapiEncoderH264 * encoder);
+
G_END_DECLS
#endif /*GST_VAAPI_ENCODER_H264_H */