passthrough = trans->passthrough || trans->always_in_place;
GST_BASE_TRANSFORM_UNLOCK (trans);
- GST_DEBUG_OBJECT (trans, "passthrough %d", passthrough);
-
- if (passthrough)
+ if (passthrough) {
+ GST_DEBUG_OBJECT (trans, "doing passthrough query");
ret = gst_pad_peer_query (otherpad, query);
- else
- ret = FALSE;
+ } else {
+ GstBaseTransformClass *klass;
+
+ GST_DEBUG_OBJECT (trans, "deciding on allocation values");
+
+ klass = GST_BASE_TRANSFORM_GET_CLASS (trans);
+ /* pass the query to the decide_allocation vmethod if any */
+ if (G_LIKELY (klass->decide_allocation))
+ ret = klass->decide_allocation (trans, query);
+ else
+ ret = FALSE;
+ }
+ GST_DEBUG_OBJECT (trans, "ALLOCATION ret %d, %" GST_PTR_FORMAT, ret,
+ query);
break;
}
case GST_QUERY_POSITION:
* query
* @decide_allocation: Decide what parameters you want upstream elements to use
* for the allocation of buffers. This function is only
- * called when not operating in passthrough mode.
+ * called when not operating in passthrough mode. The
+ * default implementation is NULL.
* @setup_allocation: Setup the allocation parameters for allocating output
* buffers. The passed in query contains the result of the
* downstream allocation query. This function is only called
- * when not operating in passthrough mode.
+ * when not operating in passthrough mode. The default
+ * implementation is NULL.
* @transform_size: Optional. Given the size of a buffer in the given direction
* with the given caps, calculate the size in bytes of a buffer
* on the other pad with the given other caps.
* @stop: Optional.
* Called when the element stops processing.
* Allows closing external resources.
- * @transform: Required if the element does not operate in-place.
- * Transforms one incoming buffer to one outgoing buffer.
- * The function is allowed to change size/timestamp/duration
- * of the outgoing buffer.
- * @transform_ip: Required if the element operates in-place.
- * Transform the incoming buffer in-place.
* @sink_event: Optional.
* Event handler on the sink pad. The default implementation
* handles the event and forwards it downstream.
* This method is called right before the base class will
* start processing. Dynamic properties or other delayed
* configuration could be performed in this method.
+ * @transform: Required if the element does not operate in-place.
+ * Transforms one incoming buffer to one outgoing buffer.
+ * The function is allowed to change size/timestamp/duration
+ * of the outgoing buffer.
+ * @transform_ip: Required if the element operates in-place.
+ * Transform the incoming buffer in-place.
*
* Subclasses can override any of the available virtual methods or not, as
* needed. At minimum either @transform or @transform_ip need to be overridden.