gstvaapisurfacepool: Add new API to create surface pool based on chroma type

This new API gst_vaapi_surface_pool_new_with_chroma_type() is for
creating a new GstVaapiVideoPool of GstVaapiSurfaces with the specified
chroam type and dimensions. The underlying format of the surfaces is
implementation (driver) defined.
This commit is contained in:
Sreerenj Balachandran 2001-01-01 04:59:28 +02:00
parent 009c2c72c9
commit 9ccdbce4bd
2 changed files with 40 additions and 0 deletions

View file

@ -164,3 +164,39 @@ error:
gst_vaapi_mini_object_unref (GST_VAAPI_MINI_OBJECT (pool));
return NULL;
}
/**
* gst_vaapi_surface_pool_new_with_chroma_type:
* @display: a #GstVaapiDisplay
* @chroma_type: a #GstVaapiChromatype
* @width: the desired width, in pixels
* @height: the desired height, in pixels
*
* Creates a new #GstVaapiVideoPool of #GstVaapiSurface with the specified
* chroam type and dimensions. The underlying format of the surfaces is
* implementation (driver) defined.
*
* Return value: the newly allocated #GstVaapiVideoPool
*/
GstVaapiVideoPool *
gst_vaapi_surface_pool_new_with_chroma_type (GstVaapiDisplay * display,
GstVaapiChromaType chroma_type, guint width, guint height)
{
GstVaapiVideoPool *pool;
GstVideoInfo vi;
g_return_val_if_fail (display != NULL, NULL);
g_return_val_if_fail (chroma_type > 0, NULL);
g_return_val_if_fail (width > 0, NULL);
g_return_val_if_fail (height > 0, NULL);
gst_video_info_set_format (&vi, GST_VIDEO_FORMAT_ENCODED, width, height);
pool = gst_vaapi_surface_pool_new_full (display, &vi, 0);
if (!pool)
return NULL;
GST_VAAPI_SURFACE_POOL (pool)->chroma_type = chroma_type;
return pool;
}

View file

@ -44,6 +44,10 @@ GstVaapiVideoPool *
gst_vaapi_surface_pool_new_full (GstVaapiDisplay * display,
const GstVideoInfo * vip, guint flags);
GstVaapiVideoPool *
gst_vaapi_surface_pool_new_with_chroma_type (GstVaapiDisplay * display,
GstVaapiChromaType chroma_type, guint width, guint height);
G_END_DECLS
#endif /* GST_VAAPI_SURFACE_POOL_H */