summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 09f803f)
raw | patch | inline | side by side (parent: 09f803f)
author | Wim Taymans <wim.taymans@gmail.com> | |
Wed, 31 Aug 2005 13:41:19 +0000 (13:41 +0000) | ||
committer | Wim Taymans <wim.taymans@gmail.com> | |
Wed, 31 Aug 2005 13:41:19 +0000 (13:41 +0000) |
Original commit message from CVS:
* gst/base/gstbasetransform.c: (gst_base_transform_configure_caps),
(gst_base_transform_setcaps), (gst_base_transform_handle_buffer),
(gst_base_transform_chain), (gst_base_transform_change_state):
* gst/base/gstbasetransform.h:
Handle the case where we are not negotiated more gracefully.
* gst/base/gstbasetransform.c: (gst_base_transform_configure_caps),
(gst_base_transform_setcaps), (gst_base_transform_handle_buffer),
(gst_base_transform_chain), (gst_base_transform_change_state):
* gst/base/gstbasetransform.h:
Handle the case where we are not negotiated more gracefully.
diff --git a/ChangeLog b/ChangeLog
index a890cb6358537ba299681ff28807551ff212b068..a1c1cd6cc7ac70465aa5152f4e74c2cb5aa1e62a 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
+2005-08-31 Wim Taymans <wim@fluendo.com>
+
+ * gst/base/gstbasetransform.c: (gst_base_transform_configure_caps),
+ (gst_base_transform_setcaps), (gst_base_transform_handle_buffer),
+ (gst_base_transform_chain), (gst_base_transform_change_state):
+ * gst/base/gstbasetransform.h:
+ Handle the case where we are not negotiated more gracefully.
+
2005-08-31 Tim-Philipp Müller <tim at centricular dot net>
* gst/elements/gstfilesrc.c: (gst_mmap_buffer_init),
index 3a253713e5ac0ed6103dfcbb7678e8adde3b4328..39b0c1ee3de4ea390eda1603b930b1f3bf522fbb 100644 (file)
ret = klass->set_caps (trans, in, out);
}
+ trans->negotiated = ret;
+
return ret;
}
gboolean ret = TRUE;
gboolean peer_checked = FALSE;
- /* caps must be fixed here */
- g_return_val_if_fail (gst_caps_is_fixed (caps), FALSE);
-
trans = GST_BASE_TRANSFORM (gst_pad_get_parent (pad));
klass = GST_BASE_TRANSFORM_GET_CLASS (trans);
- g_return_val_if_fail (gst_caps_is_fixed (caps), FALSE);
otherpad = (pad == trans->srcpad) ? trans->sinkpad : trans->srcpad;
otherpeer = gst_pad_get_peer (otherpad);
if (GST_PAD_IS_IN_SETCAPS (otherpad))
goto done;
+ /* caps must be fixed here */
+ if (!gst_caps_is_fixed (caps))
+ goto unfixed_caps;
+
/* see how we can transform the input caps. */
othercaps = gst_base_transform_transform_caps (trans,
GST_PAD_DIRECTION (pad), caps);
if (othercaps)
gst_caps_unref (othercaps);
+ trans->negotiated = ret;
+
gst_object_unref (trans);
return ret;
/* ERRORS */
+unfixed_caps:
+ {
+ GST_DEBUG_OBJECT (trans, "caps are not fixed %" GST_PTR_FORMAT, caps);
+ ret = FALSE;
+ goto done;
+ }
no_transform:
{
GST_DEBUG_OBJECT (trans,
trans = GST_BASE_TRANSFORM (gst_pad_get_parent (pad));
+ if (!trans->negotiated)
+ goto not_negotiated;
+
ret = gst_base_transform_handle_buffer (trans, buffer, &outbuf);
if (ret == GST_FLOW_OK) {
ret = gst_pad_push (trans->srcpad, outbuf);
gst_object_unref (trans);
return ret;
+
+not_negotiated:
+ {
+ return GST_FLOW_NOT_NEGOTIATED;
+ }
}
static void
GST_DEBUG_OBJECT (trans, "in_place %d", trans->in_place);
gst_caps_replace (&trans->cache_caps1, NULL);
gst_caps_replace (&trans->cache_caps2, NULL);
+ trans->negotiated = FALSE;
GST_UNLOCK (trans);
break;
case GST_STATE_PAUSED_TO_PLAYING:
index d3426075d0e8b06063c276f28e94def22ef677f9..db3c16ce0421165653797b44933d20e3915926f8 100644 (file)
gboolean delay_configure;
gboolean pending_configure;
+ gboolean negotiated;
gboolean have_newsegment;
index 3a253713e5ac0ed6103dfcbb7678e8adde3b4328..39b0c1ee3de4ea390eda1603b930b1f3bf522fbb 100644 (file)
ret = klass->set_caps (trans, in, out);
}
+ trans->negotiated = ret;
+
return ret;
}
gboolean ret = TRUE;
gboolean peer_checked = FALSE;
- /* caps must be fixed here */
- g_return_val_if_fail (gst_caps_is_fixed (caps), FALSE);
-
trans = GST_BASE_TRANSFORM (gst_pad_get_parent (pad));
klass = GST_BASE_TRANSFORM_GET_CLASS (trans);
- g_return_val_if_fail (gst_caps_is_fixed (caps), FALSE);
otherpad = (pad == trans->srcpad) ? trans->sinkpad : trans->srcpad;
otherpeer = gst_pad_get_peer (otherpad);
if (GST_PAD_IS_IN_SETCAPS (otherpad))
goto done;
+ /* caps must be fixed here */
+ if (!gst_caps_is_fixed (caps))
+ goto unfixed_caps;
+
/* see how we can transform the input caps. */
othercaps = gst_base_transform_transform_caps (trans,
GST_PAD_DIRECTION (pad), caps);
if (othercaps)
gst_caps_unref (othercaps);
+ trans->negotiated = ret;
+
gst_object_unref (trans);
return ret;
/* ERRORS */
+unfixed_caps:
+ {
+ GST_DEBUG_OBJECT (trans, "caps are not fixed %" GST_PTR_FORMAT, caps);
+ ret = FALSE;
+ goto done;
+ }
no_transform:
{
GST_DEBUG_OBJECT (trans,
trans = GST_BASE_TRANSFORM (gst_pad_get_parent (pad));
+ if (!trans->negotiated)
+ goto not_negotiated;
+
ret = gst_base_transform_handle_buffer (trans, buffer, &outbuf);
if (ret == GST_FLOW_OK) {
ret = gst_pad_push (trans->srcpad, outbuf);
gst_object_unref (trans);
return ret;
+
+not_negotiated:
+ {
+ return GST_FLOW_NOT_NEGOTIATED;
+ }
}
static void
GST_DEBUG_OBJECT (trans, "in_place %d", trans->in_place);
gst_caps_replace (&trans->cache_caps1, NULL);
gst_caps_replace (&trans->cache_caps2, NULL);
+ trans->negotiated = FALSE;
GST_UNLOCK (trans);
break;
case GST_STATE_PAUSED_TO_PLAYING:
index d3426075d0e8b06063c276f28e94def22ef677f9..db3c16ce0421165653797b44933d20e3915926f8 100644 (file)
gboolean delay_configure;
gboolean pending_configure;
+ gboolean negotiated;
gboolean have_newsegment;