Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(501)

Unified Diff: remoting/protocol/content_description.cc

Issue 10532211: Added piping for sending audio packets from host to client. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Addressed comments Created 8 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: remoting/protocol/content_description.cc
diff --git a/remoting/protocol/content_description.cc b/remoting/protocol/content_description.cc
index c88a36262df02dd7cc7d81d1657216b14bd7bd46..cb118679deaebb382e22453b95f5ce03109eac5d 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)

Powered by Google App Engine
This is Rietveld 408576698