{
const gchar *name;
const GstRTSPTransMode mode;
- const gchar *gst_mime;
+ const GstRTSPProfile profile;
+ const gchar *media_type;
const gchar *manager[MAX_MANAGERS];
} GstRTSPTransMap;
static const GstRTSPTransMap transports[] = {
- {"rtp", GST_RTSP_TRANS_RTP, "application/x-rtp", {"rtpbin", "rtpdec"}},
- {"x-real-rdt", GST_RTSP_TRANS_RDT, "application/x-rdt", {"rdtmanager", NULL}},
- {"x-pn-tng", GST_RTSP_TRANS_RDT, "application/x-rdt", {"rdtmanager", NULL}},
- {NULL, GST_RTSP_TRANS_UNKNOWN, NULL, {NULL, NULL}}
+ {"rtp", GST_RTSP_TRANS_RTP, GST_RTSP_PROFILE_AVP, "application/x-rtp",
+ {"rtpbin", "rtpdec"}},
+ {"srtp", GST_RTSP_TRANS_RTP, GST_RTSP_PROFILE_SAVP, "application/x-srtp",
+ {"rtpbin", "rtpdec"}},
+ {"rtpf", GST_RTSP_TRANS_RTP, GST_RTSP_PROFILE_AVPF, "application/x-rtp",
+ {"rtpbin", "rtpdec"}},
+ {"srtpf", GST_RTSP_TRANS_RTP, GST_RTSP_PROFILE_SAVPF, "application/x-srtp",
+ {"rtpbin", "rtpdec"}},
+ {"x-real-rdt", GST_RTSP_TRANS_RDT, GST_RTSP_PROFILE_AVP, "application/x-rdt",
+ {"rdtmanager", NULL}},
+ {"x-pn-tng", GST_RTSP_TRANS_RDT, GST_RTSP_PROFILE_AVP, "application/x-rdt",
+ {"rdtmanager", NULL}},
+ {NULL, GST_RTSP_TRANS_UNKNOWN, GST_RTSP_PROFILE_UNKNOWN, NULL, {NULL, NULL}}
};
typedef struct
* @mime: location to hold the result
*
* Get the mime type of the transport mode @trans. This mime type is typically
- * used to generate #GstCaps on buffers.
+ * used to generate #GstCaps events.
*
- * Returns: #GST_RTSP_OK.
+ * Deprecated: This functions only deals with the GstRTSPTransMode and only
+ * returns the mime type for #GST_RTSP_PROFILE_AVP. Use
+ * gst_rtsp_transport_get_media_type() instead.
+ *
+ * Returns: #GST_RTSP_OK.
*/
GstRTSPResult
gst_rtsp_transport_get_mime (GstRTSPTransMode trans, const gchar ** mime)
g_return_val_if_fail (mime != NULL, GST_RTSP_EINVAL);
for (i = 0; transports[i].name; i++)
- if (transports[i].mode == trans)
+ if (transports[i].mode == trans
+ && transports[i].profile == GST_RTSP_PROFILE_AVP)
+ break;
+ *mime = transports[i].media_type;
+
+ return GST_RTSP_OK;
+}
+
+/**
+ * gst_rtsp_transport_get_media_type:
+ * @transport: a #GstRTSPTransport
+ * @mime: location to hold the result
+ *
+ * Get the media type of @transport. This media type is typically
+ * used to generate #GstCaps events.
+ *
+ * Since: 1.4
+ *
+ * Returns: #GST_RTSP_OK.
+ */
+GstRTSPResult
+gst_rtsp_transport_get_media_type (GstRTSPTransport * transport,
+ const gchar ** media_type)
+{
+ gint i;
+
+ g_return_val_if_fail (transport != NULL, GST_RTSP_EINVAL);
+ g_return_val_if_fail (media_type != NULL, GST_RTSP_EINVAL);
+
+ for (i = 0; transports[i].name; i++)
+ if (transports[i].mode == transport->trans
+ && transports[i].profile == transport->profile)
break;
- *mime = transports[i].gst_mime;
+ *media_type = transports[i].media_type;
return GST_RTSP_OK;
}