summaryrefslogtreecommitdiff
path: root/gst-libs
diff options
context:
space:
mode:
authorVíctor Manuel Jáquez Leal <victorx.jaquez@intel.com>2016-02-25 18:57:30 +0100
committerVíctor Manuel Jáquez Leal <victorx.jaquez@intel.com>2016-11-03 13:04:09 +0100
commitb09f592a4c62becccc549d15d02e99c0a6a44320 (patch)
treea400510fbcec4f18690c1f75cb5a53ec79d26087 /gst-libs
parent71264ede6f3eb82c8dd3cb6ac566afefa502fd7e (diff)
libs: decoder: add _get_surface_formats()
This function exposes the available formats of the surfaces in the the current context to the plugins.
Diffstat (limited to 'gst-libs')
-rw-r--r--gst-libs/gst/vaapi/gstvaapidecoder.c18
-rw-r--r--gst-libs/gst/vaapi/gstvaapidecoder.h3
2 files changed, 21 insertions, 0 deletions
diff --git a/gst-libs/gst/vaapi/gstvaapidecoder.c b/gst-libs/gst/vaapi/gstvaapidecoder.c
index 123b5a33..9a8cda2a 100644
--- a/gst-libs/gst/vaapi/gstvaapidecoder.c
+++ b/gst-libs/gst/vaapi/gstvaapidecoder.c
@@ -1067,3 +1067,21 @@ gst_vaapi_decoder_decode_codec_data (GstVaapiDecoder * decoder)
gst_buffer_unmap (codec_data, &map_info);
return status;
}
+
+/**
+ * gst_vaapi_decoder_get_surface_formats:
+ * @decoder: a #GstVaapiDecoder
+ *
+ * Retrieves an array of #GstVideoFormat which the output surfaces of
+ * the @decoder can handle.
+ *
+ * Return value: (transfer full): a #GArray of #GstVideoFormat or
+ * %NULL
+ */
+GArray *
+gst_vaapi_decoder_get_surface_formats (GstVaapiDecoder * decoder)
+{
+ if (decoder && decoder->context)
+ return gst_vaapi_context_get_surface_formats (decoder->context);
+ return NULL;
+}
diff --git a/gst-libs/gst/vaapi/gstvaapidecoder.h b/gst-libs/gst/vaapi/gstvaapidecoder.h
index 77587d47..4b75f2d2 100644
--- a/gst-libs/gst/vaapi/gstvaapidecoder.h
+++ b/gst-libs/gst/vaapi/gstvaapidecoder.h
@@ -102,6 +102,9 @@ gst_vaapi_decoder_set_codec_state_changed_func (GstVaapiDecoder * decoder,
GstCaps *
gst_vaapi_decoder_get_caps (GstVaapiDecoder * decoder);
+GArray *
+gst_vaapi_decoder_get_surface_formats (GstVaapiDecoder * decoder);
+
gboolean
gst_vaapi_decoder_put_buffer (GstVaapiDecoder * decoder, GstBuffer * buf);