summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWim Taymans <wim.taymans@collabora.co.uk>2011-05-23 18:15:00 +0200
committerWim Taymans <wim.taymans@collabora.co.uk>2011-05-23 18:15:00 +0200
commit7754d8d7bab96808ee53366c5765361b26e6bb39 (patch)
treef7af33863fb9fa22628718eb9761f8c12c22dcdb
parent8380949994e29fb3dd886470bf0817f90f89326d (diff)
transform: fixes for bufferpool handling
Don't error out when the allocation query returns success. Do bufferpool query after we pushed the caps event downstream so that we can get a good bufferpool suggestion. Also proxy the bufferpool query downstream when we operate in in_place mode.
-rw-r--r--libs/gst/base/gstbasetransform.c18
1 files changed, 10 insertions, 8 deletions
diff --git a/libs/gst/base/gstbasetransform.c b/libs/gst/base/gstbasetransform.c
index 43821220b..3a57bac2b 100644
--- a/libs/gst/base/gstbasetransform.c
+++ b/libs/gst/base/gstbasetransform.c
@@ -778,7 +778,7 @@ gst_base_transform_do_bufferpool (GstBaseTransform * trans, GstCaps * outcaps)
/* find a pool for the negotiated caps now */
query = gst_query_new_allocation (outcaps, TRUE);
- if (gst_pad_peer_query (trans->srcpad, query))
+ if (!gst_pad_peer_query (trans->srcpad, query))
goto query_failed;
/* we got configuration from our peer, parse them */
@@ -861,11 +861,6 @@ gst_base_transform_configure_caps (GstBaseTransform * trans, GstCaps * in,
ret = klass->set_caps (trans, in, out);
}
- if (ret) {
- /* try to get a pool when needed */
- gst_base_transform_do_bufferpool (trans, out);
- }
-
trans->negotiated = ret;
return ret;
@@ -1251,6 +1246,11 @@ gst_base_transform_setcaps (GstBaseTransform * trans, GstPad * pad,
}
}
+ if (ret) {
+ /* try to get a pool when needed */
+ gst_base_transform_do_bufferpool (trans, othercaps);
+ }
+
done:
if (otherpeer)
gst_object_unref (otherpeer);
@@ -1301,9 +1301,11 @@ gst_base_transform_query (GstPad * pad, GstQuery * query)
goto done;
GST_BASE_TRANSFORM_LOCK (trans);
- passthrough = trans->passthrough;
+ passthrough = trans->passthrough || trans->always_in_place;
GST_BASE_TRANSFORM_UNLOCK (trans);
+ GST_DEBUG_OBJECT (trans, "passthrough %d", passthrough);
+
if (passthrough)
ret = gst_pad_peer_query (otherpad, query);
else
@@ -1439,7 +1441,7 @@ gst_base_transform_prepare_output_buffer (GstBaseTransform * trans,
if (*out_buf == NULL) {
if (trans->passthrough) {
- GST_DEBUG_OBJECT (trans, "Avoiding pad alloc");
+ GST_DEBUG_OBJECT (trans, "Reusing input buffer");
*out_buf = in_buf;
} else if (trans->priv->srcpool) {
GST_DEBUG_OBJECT (trans, "using pool alloc");