Index: chrome/browser/media/router/media_sink.h |
diff --git a/chrome/browser/media/router/media_sink.h b/chrome/browser/media/router/media_sink.h |
new file mode 100644 |
index 0000000000000000000000000000000000000000..15b4efa8bea550a188aa4cff66041b92afa5375f |
--- /dev/null |
+++ b/chrome/browser/media/router/media_sink.h |
@@ -0,0 +1,52 @@ |
+// Copyright 2015 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. |
+ |
+#ifndef CHROME_BROWSER_MEDIA_ROUTER_MEDIA_SINK_H_ |
+#define CHROME_BROWSER_MEDIA_ROUTER_MEDIA_SINK_H_ |
+ |
+#include <string> |
+ |
+#include "chrome/browser/media/router/media_route_id.h" |
+ |
+namespace media_router { |
+ |
+typedef std::string MediaSinkId; |
+ |
+// Represents a sink to which media can be routed. |
+class MediaSink { |
+ public: |
+ enum Status { |
mark a. foltz
2015/03/02 21:40:10
It would be a good idea to document the state tran
Kevin M
2015/03/03 21:53:19
Done.
|
+ // The sink is currently not associated with any routes. |
+ IDLE, |
+ // The sink is currently associated with a route. |
+ ACTIVE, |
+ // The sink has a pending route request. |
+ REQUEST_PENDING |
mark a. foltz
2015/03/02 21:40:10
Can a sink ever have a request pending while it is
Kevin M
2015/03/03 21:53:19
I talked this over with imcheng and he's thinking
|
+ }; |
+ |
+ // |sink_id|: Unique identifier for the MediaSink. |
+ // |name|: Descriptive name of the MediaSink. |
mark a. foltz
2015/03/02 21:40:09
Does this represent a localized string? If so, is
Kevin M
2015/03/03 21:53:20
The string data we get from Mojo is a UTF-8 encode
mark a. foltz
2015/03/04 06:22:58
We should touch base about rendering requirements
Kevin M
2015/03/04 23:33:32
Sure, I'll talk to you in person, maybe including
|
+ // |status|: Current status of the MediaSink. |
+ MediaSink(const MediaSinkId& sink_id, |
+ const std::string& name, |
+ Status status); |
+ ~MediaSink(); |
+ |
+ const MediaSinkId& sink_id() const { return sink_id_; } |
+ const std::string& name() const { return name_; } |
+ Status status() const { return status_; } |
+ std::string StatusAsString() const; |
+ |
+ bool operator==(const MediaSink& other) const; |
+ bool operator!=(const MediaSink& other) const; |
+ |
+ private: |
+ MediaSinkId sink_id_; |
+ std::string name_; |
+ Status status_; |
+}; |
+ |
+} // namespace media_router |
+ |
+#endif // CHROME_BROWSER_MEDIA_ROUTER_MEDIA_SINK_H_ |