mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-04-26 06:54:49 +00:00
Allow setting a custom media factory for a client.
This commit is contained in:
parent
f38c390736
commit
94d60a8611
2 changed files with 59 additions and 10 deletions
|
@ -803,6 +803,49 @@ gst_rtsp_client_get_session_pool (GstRTSPClient *client)
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* gst_rtsp_client_set_media_factory:
|
||||||
|
* @client: a #GstRTSPClient
|
||||||
|
* @factory: a #GstRTSPMediaFactory
|
||||||
|
*
|
||||||
|
* Set @factory as the media factory for @client which it will use to map urls
|
||||||
|
* to media streams.
|
||||||
|
*/
|
||||||
|
void
|
||||||
|
gst_rtsp_client_set_media_factory (GstRTSPClient *client, GstRTSPMediaFactory *factory)
|
||||||
|
{
|
||||||
|
GstRTSPMediaFactory *old;
|
||||||
|
|
||||||
|
old = client->factory;
|
||||||
|
|
||||||
|
if (old != factory) {
|
||||||
|
if (factory)
|
||||||
|
g_object_ref (factory);
|
||||||
|
client->factory = factory;
|
||||||
|
if (old)
|
||||||
|
g_object_unref (old);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* gst_rtsp_client_get_media_factory:
|
||||||
|
* @client: a #GstRTSPClient
|
||||||
|
*
|
||||||
|
* Get the #GstRTSPMediaFactory object that @client uses to manage its sessions.
|
||||||
|
*
|
||||||
|
* Returns: a #GstRTSPMediaFactory, unref after usage.
|
||||||
|
*/
|
||||||
|
GstRTSPMediaFactory *
|
||||||
|
gst_rtsp_client_get_media_factory (GstRTSPClient *client)
|
||||||
|
{
|
||||||
|
GstRTSPMediaFactory *result;
|
||||||
|
|
||||||
|
if ((result = client->factory))
|
||||||
|
g_object_ref (result);
|
||||||
|
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* gst_rtsp_client_attach:
|
* gst_rtsp_client_attach:
|
||||||
|
|
|
@ -38,6 +38,7 @@
|
||||||
#define __GST_RTSP_CLIENT_H__
|
#define __GST_RTSP_CLIENT_H__
|
||||||
|
|
||||||
#include "rtsp-media.h"
|
#include "rtsp-media.h"
|
||||||
|
#include "rtsp-media-factory.h"
|
||||||
#include "rtsp-session-pool.h"
|
#include "rtsp-session-pool.h"
|
||||||
|
|
||||||
G_BEGIN_DECLS
|
G_BEGIN_DECLS
|
||||||
|
@ -70,28 +71,33 @@ struct _GstRTSPClient {
|
||||||
|
|
||||||
GstRTSPConnection *connection;
|
GstRTSPConnection *connection;
|
||||||
struct sockaddr_in address;
|
struct sockaddr_in address;
|
||||||
|
GThread *thread;
|
||||||
GstRTSPMedia *media;
|
|
||||||
|
|
||||||
GstRTSPSessionPool *pool;
|
GstRTSPSessionPool *pool;
|
||||||
|
|
||||||
GThread *thread;
|
GstRTSPMedia *media;
|
||||||
|
GstRTSPMediaFactory *factory;
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
struct _GstRTSPClientClass {
|
struct _GstRTSPClientClass {
|
||||||
GObjectClass parent_class;
|
GObjectClass parent_class;
|
||||||
};
|
};
|
||||||
|
|
||||||
GType gst_rtsp_client_get_type (void);
|
GType gst_rtsp_client_get_type (void);
|
||||||
|
|
||||||
GstRTSPClient * gst_rtsp_client_new (void);
|
GstRTSPClient * gst_rtsp_client_new (void);
|
||||||
|
|
||||||
void gst_rtsp_client_set_session_pool (GstRTSPClient *client,
|
void gst_rtsp_client_set_session_pool (GstRTSPClient *client,
|
||||||
GstRTSPSessionPool *pool);
|
GstRTSPSessionPool *pool);
|
||||||
GstRTSPSessionPool * gst_rtsp_client_get_session_pool (GstRTSPClient *client);
|
GstRTSPSessionPool * gst_rtsp_client_get_session_pool (GstRTSPClient *client);
|
||||||
|
|
||||||
gboolean gst_rtsp_client_accept (GstRTSPClient *client,
|
void gst_rtsp_client_set_media_factory (GstRTSPClient *client,
|
||||||
GIOChannel *channel);
|
GstRTSPMediaFactory *factory);
|
||||||
|
GstRTSPMediaFactory * gst_rtsp_client_get_media_factory (GstRTSPClient *client);
|
||||||
|
|
||||||
|
gboolean gst_rtsp_client_accept (GstRTSPClient *client,
|
||||||
|
GIOChannel *channel);
|
||||||
|
|
||||||
G_END_DECLS
|
G_END_DECLS
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue