rtsp-client: make create_sdp virtual method

Fixes https://bugzilla.gnome.org/show_bug.cgi?id=680173
This commit is contained in:
Patricia Muscalu 2012-07-18 15:54:49 +02:00 committed by Wim Taymans
parent d803c8e29f
commit 228e2ccc2d
2 changed files with 11 additions and 1 deletions

View file

@ -64,6 +64,7 @@ static void gst_rtsp_client_set_property (GObject * object, guint propid,
const GValue * value, GParamSpec * pspec);
static void gst_rtsp_client_finalize (GObject * obj);
static GstSDPMessage * create_sdp (GstRTSPClient * client, GstRTSPMedia * media);
static void client_session_finalized (GstRTSPClient * client,
GstRTSPSession * session);
static void unlink_session_streams (GstRTSPClient * client,
@ -82,6 +83,8 @@ gst_rtsp_client_class_init (GstRTSPClientClass * klass)
gobject_class->set_property = gst_rtsp_client_set_property;
gobject_class->finalize = gst_rtsp_client_finalize;
klass->create_sdp = create_sdp;
g_object_class_install_property (gobject_class, PROP_SESSION_POOL,
g_param_spec_object ("session-pool", "Session Pool",
"The session pool to use for client session",
@ -1143,6 +1146,9 @@ handle_describe_request (GstRTSPClient * client, GstRTSPClientState * state)
guint i, str_len;
gchar *str, *content_base;
GstRTSPMedia *media;
GstRTSPClientClass *klass;
klass = GST_RTSP_CLIENT_GET_CLASS (client);
/* check what kind of format is accepted, we don't really do anything with it
* and always return SDP for now. */
@ -1163,8 +1169,9 @@ handle_describe_request (GstRTSPClient * client, GstRTSPClientState * state)
if (!(media = find_media (client, state)))
goto no_media;
/* create an SDP for the media object on this client */
if (!(sdp = create_sdp (client, media)))
if (!(sdp = klass->create_sdp (client, media)))
goto no_sdp;
g_object_unref (media);

View file

@ -34,6 +34,7 @@ typedef struct _GstRTSPClientState GstRTSPClientState;
#include "rtsp-media-mapping.h"
#include "rtsp-session-pool.h"
#include "rtsp-auth.h"
#include "rtsp-sdp.h"
#define GST_TYPE_RTSP_CLIENT (gst_rtsp_client_get_type ())
#define GST_IS_RTSP_CLIENT(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GST_TYPE_RTSP_CLIENT))
@ -108,6 +109,8 @@ struct _GstRTSPClient {
struct _GstRTSPClientClass {
GObjectClass parent_class;
GstSDPMessage * (*create_sdp) (GstRTSPClient *client, GstRTSPMedia *media);
/* signals */
void (*closed) (GstRTSPClient *client);
};