From: Patricia Muscalu Date: Wed, 18 Jul 2012 13:54:49 +0000 (+0200) Subject: rtsp-client: make create_sdp virtual method X-Git-Tag: 1.6.0~751 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=228e2ccc2d7fb5df5620645b372069376b67683a;p=platform%2Fupstream%2Fgst-rtsp-server.git rtsp-client: make create_sdp virtual method Fixes https://bugzilla.gnome.org/show_bug.cgi?id=680173 --- diff --git a/gst/rtsp-server/rtsp-client.c b/gst/rtsp-server/rtsp-client.c index 9e9332f..159a718 100644 --- a/gst/rtsp-server/rtsp-client.c +++ b/gst/rtsp-server/rtsp-client.c @@ -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); diff --git a/gst/rtsp-server/rtsp-client.h b/gst/rtsp-server/rtsp-client.h index 97bb0c2..dae2014 100644 --- a/gst/rtsp-server/rtsp-client.h +++ b/gst/rtsp-server/rtsp-client.h @@ -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); };