Commit a6d75bd3 authored by Wim Taymans's avatar Wim Taymans
Browse files

Add RTSP channel object for async io

Add a GstRTSPChannel object that wraps a GSource around the RTSP connection so
that the connection can be monitored from a maincontext. This allows us to
operate in ASYNC mode, which is handy when building a server.

Rework the old code to use the async code under the hood.

API: gst_rtsp_channel_new()
API: gst_rtsp_channel_unref()
API: gst_rtsp_channel_attach()
API: gst_rtsp_channel_queue_message()
parent 6c28744f
......@@ -1205,6 +1205,13 @@ gst_rtsp_connection_next_timeout
gst_rtsp_connection_reset_timeout
gst_rtsp_connection_flush
gst_rtsp_connection_set_auth
GstRTSPChannel
GstRTSPChannelFuncs
gst_rtsp_channel_new
gst_rtsp_channel_unref
gst_rtsp_channel_attach
gst_rtsp_channel_queue_message
</SECTION>
<SECTION>
......
This diff is collapsed.
......@@ -127,6 +127,48 @@ GstRTSPResult gst_rtsp_connection_set_qos_dscp (GstRTSPConnection *conn,
/* accessors */
const gchar * gst_rtsp_connection_get_ip (const GstRTSPConnection *conn);
/* async IO */
/**
* GstRTSPChannel:
*
* Opaque RTSP channel object that can be used for asynchronous RTSP
* operations.
*/
typedef struct _GstRTSPChannel GstRTSPChannel;
/**
* GstRTSPChannelFuncs:
* @message_received: callback when a message was received
* @message_sent: callback when a message was sent
* @closed: callback when the connection is closed
* @error: callback when an error occured
*
* Callback functions from a #GstRTSPChannel.
*/
typedef struct {
GstRTSPResult (*message_received) (GstRTSPChannel *channel, GstRTSPMessage *message,
gpointer user_data);
GstRTSPResult (*message_sent) (GstRTSPChannel *channel, guint cseq,
gpointer user_data);
GstRTSPResult (*closed) (GstRTSPChannel *channel, gpointer user_data);
GstRTSPResult (*error) (GstRTSPChannel *channel, GstRTSPResult result,
gpointer user_data);
} GstRTSPChannelFuncs;
GstRTSPChannel * gst_rtsp_channel_new (GstRTSPConnection *conn,
GstRTSPChannelFuncs *funcs,
gpointer user_data,
GDestroyNotify notify);
void gst_rtsp_channel_unref (GstRTSPChannel *channel);
guint gst_rtsp_channel_attach (GstRTSPChannel *channel,
GMainContext *context);
guint gst_rtsp_channel_queue_message (GstRTSPChannel *channel,
GstRTSPMessage *message);
G_END_DECLS
#endif /* __GST_RTSP_CONNECTION_H__ */
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment