GST_DEBUG_OBJECT (src, "stream %p, pt %d, caps %" GST_PTR_FORMAT, stream,
item->pt, caps);
- if (item->pt == stream->default_pt && stream->udpsrc[0]) {
- g_object_set (stream->udpsrc[0], "caps", caps, NULL);
+ if (item->pt == stream->default_pt) {
+ if (stream->udpsrc[0])
+ g_object_set (stream->udpsrc[0], "caps", caps, NULL);
+ stream->need_caps = TRUE;
}
}
}
gst_pad_send_event (ostream->channelpad[0],
gst_event_new_caps (caps));
}
+ ostream->need_caps = FALSE;
if (ostream->profile == GST_RTSP_PROFILE_SAVP ||
ostream->profile == GST_RTSP_PROFILE_SAVPF)
gst_rtspsrc_push_event (src, gst_event_new_segment (&segment));
}
+ if (stream->need_caps) {
+ GstCaps *caps;
+
+ if ((caps = stream_get_caps_for_pt (stream, stream->default_pt))) {
+ /* only streams that have a connection to the outside world */
+ if (stream->setup) {
+ /* Only need to update the TCP caps here, UDP is already handled */
+ if (stream->channelpad[0]) {
+ if (GST_PAD_IS_SRC (stream->channelpad[0]))
+ gst_pad_push_event (stream->channelpad[0],
+ gst_event_new_caps (caps));
+ else
+ gst_pad_send_event (stream->channelpad[0],
+ gst_event_new_caps (caps));
+ }
+ stream->need_caps = FALSE;
+ }
+ }
+
+ stream->need_caps = FALSE;
+ }
+
if (stream->discont && !is_rtcp) {
/* mark first RTP buffer as discont */
GST_BUFFER_FLAG_SET (buf, GST_BUFFER_FLAG_DISCONT);
item->caps = gst_caps_make_writable (item->caps);
s = gst_caps_get_structure (item->caps, 0);
gst_structure_remove_fields (s, "clock-base", "seqnum-base", NULL);
+ if (item->pt == stream->default_pt && stream->udpsrc[0])
+ g_object_set (stream->udpsrc[0], "caps", item->caps, NULL);
}
+ stream->need_caps = TRUE;
}
static GstRTSPResult