mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-20 00:31:13 +00:00
Merge branch 'master' into 0.11
This commit is contained in:
commit
debbea1008
4 changed files with 43 additions and 2 deletions
|
@ -65,3 +65,23 @@ _wrap_gst_rtsp_server_create_watch(PyGObject *self, PyObject *args, PyObject *ke
|
|||
pyg_end_allow_threads;
|
||||
return pygobject_new((GObject *)ret);
|
||||
}
|
||||
|
||||
%%
|
||||
override gst_rtsp_media_mapping_add_factory kwargs
|
||||
static PyObject *
|
||||
_wrap_gst_rtsp_media_mapping_add_factory(PyGObject *self, PyObject *args, PyObject *kwargs)
|
||||
{
|
||||
static char *kwlist[] = { "path", "factory", NULL };
|
||||
char *path;
|
||||
PyGObject *factory;
|
||||
|
||||
if (!PyArg_ParseTupleAndKeywords(args, kwargs,"sO!:GstRTSPMediaMapping.add_factory", kwlist, &path, &PyGstRTSPMediaFactory_Type, &factory))
|
||||
return NULL;
|
||||
pyg_begin_allow_threads;
|
||||
gst_rtsp_media_mapping_add_factory(GST_RTSP_MEDIA_MAPPING(self->obj), path,
|
||||
g_object_ref (GST_RTSP_MEDIA_FACTORY(factory->obj)));
|
||||
pyg_end_allow_threads;
|
||||
Py_INCREF(Py_None);
|
||||
return Py_None;
|
||||
}
|
||||
|
||||
|
|
|
@ -165,6 +165,7 @@ namespace Gst {
|
|||
}
|
||||
[CCode (cheader_filename = "gst/rtsp-server/rtsp-server.h")]
|
||||
public class RTSPServer : GLib.Object {
|
||||
public signal void client_connected (RTSPClient client);
|
||||
public weak GLib.IOChannel io_channel;
|
||||
public weak GLib.TimeoutSource io_watch;
|
||||
public void* server_sin;
|
||||
|
|
|
@ -57,11 +57,19 @@ enum
|
|||
PROP_LAST
|
||||
};
|
||||
|
||||
enum
|
||||
{
|
||||
SIGNAL_CLIENT_CONNECTED,
|
||||
SIGNAL_LAST
|
||||
};
|
||||
|
||||
G_DEFINE_TYPE (GstRTSPServer, gst_rtsp_server, G_TYPE_OBJECT);
|
||||
|
||||
GST_DEBUG_CATEGORY_STATIC (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,
|
||||
GValue * value, GParamSpec * pspec);
|
||||
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,
|
||||
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->accept_client = default_accept_client;
|
||||
|
||||
|
@ -793,6 +807,9 @@ gst_rtsp_server_io_func (GIOChannel * channel, GIOCondition condition,
|
|||
|
||||
/* manage the client connection */
|
||||
manage_client (server, client);
|
||||
|
||||
g_signal_emit (server, gst_rtsp_server_signals[SIGNAL_CLIENT_CONNECTED], 0,
|
||||
client);
|
||||
} else {
|
||||
GST_WARNING_OBJECT (server, "received unknown event %08x", condition);
|
||||
}
|
||||
|
|
|
@ -87,8 +87,11 @@ struct _GstRTSPServer {
|
|||
struct _GstRTSPServerClass {
|
||||
GObjectClass parent_class;
|
||||
|
||||
GstRTSPClient * (*create_client) (GstRTSPServer *server);
|
||||
gboolean (*accept_client) (GstRTSPServer *server, GstRTSPClient *client, GIOChannel *channel);
|
||||
GstRTSPClient * (*create_client) (GstRTSPServer *server);
|
||||
gboolean (*accept_client) (GstRTSPServer *server, GstRTSPClient *client, GIOChannel *channel);
|
||||
|
||||
/* signals */
|
||||
void (*client_connected) (GstRTSPServer *server, GstRTSPClient *client);
|
||||
};
|
||||
|
||||
GType gst_rtsp_server_get_type (void);
|
||||
|
|
Loading…
Reference in a new issue