GStreamer uses a type system to ensure that the data passed between elements is in a recognized format. The type system is also important for ensuring that the parameters required to fully specify a format match up correctly when linking pads between elements. Each link that is made between elements has a specified type and optionally a set of properties.
GStreamer already supports many basic media types. Following is a table of a few of the the basic types used for buffers in GStreamer. The table contains the name ("mime type") and a description of the type, the properties associated with the type, and the meaning of each property. A full list of supported types is included in List of Defined Types.
Table 2-1. Table of Example Types
Mime Type | Description | Property | Property Type | Property Values | Property Description |
---|---|---|---|---|---|
audio/* | All audio types | rate | integer | greater than 0 | The sample rate of the data, in samples (per channel) per second. |
channels | integer | greater than 0 | The number of channels of audio data. | ||
audio/x-raw-int | Unstructured and uncompressed raw integer audio data. | endianness | integer | G_BIG_ENDIAN (1234) or G_LITTLE_ENDIAN (4321) | The order of bytes in a sample. The value G_LITTLE_ENDIAN (4321) means "little-endian" (byte-order is "least significant byte first"). The value G_BIG_ENDIAN (1234) means "big-endian" (byte order is "most significant byte first"). |
signed | boolean | TRUE or FALSE | Whether the values of the integer samples are signed or not. Signed samples use one bit to indicate sign (negative or positive) of the value. Unsigned samples are always positive. | ||
width | integer | greater than 0 | Number of bits allocated per sample. | ||
depth | integer | greater than 0 | The number of bits used per sample. This must be less than or equal to the width: If the depth is less than the width, the low bits are assumed to be the ones used. For example, a width of 32 and a depth of 24 means that each sample is stored in a 32 bit word, but only the low 24 bits are actually used. | ||
audio/mpeg | Audio data compressed using the MPEG audio encoding scheme. | mpegversion | integer | 1, 2 or 4 | The MPEG-version used for encoding the data. The value 1 refers to MPEG-1, -2 and -2.5 layer 1, 2 or 3. The values 2 and 4 refer to the MPEG-AAC audio encoding schemes. |
framed | boolean | 0 or 1 | A true value indicates that each buffer contains exactly one frame. A false value indicates that frames and buffers do not necessarily match up. | ||
layer | integer | 1, 2, or 3 | The compression scheme layer used to compress the data (only if mpegversion=1). | ||
bitrate | integer | greater than 0 | The bitrate, in bits per second. For VBR (variable bitrate) MPEG data, this is the average bitrate. | ||
audio/x-vorbis | Vorbis audio data | There are currently no specific properties defined for this type. |