Name the allocation vmethod on srcpad decide_allocation because source pads will
have to decide what allocation parameters will be used.
Name the allocation vmethod on sinkpads propose_allocation because they will
need to configure the allocation query with a proposed values for upstream.
switch (GST_QUERY_TYPE (query)) {
case GST_QUERY_ALLOCATION:
{
- if (bclass->setup_allocation)
- res = bclass->setup_allocation (basesink, query);
+ if (bclass->propose_allocation)
+ res = bclass->propose_allocation (basesink, query);
else
res = FALSE;
break;
* mode. The default implementation starts a task on the sink pad.
* @get_times: Called to get the start and end times for synchronising
* the passed buffer to the clock
- * @setup_allocation: configure the allocation query
+ * @propose_allocation: configure the allocation query
* @start: Start processing. Ideal for opening resources in the subclass
* @stop: Stop processing. Subclasses should use this to close resources.
* @unlock: Unlock any pending access to the resource. Subclasses should
void (*get_times) (GstBaseSink *sink, GstBuffer *buffer,
GstClockTime *start, GstClockTime *end);
- /* setup allocation query */
- gboolean (*setup_allocation) (GstBaseSink *sink, GstQuery *query);
+ /* propose allocation parameters for upstream */
+ gboolean (*propose_allocation) (GstBaseSink *sink, GstQuery *query);
/* start and stop processing, ideal for opening/closing the resource */
gboolean (*start) (GstBaseSink *sink);
GST_DEBUG_OBJECT (basesrc, "peer ALLOCATION query failed");
}
- if (G_LIKELY (bclass->setup_allocation))
- result = bclass->setup_allocation (basesrc, query);
+ if (G_LIKELY (bclass->decide_allocation))
+ result = bclass->decide_allocation (basesrc, query);
GST_DEBUG_OBJECT (basesrc, "ALLOCATION (%d) params: %" GST_PTR_FORMAT, result,
query);
* @fixate: Called during negotiation if caps need fixating. Implement instead of
* setting a fixate function on the source pad.
* @set_caps: Notify subclass of changed output caps
- * @setup_allocation: configure the allocation query
+ * @decide_allocation: configure the allocation query
* @start: Start processing. Subclasses should open resources and prepare
* to produce data.
* @stop: Stop processing. Subclasses should use this to close resources.
gboolean (*set_caps) (GstBaseSrc *src, GstCaps *caps);
/* setup allocation query */
- gboolean (*setup_allocation) (GstBaseSrc *src, GstQuery *query);
+ gboolean (*decide_allocation) (GstBaseSrc *src, GstQuery *query);
/* start and stop processing, ideal for opening/closing the resource */
gboolean (*start) (GstBaseSrc *src);
* will do that whenever some upstream does an allocation query.
* 2) we need to do a transform, we need to get a bufferpool from downstream
* and configure it. When upstream does the ALLOCATION query, the
- * decide_allocation vmethod will be called and we will configure the
- * upstream allocator then.
+ * propose_allocation vmethod will be called and we will configure the
+ * upstream allocator with our porposed values then.
*/
/* clear old pool */
klass = GST_BASE_TRANSFORM_GET_CLASS (trans);
- GST_DEBUG_OBJECT (trans, "calling setup_allocation");
- if (G_LIKELY (klass->setup_allocation))
- result = klass->setup_allocation (trans, query);
+ GST_DEBUG_OBJECT (trans, "calling decide_allocation");
+ if (G_LIKELY (klass->decide_allocation))
+ result = klass->decide_allocation (trans, query);
/* we got configuration from our peer, parse them */
gst_query_parse_allocation_params (query, &size, &min, &max, &prefix,
} else {
GstBaseTransformClass *klass;
- GST_DEBUG_OBJECT (trans, "deciding on allocation values");
+ GST_DEBUG_OBJECT (trans, "propose 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);
+ /* pass the query to the propose_allocation vmethod if any */
+ if (G_LIKELY (klass->propose_allocation))
+ ret = klass->propose_allocation (trans, query);
else
ret = FALSE;
}
gboolean (*query) (GstBaseTransform *trans, GstPadDirection direction,
GstQuery *query);
- /* decide allocation query parameters for input buffers */
+ /* propose allocation query parameters for input buffers */
+ gboolean (*propose_allocation) (GstBaseTransform *trans, GstQuery *query);
+ /* decide allocation query for output buffers */
gboolean (*decide_allocation) (GstBaseTransform *trans, GstQuery *query);
- /* setup allocation query for output buffers */
- gboolean (*setup_allocation) (GstBaseTransform *trans, GstQuery *query);
/* transform size */
gboolean (*transform_size) (GstBaseTransform *trans,