input-selector: GStreamer Core Plugins 1.0 Plugins Reference Manual

## input-selector input-selector |

## Properties

GstPad * | active-pad | Read / Write
gboolean | cache-buffers | Read / Write
guint | n-pads | Read
GstInputSelectorSyncMode | sync-mode | Read / Write
gboolean | sync-streams | Read / Write

## Types and Values

struct | GstInputSelector
enum | GstInputSelectorSyncMode

## Object Hierarchy

        GObject
        ╰── GInitiallyUnowned
            ╰── GstObject
                ╰── GstElement
                    ╰── GstInputSelector

## Description

Direct one out of N input streams to the output pad.

The input pads are from a GstPad subclass and have additional properties, which users may find useful, namely:

- "running-time": Running time of stream on pad (gint64)
- "tags": The currently active tags on the pad (GstTagList, boxed type)
- "active": If the pad is currently active (gboolean)
- "always-ok" : Make an inactive pads return GST_FLOW_OK instead of GST_FLOW_NOT_LINKED

## Synopsis

### Element Information

plugin | coreelements
author | Julien Moutte <julien@moutte.net>, Jan Schmidt <thaytan@mad.scientist.com>, Wim Taymans <wim.taymans@gmail.com>
class | Generic

### Element Pads

name | sink_%u
direction | sink
presence | request
details | ANY

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

## Functions

## Types and Values

### struct GstInputSelector

    struct GstInputSelector;

### enum GstInputSelectorSyncMode

The different ways that input-selector can behave when in sync-streams mode.

#### Members

GST_INPUT_SELECTOR_SYNC_MODE_ACTIVE_SEGMENT | Sync using the current active segment. |
GST_INPUT_SELECTOR_SYNC_MODE_CLOCK | Sync using the clock. |

## Property Details

### The `“active-pad”` property

      “active-pad”               GstPad *

The currently active sink pad.

Flags: Read / Write

### The `“cache-buffers”` property

      “cache-buffers”            gboolean

If set to `TRUE` and GstInputSelector:sync-streams is also set to `TRUE`, the active pad will cache the buffers still considered valid (after current running time, see sync-mode) to avoid missing frames if/when the pad is reactivated.

The active pad may push more buffers than what is currently displayed/consumed and when changing pads those buffers will be discarded and the only way to reactivate that pad without loosing the already consumed buffers is to enable cache.

Flags: Read / Write

Default value: FALSE

### The `“n-pads”` property

      “n-pads”                   guint

The number of sink pads.

Flags: Read

Default value: 0

### The `“sync-mode”` property

      “sync-mode”                GstInputSelectorSyncMode

Select how input-selector will sync buffers when in sync-streams mode.

Note that when using the "active-segment" mode, the "active-segment" may be ahead of current clock time when switching the active pad, as the current active pad may have pushed more buffers than what was displayed/consumed, which may cause delays and some missing buffers.

Flags: Read / Write

Default value: Sync using the current active segment

### The `“sync-streams”` property

      “sync-streams”             gboolean

If set to `TRUE` all inactive streams will be synced to the running time of the active stream or to the current clock.

To make sure no buffers are dropped by input-selector that might be needed when switching the active pad, sync-mode should be set to "clock" and cache-buffers to TRUE.

Flags: Read / Write

Default value: TRUE

## See Also

GstOutputSelector