rtsp-client: make create_sdp virtual method
authorPatricia Muscalu <patricia@axis.com>
Wed, 18 Jul 2012 13:54:49 +0000 (15:54 +0200)
committerWim Taymans <wim.taymans@collabora.co.uk>
Tue, 24 Jul 2012 10:52:53 +0000 (12:52 +0200)
Fixes https://bugzilla.gnome.org/show_bug.cgi?id=680173

gst/rtsp-server/rtsp-client.c
gst/rtsp-server/rtsp-client.h

index 9e9332f..159a718 100644 (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);
index 97bb0c2..dae2014 100644 (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);
 };