GstRTSPServer

GstRTSPServer

Synopsis

                    GstRTSPServer;
                    GstRTSPServerClass;
GstRTSPServer *     gst_rtsp_server_new                 (void);
void                gst_rtsp_server_set_address         (GstRTSPServer *server,
                                                         const gchar *address);
gchar *             gst_rtsp_server_get_address         (GstRTSPServer *server);
void                gst_rtsp_server_set_service         (GstRTSPServer *server,
                                                         const gchar *service);
gchar *             gst_rtsp_server_get_service         (GstRTSPServer *server);
void                gst_rtsp_server_set_backlog         (GstRTSPServer *server,
                                                         gint backlog);
gint                gst_rtsp_server_get_backlog         (GstRTSPServer *server);
void                gst_rtsp_server_set_session_pool    (GstRTSPServer *server,
                                                         GstRTSPSessionPool *pool);
GstRTSPSessionPool * gst_rtsp_server_get_session_pool   (GstRTSPServer *server);
void                gst_rtsp_server_set_media_mapping   (GstRTSPServer *server,
                                                         GstRTSPMediaMapping *mapping);
GstRTSPMediaMapping * gst_rtsp_server_get_media_mapping (GstRTSPServer *server);
GstRTSPAuth *       gst_rtsp_server_get_auth            (GstRTSPServer *server);
void                gst_rtsp_server_set_auth            (GstRTSPServer *server,
                                                         GstRTSPAuth *auth);
gboolean            gst_rtsp_server_io_func             (GIOChannel *channel,
                                                         GIOCondition condition,
                                                         GstRTSPServer *server);
GIOChannel *        gst_rtsp_server_get_io_channel      (GstRTSPServer *server);
GSource *           gst_rtsp_server_create_watch        (GstRTSPServer *server);
guint               gst_rtsp_server_attach              (GstRTSPServer *server,
                                                         GMainContext *context);

Object Hierarchy

  GObject
   +----GstRTSPServer

Properties

  "address"                  gchar*                : Read / Write
  "backlog"                  gint                  : Read / Write
  "media-mapping"            GstRTSPMediaMapping*  : Read / Write
  "service"                  gchar*                : Read / Write
  "session-pool"             GstRTSPSessionPool*   : Read / Write

Description

Details

GstRTSPServer

typedef struct _GstRTSPServer GstRTSPServer;

This object listens on a port, creates and manages the clients connected to it.


GstRTSPServerClass

typedef struct {
  GObjectClass  parent_class;

  GstRTSPClient * (*create_client) (GstRTSPServer *server);
  gboolean        (*accept_client) (GstRTSPServer *server, GstRTSPClient *client, GIOChannel *channel);
} GstRTSPServerClass;

create_client: Create, configure a new GstRTSPClient object that handles the new connection on channel. accept_client: accept a new GstRTSPClient

The RTSP server class structure


gst_rtsp_server_new ()

GstRTSPServer *     gst_rtsp_server_new                 (void);

Create a new GstRTSPServer instance.


gst_rtsp_server_set_address ()

void                gst_rtsp_server_set_address         (GstRTSPServer *server,
                                                         const gchar *address);

Configure server to accept connections on the given address.

This function must be called before the server is bound.

server :

a GstRTSPServer

address :

the address

gst_rtsp_server_get_address ()

gchar *             gst_rtsp_server_get_address         (GstRTSPServer *server);

Get the address on which the server will accept connections.

server :

a GstRTSPServer

Returns :

the server address. g_free() after usage.

gst_rtsp_server_set_service ()

void                gst_rtsp_server_set_service         (GstRTSPServer *server,
                                                         const gchar *service);

Configure server to accept connections on the given service. service should be a string containing the service name (see services(5)) or a string containing a port number between 1 and 65535.

This function must be called before the server is bound.

server :

a GstRTSPServer

service :

the service

gst_rtsp_server_get_service ()

gchar *             gst_rtsp_server_get_service         (GstRTSPServer *server);

Get the service on which the server will accept connections.

server :

a GstRTSPServer

Returns :

the service. use g_free() after usage.

gst_rtsp_server_set_backlog ()

void                gst_rtsp_server_set_backlog         (GstRTSPServer *server,
                                                         gint backlog);

configure the maximum amount of requests that may be queued for the server.

This function must be called before the server is bound.

server :

a GstRTSPServer

backlog :

the backlog

gst_rtsp_server_get_backlog ()

gint                gst_rtsp_server_get_backlog         (GstRTSPServer *server);

The maximum amount of queued requests for the server.

server :

a GstRTSPServer

Returns :

the server backlog.

gst_rtsp_server_set_session_pool ()

void                gst_rtsp_server_set_session_pool    (GstRTSPServer *server,
                                                         GstRTSPSessionPool *pool);

configure pool to be used as the session pool of server.

server :

a GstRTSPServer

pool :

a GstRTSPSessionPool

gst_rtsp_server_get_session_pool ()

GstRTSPSessionPool * gst_rtsp_server_get_session_pool   (GstRTSPServer *server);

Get the GstRTSPSessionPool used as the session pool of server.

server :

a GstRTSPServer

Returns :

the GstRTSPSessionPool used for sessions. g_object_unref() after usage.

gst_rtsp_server_set_media_mapping ()

void                gst_rtsp_server_set_media_mapping   (GstRTSPServer *server,
                                                         GstRTSPMediaMapping *mapping);

configure mapping to be used as the media mapping of server.

server :

a GstRTSPServer

mapping :

a GstRTSPMediaMapping

gst_rtsp_server_get_media_mapping ()

GstRTSPMediaMapping * gst_rtsp_server_get_media_mapping (GstRTSPServer *server);

Get the GstRTSPMediaMapping used as the media mapping of server.

server :

a GstRTSPServer

Returns :

the GstRTSPMediaMapping of server. g_object_unref() after usage.

gst_rtsp_server_get_auth ()

GstRTSPAuth *       gst_rtsp_server_get_auth            (GstRTSPServer *server);

Get the GstRTSPAuth used as the authentication manager of server.

server :

a GstRTSPServer

Returns :

the GstRTSPAuth of server. g_object_unref() after usage.

gst_rtsp_server_set_auth ()

void                gst_rtsp_server_set_auth            (GstRTSPServer *server,
                                                         GstRTSPAuth *auth);

configure auth to be used as the authentication manager of server.

server :

a GstRTSPServer

auth :

a GstRTSPAuth

gst_rtsp_server_io_func ()

gboolean            gst_rtsp_server_io_func             (GIOChannel *channel,
                                                         GIOCondition condition,
                                                         GstRTSPServer *server);

A default GIOFunc that creates a new GstRTSPClient to accept and handle a new connection on channel or server.

channel :

a GIOChannel

condition :

the condition on source

Returns :

TRUE if the source could be connected, FALSE if an error occured.

gst_rtsp_server_get_io_channel ()

GIOChannel *        gst_rtsp_server_get_io_channel      (GstRTSPServer *server);

Create a GIOChannel for server. The io channel will listen on the configured service.

server :

a GstRTSPServer

Returns :

the GIOChannel for server or NULL when an error occured.

gst_rtsp_server_create_watch ()

GSource *           gst_rtsp_server_create_watch        (GstRTSPServer *server);

Create a GSource for server. The new source will have a default GIOFunc of gst_rtsp_server_io_func().

server :

a GstRTSPServer

Returns :

the GSource for server or NULL when an error occured.

gst_rtsp_server_attach ()

guint               gst_rtsp_server_attach              (GstRTSPServer *server,
                                                         GMainContext *context);

Attaches server to context. When the mainloop for context is run, the server will be dispatched. When context is NULL, the default context will be used).

This function should be called when the server properties and urls are fully configured and the server is ready to start.

server :

a GstRTSPServer

context :

a GMainContext

Returns :

the ID (greater than 0) for the source within the GMainContext.

Property Details

The "address" property

  "address"                  gchar*                : Read / Write

The address the server uses to listen on.

Default value: "0.0.0.0"


The "backlog" property

  "backlog"                  gint                  : Read / Write

The maximum length to which the queue of pending connections may grow.

Allowed values: >= 0

Default value: 5


The "media-mapping" property

  "media-mapping"            GstRTSPMediaMapping*  : Read / Write

The media mapping to use for client session.


The "service" property

  "service"                  gchar*                : Read / Write

The service or port number the server uses to listen on.

Default value: "8554"


The "session-pool" property

  "session-pool"             GstRTSPSessionPool*   : Read / Write

The session pool to use for client session.