// Copyright (c) 2012 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #include "remoting/protocol/content_description.h" #include "base/base64.h" #include "base/logging.h" #include "base/strings/string_number_conversions.h" #include "remoting/base/constants.h" #include "remoting/protocol/authenticator.h" #include "remoting/protocol/name_value_map.h" #include "third_party/webrtc/libjingle/xmllite/xmlelement.h" using buzz::QName; using buzz::XmlElement; namespace remoting { namespace protocol { const char ContentDescription::kChromotingContentName[] = "chromoting"; namespace { const char kDefaultNs[] = ""; // Following constants are used to format session description in XML. const char kDescriptionTag[] = "description"; const char kStandardIceTag[] = "standard-ice"; const char kControlTag[] = "control"; const char kEventTag[] = "event"; const char kVideoTag[] = "video"; const char kAudioTag[] = "audio"; const char kVp9ExperimentTag[] = "vp9-experiment"; const char kDeprecatedResolutionTag[] = "initial-resolution"; const char kQuicConfigTag[] = "quic-config"; const char kTransportAttr[] = "transport"; const char kVersionAttr[] = "version"; const char kCodecAttr[] = "codec"; const char kDeprecatedWidthAttr[] = "width"; const char kDeprecatedHeightAttr[] = "height"; const NameMapElement kTransports[] = { { ChannelConfig::TRANSPORT_STREAM, "stream" }, { ChannelConfig::TRANSPORT_MUX_STREAM, "mux-stream" }, { ChannelConfig::TRANSPORT_QUIC_STREAM, "quic-stream" }, { ChannelConfig::TRANSPORT_DATAGRAM, "datagram" }, { ChannelConfig::TRANSPORT_NONE, "none" }, }; const NameMapElement kCodecs[] = { { ChannelConfig::CODEC_VERBATIM, "verbatim" }, { ChannelConfig::CODEC_VP8, "vp8" }, { ChannelConfig::CODEC_VP9, "vp9" }, { ChannelConfig::CODEC_ZIP, "zip" }, { ChannelConfig::CODEC_OPUS, "opus" }, { ChannelConfig::CODEC_SPEEX, "speex" }, }; // Format a channel configuration tag for chromotocol session description, // e.g. for video channel: //