fakesrc: GStreamer Core Plugins 1.0 Plugins Reference Manual

## fakesrc fakesrc |

## Properties

gboolean | can-activate-pull | Read / Write / Construct
gboolean | can-activate-push | Read / Write / Construct
GstFakeSrcDataType | data | Read / Write
gint | datarate | Read / Write
gboolean | dump | Read / Write
GstFakeSrcFillType | filltype | Read / Write
GstFormat | format | Read / Write
gboolean | is-live | Read / Write / Construct
gchar * | last-message | Read
gint | parentsize | Read / Write
gchar * | pattern | Read / Write
gboolean | signal-handoffs | Read / Write
gboolean | silent | Read / Write
gint | sizemax | Read / Write
gint | sizemin | Read / Write
GstFakeSrcSizeType | sizetype | Read / Write
gboolean | sync | Read / Write

## Signals

void | handoff | Run Last

## Types and Values

struct | GstFakeSrc
enum | GstFakeSrcDataType
enum | GstFakeSrcFillType
enum | GstFakeSrcOutputType
enum | GstFakeSrcSizeType

## Object Hierarchy

        GObject
        ╰── GInitiallyUnowned
            ╰── GstObject
                ╰── GstElement
                    ╰── GstBaseSrc
                        ╰── GstFakeSrc

## Description

The fakesrc element is a multipurpose element that can generate a wide range of buffers and can operate in various scheduling modes.

It is mostly used as a testing element, one trivial example for testing basic GStreamer core functionality is:

#### Example launch line

    1
    gst-launch-1.0 -v fakesrc num-buffers=5 ! fakesink

This pipeline will push 5 empty buffers to the fakesink element and then sends an EOS.

## Synopsis

### Element Information

plugin | coreelements
author | Erik Walthinsen <omega@cse.ogi.edu>, Wim Taymans <wim@fluendo.com>
class | Source

### Element Pads

name | src
direction | source
presence | always
details | ANY

## Functions

## Types and Values

### struct GstFakeSrc

    struct GstFakeSrc;

Opaque GstFakeSrc data structure.

### enum GstFakeSrcDataType

The different ways buffers are allocated.

#### Members

FAKE_SRC_DATA_ALLOCATE | allocate buffers |
FAKE_SRC_DATA_SUBBUFFER | subbuffer each buffer |

### enum GstFakeSrcFillType

The different ways of filling the buffers.

#### Members

FAKE_SRC_FILLTYPE_NOTHING | do not fill buffers |
FAKE_SRC_FILLTYPE_ZERO | fill buffers with 0 |
FAKE_SRC_FILLTYPE_RANDOM | fill buffers with random bytes |
FAKE_SRC_FILLTYPE_PATTERN | fill buffers with a pattern |
FAKE_SRC_FILLTYPE_PATTERN_CONT | fill buffers with a continuous pattern |

### enum GstFakeSrcOutputType

The different output types. Unused currently.

#### Members

FAKE_SRC_FIRST_LAST_LOOP | first pad then last pad |
FAKE_SRC_LAST_FIRST_LOOP | last pad then first pad |
FAKE_SRC_PING_PONG | ping pong between pads |
FAKE_SRC_ORDERED_RANDOM | ordered random pad |
FAKE_SRC_RANDOM | random pad |
FAKE_SRC_PATTERN_LOOP | loop between pads in a particular pattern |
FAKE_SRC_PING_PONG_PATTERN | ping pong based on a pattern |
FAKE_SRC_GET_ALWAYS_SUCEEDS | a get always succeeds on a pad |

### enum GstFakeSrcSizeType

The different size of the allocated buffers.

#### Members

FAKE_SRC_SIZETYPE_EMPTY | create empty buffers |
FAKE_SRC_SIZETYPE_FIXED | fixed buffer size (sizemax sized) |
FAKE_SRC_SIZETYPE_RANDOM | random buffer size (sizemin <= size <= sizemax) |

## Property Details

### The `“can-activate-pull”` property

      “can-activate-pull”        gboolean

Can activate in pull mode.

Owner: GstFakeSrc

Flags: Read / Write / Construct

Default value: TRUE

### The `“can-activate-push”` property

      “can-activate-push”        gboolean

Can activate in push mode.

Owner: GstFakeSrc

Flags: Read / Write / Construct

Default value: TRUE

### The `“data”` property

      “data”                     GstFakeSrcDataType

Data allocation method.

Owner: GstFakeSrc

Flags: Read / Write

Default value: Allocate data

### The `“datarate”` property

      “datarate”                 gint

Timestamps buffers with number of bytes per second (0 = none).

Owner: GstFakeSrc

Flags: Read / Write

Allowed values: >= 0

Default value: 0

### The `“dump”` property

      “dump”                     gboolean

Dump buffer contents to stdout.

Owner: GstFakeSrc

Flags: Read / Write

Default value: FALSE

### The `“filltype”` property

      “filltype”                 GstFakeSrcFillType

How to fill the buffer, if at all.

Owner: GstFakeSrc

Flags: Read / Write

Default value: Fill buffers with zeros

### The `“format”` property

      “format”                   GstFormat

Set the format of the newsegment events to produce.

Owner: GstFakeSrc

Flags: Read / Write

Default value: GST_FORMAT_BYTES

### The `“is-live”` property

      “is-live”                  gboolean

True if the element cannot produce data in PAUSED.

Owner: GstFakeSrc

Flags: Read / Write / Construct

Default value: FALSE

### The `“last-message”` property

      “last-message”             gchar *

The last status message.

Owner: GstFakeSrc

Flags: Read

Default value: NULL

### The `“parentsize”` property

      “parentsize”               gint

Size of parent buffer for sub-buffered allocation.

Owner: GstFakeSrc

Flags: Read / Write

Allowed values: >= 0

Default value: 40960

### The `“pattern”` property

      “pattern”                  gchar *

Set the pattern (unused).

Owner: GstFakeSrc

Flags: Read / Write

Default value: NULL

### The `“signal-handoffs”` property

      “signal-handoffs”          gboolean

Send a signal before pushing the buffer.

Owner: GstFakeSrc

Flags: Read / Write

Default value: FALSE

### The `“silent”` property

      “silent”                   gboolean

Don't produce last_message events.

Owner: GstFakeSrc

Flags: Read / Write

Default value: TRUE

### The `“sizemax”` property

      “sizemax”                  gint

Maximum buffer size.

Owner: GstFakeSrc

Flags: Read / Write

Allowed values: >= 0

Default value: 4096

### The `“sizemin”` property

      “sizemin”                  gint

Minimum buffer size.

Owner: GstFakeSrc

Flags: Read / Write

Allowed values: >= 0

Default value: 0

### The `“sizetype”` property

      “sizetype”                 GstFakeSrcSizeType

How to determine buffer sizes.

Owner: GstFakeSrc

Flags: Read / Write

Default value: Send empty buffers

### The `“sync”` property

      “sync”                     gboolean

Sync to the clock to the datarate.

Owner: GstFakeSrc

Flags: Read / Write

Default value: FALSE

## Signal Details

### The `“handoff”` signal

    void
    user_function (GstFakeSrc *fakesrc,
                   GstBuffer  *buffer,
                   GstPad     *pad,
                   gpointer    user_data)

This signal gets emitted before sending the buffer.

#### Parameters

fakesrc | the fakesrc instance |
buffer | the buffer that will be pushed |
pad | the pad that will sent it |
user_data | user data set when the signal handler was connected. |

Flags: Run Last

## See Also

GstFakeSink