GstPushSrc: GStreamer 1.0 Library Reference Manual

## GstPushSrc GstPushSrc — Base class for push based source elements |

## Types and Values

struct | GstPushSrc
struct | GstPushSrcClass

## Object Hierarchy

        GObject
        ╰── GInitiallyUnowned
            ╰── GstObject
                ╰── GstElement
                    ╰── GstBaseSrc
                        ╰── GstPushSrc

## Includes

    #include <gst/base/gstpushsrc.h>

## Description

This class is mostly useful for elements that cannot do random access, or at least very slowly. The source usually prefers to push out a fixed size buffer.

Subclasses usually operate in a format that is different from the default GST_FORMAT_BYTES format of GstBaseSrc.

Classes extending this base class will usually be scheduled in a push based mode. If the peer accepts to operate without offsets and within the limits of the allowed block size, this class can operate in getrange based mode automatically. To make this possible, the subclass should implement and override the SCHEDULING query.

The subclass should extend the methods from the baseclass in addition to the ::create method.

Seeking, flushing, scheduling and sync is all handled by this base class.

## Functions

## Types and Values

### struct GstPushSrc

    struct GstPushSrc;

The opaque GstPushSrc data structure.

### struct GstPushSrcClass

    struct GstPushSrcClass {
      GstBaseSrcClass parent_class;

      /* 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);
    };

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.

#### Members

`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 allocated a buffer. The subclass decides which size this buffer should be. The default implementation will create a new buffer from the negotiate allcoator. |
`fill` () | Ask the subclass to fill the buffer with data. |

## See Also

GstBaseSrc