libs/gst/base/gstbasetransform.c: Implement a checkgetrange function instead of relying on the default core behaviour...

Original commit message from CVS:
* 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.
This commit is contained in:
Wim Taymans 2007-02-19 18:08:59 +00:00
parent efb8033bac
commit 7615bf85c6
2 changed files with 26 additions and 0 deletions

View file

@ -1,3 +1,11 @@
2007-02-19 Wim Taymans <wim@fluendo.com>
* 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 <ensonic@users.sf.net>
* gst/gstchildproxy.h:

View file

@ -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.
*/