base: rename allocation vmethods

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.
This commit is contained in:
Wim Taymans 2011-08-26 14:18:33 +02:00
parent cc1686352d
commit d924c30f5b
6 changed files with 21 additions and 21 deletions

View file

@ -4860,8 +4860,8 @@ default_sink_query (GstBaseSink * basesink, GstQuery * query)
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;

View file

@ -122,7 +122,7 @@ struct _GstBaseSink {
* 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
@ -157,8 +157,8 @@ struct _GstBaseSinkClass {
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);

View file

@ -2709,8 +2709,8 @@ gst_base_src_prepare_allocation (GstBaseSrc * basesrc, GstCaps * caps)
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);

View file

@ -113,7 +113,7 @@ struct _GstBaseSrc {
* @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.
@ -168,7 +168,7 @@ struct _GstBaseSrcClass {
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);

View file

@ -778,8 +778,8 @@ gst_base_transform_do_bufferpool (GstBaseTransform * trans, GstCaps * outcaps)
* 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 */
@ -811,9 +811,9 @@ gst_base_transform_do_bufferpool (GstBaseTransform * trans, GstCaps * outcaps)
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,
@ -1331,12 +1331,12 @@ gst_base_transform_default_query (GstBaseTransform * trans,
} 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;
}

View file

@ -235,10 +235,10 @@ struct _GstBaseTransformClass {
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,