Types and Properties

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.

The Basic Types

GStreamer already supports many basic media types. Following is a table of 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.

Table 2.1. Table of Basic Types

Mime TypeDescriptionPropertyProperty TypeProperty ValuesProperty Description
audio/raw Unstructured and uncompressed raw audio data. rateintegergreater than 0 The sample rate of the data, in samples per second.
channelsintegergreater than 0 The number of channels of audio data.
formatstringint” or “float The format in which the audio data is passed.
lawinteger0, 1, or 2 (Valid only if the data is in integer format.) The law used to describe the data. The value 0 indicates “linear”, 1 indicates “mu law”, and 2 indicates “A law”.
endiannessboolean0 or 1 (Valid only if the data is in integer format.) The order of bytes in a sample. The value 0 means “little-endian” (bytes are least significant first). The value 1 means “big-endian” (most significant byte first).
signedboolean0 or 1 (Valid only if the data is in integer format.) Whether the samples are signed or not.
widthintegergreater than 0 (Valid only if the data is in integer format.) The number of bits per sample.
depthintegergreater than 0 (Valid only if the data is in integer format.) 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.
layoutstringgfloat (Valid only if the data is in float format.) A string representing the way in which the floating point data is represented.
interceptfloatany, normally 0 (Valid only if the data is in float format.) A floating point value representing the value that the signal “centers” on.
slopefloatany, normally 1.0 (Valid only if the data is in float format.) A floating point value representing how far the signal deviates from the intercept. A slope of 1.0 and an intercept of 0.0 would mean an audio signal with minimum and maximum values of -1.0 and 1.0. A slope of 0.5 and intercept of 0.5 would represent values in the range 0.0 to 1.0.
audio/mp3 Audio data compressed using the mp3 encoding scheme. framedboolean0 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.
layerinteger1, 2, or 3 The compression scheme layer used to compress the data.
bitrateintegergreater than 0 The bitrate, in kilobits per second. For VBR (variable bitrate) mp3 data, this is the average bitrate.
channelsintegergreater than 0 The number of channels of audio data present.
joint-stereoboolean0 or 1 If true, this implies that stereo data is stored as a combined signal and the difference between the signals, rather than as two entirely separate signals. If true, the “channels” attribute must not be zero.
audio/x-ogg Audio data compressed using the Ogg Vorbis encoding scheme.     FIXME: There are currently no parameters defined for this type.
video/raw Raw video data. fourccFOURCC code  A FOURCC code identifying the format in which this data is stored. FOURCC (Four Character Code) is a simple system to allow unambiguous identification of a video datastream format. See http://www.webartz.com/fourcc/
widthintegergreater than 0 The number of pixels wide that each video frame is.
heightintegergreater than 0 The number of pixels high that each video frame is.
video/mpeg Video data compressed using an MPEG encoding scheme.     FIXME: There are currently no parameters defined for this type.
video/avi Video data compressed using the AVI encoding scheme.     FIXME: There are currently no parameters defined for this type.