![]() |
![]() |
![]() |
GStreamer RTSP Server Reference Manual | ![]() |
---|---|---|---|---|
Top | Description | Object Hierarchy | Properties | Signals |
struct GstRTSPMediaFactory; struct GstRTSPMediaFactoryClass; GstRTSPMediaFactory * gst_rtsp_media_factory_new (void
); gchar * gst_rtsp_media_factory_get_launch (GstRTSPMediaFactory *factory
); void gst_rtsp_media_factory_set_launch (GstRTSPMediaFactory *factory
,const gchar *launch
); GstRTSPPermissions * gst_rtsp_media_factory_get_permissions (GstRTSPMediaFactory *factory
); void gst_rtsp_media_factory_set_permissions (GstRTSPMediaFactory *factory
,GstRTSPPermissions *permissions
); void gst_rtsp_media_factory_add_role (GstRTSPMediaFactory *factory
,const gchar *role
,const gchar *fieldname
,...
); void gst_rtsp_media_factory_set_shared (GstRTSPMediaFactory *factory
,gboolean shared
); gboolean gst_rtsp_media_factory_is_shared (GstRTSPMediaFactory *factory
); gboolean gst_rtsp_media_factory_is_eos_shutdown (GstRTSPMediaFactory *factory
); void gst_rtsp_media_factory_set_eos_shutdown (GstRTSPMediaFactory *factory
,gboolean eos_shutdown
); GstRTSPLowerTrans gst_rtsp_media_factory_get_protocols (GstRTSPMediaFactory *factory
); void gst_rtsp_media_factory_set_protocols (GstRTSPMediaFactory *factory
,GstRTSPLowerTrans protocols
); void gst_rtsp_media_factory_set_profiles (GstRTSPMediaFactory *factory
,GstRTSPProfile profiles
); GstRTSPProfile gst_rtsp_media_factory_get_profiles (GstRTSPMediaFactory *factory
); GstRTSPAddressPool * gst_rtsp_media_factory_get_address_pool (GstRTSPMediaFactory *factory
); void gst_rtsp_media_factory_set_address_pool (GstRTSPMediaFactory *factory
,GstRTSPAddressPool *pool
); guint gst_rtsp_media_factory_get_buffer_size (GstRTSPMediaFactory *factory
); void gst_rtsp_media_factory_set_buffer_size (GstRTSPMediaFactory *factory
,guint size
); GstRTSPSuspendMode gst_rtsp_media_factory_get_suspend_mode (GstRTSPMediaFactory *factory
); void gst_rtsp_media_factory_set_suspend_mode (GstRTSPMediaFactory *factory
,GstRTSPSuspendMode mode
); GstRTSPMedia * gst_rtsp_media_factory_construct (GstRTSPMediaFactory *factory
,const GstRTSPUrl *url
); GstElement * gst_rtsp_media_factory_create_element (GstRTSPMediaFactory *factory
,const GstRTSPUrl *url
);
"buffer-size" guint : Read / Write "eos-shutdown" gboolean : Read / Write "launch" gchar* : Read / Write "profiles" GstRTSPProfile : Read / Write "protocols" GstRTSPLowerTrans : Read / Write "shared" gboolean : Read / Write "suspend-mode" GstRTSPSuspendMode : Read / Write
The GstRTSPMediaFactory is responsible for creating or recycling GstRTSPMedia objects based on the passed URL.
The default implementation of the object can create GstRTSPMedia objects
containing a pipeline created from a launch description set with
gst_rtsp_media_factory_set_launch()
.
Media from a factory can be shared by setting the shared flag with
gst_rtsp_media_factory_set_shared()
. When a factory is shared,
gst_rtsp_media_factory_construct()
will return the same GstRTSPMedia when
the url matches.
Last reviewed on 2013-07-11 (1.0.0)
struct GstRTSPMediaFactory;
The definition and logic for constructing the pipeline for a media. The media can contain multiple streams like audio and video.
struct GstRTSPMediaFactoryClass { GObjectClass parent_class; gchar * (*gen_key) (GstRTSPMediaFactory *factory, const GstRTSPUrl *url); GstElement * (*create_element) (GstRTSPMediaFactory *factory, const GstRTSPUrl *url); GstRTSPMedia * (*construct) (GstRTSPMediaFactory *factory, const GstRTSPUrl *url); GstElement * (*create_pipeline) (GstRTSPMediaFactory *factory, GstRTSPMedia *media); void (*configure) (GstRTSPMediaFactory *factory, GstRTSPMedia *media); /* signals */ void (*media_constructed) (GstRTSPMediaFactory *factory, GstRTSPMedia *media); void (*media_configure) (GstRTSPMediaFactory *factory, GstRTSPMedia *media); };
The GstRTSPMediaFactory class structure.
convert url to a key for caching shared GstRTSPMedia objects.
The default implementation of this function will use the complete URL
including the query parameters to return a key. |
|
Construct and return a GstElement that is a GstBin containing the elements to use for streaming the media. The bin should contain payloaders pay%d for each stream. The default implementation of this function returns the bin created from the launch parameter. | |
the vmethod that will be called when the factory has to create the
GstRTSPMedia for url . The default implementation of this
function calls create_element to retrieve an element and then looks for
pay%d to create the streams. |
|
create a new pipeline or re-use an existing one and
add the GstRTSPMedia's element created by construct to the pipeline. |
|
configure the media created with construct . The default
implementation will configure the 'shared' property of the media. |
|
signal emited when a media was constructed | |
signal emited when a media should be configured |
GstRTSPMediaFactory * gst_rtsp_media_factory_new (void
);
Create a new GstRTSPMediaFactory instance.
Returns : |
a new GstRTSPMediaFactory object. [transfer full] |
gchar * gst_rtsp_media_factory_get_launch (GstRTSPMediaFactory *factory
);
Get the gst_parse_launch()
pipeline description that will be used in the
default prepare vmethod.
|
a GstRTSPMediaFactory |
Returns : |
the configured launch description. g_free() after
usage. [transfer full]
|
void gst_rtsp_media_factory_set_launch (GstRTSPMediaFactory *factory
,const gchar *launch
);
The gst_parse_launch()
line to use for constructing the pipeline in the
default prepare vmethod.
The pipeline description should return a GstBin as the toplevel element which can be accomplished by enclosing the dscription with brackets '(' ')'.
The description should return a pipeline with payloaders named pay0, pay1, etc.. Each of the payloaders will result in a stream.
|
a GstRTSPMediaFactory |
|
the launch description |
GstRTSPPermissions * gst_rtsp_media_factory_get_permissions
(GstRTSPMediaFactory *factory
);
Get the permissions object from factory
.
|
a GstRTSPMediaFactory |
Returns : |
a GstRTSPPermissions object, unref after usage. [transfer full] |
void gst_rtsp_media_factory_set_permissions (GstRTSPMediaFactory *factory
,GstRTSPPermissions *permissions
);
Set permissions
on factory
.
|
a GstRTSPMediaFactory |
|
a GstRTSPPermissions. [transfer none] |
void gst_rtsp_media_factory_add_role (GstRTSPMediaFactory *factory
,const gchar *role
,const gchar *fieldname
,...
);
A convenience method to add role
with fieldname
and additional arguments to
the permissions of factory
. If factory
had no permissions, new permissions
will be created and the role will be added to it.
|
a GstRTSPMediaFactory |
|
a role |
|
the first field name |
|
additional arguments |
void gst_rtsp_media_factory_set_shared (GstRTSPMediaFactory *factory
,gboolean shared
);
Configure if media created from this factory can be shared between clients.
|
a GstRTSPMediaFactory |
|
the new value |
gboolean gst_rtsp_media_factory_is_shared (GstRTSPMediaFactory *factory
);
Get if media created from this factory can be shared between clients.
|
a GstRTSPMediaFactory |
Returns : |
TRUE if the media will be shared between clients. |
gboolean gst_rtsp_media_factory_is_eos_shutdown
(GstRTSPMediaFactory *factory
);
Get if media created from this factory will have an EOS event sent to the pipeline before shutdown.
|
a GstRTSPMediaFactory |
Returns : |
TRUE if the media will receive EOS before shutdown. |
void gst_rtsp_media_factory_set_eos_shutdown (GstRTSPMediaFactory *factory
,gboolean eos_shutdown
);
Configure if media created from this factory will have an EOS sent to the pipeline before shutdown.
|
a GstRTSPMediaFactory |
|
the new value |
GstRTSPLowerTrans gst_rtsp_media_factory_get_protocols
(GstRTSPMediaFactory *factory
);
Get the allowed protocols of factory
.
|
a GstRTSPMediaFactory |
Returns : |
a GstRTSPLowerTrans |
void gst_rtsp_media_factory_set_protocols (GstRTSPMediaFactory *factory
,GstRTSPLowerTrans protocols
);
Configure the allowed lower transport for factory
.
|
a GstRTSPMediaFactory |
|
the new flags |
void gst_rtsp_media_factory_set_profiles (GstRTSPMediaFactory *factory
,GstRTSPProfile profiles
);
Configure the allowed profiles for factory
.
|
a GstRTSPMediaFactory |
|
the new flags |
GstRTSPProfile gst_rtsp_media_factory_get_profiles (GstRTSPMediaFactory *factory
);
Get the allowed profiles of factory
.
|
a GstRTSPMediaFactory |
Returns : |
a GstRTSPProfile |
GstRTSPAddressPool * gst_rtsp_media_factory_get_address_pool
(GstRTSPMediaFactory *factory
);
Get the GstRTSPAddressPool used as the address pool of factory
.
|
a GstRTSPMediaFactory |
Returns : |
the GstRTSPAddressPool of factory . g_object_unref() after
usage. [transfer full]
|
void gst_rtsp_media_factory_set_address_pool (GstRTSPMediaFactory *factory
,GstRTSPAddressPool *pool
);
configure pool
to be used as the address pool of factory
.
|
a GstRTSPMediaFactory |
|
a GstRTSPAddressPool. [transfer none] |
guint gst_rtsp_media_factory_get_buffer_size
(GstRTSPMediaFactory *factory
);
Get the kernel UDP buffer size.
|
a GstRTSPMedia |
Returns : |
the kernel UDP buffer size. |
void gst_rtsp_media_factory_set_buffer_size (GstRTSPMediaFactory *factory
,guint size
);
Set the kernel UDP buffer size.
|
a GstRTSPMedia |
|
the new value |
GstRTSPSuspendMode gst_rtsp_media_factory_get_suspend_mode
(GstRTSPMediaFactory *factory
);
Get how media created from this factory will be suspended.
|
a GstRTSPMediaFactory |
Returns : |
a GstRTSPSuspendMode. |
void gst_rtsp_media_factory_set_suspend_mode (GstRTSPMediaFactory *factory
,GstRTSPSuspendMode mode
);
Configure how media created from this factory will be suspended.
|
a GstRTSPMediaFactory |
|
the new GstRTSPSuspendMode |
GstRTSPMedia * gst_rtsp_media_factory_construct (GstRTSPMediaFactory *factory
,const GstRTSPUrl *url
);
Construct the media object and create its streams. Implementations should create the needed gstreamer elements and add them to the result object. No state changes should be performed on them yet.
One or more GstRTSPStream objects should be created from the result
with gst_rtsp_media_create_stream()
.
After the media is constructed, it can be configured and then prepared
with gst_rtsp_media_prepare()
.
|
a GstRTSPMediaFactory |
|
the url used |
Returns : |
a new GstRTSPMedia if the media could be prepared. [transfer full] |
GstElement * gst_rtsp_media_factory_create_element (GstRTSPMediaFactory *factory
,const GstRTSPUrl *url
);
Construct and return a GstElement that is a GstBin containing the elements to use for streaming the media.
The bin should contain payloaders pay%d for each stream. The default implementation of this function returns the bin created from the launch parameter.
|
a GstRTSPMediaFactory |
|
the url used |
Returns : |
a new GstElement. [transfer floating] |
"buffer-size"
property "buffer-size" guint : Read / Write
The kernel UDP buffer size to use.
Default value: 524288
"eos-shutdown"
property "eos-shutdown" gboolean : Read / Write
Send EOS down the pipeline before shutting down.
Default value: FALSE
"launch"
property "launch" gchar* : Read / Write
A launch description of the pipeline.
Default value: NULL
"profiles"
property "profiles" GstRTSPProfile : Read / Write
Allowed transfer profiles.
Default value: GST_RTSP_PROFILE_AVP
"protocols"
property "protocols" GstRTSPLowerTrans : Read / Write
Allowed lower transport protocols.
Default value: GST_RTSP_LOWER_TRANS_UDP|GST_RTSP_LOWER_TRANS_UDP_MCAST|GST_RTSP_LOWER_TRANS_TCP
"shared"
property "shared" gboolean : Read / Write
If media from this factory is shared.
Default value: FALSE
"suspend-mode"
property"suspend-mode" GstRTSPSuspendMode : Read / Write
Control how media will be suspended.
Default value: GST_RTSP_SUSPEND_MODE_NONE
"media-configure"
signalvoid user_function (GstRTSPMediaFactory *gstrtspmediafactory,
GstRTSPMedia *arg1,
gpointer user_data) : Run Last
"media-constructed"
signalvoid user_function (GstRTSPMediaFactory *gstrtspmediafactory,
GstRTSPMedia *arg1,
gpointer user_data) : Run Last