libs: decoder: add _get_surface_formats()

This function exposes the available formats of the surfaces in the the current
context to the plugins.
This commit is contained in:
Víctor Manuel Jáquez Leal 2016-02-25 18:57:30 +01:00
parent 71264ede6f
commit b09f592a4c
2 changed files with 21 additions and 0 deletions

View file

@ -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;
}

View file

@ -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);