gst/base/gstadapter.c: Flushing out 0 bytes is ok for this function.

Original commit message from CVS:
* gst/base/gstadapter.c: (gst_adapter_flush):
Flushing out 0 bytes is ok for this function.

* gst/base/gstbasesink.c: (gst_base_sink_handle_object):
no newsegment gives a warning and sets the start/stop to
invalid.

* gst/base/gstbasetransform.c: (gst_base_transform_change_state),
(gst_base_transform_set_passthrough):
Some debug info.

* gst/gstminiobject.c: (gst_mini_object_ref):
Check refcount here too.

* gst/gstpad.c: (gst_pad_init):
Pads are initially flushing and refusing data.

* gst/gstutils.c: (gst_element_link_pads_filtered):
When adding a capsfilter element make sure it has the
same state as the parent bin.
This commit is contained in:
Wim Taymans 2005-08-30 19:29:59 +00:00
parent a44593349c
commit d7cfd8a12e
11 changed files with 50 additions and 10 deletions

View file

@ -1,3 +1,26 @@
2005-08-30 Wim Taymans <wim@fluendo.com>
* gst/base/gstadapter.c: (gst_adapter_flush):
Flushing out 0 bytes is ok for this function.
* gst/base/gstbasesink.c: (gst_base_sink_handle_object):
no newsegment gives a warning and sets the start/stop to
invalid.
* gst/base/gstbasetransform.c: (gst_base_transform_change_state),
(gst_base_transform_set_passthrough):
Some debug info.
* gst/gstminiobject.c: (gst_mini_object_ref):
Check refcount here too.
* gst/gstpad.c: (gst_pad_init):
Pads are initially flushing and refusing data.
* gst/gstutils.c: (gst_element_link_pads_filtered):
When adding a capsfilter element make sure it has the
same state as the parent bin.
2005-08-30 Stefan Kost <ensonic@users.sf.net>
* docs/gst/tmpl/.cvsignore:

2
common

@ -1 +1 @@
Subproject commit 89d82b662da00096b70e70a7a102b294acaae6dd
Subproject commit 3fb3bedc9180bab9dc8c2dc784c9327bd1cc8109

View file

@ -236,7 +236,7 @@ gst_adapter_flush (GstAdapter * adapter, guint flush)
GstBuffer *cur;
g_return_if_fail (GST_IS_ADAPTER (adapter));
g_return_if_fail (flush > 0);
g_return_if_fail (flush >= 0);
g_return_if_fail (flush <= adapter->size);
GST_LOG_OBJECT (adapter, "flushing %u bytes", flush);

View file

@ -483,13 +483,13 @@ gst_base_sink_handle_object (GstBaseSink * basesink, GstPad * pad,
GstBuffer *buf = GST_BUFFER (obj);
if (!basesink->have_newsegment) {
GST_ELEMENT_ERROR (basesink, STREAM, STOPPED,
GST_ELEMENT_WARNING (basesink, STREAM, STOPPED,
("Received buffer without a new-segment. Cannot sync to clock."),
("Received buffer without a new-segment. Cannot sync to clock."));
basesink->have_newsegment = TRUE;
/* this means this sink will not be able to sync to the clock */
basesink->segment_start = 0;
basesink->segment_stop = 0;
basesink->segment_start = -1;
basesink->segment_stop = -1;
}
/* check if the buffer needs to be dropped */

View file

@ -1046,6 +1046,7 @@ gst_base_transform_change_state (GstElement * element)
GST_PAD_CAPS (trans->srcpad)) || trans->passthrough;
else
trans->in_place = trans->passthrough;
GST_DEBUG_OBJECT (trans, "in_place %d", trans->in_place);
gst_caps_replace (&trans->cache_caps1, NULL);
gst_caps_replace (&trans->cache_caps2, NULL);
GST_UNLOCK (trans);
@ -1090,6 +1091,8 @@ gst_base_transform_set_passthrough (GstBaseTransform * trans,
{
g_return_if_fail (trans != NULL);
GST_DEBUG_OBJECT (trans, "setting passthrough %d", passthrough);
GST_LOCK (trans);
trans->passthrough = passthrough;
GST_UNLOCK (trans);

View file

@ -190,6 +190,7 @@ GstMiniObject *
gst_mini_object_ref (GstMiniObject * mini_object)
{
g_return_val_if_fail (mini_object != NULL, NULL);
g_return_val_if_fail (mini_object->refcount > 0, NULL);
#ifdef DEBUG_REFCOUNT
GST_CAT_LOG (GST_CAT_REFCOUNTING, "%p ref %d->%d",

View file

@ -247,7 +247,7 @@ gst_pad_init (GstPad * pad)
pad->do_buffer_signals = 0;
pad->do_event_signals = 0;
GST_PAD_UNSET_FLUSHING (pad);
GST_PAD_SET_FLUSHING (pad);
pad->preroll_lock = g_mutex_new ();
pad->preroll_cond = g_cond_new ();

View file

@ -1272,6 +1272,8 @@ gst_element_link_pads_filtered (GstElement * src, const gchar * srcpadname,
if (filter) {
GstElement *capsfilter;
GstObject *parent;
GstElementState state, pending;
GTimeVal tv;
capsfilter = gst_element_factory_make ("capsfilter", NULL);
if (!capsfilter) {
@ -1282,6 +1284,9 @@ gst_element_link_pads_filtered (GstElement * src, const gchar * srcpadname,
parent = gst_object_get_parent (GST_OBJECT (src));
g_return_val_if_fail (GST_IS_BIN (parent), FALSE);
GST_TIME_TO_TIMEVAL (0, tv);
gst_element_get_state (GST_ELEMENT_CAST (parent), &state, &pending, &tv);
if (!gst_bin_add (GST_BIN (parent), capsfilter)) {
GST_ERROR ("Could not add capsfilter");
gst_object_unref (capsfilter);
@ -1289,6 +1294,11 @@ gst_element_link_pads_filtered (GstElement * src, const gchar * srcpadname,
return FALSE;
}
if (pending != GST_STATE_VOID_PENDING)
state = pending;
gst_element_set_state (capsfilter, state);
gst_object_unref (parent);
g_object_set (capsfilter, "filter-caps", filter, NULL);

View file

@ -236,7 +236,7 @@ gst_adapter_flush (GstAdapter * adapter, guint flush)
GstBuffer *cur;
g_return_if_fail (GST_IS_ADAPTER (adapter));
g_return_if_fail (flush > 0);
g_return_if_fail (flush >= 0);
g_return_if_fail (flush <= adapter->size);
GST_LOG_OBJECT (adapter, "flushing %u bytes", flush);

View file

@ -483,13 +483,13 @@ gst_base_sink_handle_object (GstBaseSink * basesink, GstPad * pad,
GstBuffer *buf = GST_BUFFER (obj);
if (!basesink->have_newsegment) {
GST_ELEMENT_ERROR (basesink, STREAM, STOPPED,
GST_ELEMENT_WARNING (basesink, STREAM, STOPPED,
("Received buffer without a new-segment. Cannot sync to clock."),
("Received buffer without a new-segment. Cannot sync to clock."));
basesink->have_newsegment = TRUE;
/* this means this sink will not be able to sync to the clock */
basesink->segment_start = 0;
basesink->segment_stop = 0;
basesink->segment_start = -1;
basesink->segment_stop = -1;
}
/* check if the buffer needs to be dropped */

View file

@ -1046,6 +1046,7 @@ gst_base_transform_change_state (GstElement * element)
GST_PAD_CAPS (trans->srcpad)) || trans->passthrough;
else
trans->in_place = trans->passthrough;
GST_DEBUG_OBJECT (trans, "in_place %d", trans->in_place);
gst_caps_replace (&trans->cache_caps1, NULL);
gst_caps_replace (&trans->cache_caps2, NULL);
GST_UNLOCK (trans);
@ -1090,6 +1091,8 @@ gst_base_transform_set_passthrough (GstBaseTransform * trans,
{
g_return_if_fail (trans != NULL);
GST_DEBUG_OBJECT (trans, "setting passthrough %d", passthrough);
GST_LOCK (trans);
trans->passthrough = passthrough;
GST_UNLOCK (trans);