![]() |
![]() |
![]() |
GStreamer Base Plugins 0.10 Library Reference Manual | ![]() |
---|---|---|---|---|
Top | Description | Object Hierarchy | Properties | Signals |
#include <gst/pbutils/pbutils.h> GstDiscoverer; GstDiscoverer * gst_discoverer_new (GstClockTime timeout, GError **err); void gst_discoverer_start (GstDiscoverer *discoverer); void gst_discoverer_stop (GstDiscoverer *discoverer); GstDiscovererInfo * gst_discoverer_discover_uri (GstDiscoverer *discoverer, const gchar *uri, GError **err); gboolean gst_discoverer_discover_uri_async (GstDiscoverer *discoverer, const gchar *uri); GstDiscovererInfo; enum GstDiscovererResult; GstClockTime gst_discoverer_info_get_duration (const GstDiscovererInfo *info); const GstStructure* gst_discoverer_info_get_misc (const GstDiscovererInfo *info); GstDiscovererResult gst_discoverer_info_get_result (const GstDiscovererInfo *info); GstDiscovererStreamInfo* gst_discoverer_info_get_stream_info (GstDiscovererInfo *info); GList* gst_discoverer_info_get_stream_list (GstDiscovererInfo *info); const GstTagList* gst_discoverer_info_get_tags (const GstDiscovererInfo *info); const gchar* gst_discoverer_info_get_uri (const GstDiscovererInfo *info); gboolean gst_discoverer_info_get_seekable (const GstDiscovererInfo *info); #define gst_discoverer_info_ref (info) #define gst_discoverer_info_unref (info) GstDiscovererStreamInfo; GstDiscovererContainerInfo; GstDiscovererAudioInfo; GstDiscovererVideoInfo; GstDiscovererSubtitleInfo; GstCaps* gst_discoverer_stream_info_get_caps (GstDiscovererStreamInfo *info); const GstStructure* gst_discoverer_stream_info_get_misc (GstDiscovererStreamInfo *info); GstDiscovererStreamInfo* gst_discoverer_stream_info_get_next (GstDiscovererStreamInfo *info); GstDiscovererStreamInfo* gst_discoverer_stream_info_get_previous (GstDiscovererStreamInfo *info); const GstTagList* gst_discoverer_stream_info_get_tags (GstDiscovererStreamInfo *info); #define gst_discoverer_stream_info_ref (info) #define gst_discoverer_stream_info_unref (info) void gst_discoverer_stream_info_list_free (GList *infos); const gchar * gst_discoverer_stream_info_get_stream_type_nick (GstDiscovererStreamInfo *info); GList * gst_discoverer_info_get_audio_streams (GstDiscovererInfo *info); GList * gst_discoverer_info_get_container_streams (GstDiscovererInfo *info); GList * gst_discoverer_info_get_streams (GstDiscovererInfo *info, GType streamtype); GList * gst_discoverer_info_get_subtitle_streams (GstDiscovererInfo *info); GList * gst_discoverer_info_get_video_streams (GstDiscovererInfo *info); guint gst_discoverer_audio_info_get_bitrate (const GstDiscovererAudioInfo *info); guint gst_discoverer_audio_info_get_channels (const GstDiscovererAudioInfo *info); guint gst_discoverer_audio_info_get_depth (const GstDiscovererAudioInfo *info); const gchar * gst_discoverer_audio_info_get_language (const GstDiscovererAudioInfo *info); guint gst_discoverer_audio_info_get_max_bitrate (const GstDiscovererAudioInfo *info); guint gst_discoverer_audio_info_get_sample_rate (const GstDiscovererAudioInfo *info); GList * gst_discoverer_container_info_get_streams (GstDiscovererContainerInfo *info); const gchar * gst_discoverer_subtitle_info_get_language (const GstDiscovererSubtitleInfo *info); guint gst_discoverer_video_info_get_bitrate (const GstDiscovererVideoInfo *info); guint gst_discoverer_video_info_get_depth (const GstDiscovererVideoInfo *info); guint gst_discoverer_video_info_get_framerate_denom (const GstDiscovererVideoInfo *info); guint gst_discoverer_video_info_get_framerate_num (const GstDiscovererVideoInfo *info); guint gst_discoverer_video_info_get_height (const GstDiscovererVideoInfo *info); gboolean gst_discoverer_video_info_is_interlaced (const GstDiscovererVideoInfo *info); gboolean gst_discoverer_video_info_is_image (const GstDiscovererVideoInfo *info); guint gst_discoverer_video_info_get_max_bitrate (const GstDiscovererVideoInfo *info); guint gst_discoverer_video_info_get_par_denom (const GstDiscovererVideoInfo *info); guint gst_discoverer_video_info_get_par_num (const GstDiscovererVideoInfo *info); guint gst_discoverer_video_info_get_width (const GstDiscovererVideoInfo *info);
The GstDiscoverer is a utility object which allows to get as much information as possible from one or many URIs.
It provides two APIs, allowing usage in blocking or non-blocking mode.
The blocking mode just requires calling gst_discoverer_discover_uri()
with the URI one wishes to discover.
The non-blocking mode requires a running GMainLoop in the default
GMainContext, where one connects to the various signals, appends the
URIs to be processed (through gst_discoverer_discover_uri_async()
) and then
asks for the discovery to begin (through gst_discoverer_start()
).
All the information is returned in a GstDiscovererInfo structure.
typedef struct _GstDiscoverer GstDiscoverer;
The GstDiscoverer structure.
Since 0.10.31
GstDiscoverer * gst_discoverer_new (GstClockTime timeout, GError **err);
Creates a new GstDiscoverer with the provided timeout.
|
timeout per file, in nanoseconds. Allowed are values between one second (GST_SECOND) and one hour (3600 * GST_SECOND) |
|
a pointer to a GError. can be NULL
|
Returns : |
transfer full. transfer full. |
Since 0.10.31
void gst_discoverer_start (GstDiscoverer *discoverer);
Allow asynchronous discovering of URIs to take place. A GMainLoop must be available for GstDiscoverer to properly work in asynchronous mode.
|
A GstDiscoverer |
Since 0.10.31
void gst_discoverer_stop (GstDiscoverer *discoverer);
Stop the discovery of any pending URIs and clears the list of pending URIS (if any).
|
A GstDiscoverer |
Since 0.10.31
GstDiscovererInfo * gst_discoverer_discover_uri (GstDiscoverer *discoverer, const gchar *uri, GError **err);
Synchronously discovers the given uri
.
A copy of uri
will be made internally, so the caller can safely g_free()
afterwards.
|
A GstDiscoverer |
|
The URI to run on. |
|
If an error occurred, this field will be filled in.. out. allow-none. |
Returns : |
transfer full. transfer full. |
Since 0.10.31
gboolean gst_discoverer_discover_uri_async (GstDiscoverer *discoverer, const gchar *uri);
Appends the given uri
to the list of URIs to discoverer. The actual
discovery of the uri
will only take place if gst_discoverer_start()
has
been called.
A copy of uri
will be made internally, so the caller can safely g_free()
afterwards.
|
A GstDiscoverer |
|
the URI to add. |
Returns : |
TRUE if the uri was successfully appended to the list of pending
uris, else FALSE
|
Since 0.10.31
typedef struct _GstDiscovererInfo GstDiscovererInfo;
Structure containing the information of a URI analyzed by GstDiscoverer.
Since 0.10.31
typedef enum { GST_DISCOVERER_OK = 0, GST_DISCOVERER_URI_INVALID = 1, GST_DISCOVERER_ERROR = 2, GST_DISCOVERER_TIMEOUT = 3, GST_DISCOVERER_BUSY = 4, GST_DISCOVERER_MISSING_PLUGINS = 5 } GstDiscovererResult;
Result values for the discovery process.
The discovery was successful | |
the URI is invalid | |
an error happened and the GError is set | |
the discovery timed-out | |
the discoverer was already discovering a file | |
Some plugins are missing for full discovery |
Since 0.10.31
GstClockTime gst_discoverer_info_get_duration (const GstDiscovererInfo *info);
|
a GstDiscovererInfo |
Returns : |
the duration of the URI in GstClockTime (nanoseconds). |
Since 0.10.31
const GstStructure* gst_discoverer_info_get_misc (const GstDiscovererInfo *info);
|
a GstDiscovererInfo |
Returns : |
transfer none. transfer none. |
Since 0.10.31
GstDiscovererResult gst_discoverer_info_get_result (const GstDiscovererInfo *info);
|
a GstDiscovererInfo |
Returns : |
the result of the discovery as a GstDiscovererResult. |
Since 0.10.31
GstDiscovererStreamInfo* gst_discoverer_info_get_stream_info (GstDiscovererInfo *info);
|
a GstDiscovererInfo |
Returns : |
transfer full. transfer full. |
Since 0.10.31
GList* gst_discoverer_info_get_stream_list (GstDiscovererInfo *info);
|
a GstDiscovererInfo |
Returns : |
transfer full) (element-type Gst.DiscovererStreamInfo. transfer full. element-type Gst.DiscovererStreamInfo. |
Since 0.10.31
const GstTagList* gst_discoverer_info_get_tags (const GstDiscovererInfo *info);
|
a GstDiscovererInfo |
Returns : |
transfer none. transfer none. |
Since 0.10.31
const gchar* gst_discoverer_info_get_uri (const GstDiscovererInfo *info);
|
a GstDiscovererInfo |
Returns : |
transfer none. transfer none. |
Since 0.10.31
gboolean gst_discoverer_info_get_seekable (const GstDiscovererInfo *info);
|
a GstDiscovererInfo |
Returns : |
the whether the URI is seekable. |
Since 0.10.32
#define gst_discoverer_info_ref(info) (gst_mini_object_ref((GstMiniObject*)info))
Increments the reference count of info
.
|
a GstDiscovererInfo |
Returns : |
the same GstDiscovererInfo object |
Since 0.10.31
#define gst_discoverer_info_unref(info) (gst_mini_object_unref((GstMiniObject*)info))
Decrements the reference count of info
.
|
a GstDiscovererInfo |
Since 0.10.31
typedef struct _GstDiscovererStreamInfo GstDiscovererStreamInfo;
Base structure for information concerning a media stream. Depending on the stream type, one can find more media-specific information in GstDiscovererAudioInfo, GstDiscovererVideoInfo, and GstDiscovererContainerInfo.
The GstDiscovererStreamInfo represents the topology of the stream. Siblings
can be iterated over with gst_discoverer_stream_info_get_next()
and
gst_discoverer_stream_info_get_previous()
. Children (sub-streams) of a
stream can be accessed using the GstDiscovererContainerInfo API.
As a simple example, if you run GstDiscoverer on an AVI file with one audio and one video stream, you will get a GstDiscovererContainerInfo corresponding to the AVI container, which in turn will have a GstDiscovererAudioInfo sub-stream and a GstDiscovererVideoInfo sub-stream for the audio and video streams respectively.
Since 0.10.31
typedef struct _GstDiscovererContainerInfo GstDiscovererContainerInfo;
GstDiscovererStreamInfo specific to container streams.
Since 0.10.31
typedef struct _GstDiscovererAudioInfo GstDiscovererAudioInfo;
GstDiscovererStreamInfo specific to audio streams.
Since 0.10.31
typedef struct _GstDiscovererVideoInfo GstDiscovererVideoInfo;
GstDiscovererStreamInfo specific to video streams (this includes images).
Since 0.10.31
typedef struct _GstDiscovererSubtitleInfo GstDiscovererSubtitleInfo;
GstDiscovererStreamInfo specific to subtitle streams (this includes text and image based ones).
Since 0.10.36
GstCaps* gst_discoverer_stream_info_get_caps (GstDiscovererStreamInfo *info);
|
a GstDiscovererStreamInfo |
Returns : |
transfer full. transfer full. |
Since 0.10.31
const GstStructure* gst_discoverer_stream_info_get_misc (GstDiscovererStreamInfo *info);
|
a GstDiscovererStreamInfo |
Returns : |
transfer none. transfer none. |
Since 0.10.31
GstDiscovererStreamInfo* gst_discoverer_stream_info_get_next (GstDiscovererStreamInfo *info);
|
a GstDiscovererStreamInfo |
Returns : |
transfer full. transfer full. |
Since 0.10.31
GstDiscovererStreamInfo* gst_discoverer_stream_info_get_previous (GstDiscovererStreamInfo *info);
|
a GstDiscovererStreamInfo |
Returns : |
transfer full. transfer full. |
Since 0.10.31
const GstTagList* gst_discoverer_stream_info_get_tags (GstDiscovererStreamInfo *info);
|
a GstDiscovererStreamInfo |
Returns : |
transfer none. transfer none. |
Since 0.10.31
#define gst_discoverer_stream_info_ref(info) ((GstDiscovererStreamInfo*) gst_mini_object_ref((GstMiniObject*) info))
Increments the reference count of info
.
|
a GstDiscovererStreamInfo |
Returns : |
the same GstDiscovererStreamInfo object |
Since 0.10.31
#define gst_discoverer_stream_info_unref(info) (gst_mini_object_unref((GstMiniObject*) info))
Decrements the reference count of info
.
|
a GstDiscovererStreamInfo |
Since 0.10.31
void gst_discoverer_stream_info_list_free (GList *infos);
Decrements the reference count of all contained GstDiscovererStreamInfo and fress the GList.
|
a GList of GstDiscovererStreamInfo |
const gchar * gst_discoverer_stream_info_get_stream_type_nick (GstDiscovererStreamInfo *info);
|
a GstDiscovererStreamInfo |
Returns : |
a human readable name for the stream type of the given info (ex : "audio",
"container",...).
|
Since 0.10.31
GList * gst_discoverer_info_get_audio_streams (GstDiscovererInfo *info);
Finds all the GstDiscovererAudioInfo contained in info
|
a GstDiscovererInfo |
Returns : |
transfer full) (element-type Gst.DiscovererStreamInfo. transfer full. element-type Gst.DiscovererStreamInfo. |
Since 0.10.31
GList * gst_discoverer_info_get_container_streams (GstDiscovererInfo *info);
Finds all the GstDiscovererContainerInfo contained in info
|
a GstDiscovererInfo |
Returns : |
transfer full) (element-type Gst.DiscovererStreamInfo. transfer full. element-type Gst.DiscovererStreamInfo. |
Since 0.10.31
GList * gst_discoverer_info_get_streams (GstDiscovererInfo *info, GType streamtype);
Finds the GstDiscovererStreamInfo contained in info
that match the
given streamtype
.
|
a GstDiscovererInfo |
|
a GType derived from GstDiscovererStreamInfo |
Returns : |
transfer full) (element-type Gst.DiscovererStreamInfo. transfer full. element-type Gst.DiscovererStreamInfo. |
Since 0.10.31
GList * gst_discoverer_info_get_subtitle_streams (GstDiscovererInfo *info);
Finds all the GstDiscovererSubtitleInfo contained in info
|
a GstDiscovererInfo |
Returns : |
transfer full) (element-type Gst.DiscovererStreamInfo. transfer full. element-type Gst.DiscovererStreamInfo. |
Since 0.10.36
GList * gst_discoverer_info_get_video_streams (GstDiscovererInfo *info);
Finds all the GstDiscovererVideoInfo contained in info
|
a GstDiscovererInfo |
Returns : |
transfer full) (element-type Gst.DiscovererStreamInfo. transfer full. element-type Gst.DiscovererStreamInfo. |
Since 0.10.31
guint gst_discoverer_audio_info_get_bitrate (const GstDiscovererAudioInfo *info);
|
a GstDiscovererAudioInfo |
Returns : |
the average or nominal bitrate of the stream in bits/second. |
Since 0.10.31
guint gst_discoverer_audio_info_get_channels (const GstDiscovererAudioInfo *info);
|
a GstDiscovererAudioInfo |
Returns : |
the number of channels in the stream. |
Since 0.10.31
guint gst_discoverer_audio_info_get_depth (const GstDiscovererAudioInfo *info);
|
a GstDiscovererAudioInfo |
Returns : |
the number of bits used per sample in each channel. |
Since 0.10.31
const gchar * gst_discoverer_audio_info_get_language (const GstDiscovererAudioInfo *info);
|
a GstDiscovererAudioInfo |
Returns : |
the language of the stream, or NULL if unknown. |
Since 0.10.36
guint gst_discoverer_audio_info_get_max_bitrate (const GstDiscovererAudioInfo *info);
|
a GstDiscovererAudioInfo |
Returns : |
the maximum bitrate of the stream in bits/second. |
Since 0.10.31
guint gst_discoverer_audio_info_get_sample_rate (const GstDiscovererAudioInfo *info);
|
a GstDiscovererAudioInfo |
Returns : |
the sample rate of the stream in Hertz. |
Since 0.10.31
GList * gst_discoverer_container_info_get_streams (GstDiscovererContainerInfo *info);
|
a GstDiscovererStreamInfo |
Returns : |
transfer full) (element-type Gst.DiscovererStreamInfo. transfer full. element-type Gst.DiscovererStreamInfo. |
Since 0.10.31
const gchar * gst_discoverer_subtitle_info_get_language (const GstDiscovererSubtitleInfo *info);
|
a GstDiscovererSubtitleInfo |
Returns : |
the language of the stream, or NULL if unknown. |
Since 0.10.36
guint gst_discoverer_video_info_get_bitrate (const GstDiscovererVideoInfo *info);
|
a GstDiscovererVideoInfo |
Returns : |
the average or nominal bitrate of the video stream in bits/second. |
Since 0.10.31
guint gst_discoverer_video_info_get_depth (const GstDiscovererVideoInfo *info);
|
a GstDiscovererVideoInfo |
Returns : |
the depth in bits of the video stream. |
Since 0.10.31
guint gst_discoverer_video_info_get_framerate_denom (const GstDiscovererVideoInfo *info);
|
a GstDiscovererVideoInfo |
Returns : |
the framerate of the video stream (denominator). |
Since 0.10.31
guint gst_discoverer_video_info_get_framerate_num (const GstDiscovererVideoInfo *info);
|
a GstDiscovererVideoInfo |
Returns : |
the framerate of the video stream (numerator). |
Since 0.10.31
guint gst_discoverer_video_info_get_height (const GstDiscovererVideoInfo *info);
|
a GstDiscovererVideoInfo |
Returns : |
the height of the video stream in pixels. |
Since 0.10.31
gboolean gst_discoverer_video_info_is_interlaced (const GstDiscovererVideoInfo *info);
|
a GstDiscovererVideoInfo |
Returns : |
TRUE if the stream is interlaced, else FALSE .
|
Since 0.10.31
gboolean gst_discoverer_video_info_is_image (const GstDiscovererVideoInfo *info);
|
a GstDiscovererVideoInfo |
Returns : |
TRUE if the video stream corresponds to an image (i.e. only contains one frame). |
Since 0.10.31
guint gst_discoverer_video_info_get_max_bitrate (const GstDiscovererVideoInfo *info);
|
a GstDiscovererVideoInfo |
Returns : |
the maximum bitrate of the video stream in bits/second. |
Since 0.10.31
guint gst_discoverer_video_info_get_par_denom (const GstDiscovererVideoInfo *info);
|
a GstDiscovererVideoInfo |
Returns : |
the Pixel Aspect Ratio (PAR) of the video stream (denominator). |
Since 0.10.31
guint gst_discoverer_video_info_get_par_num (const GstDiscovererVideoInfo *info);
|
a GstDiscovererVideoInfo |
Returns : |
the Pixel Aspect Ratio (PAR) of the video stream (numerator). |
Since 0.10.31
guint gst_discoverer_video_info_get_width (const GstDiscovererVideoInfo *info);
|
a GstDiscovererVideoInfo |
Returns : |
the width of the video stream in pixels. |
Since 0.10.31
"timeout"
property"timeout" guint64 : Read / Write / Construct
The duration (in nanoseconds) after which the discovery of an individual URI will timeout.
If the discovery of a URI times out, the GST_DISCOVERER_TIMEOUT
will be
set on the result flags.
Allowed values: [1000000000,3600000000000]
Default value: 15000000000
"discovered"
signalvoid user_function (GstDiscoverer *discoverer, GstDiscovererInfo *info, GError *error, gpointer user_data) : Run Last
Will be emitted when all information on a URI could be discovered.
|
the GstDiscoverer |
|
the results GstDiscovererInfo |
|
type GLib.Error. type GLib.Error. |
|
user data set when the signal handler was connected. |
"finished"
signalvoid user_function (GstDiscoverer *discoverer, gpointer user_data) : Run Last
Will be emitted when all pending URIs have been processed.
|
the GstDiscoverer |
|
user data set when the signal handler was connected. |
"starting"
signalvoid user_function (GstDiscoverer *discoverer, gpointer user_data) : Run Last
Will be emitted when the discover starts analyzing the pending URIs
|
the GstDiscoverer |
|
user data set when the signal handler was connected. |