mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-28 04:31:06 +00:00
media-factory: add methods to configure authorisation
This commit is contained in:
parent
748d044b62
commit
9ea0346d97
2 changed files with 58 additions and 0 deletions
|
@ -127,6 +127,8 @@ gst_rtsp_media_factory_finalize (GObject * obj)
|
|||
g_mutex_free (factory->medias_lock);
|
||||
g_free (factory->launch);
|
||||
g_mutex_free (factory->lock);
|
||||
if (factory->auth)
|
||||
g_object_unref (factory->auth);
|
||||
|
||||
G_OBJECT_CLASS (gst_rtsp_media_factory_parent_class)->finalize (obj);
|
||||
}
|
||||
|
@ -326,6 +328,56 @@ gst_rtsp_media_factory_is_eos_shutdown (GstRTSPMediaFactory * factory)
|
|||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* gst_rtsp_media_factory_set_auth:
|
||||
* @factory: a #GstRTSPMediaFactory
|
||||
* @auth: a #GstRTSPAuth
|
||||
*
|
||||
* configure @auth to be used as the authentication manager of @factory.
|
||||
*/
|
||||
void
|
||||
gst_rtsp_media_factory_set_auth (GstRTSPMediaFactory * factory,
|
||||
GstRTSPAuth * auth)
|
||||
{
|
||||
GstRTSPAuth *old;
|
||||
|
||||
g_return_if_fail (GST_IS_RTSP_MEDIA_FACTORY (factory));
|
||||
|
||||
old = factory->auth;
|
||||
|
||||
if (old != auth) {
|
||||
if (auth)
|
||||
g_object_ref (auth);
|
||||
factory->auth = auth;
|
||||
if (old)
|
||||
g_object_unref (old);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* gst_rtsp_media_factory_get_auth:
|
||||
* @factory: a #GstRTSPMediaFactory
|
||||
*
|
||||
* Get the #GstRTSPAuth used as the authentication manager of @factory.
|
||||
*
|
||||
* Returns: the #GstRTSPAuth of @factory. g_object_unref() after
|
||||
* usage.
|
||||
*/
|
||||
GstRTSPAuth *
|
||||
gst_rtsp_factory_get_auth (GstRTSPMediaFactory * factory)
|
||||
{
|
||||
GstRTSPAuth *result;
|
||||
|
||||
g_return_val_if_fail (GST_IS_RTSP_MEDIA_FACTORY (factory), NULL);
|
||||
|
||||
if ((result = factory->auth))
|
||||
g_object_ref (result);
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
static gboolean
|
||||
compare_media (gpointer key, GstRTSPMedia * media1, GstRTSPMedia * media2)
|
||||
{
|
||||
|
|
|
@ -21,6 +21,7 @@
|
|||
#include <gst/rtsp/gstrtspurl.h>
|
||||
|
||||
#include "rtsp-media.h"
|
||||
#include "rtsp-auth.h"
|
||||
|
||||
#ifndef __GST_RTSP_MEDIA_FACTORY_H__
|
||||
#define __GST_RTSP_MEDIA_FACTORY_H__
|
||||
|
@ -62,6 +63,7 @@ struct _GstRTSPMediaFactory {
|
|||
gchar *launch;
|
||||
gboolean shared;
|
||||
gboolean eos_shutdown;
|
||||
GstRTSPAuth *auth;
|
||||
|
||||
GMutex *medias_lock;
|
||||
GHashTable *medias;
|
||||
|
@ -116,6 +118,10 @@ void gst_rtsp_media_factory_set_eos_shutdown (GstRTSPMediaFac
|
|||
gboolean eos_shutdown);
|
||||
gboolean gst_rtsp_media_factory_is_eos_shutdown (GstRTSPMediaFactory *factory);
|
||||
|
||||
void gst_rtsp_media_factory_set_auth (GstRTSPMediaFactory *factory, GstRTSPAuth *auth);
|
||||
GstRTSPAuth * gst_rtsp_media_factory_get_auth (GstRTSPMediaFactory *factory);
|
||||
|
||||
|
||||
/* creating the media from the factory and a url */
|
||||
GstRTSPMedia * gst_rtsp_media_factory_construct (GstRTSPMediaFactory *factory,
|
||||
const GstRTSPUrl *url);
|
||||
|
|
Loading…
Reference in a new issue