GstRTSPMedia: GStreamer RTSP Server Reference Manual

## GstRTSPMedia GstRTSPMedia |

## Functions

GstRTSPMedia * | gst_rtsp_media_new ()
GstElement * | gst_rtsp_media_get_element ()
void | gst_rtsp_media_take_pipeline ()
void | gst_rtsp_media_set_permissions ()
GstRTSPPermissions * | gst_rtsp_media_get_permissions ()
void | gst_rtsp_media_set_shared ()
gboolean | gst_rtsp_media_is_shared ()
void | gst_rtsp_media_set_reusable ()
gboolean | gst_rtsp_media_is_reusable ()
void | gst_rtsp_media_set_profiles ()
GstRTSPProfile | gst_rtsp_media_get_profiles ()
void | gst_rtsp_media_set_protocols ()
GstRTSPLowerTrans | gst_rtsp_media_get_protocols ()
void | gst_rtsp_media_set_eos_shutdown ()
gboolean | gst_rtsp_media_is_eos_shutdown ()
void | gst_rtsp_media_set_address_pool ()
GstRTSPAddressPool * | gst_rtsp_media_get_address_pool ()
void | gst_rtsp_media_set_buffer_size ()
guint | gst_rtsp_media_get_buffer_size ()
void | gst_rtsp_media_set_retransmission_time ()
GstClockTime | gst_rtsp_media_get_retransmission_time ()
void | gst_rtsp_media_set_latency ()
guint | gst_rtsp_media_get_latency ()
gboolean | gst_rtsp_media_setup_sdp ()
gboolean | gst_rtsp_media_handle_sdp ()
gboolean | gst_rtsp_media_prepare ()
gboolean | gst_rtsp_media_unprepare ()
GstRTSPMediaStatus | gst_rtsp_media_get_status ()
void | gst_rtsp_media_set_suspend_mode ()
GstRTSPSuspendMode | gst_rtsp_media_get_suspend_mode ()
gboolean | gst_rtsp_media_suspend ()
gboolean | gst_rtsp_media_unsuspend ()
void | gst_rtsp_media_collect_streams ()
GstRTSPStream * | gst_rtsp_media_create_stream ()
guint | gst_rtsp_media_n_streams ()
GstRTSPStream * | gst_rtsp_media_get_stream ()
GstRTSPStream * | gst_rtsp_media_find_stream ()
gboolean | gst_rtsp_media_seek ()
gchar * | gst_rtsp_media_get_range_string ()
gboolean | gst_rtsp_media_set_state ()
void | gst_rtsp_media_set_pipeline_state ()
GstClock * | gst_rtsp_media_get_clock ()
GstClockTime | gst_rtsp_media_get_base_time ()
void | gst_rtsp_media_use_time_provider ()
gboolean | gst_rtsp_media_is_time_provider ()
GstNetTimeProvider * | gst_rtsp_media_get_time_provider ()

## Properties

guint | buffer-size | Read / Write
GstClock * | clock | Read / Write
GstElement * | element | Read / Write / Construct Only
gboolean | eos-shutdown | Read / Write
guint | latency | Read / Write
GstRTSPProfile | profiles | Read / Write
GstRTSPLowerTrans | protocols | Read / Write
gboolean | reusable | Read / Write
gboolean | shared | Read / Write
gboolean | stop-on-disconnect | Read / Write
GstRTSPSuspendMode | suspend-mode | Read / Write
gboolean | time-provider | Read / Write
GstRTSPTransportMode | transport-mode | Read / Write

## Signals

void | new-state | Run Last
void | new-stream | Run Last
void | prepared | Run Last
void | removed-stream | Run Last
void | target-state | Run Last
void | unprepared | Run Last

## Types and Values

struct | GstRTSPMedia
struct | GstRTSPMediaClass
enum | GstRTSPMediaStatus
enum | GstRTSPSuspendMode

## Object Hierarchy

        GObject
        ╰── GstRTSPMedia

## Description

## Functions

### gst_rtsp_media_new ()

    GstRTSPMedia *
    gst_rtsp_media_new (GstElement *element);

### gst_rtsp_media_get_element ()

    GstElement *
    gst_rtsp_media_get_element (GstRTSPMedia *media);

### gst_rtsp_media_take_pipeline ()

    void
    gst_rtsp_media_take_pipeline (GstRTSPMedia *media,
                                  GstPipeline *pipeline);

### gst_rtsp_media_set_permissions ()

    void
    gst_rtsp_media_set_permissions (GstRTSPMedia *media,
                                    GstRTSPPermissions *permissions);

### gst_rtsp_media_get_permissions ()

    GstRTSPPermissions *
    gst_rtsp_media_get_permissions (GstRTSPMedia *media);

### gst_rtsp_media_set_shared ()

    void
    gst_rtsp_media_set_shared (GstRTSPMedia *media,
                               gboolean shared);

### gst_rtsp_media_is_shared ()

    gboolean
    gst_rtsp_media_is_shared (GstRTSPMedia *media);

### gst_rtsp_media_set_reusable ()

    void
    gst_rtsp_media_set_reusable (GstRTSPMedia *media,
                                 gboolean reusable);

### gst_rtsp_media_is_reusable ()

    gboolean
    gst_rtsp_media_is_reusable (GstRTSPMedia *media);

### gst_rtsp_media_set_profiles ()

    void
    gst_rtsp_media_set_profiles (GstRTSPMedia *media,
                                 GstRTSPProfile profiles);

### gst_rtsp_media_get_profiles ()

    GstRTSPProfile
    gst_rtsp_media_get_profiles (GstRTSPMedia *media);

### gst_rtsp_media_set_protocols ()

    void
    gst_rtsp_media_set_protocols (GstRTSPMedia *media,
                                  GstRTSPLowerTrans protocols);

### gst_rtsp_media_get_protocols ()

    GstRTSPLowerTrans
    gst_rtsp_media_get_protocols (GstRTSPMedia *media);

### gst_rtsp_media_set_eos_shutdown ()

    void
    gst_rtsp_media_set_eos_shutdown (GstRTSPMedia *media,
                                     gboolean eos_shutdown);

### gst_rtsp_media_is_eos_shutdown ()

    gboolean
    gst_rtsp_media_is_eos_shutdown (GstRTSPMedia *media);

### gst_rtsp_media_set_address_pool ()

    void
    gst_rtsp_media_set_address_pool (GstRTSPMedia *media,
                                     GstRTSPAddressPool *pool);

### gst_rtsp_media_get_address_pool ()

    GstRTSPAddressPool *
    gst_rtsp_media_get_address_pool (GstRTSPMedia *media);

### gst_rtsp_media_set_buffer_size ()

    void
    gst_rtsp_media_set_buffer_size (GstRTSPMedia *media,
                                    guint size);

### gst_rtsp_media_get_buffer_size ()

    guint
    gst_rtsp_media_get_buffer_size (GstRTSPMedia *media);

### gst_rtsp_media_set_retransmission_time ()

    void
    gst_rtsp_media_set_retransmission_time
                                   (GstRTSPMedia *media,
                                    GstClockTime time);

### gst_rtsp_media_get_retransmission_time ()

    GstClockTime
    gst_rtsp_media_get_retransmission_time
                                   (GstRTSPMedia *media);

### gst_rtsp_media_set_latency ()

    void
    gst_rtsp_media_set_latency (GstRTSPMedia *media,
                                guint latency);

### gst_rtsp_media_get_latency ()

    guint
    gst_rtsp_media_get_latency (GstRTSPMedia *media);

### gst_rtsp_media_setup_sdp ()

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

### gst_rtsp_media_handle_sdp ()

    gboolean
    gst_rtsp_media_handle_sdp (GstRTSPMedia *media,
                               GstSDPMessage *sdp);

### gst_rtsp_media_prepare ()

    gboolean
    gst_rtsp_media_prepare (GstRTSPMedia *media,
                            GstRTSPThread *thread);

### gst_rtsp_media_unprepare ()

    gboolean
    gst_rtsp_media_unprepare (GstRTSPMedia *media);

### gst_rtsp_media_get_status ()

    GstRTSPMediaStatus
    gst_rtsp_media_get_status (GstRTSPMedia *media);

### gst_rtsp_media_set_suspend_mode ()

    void
    gst_rtsp_media_set_suspend_mode (GstRTSPMedia *media,
                                     GstRTSPSuspendMode mode);

### gst_rtsp_media_get_suspend_mode ()

    GstRTSPSuspendMode
    gst_rtsp_media_get_suspend_mode (GstRTSPMedia *media);

### gst_rtsp_media_suspend ()

    gboolean
    gst_rtsp_media_suspend (GstRTSPMedia *media);

### gst_rtsp_media_unsuspend ()

    gboolean
    gst_rtsp_media_unsuspend (GstRTSPMedia *media);

### gst_rtsp_media_collect_streams ()

    void
    gst_rtsp_media_collect_streams (GstRTSPMedia *media);

### gst_rtsp_media_create_stream ()

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

### gst_rtsp_media_n_streams ()

    guint
    gst_rtsp_media_n_streams (GstRTSPMedia *media);

### gst_rtsp_media_get_stream ()

    GstRTSPStream *
    gst_rtsp_media_get_stream (GstRTSPMedia *media,
                               guint idx);

### gst_rtsp_media_find_stream ()

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

### gst_rtsp_media_seek ()

    gboolean
    gst_rtsp_media_seek (GstRTSPMedia *media,
                         GstRTSPTimeRange *range);

### gst_rtsp_media_get_range_string ()

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

### gst_rtsp_media_set_state ()

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

### gst_rtsp_media_set_pipeline_state ()

    void
    gst_rtsp_media_set_pipeline_state (GstRTSPMedia *media,
                                       GstState state);

### gst_rtsp_media_get_clock ()

    GstClock *
    gst_rtsp_media_get_clock (GstRTSPMedia *media);

### gst_rtsp_media_get_base_time ()

    GstClockTime
    gst_rtsp_media_get_base_time (GstRTSPMedia *media);

### gst_rtsp_media_use_time_provider ()

    void
    gst_rtsp_media_use_time_provider (GstRTSPMedia *media,
                                      gboolean time_provider);

### gst_rtsp_media_is_time_provider ()

    gboolean
    gst_rtsp_media_is_time_provider (GstRTSPMedia *media);

### gst_rtsp_media_get_time_provider ()

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

## Types and Values

### struct GstRTSPMedia

    struct GstRTSPMedia;

### struct GstRTSPMediaClass

    struct GstRTSPMediaClass {
      GObjectClass  parent_class;

      /* vmethods */
      gboolean        (*handle_message)  (GstRTSPMedia *media, GstMessage *message);
      gboolean        (*prepare)         (GstRTSPMedia *media, GstRTSPThread *thread);
      gboolean        (*unprepare)       (GstRTSPMedia *media);
      gboolean        (*suspend)         (GstRTSPMedia *media);
      gboolean        (*unsuspend)       (GstRTSPMedia *media);
      gboolean        (*convert_range)   (GstRTSPMedia *media, GstRTSPTimeRange *range,
                                          GstRTSPRangeUnit unit);
      gboolean        (*query_position)  (GstRTSPMedia *media, gint64 *position);
      gboolean        (*query_stop)      (GstRTSPMedia *media, gint64 *stop);
      GstElement *    (*create_rtpbin)   (GstRTSPMedia *media);
      gboolean        (*setup_rtpbin)    (GstRTSPMedia *media, GstElement *rtpbin);
      gboolean        (*setup_sdp)       (GstRTSPMedia *media, GstSDPMessage *sdp, GstSDPInfo *info);

      /* signals */
      void            (*new_stream)      (GstRTSPMedia *media, GstRTSPStream * stream);
      void            (*removed_stream)  (GstRTSPMedia *media, GstRTSPStream * stream);

      void            (*prepared)        (GstRTSPMedia *media);
      void            (*unprepared)      (GstRTSPMedia *media);

      void            (*target_state)    (GstRTSPMedia *media, GstState state);
      void            (*new_state)       (GstRTSPMedia *media, GstState state);

      gboolean        (*handle_sdp)      (GstRTSPMedia *media, GstSDPMessage *sdp);
    };

### enum GstRTSPMediaStatus

#### Members

GST_RTSP_MEDIA_STATUS_UNPREPARED |  |
GST_RTSP_MEDIA_STATUS_UNPREPARING |  |
GST_RTSP_MEDIA_STATUS_PREPARING |  |
GST_RTSP_MEDIA_STATUS_PREPARED |  |
GST_RTSP_MEDIA_STATUS_SUSPENDED |  |
GST_RTSP_MEDIA_STATUS_ERROR |  |

### enum GstRTSPSuspendMode

#### Members

GST_RTSP_SUSPEND_MODE_NONE |  |
GST_RTSP_SUSPEND_MODE_PAUSE |  |
GST_RTSP_SUSPEND_MODE_RESET |  |

## Property Details

### The `“buffer-size”` property

      “buffer-size”              guint

The kernel UDP buffer size to use.

Flags: Read / Write

Default value: 524288

### The `“clock”` property

      “clock”                    GstClock *

Clock to be used by the media pipeline.

Flags: Read / Write

### The `“element”` property

      “element”                  GstElement *

The GstBin to use for streaming the media.

Flags: Read / Write / Construct Only

### The `“eos-shutdown”` property

      “eos-shutdown”             gboolean

Send an EOS event to the pipeline before unpreparing.

Flags: Read / Write

Default value: FALSE

### The `“latency”` property

      “latency”                  guint

Latency used for receiving media in milliseconds.

Flags: Read / Write

Default value: 524288

### The `“profiles”` property

      “profiles”                 GstRTSPProfile

Allowed transfer profiles.

Flags: Read / Write

Default value: GST_RTSP_PROFILE_AVP

### The `“protocols”` property

      “protocols”                GstRTSPLowerTrans

Allowed lower transport protocols.

Flags: Read / Write

Default value: GST_RTSP_LOWER_TRANS_UDP | GST_RTSP_LOWER_TRANS_UDP_MCAST | GST_RTSP_LOWER_TRANS_TCP

### The `“reusable”` property

      “reusable”                 gboolean

If this media pipeline can be reused after an unprepare.

Flags: Read / Write

Default value: FALSE

### The `“shared”` property

      “shared”                   gboolean

If this media pipeline can be shared.

Flags: Read / Write

Default value: FALSE

### The `“stop-on-disconnect”` property

      “stop-on-disconnect”       gboolean

If this media pipeline should be stopped when a client disconnects without TEARDOWN.

Flags: Read / Write

Default value: TRUE

### The `“suspend-mode”` property

      “suspend-mode”             GstRTSPSuspendMode

How to suspend the media in PAUSED.

Flags: Read / Write

Default value: GST_RTSP_SUSPEND_MODE_NONE

### The `“time-provider”` property

      “time-provider”            gboolean

Use a NetTimeProvider for clients.

Flags: Read / Write

Default value: FALSE

### The `“transport-mode”` property

      “transport-mode”           GstRTSPTransportMode

If this media pipeline can be used for PLAY or RECORD.

Flags: Read / Write

Default value: GST_RTSP_TRANSPORT_MODE_PLAY

## Signal Details

### The `“new-state”` signal

    void
    user_function (GstRTSPMedia *gstrtspmedia,
                   gint          arg1,
                   gpointer      user_data)

Flags: Run Last

### The `“new-stream”` signal

    void
    user_function (GstRTSPMedia  *gstrtspmedia,
                   GstRTSPStream *arg1,
                   gpointer       user_data)

Flags: Run Last

### The `“prepared”` signal

    void
    user_function (GstRTSPMedia *gstrtspmedia,
                   gpointer      user_data)

Flags: Run Last

### The `“removed-stream”` signal

    void
    user_function (GstRTSPMedia  *gstrtspmedia,
                   GstRTSPStream *arg1,
                   gpointer       user_data)

Flags: Run Last

### The `“target-state”` signal

    void
    user_function (GstRTSPMedia *gstrtspmedia,
                   gint          arg1,
                   gpointer      user_data)

Flags: Run Last

### The `“unprepared”` signal

    void
    user_function (GstRTSPMedia *gstrtspmedia,
                   gpointer      user_data)

Flags: Run Last