static gboolean kms_sdp_media_handler_can_insert_attribute_impl (KmsSdpMediaHandler * handler, const GstSDPMedia * offer, const GstSDPAttribute * attr, GstSDPMedia * media, SdpMessageContext * ctx) { guint i, len; GSList *l; if (sdp_utils_is_attribute_in_media (media, attr)) { return FALSE; } if (sdp_utils_attribute_is_direction (attr, NULL)) { return !is_direction_attr_present (media); } len = G_N_ELEMENTS (attributes); for (i = 0; i < len; i++) { if (g_strcmp0 (attr->key, attributes[i].name) == 0) { return attributes[i].accept (offer, attr, media, ctx); } } for (l = handler->priv->extensions; l != NULL; l = g_slist_next (l)) { KmsISdpMediaExtension *ext = KMS_I_SDP_MEDIA_EXTENSION (l->data); if (kms_i_sdp_media_extension_can_insert_attribute (ext, offer, attr, media, ctx)) { return TRUE; } } return FALSE; }
static gboolean kms_sdp_rtp_media_handler_can_insert_attribute (KmsSdpMediaHandler * handler, const GstSDPMedia * offer, const GstSDPAttribute * attr, GstSDPMedia * answer, SdpMessageContext * ctx) { KmsSdpRtpMediaHandler *self = KMS_SDP_RTP_MEDIA_HANDLER (handler); if (g_strcmp0 (attr->key, "rtcp-mux") != 0) { return KMS_SDP_MEDIA_HANDLER_CLASS (parent_class)->can_insert_attribute (handler, offer, attr, answer, ctx); } if (!self->priv->rtcp_mux) { return FALSE; } if (!self->priv->rtcp_entry) { return FALSE; } return !sdp_utils_is_attribute_in_media (answer, attr); }