![]() |
![]() |
![]() |
GStreamer 0.10 Core Reference Manual | ![]() |
---|---|---|---|---|
#include <gst/gst.h> enum GstFormat; #define GST_FORMAT_PERCENT_MAX #define GST_FORMAT_PERCENT_SCALE GstFormatDefinition; const gchar* gst_format_get_name (GstFormat format); GQuark gst_format_to_quark (GstFormat format); GstFormat gst_format_register (const gchar *nick, const gchar *description); GstFormat gst_format_get_by_nick (const gchar *nick); gboolean gst_formats_contains (const GstFormat *formats, GstFormat format); const GstFormatDefinition* gst_format_get_details (GstFormat format); GstIterator* gst_format_iterate_definitions (void);
GstFormats functions are used to register a new format to the gstreamer core. Formats can be used to perform seeking or conversions/query operations.
typedef enum { GST_FORMAT_UNDEFINED = 0, /* must be first in list */ GST_FORMAT_DEFAULT = 1, GST_FORMAT_BYTES = 2, GST_FORMAT_TIME = 3, GST_FORMAT_BUFFERS = 4, GST_FORMAT_PERCENT = 5 } GstFormat;
Standard predefined formats
GST_FORMAT_UNDEFINED
GST_FORMAT_UNDEFINED
undefined format
undefined format
GST_FORMAT_DEFAULT
GST_FORMAT_DEFAULT
the default format of the pad/element. This can be
samples for raw audio, frames/fields for raw video.
the default format of the pad/element. This can be
samples for raw audio, frames/fields for raw video.
GST_FORMAT_BYTES
GST_FORMAT_BYTES
bytes
bytes
GST_FORMAT_TIME
GST_FORMAT_TIME
time in nanoseconds
time in nanoseconds
GST_FORMAT_BUFFERS
GST_FORMAT_BUFFERS
buffers
buffers
GST_FORMAT_PERCENT
GST_FORMAT_PERCENT
percentage of stream
percentage of stream
#define GST_FORMAT_PERCENT_MAX G_GINT64_CONSTANT (1000000)
The PERCENT format is between 0 and this value
#define GST_FORMAT_PERCENT_SCALE G_GINT64_CONSTANT (10000)
The value used to scale down the reported PERCENT format value to its real value.
typedef struct { GstFormat value; gchar *nick; gchar *description; GQuark quark; } GstFormatDefinition;
A format definition
value
;GstFormatvalue
The unique id of this format
The unique id of this format
gchar *nick
;gcharnick
A short nick of the format
A short nick of the format
gchar *description
;gchardescription
A longer description of the format
A longer description of the format
GQuark quark
;GQuarkquark
A quark for the nick
A quark for the nick
GstFormat value ; |
The unique id of this format |
gchar *nick ; |
A short nick of the format |
gchar *description ; |
A longer description of the format |
GQuark quark ; |
A quark for the nick |
const gchar* gst_format_get_name (GstFormat format);
Get a printable name for the given format. Do not modify or free.
format
:format
a GstFormat
a GstFormat
GstFormatGstFormatReturns :Returns a reference to the static name of the format or NULL if
the format is unknown.
a reference to the static name of the format or NULL if
the format is unknown.
format : |
a GstFormat |
Returns : | a reference to the static name of the format or NULL if the format is unknown. |
GQuark gst_format_to_quark (GstFormat format);
Get the unique quark for the given format.
format
:format
a GstFormat
a GstFormat
GstFormatGstFormatReturns :Returns the quark associated with the format or 0 if the format
is unknown.
the quark associated with the format or 0 if the format
is unknown.
format : |
a GstFormat |
Returns : | the quark associated with the format or 0 if the format is unknown. |
GstFormat gst_format_register (const gchar *nick, const gchar *description);
Create a new GstFormat based on the nick or return an already registered format with that nick.
nick
:nick
The nick of the new format
The nick of the new format
description
:description
The description of the new format
The description of the new format
Returns :Returns A new GstFormat or an already registered format
with the same nick.
MT safe.
A new GstFormat or an already registered format
with the same nick.
MT safe.
nick : |
The nick of the new format |
description : |
The description of the new format |
Returns : | A new GstFormat or an already registered format with the same nick. MT safe. |
GstFormat gst_format_get_by_nick (const gchar *nick);
Return the format registered with the given nick.
nick
:nick
The nick of the format
The nick of the format
Returns :Returns The format with nick
or GST_FORMAT_UNDEFINED
if the format was not registered.
The format with nick
or GST_FORMAT_UNDEFINED
if the format was not registered.
nick
nick : |
The nick of the format |
Returns : | The format with nick or GST_FORMAT_UNDEFINED
if the format was not registered.
|
gboolean gst_formats_contains (const GstFormat *formats, GstFormat format);
See if the given format is inside the format array.
formats
:formats
The format array to search
The format array to search
format
:format
the format to find
the format to find
Returns :Returns TRUE if the format is found inside the array
TRUE if the format is found inside the array
formats : |
The format array to search |
format : |
the format to find |
Returns : | TRUE if the format is found inside the array |
const GstFormatDefinition* gst_format_get_details (GstFormat format);
Get details about the given format.
format
:format
The format to get details of
The format to get details of
Returns :Returns The GstFormatDefinition for format
or NULL on failure.
MT safe.
The GstFormatDefinition for format
or NULL on failure.
MT safe.
GstFormatDefinitionGstFormatDefinitionformat
format : |
The format to get details of |
Returns : | The GstFormatDefinition for format or NULL on failure.
MT safe.
|
GstIterator* gst_format_iterate_definitions (void);
Iterate all the registered formats. The format definition is read only.
Returns : | A GstIterator of GstFormatDefinition. |