# downloadbuffer

The downloadbuffer element provides on-disk buffering and caching of, typically, a network file. temp-template should be set to a value such as /tmp/gstreamer-XXXXXX and the element will allocate a random free filename and buffer the data in the file.

With max-size-bytes and max-size-time you can configure the buffering limits. The downloadbuffer element will try to read-ahead these amounts of data. When the amount of read-ahead data drops below low-percent of the configured max, the element will start emitting BUFFERING messages until high-percent of max is reached again.

The downloadbuffer provides push and pull based scheduling on its source pad and will efficiently seek in the upstream element when needed.

The temp-location property will be used to notify the application of the allocated filename.

When the downloadbuffer has completely downloaded the media, it will post an application message named `GstCacheDownloadComplete` with the following information:

- G_TYPE_STRING `location`: the location of the completely downloaded file.

## Hierarchy

    GObject
        ╰──GInitiallyUnowned
            ╰──GstObject
                ╰──GstElement
                    ╰──downloadbuffer

## Factory details

Authors: – Wim Taymans <wim.taymans@gmail.com></wim.taymans@gmail.com>

Classification: – `Generic`

Rank – none

Plugin – coreelements

Package – GStreamer

## Pad Templates

### `sink`

    ANY

Presence – always

Direction – sink

Object type – GstPad

### `src`

    ANY

Presence – always

Direction – src

Object type – GstPad

## Properties

### high-percent

    “high-percent” gint

High threshold for buffering to finish. Emits GST_MESSAGE_BUFFERING with a value of 100%%

Flags : Read / Write

Default value : 99

### low-percent

    “low-percent” gint

Low threshold for buffering to start. Emits GST_MESSAGE_BUFFERING with a value of 0%%

Flags : Read / Write

Default value : 10

### max-size-bytes

    “max-size-bytes” guint

Max. amount of data to buffer (bytes, 0=disable)

Flags : Read / Write

Default value : 2097152

### max-size-time

    “max-size-time” guint64

Max. amount of data to buffer (in ns, 0=disable)

Flags : Read / Write

Default value : 2000000000

### temp-location

    “temp-location” gchararray

Location to store temporary files in (Only read this property, use temp-template to configure the name template)

Flags : Read

Default value : NULL

### temp-remove

    “temp-remove” gboolean

When temp-template is set, remove the temporary file when going to READY.

Flags : Read / Write

Default value : true

### temp-template

    “temp-template” gchararray

File template to store temporary files in, should contain directory and XXXXXX. (NULL == disabled)

Flags : Read / Write

Default value : NULL

The results of the search are