base: rename allocation vmethods
authorWim Taymans <wim.taymans@collabora.co.uk>
Fri, 26 Aug 2011 12:18:33 +0000 (14:18 +0200)
committerWim Taymans <wim.taymans@collabora.co.uk>
Fri, 26 Aug 2011 12:18:33 +0000 (14:18 +0200)
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.

libs/gst/base/gstbasesink.c
libs/gst/base/gstbasesink.h
libs/gst/base/gstbasesrc.c
libs/gst/base/gstbasesrc.h
libs/gst/base/gstbasetransform.c
libs/gst/base/gstbasetransform.h

index e548045..6dc3c87 100644 (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;
index 765496f..f9195e5 100644 (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);
index ef64843..4f66878 100644 (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);
index ec8419b..9466d7d 100644 (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);
index 77b5651..5828a74 100644 (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;
       }
index fb957d9..af72eb0 100644 (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,