Chromium Code Reviews| Index: extensions/browser/api/cast_channel/cast_channel_api.cc |
| diff --git a/extensions/browser/api/cast_channel/cast_channel_api.cc b/extensions/browser/api/cast_channel/cast_channel_api.cc |
| index 08e05d42746ccba4fd355d754855ad717e5c3471..73d1b149d057fade7c495d35faf3f2b1dfe50d07 100644 |
| --- a/extensions/browser/api/cast_channel/cast_channel_api.cc |
| +++ b/extensions/browser/api/cast_channel/cast_channel_api.cc |
| @@ -30,6 +30,15 @@ |
| // Used if not otherwise specified at ConnectInfo::timeout. |
| const int kDefaultConnectTimeoutMillis = 5000; // 5 seconds. |
| +// Cast device capabilities. |
| +enum CastDeviceCapability { |
| + VIDEO_OUT = (1 << 0), |
|
mark a. foltz
2015/01/12 22:01:57
I don't think the parenthesis are necessary.
vadimgo
2015/01/13 00:08:27
Removed parenthesis.
|
| + VIDEO_IN = (1 << 1), |
| + AUDIO_OUT = (1 << 2), |
| + AUDIO_IN = (1 << 3), |
| + DEV_MODE = (1 << 4) |
| +}; |
| + |
| namespace extensions { |
| namespace Close = cast_channel::Close; |
| @@ -348,6 +357,16 @@ void CastChannelOpenFunction::AsyncWorkStart() { |
| ? *connect_info_->timeout |
| : kDefaultConnectTimeoutMillis), |
| api_->GetLogger()); |
| + |
| + // If device capabilities are available in the connect information, pass the |
|
mark a. foltz
2015/01/12 22:01:56
Slightly prefer to pass the capabilities in the Ca
vadimgo
2015/01/13 00:08:27
Changed to pass device capabilities to the socket
|
| + // claimed video out capability to the socket for audio only policy |
| + // enforcement. |
| + if (connect_info_->capabilities.get()) { |
| + bool has_video_out = |
| + (*connect_info_->capabilities & CastDeviceCapability::VIDEO_OUT) == |
| + CastDeviceCapability::VIDEO_OUT; |
| + socket->set_has_video_out(has_video_out); |
|
mark a. foltz
2015/01/12 22:01:56
ISTM we should have an API like
socket->HasCapabi
vadimgo
2015/01/13 00:08:27
This code is removed with the new api design.
|
| + } |
| } |
| new_channel_id_ = AddSocket(socket); |
| scoped_ptr<CastMessageHandler> delegate(new CastMessageHandler(api_, socket)); |