From 522826acfbec1d5e84c8a978112d1542e1ced748 Mon Sep 17 00:00:00 2001 From: Youngwoo Cho Date: Wed, 7 Feb 2024 13:10:10 +0900 Subject: [PATCH] rtsp-server: separate tizen feature code using pre-processor [Version] 1.22.8-5 Change-Id: I5db791f8e8e7c4b13b037e2dedd99486a5dbc003 Signed-off-by: Youngwoo Cho --- packaging/gstreamer.spec | 2 +- .../gst-rtsp-server/gst/rtsp-server/meson.build | 5 ++ .../gst-rtsp-server/gst/rtsp-server/rtsp-client.c | 46 +++++++++++++ .../gst-rtsp-server/gst/rtsp-server/rtsp-client.h | 4 ++ .../gst/rtsp-server/rtsp-media-factory-uri.c | 2 + .../gst-rtsp-server/gst/rtsp-server/rtsp-media.c | 78 +++++++++++++++++++++- .../gst-rtsp-server/gst/rtsp-server/rtsp-media.h | 9 +++ .../gst/rtsp-server/rtsp-server-object.h | 2 + .../gst-rtsp-server/gst/rtsp-server/rtsp-server.c | 10 +++ .../gst-rtsp-server/gst/rtsp-server/rtsp-stream.c | 10 +++ .../gst-rtsp-server/gst/rtsp-server/rtsp-stream.h | 2 + subprojects/gst-rtsp-server/meson.build | 1 + 12 files changed, 169 insertions(+), 2 deletions(-) diff --git a/packaging/gstreamer.spec b/packaging/gstreamer.spec index b2899b9..fe3b1fa 100644 --- a/packaging/gstreamer.spec +++ b/packaging/gstreamer.spec @@ -62,7 +62,7 @@ Name: %{_name} Version: 1.22.8 -Release: 4 +Release: 5 Summary: Streaming-Media Framework Runtime License: LGPL-2.0+ Group: Multimedia/Framework diff --git a/subprojects/gst-rtsp-server/gst/rtsp-server/meson.build b/subprojects/gst-rtsp-server/gst/rtsp-server/meson.build index 30c9da9..12c8bcf 100644 --- a/subprojects/gst-rtsp-server/gst/rtsp-server/meson.build +++ b/subprojects/gst-rtsp-server/gst/rtsp-server/meson.build @@ -1,3 +1,5 @@ +extra_defs = [] + rtsp_server_sources = files( 'rtsp-address-pool.c', 'rtsp-auth.c', @@ -76,11 +78,14 @@ gst_rtsp_server = library('gstrtspserver-@0@'.format(api_version), install : true, dependencies : gst_rtsp_server_deps) +extra_defs += ['-DTIZEN_FEATURE_RTSP_SERVER_MODIFICATION'] + library_def = {'lib': gst_rtsp_server} pkg_name = 'gstreamer-rtsp-server-' + api_version pkgconfig.generate(gst_rtsp_server, libraries : [gst_dep], subdirs : pkgconfig_subdirs, + extra_cflags : extra_defs, name : 'gstreamer-rtsp-server-1.0', description : 'GStreamer based RTSP server', ) diff --git a/subprojects/gst-rtsp-server/gst/rtsp-server/rtsp-client.c b/subprojects/gst-rtsp-server/gst/rtsp-server/rtsp-client.c index 382ef2f..ccba62e 100644 --- a/subprojects/gst-rtsp-server/gst/rtsp-server/rtsp-client.c +++ b/subprojects/gst-rtsp-server/gst/rtsp-server/rtsp-client.c @@ -202,6 +202,8 @@ static GstRTSPResult default_params_get (GstRTSPClient * client, GstRTSPContext * ctx); static gchar *default_make_path_from_uri (GstRTSPClient * client, const GstRTSPUrl * uri); + +#ifdef TIZEN_FEATURE_RTSP_SERVER_MODIFICATION static gboolean default_handle_options_request (GstRTSPClient * client, GstRTSPContext * ctx, GstRTSPVersion version); static gboolean default_handle_set_param_request (GstRTSPClient * client, @@ -210,6 +212,7 @@ static gboolean default_handle_get_param_request (GstRTSPClient * client, GstRTSPContext * ctx); static gboolean default_handle_play_request (GstRTSPClient * client, GstRTSPContext * ctx); +#endif static void client_session_removed (GstRTSPSessionPool * pool, GstRTSPSession * session, GstRTSPClient * client); @@ -238,10 +241,13 @@ gst_rtsp_client_class_init (GstRTSPClientClass * klass) klass->params_set = default_params_set; klass->params_get = default_params_get; klass->make_path_from_uri = default_make_path_from_uri; + +#ifdef TIZEN_FEATURE_RTSP_SERVER_MODIFICATION klass->handle_options_request = default_handle_options_request; klass->handle_set_param_request = default_handle_set_param_request; klass->handle_get_param_request = default_handle_get_param_request; klass->handle_play_request = default_handle_play_request; +#endif klass->pre_options_request = default_pre_signal_handler; klass->pre_describe_request = default_pre_signal_handler; @@ -1611,7 +1617,11 @@ default_params_get (GstRTSPClient * client, GstRTSPContext * ctx) } static gboolean +#ifdef TIZEN_FEATURE_RTSP_SERVER_MODIFICATION default_handle_get_param_request (GstRTSPClient * client, GstRTSPContext * ctx) +#else +handle_get_param_request (GstRTSPClient * client, GstRTSPContext * ctx) +#endif { GstRTSPResult res; guint8 *data; @@ -1669,7 +1679,11 @@ bad_request: } static gboolean +#ifdef TIZEN_FEATURE_RTSP_SERVER_MODIFICATION default_handle_set_param_request (GstRTSPClient * client, GstRTSPContext * ctx) +#else +handle_set_param_request (GstRTSPClient * client, GstRTSPContext * ctx) +#endif { GstRTSPResult res; guint8 *data; @@ -2088,7 +2102,11 @@ seek_failed: } static gboolean +#ifdef TIZEN_FEATURE_RTSP_SERVER_MODIFICATION default_handle_play_request (GstRTSPClient * client, GstRTSPContext * ctx) +#else +handle_play_request (GstRTSPClient * client, GstRTSPContext * ctx) +#endif { GstRTSPSession *session; GstRTSPClientClass *klass; @@ -3054,8 +3072,10 @@ handle_setup_request (GstRTSPClient * client, GstRTSPContext * ctx) st = make_server_transport (client, media, ctx, ct); trans_str = gst_rtsp_transport_as_text (st); +#ifdef TIZEN_FEATURE_RTSP_SERVER_MODIFICATION /* FIXME-WFD : Temporarily force to set profile string */ trans_str = g_strjoinv ("RTP/AVP/UDP", g_strsplit (trans_str, "RTP/AVP", -1)); +#endif gst_rtsp_transport_free (st); @@ -3817,7 +3837,11 @@ unsuspend_failed: } static gboolean +#ifdef TIZEN_FEATURE_RTSP_SERVER_MODIFICATION default_handle_options_request (GstRTSPClient * client, GstRTSPContext * ctx, +#else +handle_options_request (GstRTSPClient * client, GstRTSPContext * ctx, +#endif GstRTSPVersion version) { GstRTSPMethod options; @@ -4016,9 +4040,11 @@ handle_request (GstRTSPClient * client, GstRTSPMessage * request) GstRTSPMessage response = { 0 }; gchar *unsupported_reqs = NULL; gchar *sessid = NULL, *pipelined_request_id = NULL; +#ifdef TIZEN_FEATURE_RTSP_SERVER_MODIFICATION GstRTSPClientClass *klass; klass = GST_RTSP_CLIENT_GET_CLASS (client); +#endif if (!(ctx = gst_rtsp_context_get_current ())) { ctx = &sctx; ctx->auth = priv->auth; @@ -4125,7 +4151,11 @@ handle_request (GstRTSPClient * client, GstRTSPMessage * request) switch (method) { case GST_RTSP_OPTIONS: priv->version = version; +#ifdef TIZEN_FEATURE_RTSP_SERVER_MODIFICATION klass->handle_options_request (client, ctx, version); +#else + handle_options_request (client, ctx, version); +#endif break; case GST_RTSP_DESCRIBE: handle_describe_request (client, ctx); @@ -4134,7 +4164,11 @@ handle_request (GstRTSPClient * client, GstRTSPMessage * request) handle_setup_request (client, ctx); break; case GST_RTSP_PLAY: +#ifdef TIZEN_FEATURE_RTSP_SERVER_MODIFICATION klass->handle_play_request (client, ctx); +#else + handle_play_request (client, ctx); +#endif break; case GST_RTSP_PAUSE: handle_pause_request (client, ctx); @@ -4143,10 +4177,18 @@ handle_request (GstRTSPClient * client, GstRTSPMessage * request) handle_teardown_request (client, ctx); break; case GST_RTSP_SET_PARAMETER: +#ifdef TIZEN_FEATURE_RTSP_SERVER_MODIFICATION klass->handle_set_param_request (client, ctx); +#else + handle_set_param_request (client, ctx); +#endif break; case GST_RTSP_GET_PARAMETER: +#ifdef TIZEN_FEATURE_RTSP_SERVER_MODIFICATION klass->handle_get_param_request (client, ctx); +#else + handle_get_param_request (client, ctx); +#endif break; case GST_RTSP_ANNOUNCE: if (version >= GST_RTSP_VERSION_2_0) @@ -4711,7 +4753,9 @@ gst_rtsp_client_set_connection (GstRTSPClient * client, } else { priv->is_ipv6 = g_socket_get_family (read_socket) == G_SOCKET_FAMILY_IPV6; priv->server_ip = g_strdup ("unknown"); +#ifdef TIZEN_FEATURE_BUG_FIX g_object_unref (address); +#endif } GST_INFO ("client %p connected to server ip %s, ipv6 = %d", client, @@ -5487,6 +5531,7 @@ restart: return result; } +#ifdef TIZEN_FEATURE_RTSP_SERVER_MODIFICATION /** * gst_rtsp_client_set_watch_flushing: * @client: a #GstRTSPClient @@ -5508,3 +5553,4 @@ gst_rtsp_client_set_watch_flushing (GstRTSPClient * client, gboolean val) gst_rtsp_watch_set_flushing (priv->watch, val); } } +#endif diff --git a/subprojects/gst-rtsp-server/gst/rtsp-server/rtsp-client.h b/subprojects/gst-rtsp-server/gst/rtsp-server/rtsp-client.h index 7df4c52..1d5d8ec 100644 --- a/subprojects/gst-rtsp-server/gst/rtsp-server/rtsp-client.h +++ b/subprojects/gst-rtsp-server/gst/rtsp-server/rtsp-client.h @@ -131,10 +131,12 @@ struct _GstRTSPClientClass { GstRTSPResult (*params_set) (GstRTSPClient *client, GstRTSPContext *ctx); GstRTSPResult (*params_get) (GstRTSPClient *client, GstRTSPContext *ctx); gchar * (*make_path_from_uri) (GstRTSPClient *client, const GstRTSPUrl *uri); +#ifdef TIZEN_FEATURE_RTSP_SERVER_MODIFICATION gboolean (*handle_options_request) (GstRTSPClient * client, GstRTSPContext * ctx, GstRTSPVersion version); gboolean (*handle_set_param_request) (GstRTSPClient * client, GstRTSPContext * ctx); gboolean (*handle_get_param_request) (GstRTSPClient * client, GstRTSPContext * ctx); gboolean (*handle_play_request) (GstRTSPClient * client, GstRTSPContext * ctx); +#endif GstRTSPStatusCode (*adjust_play_mode) (GstRTSPClient * client, GstRTSPContext * context, GstRTSPTimeRange ** range, @@ -271,8 +273,10 @@ GstRTSPResult gst_rtsp_client_send_message (GstRTSPClient * client, GstRTSPSession *session, GstRTSPMessage *message); +#ifdef TIZEN_FEATURE_RTSP_SERVER_MODIFICATION GST_RTSP_SERVER_API void gst_rtsp_client_set_watch_flushing (GstRTSPClient * client, gboolean val); +#endif /** * GstRTSPClientSessionFilterFunc: * @client: a #GstRTSPClient object diff --git a/subprojects/gst-rtsp-server/gst/rtsp-server/rtsp-media-factory-uri.c b/subprojects/gst-rtsp-server/gst/rtsp-server/rtsp-media-factory-uri.c index 22befcc..fe6b99c 100644 --- a/subprojects/gst-rtsp-server/gst/rtsp-server/rtsp-media-factory-uri.c +++ b/subprojects/gst-rtsp-server/gst/rtsp-server/rtsp-media-factory-uri.c @@ -641,7 +641,9 @@ no_uridecodebin: { g_critical ("can't create uridecodebin element"); gst_object_unref (element); +#ifdef TIZEN_FEATURE_BUG_FIX gst_object_unref (topbin); +#endif return NULL; } } diff --git a/subprojects/gst-rtsp-server/gst/rtsp-server/rtsp-media.c b/subprojects/gst-rtsp-server/gst/rtsp-server/rtsp-media.c index b5bf472..995e0d9 100644 --- a/subprojects/gst-rtsp-server/gst/rtsp-server/rtsp-media.c +++ b/subprojects/gst-rtsp-server/gst/rtsp-server/rtsp-media.c @@ -218,8 +218,10 @@ enum SIGNAL_TARGET_STATE, SIGNAL_NEW_STATE, SIGNAL_HANDLE_MESSAGE, +#ifdef TIZEN_FEATURE_RTSP_SERVER_MODIFICATION SIGNAL_PREPARING, SIGNAL_UNPREPARING, +#endif SIGNAL_LAST }; @@ -236,7 +238,9 @@ static gboolean default_handle_message (GstRTSPMedia * media, GstMessage * message); static void finish_unprepare (GstRTSPMedia * media); static gboolean default_prepare (GstRTSPMedia * media, GstRTSPThread * thread); +#ifdef TIZEN_FEATURE_RTSP_SERVER_MODIFICATION static gboolean default_start_preroll (GstRTSPMedia * media); +#endif static gboolean default_unprepare (GstRTSPMedia * media); static gboolean default_suspend (GstRTSPMedia * media); static gboolean default_unsuspend (GstRTSPMedia * media); @@ -249,7 +253,9 @@ static GstElement *default_create_rtpbin (GstRTSPMedia * media); static gboolean default_setup_sdp (GstRTSPMedia * media, GstSDPMessage * sdp, GstSDPInfo * info); static gboolean default_handle_sdp (GstRTSPMedia * media, GstSDPMessage * sdp); +#ifdef TIZEN_FEATURE_RTSP_SERVER_MODIFICATION static gboolean default_start_prepare (GstRTSPMedia * media); +#endif static gboolean wait_preroll (GstRTSPMedia * media); @@ -474,6 +480,7 @@ gst_rtsp_media_class_init (GstRTSPMediaClass * klass) handle_message), NULL, NULL, NULL, G_TYPE_BOOLEAN, 1, GST_TYPE_MESSAGE); +#ifdef TIZEN_FEATURE_RTSP_SERVER_MODIFICATION gst_rtsp_media_signals[SIGNAL_PREPARING] = g_signal_new ("preparing", G_TYPE_FROM_CLASS (klass), G_SIGNAL_RUN_LAST, G_STRUCT_OFFSET (GstRTSPMediaClass, preparing), NULL, NULL, @@ -485,12 +492,15 @@ gst_rtsp_media_class_init (GstRTSPMediaClass * klass) G_STRUCT_OFFSET (GstRTSPMediaClass, unpreparing), NULL, NULL, NULL, G_TYPE_NONE, 2, GST_TYPE_RTSP_STREAM, G_TYPE_UINT); +#endif GST_DEBUG_CATEGORY_INIT (rtsp_media_debug, "rtspmedia", 0, "GstRTSPMedia"); klass->handle_message = default_handle_message; klass->prepare = default_prepare; +#ifdef TIZEN_FEATURE_RTSP_SERVER_MODIFICATION klass->start_preroll = default_start_preroll; +#endif klass->unprepare = default_unprepare; klass->suspend = default_suspend; klass->unsuspend = default_unsuspend; @@ -500,7 +510,9 @@ gst_rtsp_media_class_init (GstRTSPMediaClass * klass) klass->create_rtpbin = default_create_rtpbin; klass->setup_sdp = default_setup_sdp; klass->handle_sdp = default_handle_sdp; +#ifdef TIZEN_FEATURE_RTSP_SERVER_MODIFICATION klass->start_prepare = default_start_prepare; +#endif } static void @@ -2822,7 +2834,11 @@ media_streams_set_blocked (GstRTSPMedia * media, gboolean blocked) priv->blocking_msg_received = 0; } +#ifdef TIZEN_FEATURE_RTSP_SERVER_MODIFICATION void +#else +static void +#endif gst_rtsp_media_set_status (GstRTSPMedia * media, GstRTSPMediaStatus status) { GstRTSPMediaPrivate *priv = media->priv; @@ -3180,6 +3196,7 @@ set_state (GstRTSPMedia * media, GstState state) media); ret = gst_element_set_state (priv->pipeline, state); +#ifdef TIZEN_FEATURE_RTSP_SERVER_MODIFICATION { gchar *filename = NULL; filename = g_strdup_printf ("media_%s", gst_element_state_get_name (state)); @@ -3188,12 +3205,18 @@ set_state (GstRTSPMedia * media, GstState state) g_free (filename); } +#endif return ret; } +#ifdef TIZEN_FEATURE_RTSP_SERVER_MODIFICATION GstStateChangeReturn gst_rtsp_media_set_target_state (GstRTSPMedia * media, GstState state, gboolean do_state) +#else +static GstStateChangeReturn +set_target_state (GstRTSPMedia * media, GstState state, gboolean do_state) +#endif { GstRTSPMediaPrivate *priv = media->priv; GstStateChangeReturn ret; @@ -3604,7 +3627,11 @@ struct _DynPaySignalHandlers }; static gboolean +#ifdef TIZEN_FEATURE_RTSP_SERVER_MODIFICATION default_start_preroll (GstRTSPMedia * media) +#else +start_preroll (GstRTSPMedia * media) +#endif { GstRTSPMediaPrivate *priv = media->priv; GstStateChangeReturn ret; @@ -3613,7 +3640,11 @@ default_start_preroll (GstRTSPMedia * media) /* start blocked since it is possible that there are no sink elements yet */ media_streams_set_blocked (media, TRUE); +#ifdef TIZEN_FEATURE_RTSP_SERVER_MODIFICATION ret = gst_rtsp_media_set_target_state (media, GST_STATE_PAUSED, TRUE); +#else + ret = set_target_state (media, GST_STATE_PAUSED, TRUE); +#endif switch (ret) { case GST_STATE_CHANGE_SUCCESS: @@ -3745,10 +3776,16 @@ request_fec_decoder (GstElement * rtpbin, guint sessid, GstRTSPMedia * media) } static gboolean +#ifdef TIZEN_FEATURE_RTSP_SERVER_MODIFICATION default_start_prepare (GstRTSPMedia * media) +#else +start_prepare (GstRTSPMedia * media) +#endif { GstRTSPMediaPrivate *priv = media->priv; +#ifdef TIZEN_FEATURE_RTSP_SERVER_MODIFICATION GstRTSPMediaClass *klass; +#endif guint i; GList *walk; @@ -3758,8 +3795,9 @@ default_start_prepare (GstRTSPMedia * media) g_signal_connect (priv->rtpbin, "request-fec-decoder", G_CALLBACK (request_fec_decoder), media); - +#ifdef TIZEN_FEATURE_RTSP_SERVER_MODIFICATION klass = GST_RTSP_MEDIA_GET_CLASS (media); +#endif /* link streams we already have, other streams might appear when we have * dynamic elements */ @@ -3784,8 +3822,10 @@ default_start_prepare (GstRTSPMedia * media) goto join_bin_failed; } +#ifdef TIZEN_FEATURE_RTSP_SERVER_MODIFICATION g_signal_emit (media, gst_rtsp_media_signals[SIGNAL_PREPARING], 0, stream, i, NULL); +#endif } if (priv->rtpbin) @@ -3813,7 +3853,11 @@ default_start_prepare (GstRTSPMedia * media) * a second ASYNC state change failing */ priv->is_live = TRUE; gst_rtsp_media_set_status (media, GST_RTSP_MEDIA_STATUS_PREPARED); +#ifdef TIZEN_FEATURE_RTSP_SERVER_MODIFICATION } else if (!klass->start_preroll (media)) { +#else + } else if (!start_preroll (media)) { +#endif goto preroll_failed; } @@ -3895,9 +3939,14 @@ default_prepare (GstRTSPMedia * media, GstRTSPThread * thread) /* do remainder in context */ source = g_idle_source_new (); +#ifdef TIZEN_FEATURE_RTSP_SERVER_MODIFICATION if (klass->start_prepare) g_source_set_callback (source, (GSourceFunc) klass->start_prepare, g_object_ref (media), (GDestroyNotify) g_object_unref); +#else + g_source_set_callback (source, (GSourceFunc) start_prepare, + g_object_ref (media), (GDestroyNotify) g_object_unref); +#endif g_source_attach (source, context); g_source_unref (source); @@ -4077,8 +4126,10 @@ finish_unprepare (GstRTSPMedia * media) gst_rtsp_stream_leave_bin (stream, GST_BIN (priv->pipeline), priv->rtpbin); +#ifdef TIZEN_FEATURE_RTSP_SERVER_MODIFICATION g_signal_emit (media, gst_rtsp_media_signals[SIGNAL_UNPREPARING], 0, stream, i, NULL); +#endif } /* remove the pad signal handlers */ @@ -4187,7 +4238,11 @@ gst_rtsp_media_unprepare (GstRTSPMedia * media) goto is_unpreparing; GST_INFO ("unprepare media %p", media); +#ifdef TIZEN_FEATURE_RTSP_SERVER_MODIFICATION gst_rtsp_media_set_target_state (media, GST_STATE_NULL, FALSE); +#else + set_target_state (media, GST_STATE_NULL, FALSE); +#endif success = TRUE; if (priv->status == GST_RTSP_MEDIA_STATUS_PREPARED @@ -4607,13 +4662,21 @@ default_suspend (GstRTSPMedia * media) break; case GST_RTSP_SUSPEND_MODE_PAUSE: GST_DEBUG ("media %p suspend to PAUSED", media); +#ifdef TIZEN_FEATURE_RTSP_SERVER_MODIFICATION ret = gst_rtsp_media_set_target_state (media, GST_STATE_PAUSED, TRUE); +#else + ret = set_target_state (media, GST_STATE_PAUSED, TRUE); +#endif if (ret == GST_STATE_CHANGE_FAILURE) goto state_failed; break; case GST_RTSP_SUSPEND_MODE_RESET: GST_DEBUG ("media %p suspend to NULL", media); +#ifdef TIZEN_FEATURE_RTSP_SERVER_MODIFICATION ret = gst_rtsp_media_set_target_state (media, GST_STATE_NULL, TRUE); +#else + ret = set_target_state (media, GST_STATE_NULL, TRUE); +#endif if (ret == GST_STATE_CHANGE_FAILURE) goto state_failed; /* Because payloader needs to set the sequence number as @@ -4720,9 +4783,11 @@ default_unsuspend (GstRTSPMedia * media) { GstRTSPMediaPrivate *priv = media->priv; gboolean preroll_ok; +#ifdef TIZEN_FEATURE_RTSP_SERVER_MODIFICATION GstRTSPMediaClass *klass; klass = GST_RTSP_MEDIA_GET_CLASS (media); +#endif switch (priv->suspend_mode) { case GST_RTSP_SUSPEND_MODE_NONE: @@ -4747,9 +4812,14 @@ default_unsuspend (GstRTSPMedia * media) * specific transport parts: all active streams contain at least one sink * element and it's safe to unblock all blocked streams */ media_streams_set_blocked (media, FALSE); +#ifdef TIZEN_FEATURE_RTSP_SERVER_MODIFICATION if (klass->start_preroll) if (!klass->start_preroll (media)) goto start_failed; +#else + if (!start_preroll (media)) + goto start_failed; +#endif g_rec_mutex_unlock (&priv->state_lock); preroll_ok = wait_preroll (media); @@ -4847,7 +4917,11 @@ media_set_pipeline_state_locked (GstRTSPMedia * media, GstState state) gst_rtsp_media_unprepare (media); } else { GST_INFO ("state %s media %p", gst_element_state_get_name (state), media); +#ifdef TIZEN_FEATURE_RTSP_SERVER_MODIFICATION gst_rtsp_media_set_target_state (media, state, FALSE); +#else + set_target_state (media, state, FALSE); +#endif if (state == GST_STATE_PLAYING) { /* make sure pads are not blocking anymore when going to PLAYING */ @@ -5288,6 +5362,7 @@ gst_rtsp_media_get_rate_control (GstRTSPMedia * media) return res; } +#ifdef TIZEN_FEATURE_RTSP_SERVER_MODIFICATION GstElement * gst_rtsp_media_get_pipeline (GstRTSPMedia * media) { @@ -5320,3 +5395,4 @@ gst_rtsp_media_get_rtpbin (GstRTSPMedia * media) return priv->rtpbin; } +#endif diff --git a/subprojects/gst-rtsp-server/gst/rtsp-server/rtsp-media.h b/subprojects/gst-rtsp-server/gst/rtsp-server/rtsp-media.h index d2d2c99..8e33669 100644 --- a/subprojects/gst-rtsp-server/gst/rtsp-server/rtsp-media.h +++ b/subprojects/gst-rtsp-server/gst/rtsp-server/rtsp-media.h @@ -164,7 +164,9 @@ struct _GstRTSPMediaClass { /* vmethods */ gboolean (*handle_message) (GstRTSPMedia *media, GstMessage *message); gboolean (*prepare) (GstRTSPMedia *media, GstRTSPThread *thread); +#ifdef TIZEN_FEATURE_RTSP_SERVER_MODIFICATION gboolean (*start_preroll) (GstRTSPMedia *media); +#endif gboolean (*unprepare) (GstRTSPMedia *media); gboolean (*suspend) (GstRTSPMedia *media); gboolean (*unsuspend) (GstRTSPMedia *media); @@ -175,7 +177,9 @@ struct _GstRTSPMediaClass { GstElement * (*create_rtpbin) (GstRTSPMedia *media); gboolean (*setup_rtpbin) (GstRTSPMedia *media, GstElement *rtpbin); gboolean (*setup_sdp) (GstRTSPMedia *media, GstSDPMessage *sdp, GstSDPInfo *info); +#ifdef TIZEN_FEATURE_RTSP_SERVER_MODIFICATION gboolean (*start_prepare) (GstRTSPMedia *media); +#endif /* signals */ void (*new_stream) (GstRTSPMedia *media, GstRTSPStream * stream); @@ -189,8 +193,11 @@ struct _GstRTSPMediaClass { gboolean (*handle_sdp) (GstRTSPMedia *media, GstSDPMessage *sdp); +#ifdef TIZEN_FEATURE_RTSP_SERVER_MODIFICATION void (*preparing) (GstRTSPMedia *media, GstRTSPStream * stream, guint idx); void (*unpreparing) (GstRTSPMedia *media, GstRTSPStream * stream, guint idx); +#endif + /*< private >*/ gpointer _gst_reserved[GST_PADDING_LARGE-1]; }; @@ -429,6 +436,7 @@ GST_RTSP_SERVER_API void gst_rtsp_media_set_pipeline_state (GstRTSPMedia * media, GstState state); +#ifdef TIZEN_FEATURE_RTSP_SERVER_MODIFICATION GST_RTSP_SERVER_API GstStateChangeReturn gst_rtsp_media_set_target_state (GstRTSPMedia * media, GstState state, gboolean do_state); @@ -440,6 +448,7 @@ GstElement * gst_rtsp_media_get_pipeline (GstRTSPMedia * media); GST_RTSP_SERVER_API GstElement * gst_rtsp_media_get_rtpbin (GstRTSPMedia * media); +#endif GST_RTSP_SERVER_API gboolean gst_rtsp_media_complete_pipeline (GstRTSPMedia * media, GPtrArray * transports); diff --git a/subprojects/gst-rtsp-server/gst/rtsp-server/rtsp-server-object.h b/subprojects/gst-rtsp-server/gst/rtsp-server/rtsp-server-object.h index 44f9055..2e31b30 100644 --- a/subprojects/gst-rtsp-server/gst/rtsp-server/rtsp-server-object.h +++ b/subprojects/gst-rtsp-server/gst/rtsp-server/rtsp-server-object.h @@ -85,7 +85,9 @@ struct _GstRTSPServerClass { GObjectClass parent_class; GstRTSPClient * (*create_client) (GstRTSPServer *server); +#ifdef TIZEN_FEATURE_RTSP_SERVER_MODIFICATION GSocket * (*create_socket) (GstRTSPServer * server, GCancellable * cancellable, GError ** error); +#endif /* signals */ void (*client_connected) (GstRTSPServer *server, GstRTSPClient *client); diff --git a/subprojects/gst-rtsp-server/gst/rtsp-server/rtsp-server.c b/subprojects/gst-rtsp-server/gst/rtsp-server/rtsp-server.c index af317ac..7086cc2 100644 --- a/subprojects/gst-rtsp-server/gst/rtsp-server/rtsp-server.c +++ b/subprojects/gst-rtsp-server/gst/rtsp-server/rtsp-server.c @@ -246,7 +246,9 @@ gst_rtsp_server_class_init (GstRTSPServerClass * klass) NULL, NULL, NULL, G_TYPE_NONE, 1, GST_TYPE_RTSP_CLIENT); klass->create_client = default_create_client; +#ifdef TIZEN_FEATURE_RTSP_SERVER_MODIFICATION klass->create_socket = gst_rtsp_server_create_socket; +#endif GST_DEBUG_CATEGORY_INIT (rtsp_server_debug, "rtspserver", 0, "GstRTSPServer"); } @@ -1340,17 +1342,25 @@ gst_rtsp_server_create_source (GstRTSPServer * server, GCancellable * cancellable, GError ** error) { GstRTSPServerPrivate *priv; +#ifdef TIZEN_FEATURE_RTSP_SERVER_MODIFICATION GstRTSPServerClass *klass; GSocket *socket = NULL, *old; +#else + GSocket *socket, *old; +#endif GSource *source; g_return_val_if_fail (GST_IS_RTSP_SERVER (server), NULL); priv = server->priv; +#ifdef TIZEN_FEATURE_RTSP_SERVER_MODIFICATION klass = GST_RTSP_SERVER_GET_CLASS (server); if (klass->create_socket) socket = klass->create_socket (server, NULL, error); +#else + socket = gst_rtsp_server_create_socket (server, NULL, error); +#endif if (socket == NULL) goto no_socket; diff --git a/subprojects/gst-rtsp-server/gst/rtsp-server/rtsp-stream.c b/subprojects/gst-rtsp-server/gst/rtsp-server/rtsp-stream.c index 355bb03..e5d0a00 100644 --- a/subprojects/gst-rtsp-server/gst/rtsp-server/rtsp-stream.c +++ b/subprojects/gst-rtsp-server/gst/rtsp-server/rtsp-stream.c @@ -255,7 +255,9 @@ enum SIGNAL_NEW_RTP_ENCODER, SIGNAL_NEW_RTCP_ENCODER, SIGNAL_NEW_RTP_RTCP_DECODER, +#ifdef TIZEN_FEATURE_RTSP_SERVER_MODIFICATION SIGNAL_RTCP_STATS, +#endif SIGNAL_LAST }; @@ -317,10 +319,12 @@ gst_rtsp_stream_class_init (GstRTSPStreamClass * klass) g_signal_new ("new-rtp-rtcp-decoder", G_TYPE_FROM_CLASS (klass), G_SIGNAL_RUN_LAST, 0, NULL, NULL, NULL, G_TYPE_NONE, 1, GST_TYPE_ELEMENT); +#ifdef TIZEN_FEATURE_RTSP_SERVER_MODIFICATION gst_rtsp_stream_signals[SIGNAL_RTCP_STATS] = g_signal_new ("rtcp-statistics", G_TYPE_FROM_CLASS (klass), G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_marshal_generic, G_TYPE_NONE, 1, GST_TYPE_STRUCTURE); +#endif GST_DEBUG_CATEGORY_INIT (rtsp_stream_debug, "rtspstream", 0, "GstRTSPStream"); @@ -2432,8 +2436,10 @@ check_transport (GObject * source, GstRTSPStream * stream) dump_structure (stats); +#ifdef TIZEN_FEATURE_RTSP_SERVER_MODIFICATION g_signal_emit (stream, gst_rtsp_stream_signals[SIGNAL_RTCP_STATS], 0, stats); +#endif rtcp_from = gst_structure_get_string (stats, "rtcp-from"); if ((trans = find_transport (stream, rtcp_from))) { @@ -2484,8 +2490,10 @@ on_ssrc_active (GObject * session, GObject * source, GstRTSPStream * stream) GstStructure *stats; g_object_get (source, "stats", &stats, NULL); if (stats) { +#ifdef TIZEN_FEATURE_RTSP_SERVER_MODIFICATION g_signal_emit (stream, gst_rtsp_stream_signals[SIGNAL_RTCP_STATS], 0, stats); +#endif dump_structure (stats); gst_structure_free (stats); @@ -5223,6 +5231,7 @@ gst_rtsp_stream_get_current_seqnum (GstRTSPStream * stream) return seqnum; } +#ifdef TIZEN_FEATURE_RTSP_SERVER_MODIFICATION guint64 gst_rtsp_stream_get_udp_sent_bytes (GstRTSPStream * stream) { @@ -5237,6 +5246,7 @@ gst_rtsp_stream_get_udp_sent_bytes (GstRTSPStream * stream) return bytes; } +#endif /** * gst_rtsp_stream_transport_filter: diff --git a/subprojects/gst-rtsp-server/gst/rtsp-server/rtsp-stream.h b/subprojects/gst-rtsp-server/gst/rtsp-server/rtsp-stream.h index db9d5cf..919e11a 100644 --- a/subprojects/gst-rtsp-server/gst/rtsp-server/rtsp-stream.h +++ b/subprojects/gst-rtsp-server/gst/rtsp-server/rtsp-stream.h @@ -269,8 +269,10 @@ void gst_rtsp_stream_set_seqnum_offset (GstRTSPStream *str GST_RTSP_SERVER_API guint16 gst_rtsp_stream_get_current_seqnum (GstRTSPStream *stream); +#ifdef TIZEN_FEATURE_RTSP_SERVER_MODIFICATION GST_RTSP_SERVER_API guint64 gst_rtsp_stream_get_udp_sent_bytes (GstRTSPStream *stream); +#endif GST_RTSP_SERVER_API void gst_rtsp_stream_set_retransmission_time (GstRTSPStream *stream, GstClockTime time); diff --git a/subprojects/gst-rtsp-server/meson.build b/subprojects/gst-rtsp-server/meson.build index ae6b59e..4b1f80f 100644 --- a/subprojects/gst-rtsp-server/meson.build +++ b/subprojects/gst-rtsp-server/meson.build @@ -155,6 +155,7 @@ if host_machine.system() != 'windows' endif # TIZEN_BUILD_OPTION +cdata.set('TIZEN_FEATURE_RTSP_SERVER_MODIFICATION', true) cdata.set('TIZEN_FEATURE_BUG_FIX', true) if get_option('tv-profile') -- 2.7.4