Commit ec759079 authored by Rémi Bernon's avatar Rémi Bernon Committed by Alexandre Julliard

winegstreamer: Handle allocation query in a separate helper.

parent 6dae92cf
...@@ -125,16 +125,8 @@ static gboolean transform_src_query_cb(GstPad *pad, GstObject *parent, GstQuery ...@@ -125,16 +125,8 @@ static gboolean transform_src_query_cb(GstPad *pad, GstObject *parent, GstQuery
} }
} }
static gboolean transform_sink_query_cb(GstPad *pad, GstObject *parent, GstQuery *query) static gboolean transform_sink_query_allocation(struct wg_transform *transform, GstQuery *query)
{ {
struct wg_transform *transform = gst_pad_get_element_private(pad);
GST_LOG("transform %p, type \"%s\".", transform, gst_query_type_get_name(query->type));
switch (query->type)
{
case GST_QUERY_ALLOCATION:
{
gsize plane_align = transform->attrs.output_plane_align; gsize plane_align = transform->attrs.output_plane_align;
GstStructure *config, *params; GstStructure *config, *params;
GstVideoAlignment align; GstVideoAlignment align;
...@@ -145,11 +137,11 @@ static gboolean transform_sink_query_cb(GstPad *pad, GstObject *parent, GstQuery ...@@ -145,11 +137,11 @@ static gboolean transform_sink_query_cb(GstPad *pad, GstObject *parent, GstQuery
gst_query_parse_allocation(query, &caps, &needs_pool); gst_query_parse_allocation(query, &caps, &needs_pool);
if (stream_type_from_caps(caps) != GST_STREAM_TYPE_VIDEO || !needs_pool) if (stream_type_from_caps(caps) != GST_STREAM_TYPE_VIDEO || !needs_pool)
break; return false;
if (!gst_video_info_from_caps(&info, caps) if (!gst_video_info_from_caps(&info, caps)
|| !(pool = gst_video_buffer_pool_new())) || !(pool = gst_video_buffer_pool_new()))
break; return false;
align_video_info_planes(plane_align, &info, &align); align_video_info_planes(plane_align, &info, &align);
...@@ -191,8 +183,20 @@ static gboolean transform_sink_query_cb(GstPad *pad, GstObject *parent, GstQuery ...@@ -191,8 +183,20 @@ static gboolean transform_sink_query_cb(GstPad *pad, GstObject *parent, GstQuery
g_object_unref(pool); g_object_unref(pool);
return true; return true;
} }
static gboolean transform_sink_query_cb(GstPad *pad, GstObject *parent, GstQuery *query)
{
struct wg_transform *transform = gst_pad_get_element_private(pad);
GST_LOG("transform %p, type \"%s\".", transform, gst_query_type_get_name(query->type));
switch (query->type)
{
case GST_QUERY_ALLOCATION:
if (transform_sink_query_allocation(transform, query))
return true;
break;
case GST_QUERY_CAPS: case GST_QUERY_CAPS:
{ {
GstCaps *caps, *filter, *temp; GstCaps *caps, *filter, *temp;
......
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