Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef MEDIA_BLINK_WEBMEDIAPLAYER_IMPL_H_ | 5 #ifndef MEDIA_BLINK_WEBMEDIAPLAYER_IMPL_H_ |
| 6 #define MEDIA_BLINK_WEBMEDIAPLAYER_IMPL_H_ | 6 #define MEDIA_BLINK_WEBMEDIAPLAYER_IMPL_H_ |
| 7 | 7 |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <memory> | 10 #include <memory> |
| (...skipping 241 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 252 friend class WebMediaPlayerImplTest; | 252 friend class WebMediaPlayerImplTest; |
| 253 friend class WebMediaPlayerImplBackgroundBehaviorTest; | 253 friend class WebMediaPlayerImplBackgroundBehaviorTest; |
| 254 | 254 |
| 255 void EnableOverlay(); | 255 void EnableOverlay(); |
| 256 void DisableOverlay(); | 256 void DisableOverlay(); |
| 257 | 257 |
| 258 // Do we have overlay information? For CVV, this is a surface id. For | 258 // Do we have overlay information? For CVV, this is a surface id. For |
| 259 // AndroidOverlay, this is the routing token. | 259 // AndroidOverlay, this is the routing token. |
| 260 bool HaveOverlayInfo(); | 260 bool HaveOverlayInfo(); |
| 261 | 261 |
| 262 // Send the overlay surface ID / routing token to the decoder if we have it | 262 // Send OverlayInfo to the decoder. |
| 263 // and if it has been requested. | 263 // |
| 264 // If we've requested but not yet received the surface id or routing token, or | |
| 265 // if there's no decoder-provided callback to send the overlay info, then this | |
| 266 // call will do nothing. | |
| 264 void MaybeSendOverlayInfoToDecoder(); | 267 void MaybeSendOverlayInfoToDecoder(); |
| 265 | 268 |
| 266 void OnPipelineSuspended(); | 269 void OnPipelineSuspended(); |
| 267 void OnBeforePipelineResume(); | 270 void OnBeforePipelineResume(); |
| 268 void OnPipelineResumed(); | 271 void OnPipelineResumed(); |
| 269 void OnDemuxerOpened(); | 272 void OnDemuxerOpened(); |
| 270 | 273 |
| 271 // Pipeline::Client overrides. | 274 // Pipeline::Client overrides. |
| 272 void OnError(PipelineStatus status) override; | 275 void OnError(PipelineStatus status) override; |
| 273 void OnEnded() override; | 276 void OnEnded() override; |
| (...skipping 494 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 768 | 771 |
| 769 // Use AndroidOverlay for overlays. | 772 // Use AndroidOverlay for overlays. |
| 770 kUseAndroidOverlay, | 773 kUseAndroidOverlay, |
| 771 }; | 774 }; |
| 772 | 775 |
| 773 OverlayMode overlay_mode_ = OverlayMode::kNoOverlays; | 776 OverlayMode overlay_mode_ = OverlayMode::kNoOverlays; |
| 774 | 777 |
| 775 // Optional callback to request the routing token for AndroidOverlay. | 778 // Optional callback to request the routing token for AndroidOverlay. |
| 776 RequestRoutingTokenCallback request_routing_token_cb_; | 779 RequestRoutingTokenCallback request_routing_token_cb_; |
| 777 | 780 |
| 778 // Routing token, if we have one. No value if we have a request pending to | 781 // Routing token, if we have one. We always have one, unless we've requested |
| 779 // get it via |request_routing_token_cb_|. A has_value() is_empty() token | 782 // one via |request_routing_token_cb_| but not yet received it. In that case, |
| 780 // indicates that we requested and received an empty token. Note that we | 783 // |overlay_routing_token_| won't have a value. |
|
watk
2017/05/25 21:36:20
Nice, thanks
| |
| 781 // can't send an empty token via IPC, so we handle that specially. | 784 base::Optional<OverlayInfo::RoutingToken> overlay_routing_token_; |
|
dcheng
2017/06/02 15:30:06
Hmm, isn't this an Optional<Optional<OverlayInfo::
liberato (no reviews please)
2017/06/02 18:18:59
it is O<O<>>, but i don't see how it can be reduce
dcheng
2017/06/05 18:32:10
Perhaps just integrate your reply here into the co
liberato (no reviews please)
2017/06/07 20:06:33
i ended up taking your other suggestion, to split
| |
| 782 base::Optional<base::UnguessableToken> overlay_routing_token_; | 785 |
| 786 OverlayInfo overlay_info_; | |
| 783 | 787 |
| 784 DISALLOW_COPY_AND_ASSIGN(WebMediaPlayerImpl); | 788 DISALLOW_COPY_AND_ASSIGN(WebMediaPlayerImpl); |
| 785 }; | 789 }; |
| 786 | 790 |
| 787 } // namespace media | 791 } // namespace media |
| 788 | 792 |
| 789 #endif // MEDIA_BLINK_WEBMEDIAPLAYER_IMPL_H_ | 793 #endif // MEDIA_BLINK_WEBMEDIAPLAYER_IMPL_H_ |
| OLD | NEW |