}
}
+static void
+gst_rtspsrc_collect_payloads (GstRTSPSrc * src, const GstSDPMessage * sdp,
+ const GstSDPMedia * media, GstRTSPStream * stream)
+{
+ const gchar *payload;
+
+ /* we must have a payload. No payload means we cannot create caps */
+ /* FIXME, handle multiple formats. The problem here is that we just want to
+ * take the first available format that we can handle but in order to do that
+ * we need to scan for depayloader plugins. Scanning for payloader plugins is
+ * also suboptimal because the user maybe just wants to save the raw stream
+ * and then we don't care. */
+ if ((payload = gst_sdp_media_get_format (media, 0))) {
+ stream->pt = atoi (payload);
+ /* convert caps */
+ stream->caps = gst_rtspsrc_media_to_caps (stream->pt, media);
+
+ GST_DEBUG ("mapping sdp session level attributes to caps");
+ gst_rtspsrc_sdp_attributes_to_caps (sdp->attributes, stream->caps);
+ GST_DEBUG ("mapping sdp media level attributes to caps");
+ gst_rtspsrc_sdp_attributes_to_caps (media->attributes, stream->caps);
+
+ if (stream->pt >= 96) {
+ /* If we have a dynamic payload type, see if we have a stream with the
+ * same payload number. If there is one, they are part of the same
+ * container and we only need to add one pad. */
+ if (find_stream (src, &stream->pt, (gpointer) find_stream_by_pt)) {
+ stream->container = TRUE;
+ GST_DEBUG ("found another stream with pt %d, marking as container",
+ stream->pt);
+ }
+ }
+ }
+}
+
static const gchar *
get_aggregate_control (GstRTSPSrc * src)
{
{
GstRTSPStream *stream;
const gchar *control_url;
- const gchar *payload;
const GstSDPMedia *media;
/* get media, should not return NULL */
/* collect connection info */
gst_rtspsrc_collect_connections (src, sdp, media, stream);
- /* we must have a payload. No payload means we cannot create caps */
- /* FIXME, handle multiple formats. The problem here is that we just want to
- * take the first available format that we can handle but in order to do that
- * we need to scan for depayloader plugins. Scanning for payloader plugins is
- * also suboptimal because the user maybe just wants to save the raw stream
- * and then we don't care. */
- if ((payload = gst_sdp_media_get_format (media, 0))) {
- stream->pt = atoi (payload);
- /* convert caps */
- stream->caps = gst_rtspsrc_media_to_caps (stream->pt, media);
-
- GST_DEBUG ("mapping sdp session level attributes to caps");
- gst_rtspsrc_sdp_attributes_to_caps (sdp->attributes, stream->caps);
- GST_DEBUG ("mapping sdp media level attributes to caps");
- gst_rtspsrc_sdp_attributes_to_caps (media->attributes, stream->caps);
+ gst_rtspsrc_collect_payloads (src, sdp, media, stream);
- if (stream->pt >= 96) {
- /* If we have a dynamic payload type, see if we have a stream with the
- * same payload number. If there is one, they are part of the same
- * container and we only need to add one pad. */
- if (find_stream (src, &stream->pt, (gpointer) find_stream_by_pt)) {
- stream->container = TRUE;
- GST_DEBUG ("found another stream with pt %d, marking as container",
- stream->pt);
- }
- }
- }
/* collect port number */
stream->port = gst_sdp_media_get_port (media);