rtsp media

a GstRTSPMedia contains the complete GStreamer pipeline to manage the streaming to the clients. The actual data transfer is done by the GstRTSPStream objects that are created and exposed by the GstRTSPMedia.

The GstRTSPMedia is usually created from a GstRTSPMediaFactory when the client does a DESCRIBE or SETUP of a resource.

A media is created with gst_rtsp_media_new that takes the element that will provide the streaming elements. For each of the streams, a new GstRTSPStream object needs to be made with the gst_rtsp_media_create_stream which takes the payloader element and the source pad that produces the RTP stream.

The pipeline of the media is set to PAUSED with gst_rtsp_media_prepare. The prepare method will add rtpbin and sinks and sources to send and receive RTP and RTCP packets from the clients. Each stream srcpad is connected to an input into the internal rtpbin.

It is also possible to dynamically create GstRTSPStream objects during the prepare phase. With gst_rtsp_media_get_status you can check the status of the prepare phase.

After the media is prepared, it is ready for streaming. It will usually be managed in a session with gst_rtsp_session_manage_media. See GstRTSPSession and GstRTSPSessionMedia.

The state of the media can be controlled with gst_rtsp_media_set_state (). Seeking can be done with gst_rtsp_media_seek, or gst_rtsp_media_seek_full or gst_rtsp_media_seek_trickmode for finer control of the seek.

With gst_rtsp_media_unprepare the pipeline is stopped and shut down. When gst_rtsp_media_set_eos_shutdown an EOS will be sent to the pipeline to cleanly shut down.

With gst_rtsp_media_set_shared, the media can be shared between multiple clients. With gst_rtsp_media_set_reusable you can control if the pipeline can be prepared again after an unprepare.

Last reviewed on 2013-07-11 (1.0.0)

GstRTSPMedia

GObject
    ╰──GstRTSPMedia
        ╰──GstRTSPOnvifMedia

A class that contains the GStreamer element along with a list of GstRTSPStream objects that can produce data.

This object is usually created from a GstRTSPMediaFactory.

Members

parent (GObject) –
No description available

Class structure

GstRTSPMediaClass

The RTSP media class

Fields
parent_class (GObjectClass) –
No description available

Constructors

gst_rtsp_media_new

GstRTSPMedia *
gst_rtsp_media_new (GstElement * element)

Create a new GstRTSPMedia instance. element is the bin element that provides the different streams. The GstRTSPMedia object contains the element to produce RTP data for one or more related (audio/video/..) streams.

Ownership is taken of element.

Parameters:

element ( [transfer: full])

a GstElement

Returns ( [transfer: full])

a new GstRTSPMedia object.


Methods

gst_rtsp_media_can_be_shared

gboolean
gst_rtsp_media_can_be_shared (GstRTSPMedia * media)

Check if the pipeline for media can be shared between multiple clients.

This checks if the media is shareable and whether it is either reusable or was never unprepared before.

The function must be called with gst_rtsp_media_lock.

Parameters:

media

a GstRTSPMedia

Returns

TRUE if the media can be shared between clients.

Since : 1.24


gst_rtsp_media_collect_streams

gst_rtsp_media_collect_streams (GstRTSPMedia * media)

Find all payloader elements, they should be named pay%d in the element of media, and create GstRTSPStream for them.

Collect all dynamic elements, named dynpay%d, and add them to the list of dynamic elements.

Find all depayloader elements, they should be named depay%d in the element of media, and create GstRTSPStream for them.

Parameters:

media

a GstRTSPMedia


gst_rtsp_media_complete_pipeline

gboolean
gst_rtsp_media_complete_pipeline (GstRTSPMedia * media,
                                  GPtrArray * transports)

Add a receiver and sender parts to the pipeline based on the transport from SETUP.

Parameters:

media

a GstRTSPMedia

transports ( [element-typeGstRTSPTransport])

a list of GstRTSPTransport

Returns

TRUE if the media pipeline has been sucessfully updated.

Since : 1.14


gst_rtsp_media_create_stream

GstRTSPStream *
gst_rtsp_media_create_stream (GstRTSPMedia * media,
                              GstElement * payloader,
                              GstPad * pad)

Create a new stream in media that provides RTP data on pad. pad should be a pad of an element inside media->element.

Parameters:

media

a GstRTSPMedia

payloader

a GstElement

pad

a GstPad

Returns ( [transfer: none])

a new GstRTSPStream that remains valid for as long as media exists.


gst_rtsp_media_find_stream

GstRTSPStream *
gst_rtsp_media_find_stream (GstRTSPMedia * media,
                            const gchar * control)

Find a stream in media with control as the control uri.

Parameters:

media

a GstRTSPMedia

control

the control of the stream

Returns ( [nullable][transfer: none])

the GstRTSPStream with control uri control or NULL when a stream with that control did not exist.


gst_rtsp_media_get_address_pool

GstRTSPAddressPool *
gst_rtsp_media_get_address_pool (GstRTSPMedia * media)

Get the GstRTSPAddressPool used as the address pool of media.

Parameters:

media

a GstRTSPMedia

Returns ( [transfer: full][nullable])

the GstRTSPAddressPool of media. g_object_unref after usage.


gst_rtsp_media_get_base_time

GstClockTime
gst_rtsp_media_get_base_time (GstRTSPMedia * media)

Get the base_time that is used by the pipeline in media.

media must be prepared before this method returns a valid base_time.

Parameters:

media

a GstRTSPMedia

Returns

the base_time used by media.


gst_rtsp_media_get_buffer_size

guint
gst_rtsp_media_get_buffer_size (GstRTSPMedia * media)

Get the kernel UDP buffer size.

Parameters:

media

a GstRTSPMedia

Returns

the kernel UDP buffer size.


gst_rtsp_media_get_clock

GstClock *
gst_rtsp_media_get_clock (GstRTSPMedia * media)

Get the clock that is used by the pipeline in media.

media must be prepared before this method returns a valid clock object.

Parameters:

media

a GstRTSPMedia

Returns ( [transfer: full][nullable])

the GstClock used by media. unref after usage.


gst_rtsp_media_get_do_retransmission

gboolean
gst_rtsp_media_get_do_retransmission (GstRTSPMedia * media)

Parameters:

media
No description available
Returns

Whether retransmission requests will be sent

Since : 1.16


gst_rtsp_media_get_dscp_qos

gint
gst_rtsp_media_get_dscp_qos (GstRTSPMedia * media)

Get the configured DSCP QoS of attached media.

Parameters:

media

a GstRTSPMedia

Returns

the DSCP QoS value of attached streams or -1 if disabled.

Since : 1.18


gst_rtsp_media_get_element

GstElement *
gst_rtsp_media_get_element (GstRTSPMedia * media)

Get the element that was used when constructing media.

Parameters:

media

a GstRTSPMedia

Returns ( [transfer: full])

a GstElement. Unref after usage.


gst_rtsp_media_get_ensure_keyunit_on_start

gboolean
gst_rtsp_media_get_ensure_keyunit_on_start (GstRTSPMedia * media)

Get ensure-keyunit-on-start flag.

Parameters:

media

a GstRTSPMedia

Returns

The ensure-keyunit-on-start flag.

Since : 1.24


gst_rtsp_media_get_ensure_keyunit_on_start_timeout

guint
gst_rtsp_media_get_ensure_keyunit_on_start_timeout (GstRTSPMedia * media)

Get ensure-keyunit-on-start-timeout time.

Parameters:

media

a GstRTSPMedia

Returns

The ensure-keyunit-on-start-timeout time.

Since : 1.24


gst_rtsp_media_get_latency

guint
gst_rtsp_media_get_latency (GstRTSPMedia * media)

Get the latency that is used for receiving media.

Parameters:

media

a GstRTSPMedia

Returns

latency in milliseconds


gst_rtsp_media_get_max_mcast_ttl

guint
gst_rtsp_media_get_max_mcast_ttl (GstRTSPMedia * media)

Get the the maximum time-to-live value of outgoing multicast packets.

Parameters:

media

a GstRTSPMedia

Returns

the maximum time-to-live value of outgoing multicast packets.

Since : 1.16


gst_rtsp_media_get_multicast_iface

gchar *
gst_rtsp_media_get_multicast_iface (GstRTSPMedia * media)

Get the multicast interface used for media.

Parameters:

media

a GstRTSPMedia

Returns ( [transfer: full][nullable])

the multicast interface for media. g_free after usage.


gst_rtsp_media_get_permissions

GstRTSPPermissions *
gst_rtsp_media_get_permissions (GstRTSPMedia * media)

Get the permissions object from media.

Parameters:

media

a GstRTSPMedia

Returns ( [transfer: full][nullable])

a GstRTSPPermissions object, unref after usage.


gst_rtsp_media_get_profiles

GstRTSPProfile
gst_rtsp_media_get_profiles (GstRTSPMedia * media)

Get the allowed profiles of media.

Parameters:

media

a GstRTSPMedia

Returns

a GstRTSPProfile


gst_rtsp_media_get_protocols

GstRTSPLowerTrans
gst_rtsp_media_get_protocols (GstRTSPMedia * media)

Get the allowed protocols of media.

Parameters:

media

a GstRTSPMedia

Returns

a GstRTSPLowerTrans


gst_rtsp_media_get_publish_clock_mode

GstRTSPPublishClockMode
gst_rtsp_media_get_publish_clock_mode (GstRTSPMedia * media)

Gets if and how the media clock should be published according to RFC7273.

Parameters:

media

a GstRTSPMedia

Returns

The GstRTSPPublishClockMode

Since : 1.8


gst_rtsp_media_get_range_string

gchar *
gst_rtsp_media_get_range_string (GstRTSPMedia * media,
                                 gboolean play,
                                 GstRTSPRangeUnit unit)

Get the current range as a string. media must be prepared with gst_rtsp_media_prepare ().

Parameters:

media

a GstRTSPMedia

play

for the PLAY request

unit

the unit to use for the string

Returns ( [transfer: full][nullable])

The range as a string, g_free after usage.


gst_rtsp_media_get_rate_control

gboolean
gst_rtsp_media_get_rate_control (GstRTSPMedia * media)

Parameters:

media
No description available
Returns

whether media will follow the Rate-Control=no behaviour as specified in the ONVIF replay spec.

Since : 1.18


gst_rtsp_media_get_rates

gboolean
gst_rtsp_media_get_rates (GstRTSPMedia * media,
                          gdouble * rate,
                          gdouble * applied_rate)

Get the rate and applied_rate of the current segment.

Parameters:

media

a GstRTSPMedia

rate ( [optional][out])

the rate of the current segment

applied_rate ( [optional][out])

the applied_rate of the current segment

Returns

FALSE if looking up the rate and applied rate failed. Otherwise TRUE is returned and rate and applied_rate are set to the rate and applied_rate of the current segment.

Since : 1.18


gst_rtsp_media_get_retransmission_time

GstClockTime
gst_rtsp_media_get_retransmission_time (GstRTSPMedia * media)

Get the amount of time to store retransmission data.

Parameters:

media

a GstRTSPMedia

Returns

the amount of time to store retransmission data.


gst_rtsp_media_get_status

GstRTSPMediaStatus
gst_rtsp_media_get_status (GstRTSPMedia * media)

Get the status of media. When media is busy preparing, this function waits until media is prepared or in error.

Parameters:

media

a GstRTSPMedia

Returns

the status of media.


gst_rtsp_media_get_stream

GstRTSPStream *
gst_rtsp_media_get_stream (GstRTSPMedia * media,
                           guint idx)

Retrieve the stream with index idx from media.

Parameters:

media

a GstRTSPMedia

idx

the stream index

Returns ( [nullable][transfer: none])

the GstRTSPStream at index idx or NULL when a stream with that index did not exist.


gst_rtsp_media_get_suspend_mode

GstRTSPSuspendMode
gst_rtsp_media_get_suspend_mode (GstRTSPMedia * media)

Get how media will be suspended.

Parameters:

media

a GstRTSPMedia

Returns

GstRTSPSuspendMode.


gst_rtsp_media_get_time_provider

GstNetTimeProvider *
gst_rtsp_media_get_time_provider (GstRTSPMedia * media,
                                  const gchar * address,
                                  guint16 port)

Get the GstNetTimeProvider for the clock used by media. The time provider will listen on address and port for client time requests.

Parameters:

media

a GstRTSPMedia

address ( [allow-none])

an address or NULL

port

a port or 0

Returns ( [transfer: full][nullable])

the GstNetTimeProvider of media.


gst_rtsp_media_get_transport_mode

GstRTSPTransportMode
gst_rtsp_media_get_transport_mode (GstRTSPMedia * media)

Check if the pipeline for media can be used for PLAY or RECORD methods.

Parameters:

media

a GstRTSPMedia

Returns

The transport mode.


gst_rtsp_media_handle_sdp

gboolean
gst_rtsp_media_handle_sdp (GstRTSPMedia * media,
                           GstSDPMessage * sdp)

Configure an SDP on media for receiving streams

Parameters:

media

a GstRTSPMedia

sdp ( [transfer: none])

a GstSDPMessage

Returns

TRUE on success.


gst_rtsp_media_has_completed_sender

gboolean
gst_rtsp_media_has_completed_sender (GstRTSPMedia * media)

See gst_rtsp_stream_is_complete, gst_rtsp_stream_is_sender.

Parameters:

media
No description available
Returns

whether media has at least one complete sender stream.

Since : 1.18


gst_rtsp_media_is_bind_mcast_address

gboolean
gst_rtsp_media_is_bind_mcast_address (GstRTSPMedia * media)

Check if multicast sockets are configured to be bound to multicast addresses.

Parameters:

media

a GstRTSPMedia

Returns

TRUE if multicast sockets are configured to be bound to multicast addresses.

Since : 1.16


gst_rtsp_media_is_eos_shutdown

gboolean
gst_rtsp_media_is_eos_shutdown (GstRTSPMedia * media)

Check if the pipeline for media will send an EOS down the pipeline before unpreparing.

Parameters:

media

a GstRTSPMedia

Returns

TRUE if the media will send EOS before unpreparing.


gst_rtsp_media_is_receive_only

gboolean
gst_rtsp_media_is_receive_only (GstRTSPMedia * media)

Parameters:

media
No description available
Returns

TRUE if media is receive-only, FALSE otherwise.

Since : 1.18


gst_rtsp_media_is_reusable

gboolean
gst_rtsp_media_is_reusable (GstRTSPMedia * media)

Check if the pipeline for media can be reused after an unprepare.

Parameters:

media

a GstRTSPMedia

Returns

TRUE if the media can be reused


gst_rtsp_media_is_shared

gboolean
gst_rtsp_media_is_shared (GstRTSPMedia * media)

Check if the pipeline for media can be shared between multiple clients in theory. This simply returns the value set via gst_rtsp_media_set_shared.

To know if a media can be shared in practice, i.e. if it's shareable and either reusable or was never unprepared before, use gst_rtsp_media_can_be_shared.

Parameters:

media

a GstRTSPMedia

Returns

TRUE if the media can be shared between clients.


gst_rtsp_media_is_stop_on_disconnect

gboolean
gst_rtsp_media_is_stop_on_disconnect (GstRTSPMedia * media)

Check if the pipeline for media will be stopped when a client disconnects without sending TEARDOWN.

Parameters:

media

a GstRTSPMedia

Returns

TRUE if the media will be stopped when a client disconnects without sending TEARDOWN.


gst_rtsp_media_is_time_provider

gboolean
gst_rtsp_media_is_time_provider (GstRTSPMedia * media)

Check if media can provide a GstNetTimeProvider for its pipeline clock.

Use gst_rtsp_media_get_time_provider to get the network clock.

Parameters:

media

a GstRTSPMedia

Returns

TRUE if media can provide a GstNetTimeProvider.


gst_rtsp_media_lock

gst_rtsp_media_lock (GstRTSPMedia * media)

Lock the entire media. This is needed by callers such as rtsp_client to protect the media when it is shared by many clients. The lock prevents that concurrent clients alters the shared media, while one client already is working with it. Typically the lock is taken in external RTSP API calls that uses shared media such as DESCRIBE, SETUP, ANNOUNCE, TEARDOWN, PLAY, PAUSE.

As best practice take the lock as soon as the function get hold of a shared media object. Release the lock right before the function returns.

Parameters:

media

a GstRTSPMedia

Since : 1.18


gst_rtsp_media_n_streams

guint
gst_rtsp_media_n_streams (GstRTSPMedia * media)

Get the number of streams in this media.

Parameters:

media

a GstRTSPMedia

Returns

The number of streams.


gst_rtsp_media_prepare

gboolean
gst_rtsp_media_prepare (GstRTSPMedia * media,
                        GstRTSPThread * thread)

Prepare media for streaming. This function will create the objects to manage the streaming. A pipeline must have been set on media with gst_rtsp_media_take_pipeline.

It will preroll the pipeline and collect vital information about the streams such as the duration.

Parameters:

media

a GstRTSPMedia

thread ( [transfer: full][allow-none])

a GstRTSPThread to run the bus handler or NULL

Returns

TRUE on success.


gst_rtsp_media_seek

gboolean
gst_rtsp_media_seek (GstRTSPMedia * media,
                     GstRTSPTimeRange * range)

Seek the pipeline of media to range. media must be prepared with gst_rtsp_media_prepare.

Parameters:

media

a GstRTSPMedia

range ( [transfer: none])

a GstRTSPTimeRange

Returns

TRUE on success.


gst_rtsp_media_seek_full

gboolean
gst_rtsp_media_seek_full (GstRTSPMedia * media,
                          GstRTSPTimeRange * range,
                          GstSeekFlags flags)

Seek the pipeline of media to range with the given flags. media must be prepared with gst_rtsp_media_prepare.

Parameters:

media

a GstRTSPMedia

range ( [transfer: none])

a GstRTSPTimeRange

flags

The minimal set of GstSeekFlags to use

Returns

TRUE on success.

Since : 1.18


gst_rtsp_media_seek_trickmode

gboolean
gst_rtsp_media_seek_trickmode (GstRTSPMedia * media,
                               GstRTSPTimeRange * range,
                               GstSeekFlags flags,
                               gdouble rate,
                               GstClockTime trickmode_interval)

Seek the pipeline of media to range with the given flags and rate, and trickmode_interval. media must be prepared with gst_rtsp_media_prepare. In order to perform the seek operation, the pipeline must contain all needed transport parts (transport sinks).

Parameters:

media

a GstRTSPMedia

range ( [transfer: none])

a GstRTSPTimeRange

flags

The minimal set of GstSeekFlags to use

rate

the rate to use in the seek

trickmode_interval

The trickmode interval to use for KEY_UNITS trick mode

Returns

TRUE on success.

Since : 1.18


gst_rtsp_media_seekable

GstClockTimeDiff
gst_rtsp_media_seekable (GstRTSPMedia * media)

Check if the pipeline for media seek and up to what point in time, it can seek.

Parameters:

media

a GstRTSPMedia

Returns

-1 if the stream is not seekable, 0 if seekable only to the beginning and > 0 to indicate the longest duration between any two random access points. G_MAXINT64 means any value is possible.

Since : 1.14


gst_rtsp_media_set_address_pool

gst_rtsp_media_set_address_pool (GstRTSPMedia * media,
                                 GstRTSPAddressPool * pool)

configure pool to be used as the address pool of media.

Parameters:

media

a GstRTSPMedia

pool ( [transfer: none][nullable])

a GstRTSPAddressPool


gst_rtsp_media_set_bind_mcast_address

gst_rtsp_media_set_bind_mcast_address (GstRTSPMedia * media,
                                       gboolean bind_mcast_addr)

Decide whether the multicast socket should be bound to a multicast address or INADDR_ANY.

Parameters:

media

a GstRTSPMedia

bind_mcast_addr

the new value

Since : 1.16


gst_rtsp_media_set_buffer_size

gst_rtsp_media_set_buffer_size (GstRTSPMedia * media,
                                guint size)

Set the kernel UDP buffer size.

Parameters:

media

a GstRTSPMedia

size

the new value


gst_rtsp_media_set_clock

gst_rtsp_media_set_clock (GstRTSPMedia * media,
                          GstClock * clock)

Configure the clock used for the media.

Parameters:

media

a GstRTSPMedia

clock ( [nullable])

GstClock to be used


gst_rtsp_media_set_do_retransmission

gst_rtsp_media_set_do_retransmission (GstRTSPMedia * media,
                                      gboolean do_retransmission)

Set whether retransmission requests will be sent

Parameters:

media
No description available
do_retransmission
No description available

Since : 1.16


gst_rtsp_media_set_dscp_qos

gst_rtsp_media_set_dscp_qos (GstRTSPMedia * media,
                             gint dscp_qos)

Configure the dscp qos of attached streams to dscp_qos.

Parameters:

media

a GstRTSPMedia

dscp_qos

a new dscp qos value (0-63, or -1 to disable)

Since : 1.18


gst_rtsp_media_set_ensure_keyunit_on_start

gst_rtsp_media_set_ensure_keyunit_on_start (GstRTSPMedia * media,
                                            gboolean ensure_keyunit_on_start)

Set whether or not a keyunit should be ensured when a client connects. It will also configure the streams to drop delta units to ensure that they start on a keyunit.

Note that this will only affect non-shared medias for now.

Parameters:

media

a GstRTSPMedia

ensure_keyunit_on_start

the new value

Since : 1.24


gst_rtsp_media_set_ensure_keyunit_on_start_timeout

gst_rtsp_media_set_ensure_keyunit_on_start_timeout (GstRTSPMedia * media,
                                                    guint timeout)

Sets the maximum allowed time before the first keyunit is considered expired.

Note that this will only have an effect when ensure-keyunit-on-start is enabled.

Parameters:

media

a GstRTSPMedia

timeout

the new value

Since : 1.24


gst_rtsp_media_set_eos_shutdown

gst_rtsp_media_set_eos_shutdown (GstRTSPMedia * media,
                                 gboolean eos_shutdown)

Set or unset if an EOS event will be sent to the pipeline for media before it is unprepared.

Parameters:

media

a GstRTSPMedia

eos_shutdown

the new value


gst_rtsp_media_set_latency

gst_rtsp_media_set_latency (GstRTSPMedia * media,
                            guint latency)

Configure the latency used for receiving media.

Parameters:

media

a GstRTSPMedia

latency

latency in milliseconds


gst_rtsp_media_set_max_mcast_ttl

gboolean
gst_rtsp_media_set_max_mcast_ttl (GstRTSPMedia * media,
                                  guint ttl)

Set the maximum time-to-live value of outgoing multicast packets.

Parameters:

media

a GstRTSPMedia

ttl

the new multicast ttl value

Returns

TRUE if the requested ttl has been set successfully.

Since : 1.16


gst_rtsp_media_set_multicast_iface

gst_rtsp_media_set_multicast_iface (GstRTSPMedia * media,
                                    const gchar * multicast_iface)

configure multicast_iface to be used for media.

Parameters:

media

a GstRTSPMedia

multicast_iface ( [transfer: none][nullable])

a multicast interface name


gst_rtsp_media_set_permissions

gst_rtsp_media_set_permissions (GstRTSPMedia * media,
                                GstRTSPPermissions * permissions)

Set permissions on media.

Parameters:

media

a GstRTSPMedia

permissions ( [transfer: none][nullable])

a GstRTSPPermissions


gst_rtsp_media_set_pipeline_state

gst_rtsp_media_set_pipeline_state (GstRTSPMedia * media,
                                   GstState state)

Set the state of the pipeline managed by media to state

Parameters:

media

a GstRTSPMedia

state

the target state of the pipeline


gst_rtsp_media_set_profiles

gst_rtsp_media_set_profiles (GstRTSPMedia * media,
                             GstRTSPProfile profiles)

Configure the allowed lower transport for media.

Parameters:

media

a GstRTSPMedia

profiles

the new flags


gst_rtsp_media_set_protocols

gst_rtsp_media_set_protocols (GstRTSPMedia * media,
                              GstRTSPLowerTrans protocols)

Configure the allowed lower transport for media.

Parameters:

media

a GstRTSPMedia

protocols

the new flags


gst_rtsp_media_set_publish_clock_mode

gst_rtsp_media_set_publish_clock_mode (GstRTSPMedia * media,
                                       GstRTSPPublishClockMode mode)

Sets if and how the media clock should be published according to RFC7273.

Parameters:

media

a GstRTSPMedia

mode

the clock publish mode

Since : 1.8


gst_rtsp_media_set_rate_control

gst_rtsp_media_set_rate_control (GstRTSPMedia * media,
                                 gboolean enabled)

Define whether media will follow the Rate-Control=no behaviour as specified in the ONVIF replay spec.

Parameters:

media
No description available
enabled
No description available

Since : 1.18


gst_rtsp_media_set_retransmission_time

gst_rtsp_media_set_retransmission_time (GstRTSPMedia * media,
                                        GstClockTime time)

Set the amount of time to store retransmission packets.

Parameters:

media

a GstRTSPMedia

time

the new value


gst_rtsp_media_set_reusable

gst_rtsp_media_set_reusable (GstRTSPMedia * media,
                             gboolean reusable)

Set or unset if the pipeline for media can be reused after the pipeline has been unprepared.

Parameters:

media

a GstRTSPMedia

reusable

the new value


gst_rtsp_media_set_shared

gst_rtsp_media_set_shared (GstRTSPMedia * media,
                           gboolean shared)

Set or unset if the pipeline for media can be shared will multiple clients. When shared is TRUE, client requests for this media will share the media pipeline.

Parameters:

media

a GstRTSPMedia

shared

the new value


gst_rtsp_media_set_state

gboolean
gst_rtsp_media_set_state (GstRTSPMedia * media,
                          GstState state,
                          GPtrArray * transports)

Set the state of media to state and for the transports in transports.

media must be prepared with gst_rtsp_media_prepare;

Parameters:

media

a GstRTSPMedia

state

the target state of the media

transports

(transfer none) (element-type GstRtspServer.RTSPStreamTransport): a GPtrArray of GstRTSPStreamTransport pointers

Returns

TRUE on success.


gst_rtsp_media_set_stop_on_disconnect

gst_rtsp_media_set_stop_on_disconnect (GstRTSPMedia * media,
                                       gboolean stop_on_disconnect)

Set or unset if the pipeline for media should be stopped when a client disconnects without sending TEARDOWN.

Parameters:

media

a GstRTSPMedia

stop_on_disconnect

the new value


gst_rtsp_media_set_suspend_mode

gst_rtsp_media_set_suspend_mode (GstRTSPMedia * media,
                                 GstRTSPSuspendMode mode)

Control how media will be suspended after the SDP has been generated and after a PAUSE request has been performed.

Media must be unprepared when setting the suspend mode.

Parameters:

media

a GstRTSPMedia

mode

the new GstRTSPSuspendMode


gst_rtsp_media_set_transport_mode

gst_rtsp_media_set_transport_mode (GstRTSPMedia * media,
                                   GstRTSPTransportMode mode)

Sets if the media pipeline can work in PLAY or RECORD mode

Parameters:

media

a GstRTSPMedia

mode

the new value


gst_rtsp_media_setup_sdp

gboolean
gst_rtsp_media_setup_sdp (GstRTSPMedia * media,
                          GstSDPMessage * sdp,
                          GstSDPInfo * info)

Add media specific info to sdp. info is used to configure the connection information in the SDP.

Parameters:

media

a GstRTSPMedia

sdp ( [transfer: none])

a GstSDPMessage

info ( [transfer: none])

a GstSDPInfo

Returns

TRUE on success.


gst_rtsp_media_suspend

gboolean
gst_rtsp_media_suspend (GstRTSPMedia * media)

Suspend media. The state of the pipeline managed by media is set to GST_STATE_NULL but all streams are kept. media can be prepared again with gst_rtsp_media_unsuspend

media must be prepared with gst_rtsp_media_prepare;

Parameters:

media

a GstRTSPMedia

Returns

TRUE on success.


gst_rtsp_media_take_pipeline

gst_rtsp_media_take_pipeline (GstRTSPMedia * media,
                              GstPipeline * pipeline)

Set pipeline as the GstPipeline for media. Ownership is taken of pipeline.

Parameters:

media

a GstRTSPMedia

pipeline ( [transfer: floating])

a GstPipeline


gst_rtsp_media_unlock

gst_rtsp_media_unlock (GstRTSPMedia * media)

Unlock the media.

Parameters:

media

a GstRTSPMedia

Since : 1.18


gst_rtsp_media_unprepare

gboolean
gst_rtsp_media_unprepare (GstRTSPMedia * media)

Unprepare media. After this call, the media should be prepared again before it can be used again. If the media is set to be non-reusable, a new instance must be created.

Parameters:

media

a GstRTSPMedia

Returns

TRUE on success.


gst_rtsp_media_unsuspend

gboolean
gst_rtsp_media_unsuspend (GstRTSPMedia * media)

Unsuspend media if it was in a suspended state. This method does nothing when the media was not in the suspended state.

Parameters:

media

a GstRTSPMedia

Returns

TRUE on success.


gst_rtsp_media_use_time_provider

gst_rtsp_media_use_time_provider (GstRTSPMedia * media,
                                  gboolean time_provider)

Set media to provide a GstNetTimeProvider.

Parameters:

media

a GstRTSPMedia

time_provider

if a GstNetTimeProvider should be used


Signals

handle-message

gboolean
handle_message_callback (GstRTSPMedia * self,
                         GstMessage * message,
                         gpointer user_data)

Will be emitted when a message appears on the pipeline bus.

Parameters:

self
No description available
message

a GstMessage

user_data
No description available
Returns

a gboolean indicating if the call was successful or not.

Flags: Run Last

Since : 1.22


new-state

new_state_callback (GstRTSPMedia * self,
                    gint object,
                    gpointer user_data)

Parameters:

self
No description available
object
No description available
user_data
No description available

Flags: Run Last


new-stream

new_stream_callback (GstRTSPMedia * self,
                     GstRTSPStream * object,
                     gpointer user_data)

Parameters:

self
No description available
object
No description available
user_data
No description available

Flags: Run Last


prepared

prepared_callback (GstRTSPMedia * self,
                   gpointer user_data)

Parameters:

self
No description available
user_data
No description available

Flags: Run Last


removed-stream

removed_stream_callback (GstRTSPMedia * self,
                         GstRTSPStream * object,
                         gpointer user_data)

Parameters:

self
No description available
object
No description available
user_data
No description available

Flags: Run Last


target-state

target_state_callback (GstRTSPMedia * self,
                       gint object,
                       gpointer user_data)

Parameters:

self
No description available
object
No description available
user_data
No description available

Flags: Run Last


unprepared

unprepared_callback (GstRTSPMedia * self,
                     gpointer user_data)

Parameters:

self
No description available
user_data
No description available

Flags: Run Last


Properties

bind-mcast-address

“bind-mcast-address” gboolean

Flags : Read / Write


buffer-size

“buffer-size” guint

Flags : Read / Write


clock

“clock” GstClock *

Flags : Read / Write


dscp-qos

“dscp-qos” gint

Flags : Read / Write


element

“element” GstElement *

Flags : Read / Write / Construct Only


ensure-keyunit-on-start

“ensure-keyunit-on-start” gboolean

Whether or not a keyunit should be ensured when a client connects. It will also configure the streams to drop delta units to ensure that they start on a keyunit.

Note that this will only affect non-shared medias for now.

Flags : Read / Write

Since : 1.24


ensure-keyunit-on-start-timeout

“ensure-keyunit-on-start-timeout” guint

The maximum allowed time before the first keyunit is considered expired.

Note that this will only have an effect when ensure-keyunit-on-start is enabled.

Flags : Read / Write

Since : 1.24


eos-shutdown

“eos-shutdown” gboolean

Flags : Read / Write


latency

“latency” guint

Flags : Read / Write


max-mcast-ttl

“max-mcast-ttl” guint

Flags : Read / Write


profiles

“profiles” GstRTSPProfile *

Flags : Read / Write


protocols

“protocols” GstRTSPLowerTrans *

Flags : Read / Write


reusable

“reusable” gboolean

Flags : Read / Write


shared

“shared” gboolean

Flags : Read / Write


stop-on-disconnect

“stop-on-disconnect” gboolean

Flags : Read / Write


suspend-mode

“suspend-mode” GstRTSPSuspendMode *

Flags : Read / Write


time-provider

“time-provider” gboolean

Flags : Read / Write


transport-mode

“transport-mode” GstRTSPTransportMode *

Flags : Read / Write


Virtual Methods

convert_range

gboolean
convert_range (GstRTSPMedia * media,
               GstRTSPTimeRange * range,
               GstRTSPRangeUnit unit)

convert a range to the given unit

Parameters:

media
No description available
range
No description available
unit
No description available
Returns
No description available

create_rtpbin

GstElement *
create_rtpbin (GstRTSPMedia * media)

Parameters:

media
No description available
Returns
No description available

handle_message

gboolean
handle_message (GstRTSPMedia * media,
                GstMessage * message)

handle a message

Parameters:

media
No description available
message
No description available
Returns
No description available

handle_sdp

gboolean
handle_sdp (GstRTSPMedia * media,
            GstSDPMessage * sdp)

Parameters:

media
No description available
sdp
No description available
Returns
No description available

new_state

new_state (GstRTSPMedia * media,
           GstState state)

Parameters:

media
No description available
state
No description available

new_stream

new_stream (GstRTSPMedia * media,
            GstRTSPStream * stream)

Parameters:

media
No description available
stream
No description available

prepare

gboolean
prepare (GstRTSPMedia * media,
         GstRTSPThread * thread)

the default implementation adds all elements and sets the pipeline's state to GST_STATE_PAUSED (or GST_STATE_PLAYING in case of NO_PREROLL elements).

Parameters:

media
No description available
thread
No description available
Returns
No description available

prepared

prepared (GstRTSPMedia * media)

Parameters:

media
No description available

query_position

gboolean
query_position (GstRTSPMedia * media,
                gint64 * position)

query the current position in the pipeline

Parameters:

media
No description available
position
No description available
Returns
No description available

query_stop

gboolean
query_stop (GstRTSPMedia * media,
            gint64 * stop)

query when playback will stop

Parameters:

media
No description available
stop
No description available
Returns
No description available

removed_stream

removed_stream (GstRTSPMedia * media,
                GstRTSPStream * stream)

Parameters:

media
No description available
stream
No description available

setup_rtpbin

gboolean
setup_rtpbin (GstRTSPMedia * media,
              GstElement * rtpbin)

Parameters:

media
No description available
rtpbin
No description available
Returns
No description available

setup_sdp

gboolean
setup_sdp (GstRTSPMedia * media,
           GstSDPMessage * sdp,
           GstSDPInfo * info)

Parameters:

media
No description available
sdp
No description available
info
No description available
Returns
No description available

suspend

gboolean
suspend (GstRTSPMedia * media)

the default implementation sets the pipeline's state to GST_STATE_NULL GST_STATE_PAUSED depending on the selected suspend mode.

Parameters:

media
No description available
Returns
No description available

target_state

target_state (GstRTSPMedia * media,
              GstState state)

Parameters:

media
No description available
state
No description available

unprepare

gboolean
unprepare (GstRTSPMedia * media)

the default implementation sets the pipeline's state to GST_STATE_NULL and removes all elements.

Parameters:

media
No description available
Returns
No description available

unprepared

unprepared (GstRTSPMedia * media)

Parameters:

media
No description available

unsuspend

gboolean
unsuspend (GstRTSPMedia * media)

the default implementation reverts the suspend operation. The pipeline will be prerolled again if it's state was set to GST_STATE_NULL in suspend.

Parameters:

media
No description available
Returns
No description available

Function Macros

GST_RTSP_MEDIA_CAST

#define GST_RTSP_MEDIA_CAST(obj)         ((GstRTSPMedia*)(obj))

GST_RTSP_MEDIA_CLASS_CAST

#define GST_RTSP_MEDIA_CLASS_CAST(klass) ((GstRTSPMediaClass*)(klass))

Enumerations

GstRTSPMediaStatus

The state of the media pipeline.

Members
GST_RTSP_MEDIA_STATUS_UNPREPARED (0) –

media pipeline not prerolled

GST_RTSP_MEDIA_STATUS_UNPREPARING (1) –

media pipeline is busy doing a clean shutdown.

GST_RTSP_MEDIA_STATUS_PREPARING (2) –

media pipeline is prerolling

GST_RTSP_MEDIA_STATUS_PREPARED (3) –

media pipeline is prerolled

GST_RTSP_MEDIA_STATUS_SUSPENDED (4) –

media is suspended

GST_RTSP_MEDIA_STATUS_ERROR (5) –

media pipeline is in error


GstRTSPPublishClockMode

Whether the clock and possibly RTP/clock offset should be published according to RFC7273.

Members
GST_RTSP_PUBLISH_CLOCK_MODE_NONE (0) –

Publish nothing

GST_RTSP_PUBLISH_CLOCK_MODE_CLOCK (1) –

Publish the clock but not the offset

GST_RTSP_PUBLISH_CLOCK_MODE_CLOCK_AND_OFFSET (2) –

Publish the clock and offset


GstRTSPSuspendMode

The suspend mode of the media pipeline. A media pipeline is suspended right after creating the SDP and when the client performs a PAUSED request.

Members
GST_RTSP_SUSPEND_MODE_NONE (0) –

Media is not suspended

GST_RTSP_SUSPEND_MODE_PAUSE (1) –

Media is PAUSED in suspend

GST_RTSP_SUSPEND_MODE_RESET (2) –

The media is set to NULL when suspended


GstRTSPTransportMode

The supported modes of the media.

Members
GST_RTSP_TRANSPORT_MODE_PLAY (1) –

Transport supports PLAY mode

GST_RTSP_TRANSPORT_MODE_RECORD (2) –

Transport supports RECORD mode


The results of the search are