mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-01-12 10:25:33 +00:00
Add a signal for newly connected clients.
Signed-off-by: Fabian Deutsch <fabian.deutsch@gmx.de>
This commit is contained in:
parent
6b862f0c0e
commit
6ef7c966ae
2 changed files with 22 additions and 2 deletions
|
@ -57,11 +57,19 @@ enum
|
||||||
PROP_LAST
|
PROP_LAST
|
||||||
};
|
};
|
||||||
|
|
||||||
|
enum
|
||||||
|
{
|
||||||
|
SIGNAL_CLIENT_CONNECTED,
|
||||||
|
SIGNAL_LAST
|
||||||
|
};
|
||||||
|
|
||||||
G_DEFINE_TYPE (GstRTSPServer, gst_rtsp_server, G_TYPE_OBJECT);
|
G_DEFINE_TYPE (GstRTSPServer, gst_rtsp_server, G_TYPE_OBJECT);
|
||||||
|
|
||||||
GST_DEBUG_CATEGORY_STATIC (rtsp_server_debug);
|
GST_DEBUG_CATEGORY_STATIC (rtsp_server_debug);
|
||||||
#define GST_CAT_DEFAULT rtsp_server_debug
|
#define GST_CAT_DEFAULT rtsp_server_debug
|
||||||
|
|
||||||
|
static guint gst_rtsp_server_signals[SIGNAL_LAST] = { 0 };
|
||||||
|
|
||||||
static void gst_rtsp_server_get_property (GObject * object, guint propid,
|
static void gst_rtsp_server_get_property (GObject * object, guint propid,
|
||||||
GValue * value, GParamSpec * pspec);
|
GValue * value, GParamSpec * pspec);
|
||||||
static void gst_rtsp_server_set_property (GObject * object, guint propid,
|
static void gst_rtsp_server_set_property (GObject * object, guint propid,
|
||||||
|
@ -141,6 +149,12 @@ gst_rtsp_server_class_init (GstRTSPServerClass * klass)
|
||||||
GST_TYPE_RTSP_MEDIA_MAPPING,
|
GST_TYPE_RTSP_MEDIA_MAPPING,
|
||||||
G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
|
G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
|
||||||
|
|
||||||
|
gst_rtsp_server_signals[SIGNAL_CLIENT_CONNECTED] =
|
||||||
|
g_signal_new ("client-connected", G_TYPE_FROM_CLASS (gobject_class),
|
||||||
|
G_SIGNAL_RUN_LAST, G_STRUCT_OFFSET (GstRTSPServerClass, client_connected),
|
||||||
|
NULL, NULL, g_cclosure_marshal_VOID__OBJECT, G_TYPE_NONE, 1,
|
||||||
|
gst_rtsp_client_get_type ());
|
||||||
|
|
||||||
klass->create_client = default_create_client;
|
klass->create_client = default_create_client;
|
||||||
klass->accept_client = default_accept_client;
|
klass->accept_client = default_accept_client;
|
||||||
|
|
||||||
|
@ -793,6 +807,9 @@ gst_rtsp_server_io_func (GIOChannel * channel, GIOCondition condition,
|
||||||
|
|
||||||
/* manage the client connection */
|
/* manage the client connection */
|
||||||
manage_client (server, client);
|
manage_client (server, client);
|
||||||
|
|
||||||
|
g_signal_emit (server, gst_rtsp_server_signals[SIGNAL_CLIENT_CONNECTED], 0,
|
||||||
|
client);
|
||||||
} else {
|
} else {
|
||||||
GST_WARNING_OBJECT (server, "received unknown event %08x", condition);
|
GST_WARNING_OBJECT (server, "received unknown event %08x", condition);
|
||||||
}
|
}
|
||||||
|
|
|
@ -87,8 +87,11 @@ struct _GstRTSPServer {
|
||||||
struct _GstRTSPServerClass {
|
struct _GstRTSPServerClass {
|
||||||
GObjectClass parent_class;
|
GObjectClass parent_class;
|
||||||
|
|
||||||
GstRTSPClient * (*create_client) (GstRTSPServer *server);
|
GstRTSPClient * (*create_client) (GstRTSPServer *server);
|
||||||
gboolean (*accept_client) (GstRTSPServer *server, GstRTSPClient *client, GIOChannel *channel);
|
gboolean (*accept_client) (GstRTSPServer *server, GstRTSPClient *client, GIOChannel *channel);
|
||||||
|
|
||||||
|
/* signals */
|
||||||
|
void (*client_connected) (GstRTSPServer *server, GstRTSPClient *client);
|
||||||
};
|
};
|
||||||
|
|
||||||
GType gst_rtsp_server_get_type (void);
|
GType gst_rtsp_server_get_type (void);
|
||||||
|
|
Loading…
Reference in a new issue