| Index: remoting/protocol/content_description.cc
|
| diff --git a/remoting/protocol/content_description.cc b/remoting/protocol/content_description.cc
|
| index c88a36262df02dd7cc7d81d1657216b14bd7bd46..e397940bde50cc1a9e2807217f1de463b0954a53 100644
|
| --- a/remoting/protocol/content_description.cc
|
| +++ b/remoting/protocol/content_description.cc
|
| @@ -27,6 +27,7 @@ const char kDescriptionTag[] = "description";
|
| const char kControlTag[] = "control";
|
| const char kEventTag[] = "event";
|
| const char kVideoTag[] = "video";
|
| +const char kAudioTag[] = "audio";
|
| const char kDeprecatedResolutionTag[] = "initial-resolution";
|
|
|
| const char kTransportAttr[] = "transport";
|
| @@ -37,6 +38,7 @@ const char kDeprecatedHeightAttr[] = "height";
|
|
|
| const char kStreamTransport[] = "stream";
|
| const char kDatagramTransport[] = "datagram";
|
| +const char kNoneTransport[] = "none";
|
|
|
| const char kVerbatimCodec[] = "verbatim";
|
| const char kVp8Codec[] = "vp8";
|
| @@ -48,6 +50,8 @@ const char* GetTransportName(ChannelConfig::TransportType type) {
|
| return kStreamTransport;
|
| case ChannelConfig::TRANSPORT_DATAGRAM:
|
| return kDatagramTransport;
|
| + case ChannelConfig::TRANSPORT_NONE:
|
| + return kNoneTransport;
|
| }
|
| NOTREACHED();
|
| return NULL;
|
| @@ -97,6 +101,8 @@ bool ParseTransportName(const std::string& value,
|
| *transport = ChannelConfig::TRANSPORT_STREAM;
|
| } else if (value == kDatagramTransport) {
|
| *transport = ChannelConfig::TRANSPORT_DATAGRAM;
|
| + } else if (value == kNoneTransport) {
|
| + *transport = ChannelConfig::TRANSPORT_NONE;
|
| } else {
|
| return false;
|
| }
|
| @@ -163,6 +169,7 @@ ContentDescription* ContentDescription::Copy() const {
|
| // <control transport="stream" version="1" />
|
| // <event transport="datagram" version="1" />
|
| // <video transport="stream" codec="vp8" version="1" />
|
| +// <audio transport="stream" version="1" />
|
| // <authentication>
|
| // Message created by Authenticator implementation.
|
| // </authentication>
|
| @@ -189,6 +196,11 @@ XmlElement* ContentDescription::ToXml() const {
|
| root->AddElement(FormatChannelConfig(*it, kVideoTag));
|
| }
|
|
|
| + for (it = config()->audio_configs().begin();
|
| + it != config()->audio_configs().end(); ++it) {
|
| + root->AddElement(FormatChannelConfig(*it, kAudioTag));
|
| + }
|
| +
|
| // Older endpoints require an initial-resolution tag, but otherwise ignore it.
|
| XmlElement* resolution_tag = new XmlElement(
|
| QName(kChromotingXmlNamespace, kDeprecatedResolutionTag));
|
| @@ -245,6 +257,25 @@ ContentDescription* ContentDescription::ParseXml(
|
| child = child->NextNamed(video_tag);
|
| }
|
|
|
| + // <audio> tags.
|
| + QName audio_tag(kChromotingXmlNamespace, kAudioTag);
|
| + child = element->FirstNamed(audio_tag);
|
| + if (!child) {
|
| + // if there's no mention of audio, implicitly assume
|
| + // TRANSPORT_NONE for the audio_channel
|
| + ChannelConfig no_audio(ChannelConfig::TRANSPORT_NONE,
|
| + kDefaultStreamVersion,
|
| + ChannelConfig::CODEC_UNDEFINED);
|
| + config->mutable_audio_configs()->push_back(no_audio);
|
| + }
|
| + while (child) {
|
| + ChannelConfig channel_config;
|
| + if (!ParseChannelConfig(child, false, &channel_config))
|
| + return NULL;
|
| + config->mutable_audio_configs()->push_back(channel_config);
|
| + child = child->NextNamed(audio_tag);
|
| + }
|
| +
|
| scoped_ptr<XmlElement> authenticator_message;
|
| child = Authenticator::FindAuthenticatorMessage(element);
|
| if (child)
|
|
|