mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-10 03:19:40 +00:00
videopool: simplify creation of video objects pool.
This commit is contained in:
parent
c2abeb1290
commit
4cf1213b04
2 changed files with 11 additions and 15 deletions
|
@ -50,16 +50,14 @@ static gboolean
|
|||
gst_vaapi_image_pool_set_caps(GstVaapiVideoPool *base_pool, GstCaps *caps)
|
||||
{
|
||||
GstVaapiImagePool * const pool = GST_VAAPI_IMAGE_POOL(base_pool);
|
||||
GstStructure *structure;
|
||||
gint width, height;
|
||||
GstVideoInfo vi;
|
||||
|
||||
structure = gst_caps_get_structure(caps, 0);
|
||||
gst_structure_get_int(structure, "width", &width);
|
||||
gst_structure_get_int(structure, "height", &height);
|
||||
if (!gst_video_info_from_caps(&vi, caps))
|
||||
return FALSE;
|
||||
|
||||
pool->format = gst_vaapi_image_format_from_caps(caps);
|
||||
pool->width = width;
|
||||
pool->height = height;
|
||||
pool->format = gst_vaapi_image_format_from_video(GST_VIDEO_INFO_FORMAT(&vi));
|
||||
pool->width = GST_VIDEO_INFO_WIDTH(&vi);
|
||||
pool->height = GST_VIDEO_INFO_HEIGHT(&vi);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
|
|
@ -50,16 +50,14 @@ static gboolean
|
|||
gst_vaapi_surface_pool_set_caps(GstVaapiVideoPool *base_pool, GstCaps *caps)
|
||||
{
|
||||
GstVaapiSurfacePool * const pool = GST_VAAPI_SURFACE_POOL(base_pool);
|
||||
GstStructure *structure;
|
||||
gint width, height;
|
||||
GstVideoInfo vi;
|
||||
|
||||
structure = gst_caps_get_structure(caps, 0);
|
||||
gst_structure_get_int(structure, "width", &width);
|
||||
gst_structure_get_int(structure, "height", &height);
|
||||
if (!gst_video_info_from_caps(&vi, caps))
|
||||
return FALSE;
|
||||
|
||||
pool->chroma_type = GST_VAAPI_CHROMA_TYPE_YUV420;
|
||||
pool->width = width;
|
||||
pool->height = height;
|
||||
pool->width = GST_VIDEO_INFO_WIDTH(&vi);
|
||||
pool->height = GST_VIDEO_INFO_HEIGHT(&vi);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue