aggregator: Assert if the sink/src pad type that is to be used is not a GstAggregator...
[platform/upstream/gstreamer.git] / libs / gst / base / gstpushsrc.h
index e48ffb1..89e6776 100644 (file)
@@ -17,8 +17,8 @@
  *
  * You should have received a copy of the GNU Library General Public
  * License along with this library; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
+ * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
  */
 
 #ifndef __GST_PUSH_SRC_H__
@@ -51,20 +51,43 @@ struct _GstPushSrc {
   gpointer _gst_reserved[GST_PADDING];
 };
 
+/**
+ * GstPushSrcClass:
+ * @parent_class: Element parent class
+ * @create: Ask the subclass to create a buffer. The subclass decides which
+ *          size this buffer should be. Other then that, refer to
+ *          #GstBaseSrc<!-- -->.create() for more details. If this method is
+ *          not implemented, @alloc followed by @fill will be called.
+ * @alloc: Ask the subclass to allocate a buffer. The subclass decides which
+ *         size this buffer should be. The default implementation will create
+ *         a new buffer from the negotiated allocator.
+ * @fill: Ask the subclass to fill the buffer with data.
+ *
+ * Subclasses can override any of the available virtual methods or not, as
+ * needed. At the minimum, the @fill method should be overridden to produce
+ * buffers.
+ */
 struct _GstPushSrcClass {
   GstBaseSrcClass parent_class;
 
-  /* ask the subclass to create a buffer */
+  /* ask the subclass to create a buffer, the default implementation
+   * uses alloc and fill */
   GstFlowReturn (*create) (GstPushSrc *src, GstBuffer **buf);
-
+  /* allocate memory for a buffer */
+  GstFlowReturn (*alloc)  (GstPushSrc *src, GstBuffer **buf);
   /* ask the subclass to fill a buffer */
-  GstFlowReturn (*fill) (GstPushSrc *src, GstBuffer *buf);
+  GstFlowReturn (*fill)   (GstPushSrc *src, GstBuffer *buf);
 
   /*< private >*/
   gpointer _gst_reserved[GST_PADDING];
 };
 
-GType gst_push_src_get_type(void);
+GST_BASE_API
+GType gst_push_src_get_type (void);
+
+#ifdef G_DEFINE_AUTOPTR_CLEANUP_FUNC
+G_DEFINE_AUTOPTR_CLEANUP_FUNC(GstPushSrc, gst_object_unref)
+#endif
 
 G_END_DECLS