diff --git a/ChangeLog b/ChangeLog index 350f5c29aa..ea589a4be8 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2007-02-19 Wim Taymans + + * libs/gst/base/gstbasetransform.c: (gst_base_transform_init), + (gst_base_transform_check_get_range): + Implement a checkgetrange function instead of relying on the default + core behaviour that assumes we can operate in pull mode if we have a + getrange function. First step at fixing #385084. + 2007-02-15 Stefan Kost * gst/gstchildproxy.h: diff --git a/libs/gst/base/gstbasetransform.c b/libs/gst/base/gstbasetransform.c index 6bfdeb877b..fbd3e8f5ee 100644 --- a/libs/gst/base/gstbasetransform.c +++ b/libs/gst/base/gstbasetransform.c @@ -287,6 +287,7 @@ static gboolean gst_base_transform_src_eventfunc (GstBaseTransform * trans, static gboolean gst_base_transform_sink_event (GstPad * pad, GstEvent * event); static gboolean gst_base_transform_sink_eventfunc (GstBaseTransform * trans, GstEvent * event); +static gboolean gst_base_transform_check_get_range (GstPad * pad); static GstFlowReturn gst_base_transform_getrange (GstPad * pad, guint64 offset, guint length, GstBuffer ** buffer); static GstFlowReturn gst_base_transform_chain (GstPad * pad, @@ -382,6 +383,8 @@ gst_base_transform_init (GstBaseTransform * trans, GST_DEBUG_FUNCPTR (gst_base_transform_setcaps)); gst_pad_set_event_function (trans->srcpad, GST_DEBUG_FUNCPTR (gst_base_transform_src_event)); + gst_pad_set_checkgetrange_function (trans->srcpad, + GST_DEBUG_FUNCPTR (gst_base_transform_check_get_range)); gst_pad_set_getrange_function (trans->srcpad, GST_DEBUG_FUNCPTR (gst_base_transform_getrange)); gst_pad_set_activatepull_function (trans->srcpad, @@ -1508,6 +1511,21 @@ configure_failed: } } +static gboolean +gst_base_transform_check_get_range (GstPad * pad) +{ + GstBaseTransform *trans; + gboolean ret; + + trans = GST_BASE_TRANSFORM (gst_pad_get_parent (pad)); + + ret = gst_pad_check_pull_range (trans->sinkpad); + + gst_object_unref (trans); + + return ret; +} + /* FIXME, getrange is broken, need to pull range from the other * end based on the transform_size result. */