# fakesrc

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

     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.

## Hierarchy

    GObject
        ╰──GInitiallyUnowned
            ╰──GstObject
                ╰──GstElement
                    ╰──GstBaseSrc
                        ╰──fakesrc

## Factory details

Authors: – Erik Walthinsen , Wim Taymans

Classification: – `Source`

Rank – none

Plugin – coreelements

Package – GStreamer

## Pad Templates

### `src`

    ANY

Presence – always

Direction – src

Object type – GstPad

## Signals

### handoff

    handoff_callback (GstElement * fakesrc,
                      GstBuffer * buffer,
                      GstPad * pad,
                      gpointer udata)

    def handoff_callback (fakesrc, buffer, pad, udata):
        #python callback for the 'handoff' signal

    function handoff_callback(fakesrc: GstElement * fakesrc, buffer: GstBuffer * buffer, pad: GstPad * pad, udata: gpointer udata): {
        // javascript callback for the 'handoff' signal
    }

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

`udata` –
No description available

Flags: Run Last

## Properties

### can-activate-pull

    “can-activate-pull” gboolean

Can activate in pull mode

Flags : Read / Write / Construct

Default value : true

### can-activate-push

    “can-activate-push” gboolean

Can activate in push mode

Flags : Read / Write / Construct

Default value : true

### data

    “data” Fake-src-data-type *

Data allocation method

Flags : Read / Write

Default value : allocate (1)

### datarate

    “datarate” gint

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

Flags : Read / Write

Default value : 0

### dump

    “dump” gboolean

Dump buffer contents to stdout

Flags : Read / Write

Default value : false

### filltype

    “filltype” Fake-src-fill-type *

How to fill the buffer, if at all

Flags : Read / Write

Default value : nothing (1)

### format

    “format” GstFormat *

Set the format of the newsegment events to produce.

Flags : Read / Write

Default value : bytes (2)

### is-live

    “is-live” gboolean

True if the element cannot produce data in PAUSED

Flags : Read / Write / Construct

Default value : false

### last-message

    “last-message” gchararray

The last status message

Flags : Read

Default value : NULL

### parentsize

    “parentsize” gint

Size of parent buffer for sub-buffered allocation

Flags : Read / Write

Default value : 40960

### pattern

    “pattern” gchararray

Set the pattern (unused)

Flags : Read / Write

Default value : NULL

### signal-handoffs

    “signal-handoffs” gboolean

Send a signal before pushing the buffer

Flags : Read / Write

Default value : false

### silent

    “silent” gboolean

Don't produce last_message events

Flags : Read / Write

Default value : true

### sizemax

    “sizemax” gint

Maximum buffer size

Flags : Read / Write

Default value : 4096

### sizemin

    “sizemin” gint

Minimum buffer size

Flags : Read / Write

Default value : 0

### sizetype

    “sizetype” Fake-src-size-type *

How to determine buffer sizes

Flags : Read / Write

Default value : empty (1)

### sync

    “sync” gboolean

Sync to the clock to the datarate

Flags : Read / Write

Default value : false

## Named constants

### Fake-src-data-type

The different ways buffers are allocated.

#### Members

`allocate` (1) – Allocate data
`subbuffer` (2) – Subbuffer data

### Fake-src-fill-type

The different ways of filling the buffers.

#### Members

`nothing` (1) – Leave data as malloced
`zero` (2) – Fill buffers with zeros
`random` (3) – Fill buffers with random data
`pattern` (4) – Fill buffers with pattern 0x00 -> 0xff
`pattern-span` (5) – Fill buffers with pattern 0x00 -> 0xff that spans buffers

### Fake-src-size-type

The different size of the allocated buffers.

#### Members

`empty` (1) – Send empty buffers
`fixed` (2) – Fixed size buffers (sizemax sized)
`random` (3) – Random sized buffers (sizemin

The results of the search are