Commit 4cf1213b authored by Gwenole Beauchesne's avatar Gwenole Beauchesne

videopool: simplify creation of video objects pool.

parent c2abeb12
...@@ -50,16 +50,14 @@ static gboolean ...@@ -50,16 +50,14 @@ static gboolean
gst_vaapi_image_pool_set_caps(GstVaapiVideoPool *base_pool, GstCaps *caps) gst_vaapi_image_pool_set_caps(GstVaapiVideoPool *base_pool, GstCaps *caps)
{ {
GstVaapiImagePool * const pool = GST_VAAPI_IMAGE_POOL(base_pool); GstVaapiImagePool * const pool = GST_VAAPI_IMAGE_POOL(base_pool);
GstStructure *structure; GstVideoInfo vi;
gint width, height;
structure = gst_caps_get_structure(caps, 0); if (!gst_video_info_from_caps(&vi, caps))
gst_structure_get_int(structure, "width", &width); return FALSE;
gst_structure_get_int(structure, "height", &height);
pool->format = gst_vaapi_image_format_from_caps(caps); pool->format = gst_vaapi_image_format_from_video(GST_VIDEO_INFO_FORMAT(&vi));
pool->width = width; pool->width = GST_VIDEO_INFO_WIDTH(&vi);
pool->height = height; pool->height = GST_VIDEO_INFO_HEIGHT(&vi);
return TRUE; return TRUE;
} }
......
...@@ -50,16 +50,14 @@ static gboolean ...@@ -50,16 +50,14 @@ static gboolean
gst_vaapi_surface_pool_set_caps(GstVaapiVideoPool *base_pool, GstCaps *caps) gst_vaapi_surface_pool_set_caps(GstVaapiVideoPool *base_pool, GstCaps *caps)
{ {
GstVaapiSurfacePool * const pool = GST_VAAPI_SURFACE_POOL(base_pool); GstVaapiSurfacePool * const pool = GST_VAAPI_SURFACE_POOL(base_pool);
GstStructure *structure; GstVideoInfo vi;
gint width, height;
structure = gst_caps_get_structure(caps, 0); if (!gst_video_info_from_caps(&vi, caps))
gst_structure_get_int(structure, "width", &width); return FALSE;
gst_structure_get_int(structure, "height", &height);
pool->chroma_type = GST_VAAPI_CHROMA_TYPE_YUV420; pool->chroma_type = GST_VAAPI_CHROMA_TYPE_YUV420;
pool->width = width; pool->width = GST_VIDEO_INFO_WIDTH(&vi);
pool->height = height; pool->height = GST_VIDEO_INFO_HEIGHT(&vi);
return TRUE; return TRUE;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment