}
}
-static GstWebRTCKind
-_kind_from_caps (const GstCaps * caps)
-{
- GstStructure *s;
- const gchar *media;
-
- if (gst_caps_get_size (caps) == 0)
- return GST_WEBRTC_KIND_UNKNOWN;
-
- s = gst_caps_get_structure (caps, 0);
-
- media = gst_structure_get_string (s, "media");
- if (media == NULL)
- return GST_WEBRTC_KIND_UNKNOWN;
-
- if (!g_strcmp0 (media, "audio"))
- return GST_WEBRTC_KIND_AUDIO;
-
- if (!g_strcmp0 (media, "video"))
- return GST_WEBRTC_KIND_VIDEO;
-
- return GST_WEBRTC_KIND_UNKNOWN;
-}
-
static gboolean
_update_transceiver_kind_from_caps (GstWebRTCRTPTransceiver * trans,
const GstCaps * caps)
{
- GstWebRTCKind kind = _kind_from_caps (caps);
+ GstWebRTCKind kind = webrtc_kind_from_caps (caps);
if (trans->kind == kind)
return TRUE;
if (!_update_transceiver_kind_from_caps (rtp_trans, answer_caps))
GST_WARNING_OBJECT (webrtc,
"Trying to change transceiver %d kind from %d to %d",
- rtp_trans->mline, rtp_trans->kind, _kind_from_caps (answer_caps));
+ rtp_trans->mline, rtp_trans->kind,
+ webrtc_kind_from_caps (answer_caps));
if (!trans->do_nack) {
answer_caps = gst_caps_make_writable (answer_caps);
if (webrtc->priv->sctp_transport) {
/* Let transport be the connection's [[SctpTransport]] slot.
*
- * If the [[DataChannelId]] slot is not null, transport is in
+ * If the [[DataChannelId]] slot is not null, transport is in
* connected state and [[DataChannelId]] is greater or equal to the
* transport's [[MaxChannels]] slot, throw an OperationError.
*/
}
if (trans->kind != GST_WEBRTC_KIND_UNKNOWN) {
- GstWebRTCKind kind = _kind_from_caps (caps);
+ GstWebRTCKind kind = webrtc_kind_from_caps (caps);
if (trans->kind != kind) {
GST_ERROR_OBJECT (element, "Tried to request a new sink pad %s for"
guint i;
if (caps)
- kind = _kind_from_caps (caps);
+ kind = webrtc_kind_from_caps (caps);
for (i = 0; i < webrtc->priv->transceivers->len; i++) {
GstWebRTCRTPTransceiver *tmptrans =
return ret;
}
+
+GstWebRTCKind
+webrtc_kind_from_caps (const GstCaps * caps)
+{
+ GstStructure *s;
+ const gchar *media;
+
+ if (gst_caps_get_size (caps) == 0)
+ return GST_WEBRTC_KIND_UNKNOWN;
+
+ s = gst_caps_get_structure (caps, 0);
+
+ media = gst_structure_get_string (s, "media");
+ if (media == NULL)
+ return GST_WEBRTC_KIND_UNKNOWN;
+
+ if (!g_strcmp0 (media, "audio"))
+ return GST_WEBRTC_KIND_AUDIO;
+
+ if (!g_strcmp0 (media, "video"))
+ return GST_WEBRTC_KIND_VIDEO;
+
+ return GST_WEBRTC_KIND_UNKNOWN;
+}
+