+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:
-Subproject commit 89d82b662da00096b70e70a7a102b294acaae6dd
+Subproject commit 3fb3bedc9180bab9dc8c2dc784c9327bd1cc8109
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);
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 */
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);
{
g_return_if_fail (trans != NULL);
+ GST_DEBUG_OBJECT (trans, "setting passthrough %d", passthrough);
+
GST_LOCK (trans);
trans->passthrough = passthrough;
GST_UNLOCK (trans);
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",
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 ();
if (filter) {
GstElement *capsfilter;
GstObject *parent;
+ GstElementState state, pending;
+ GTimeVal tv;
capsfilter = gst_element_factory_make ("capsfilter", NULL);
if (!capsfilter) {
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);
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);
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);
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 */
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);
{
g_return_if_fail (trans != NULL);
+ GST_DEBUG_OBJECT (trans, "setting passthrough %d", passthrough);
+
GST_LOCK (trans);
trans->passthrough = passthrough;
GST_UNLOCK (trans);