assrender: Implement srcpad query function to always forward to the video sinkpad

This commit is contained in:
Sebastian Dröge 2009-12-09 09:57:58 +01:00
parent 876cfb3d26
commit 544c9d0151

View file

@ -110,6 +110,8 @@ static gboolean gst_ass_render_event_src (GstPad * pad, GstEvent * event);
static GstFlowReturn gst_ass_render_bufferalloc_video (GstPad * pad,
guint64 offset, guint size, GstCaps * caps, GstBuffer ** buffer);
static gboolean gst_ass_render_query_src (GstPad * pad, GstQuery * query);
static void
gst_ass_render_base_init (gpointer gclass)
{
@ -211,6 +213,9 @@ gst_ass_render_init (GstAssRender * render, GstAssRenderClass * gclass)
gst_pad_set_bufferalloc_function (render->video_sinkpad,
GST_DEBUG_FUNCPTR (gst_ass_render_bufferalloc_video));
gst_pad_set_query_function (render->srcpad,
GST_DEBUG_FUNCPTR (gst_ass_render_query_src));
gst_element_add_pad (GST_ELEMENT (render), render->srcpad);
gst_element_add_pad (GST_ELEMENT (render), render->video_sinkpad);
gst_element_add_pad (GST_ELEMENT (render), render->text_sinkpad);
@ -360,6 +365,18 @@ gst_ass_render_change_state (GstElement * element, GstStateChange transition)
return ret;
}
static gboolean
gst_ass_render_query_src (GstPad * pad, GstQuery * query)
{
GstAssRender *render = GST_ASS_RENDER (gst_pad_get_parent (pad));
gboolean ret;
ret = gst_pad_peer_query (render->video_sinkpad, query);
gst_object_unref (render);
return ret;
}
static gboolean
gst_ass_render_event_src (GstPad * pad, GstEvent * event)
{