summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWim Taymans <wim.taymans@collabora.co.uk>2009-05-23 16:17:02 +0200
committerWim Taymans <wim@metal.(none)>2009-05-23 16:17:02 +0200
commit8fcbe501dcecb2ebc18de9691eeb2f67e0ebad4c (patch)
tree724424486e0f030ac1e8ca11f8cae7a1310feeed
parentbace3b601b50335af9b62de1c04148f28f6c86ad (diff)
client: only add RTP-Info when we have the info
Only add RTP-Info for a stream when we can get the seqnum and timestamp from the depayloader.
-rw-r--r--gst/rtsp-server/rtsp-client.c30
1 files changed, 21 insertions, 9 deletions
diff --git a/gst/rtsp-server/rtsp-client.c b/gst/rtsp-server/rtsp-client.c
index 27adf05..8138cef 100644
--- a/gst/rtsp-server/rtsp-client.c
+++ b/gst/rtsp-server/rtsp-client.c
@@ -465,7 +465,7 @@ handle_play_request (GstRTSPClient *client, GstRTSPUrl *uri, GstRTSPSession *ses
GstRTSPMessage response = { 0 };
GstRTSPStatusCode code;
GString *rtpinfo;
- guint n_streams, i;
+ guint n_streams, i, infocount;
guint timestamp, seqnum;
gchar *str;
GstRTSPTimeRange *range;
@@ -498,10 +498,11 @@ handle_play_request (GstRTSPClient *client, GstRTSPUrl *uri, GstRTSPSession *ses
rtpinfo = g_string_new ("");
n_streams = gst_rtsp_media_n_streams (media->media);
- for (i = 0; i < n_streams; i++) {
+ for (i = 0, infocount = 0; i < n_streams; i++) {
GstRTSPSessionStream *sstream;
GstRTSPMediaStream *stream;
GstRTSPTransport *tr;
+ GObjectClass *payobjclass;
gchar *uristr;
/* get the stream as configured in the session */
@@ -517,15 +518,26 @@ handle_play_request (GstRTSPClient *client, GstRTSPUrl *uri, GstRTSPSession *ses
stream = sstream->media_stream;
- g_object_get (G_OBJECT (stream->payloader), "seqnum", &seqnum, NULL);
- g_object_get (G_OBJECT (stream->payloader), "timestamp", &timestamp, NULL);
+ payobjclass = G_OBJECT_GET_CLASS (stream->payloader);
+
+ if (g_object_class_find_property (payobjclass, "seqnum") &&
+ g_object_class_find_property (payobjclass, "timestamp")) {
+ GObject *payobj;
+
+ payobj = G_OBJECT (stream->payloader);
- if (i > 0)
- g_string_append (rtpinfo, ", ");
+ /* only add RTP-Info for streams with seqnum and timestamp */
+ g_object_get (payobj, "seqnum", &seqnum, "timestamp", &timestamp, NULL);
- uristr = gst_rtsp_url_get_request_uri (uri);
- g_string_append_printf (rtpinfo, "url=%s/stream=%d;seq=%u;rtptime=%u", uristr, i, seqnum, timestamp);
- g_free (uristr);
+ if (infocount > 0)
+ g_string_append (rtpinfo, ", ");
+
+ uristr = gst_rtsp_url_get_request_uri (uri);
+ g_string_append_printf (rtpinfo, "url=%s/stream=%d;seq=%u;rtptime=%u", uristr, i, seqnum, timestamp);
+ g_free (uristr);
+
+ infocount++;
+ }
}
/* construct the response now */