| 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 <string> | 10 #include <string> |
| (...skipping 176 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 187 void OnPipelineError(PipelineStatus error); | 187 void OnPipelineError(PipelineStatus error); |
| 188 void OnPipelineMetadata(PipelineMetadata metadata); | 188 void OnPipelineMetadata(PipelineMetadata metadata); |
| 189 void OnPipelineBufferingStateChanged(BufferingState buffering_state); | 189 void OnPipelineBufferingStateChanged(BufferingState buffering_state); |
| 190 void OnDemuxerOpened(); | 190 void OnDemuxerOpened(); |
| 191 void OnAddTextTrack(const TextTrackConfig& config, | 191 void OnAddTextTrack(const TextTrackConfig& config, |
| 192 const AddTextTrackDoneCB& done_cb); | 192 const AddTextTrackDoneCB& done_cb); |
| 193 | 193 |
| 194 // WebMediaPlayerDelegate::Observer implementation. | 194 // WebMediaPlayerDelegate::Observer implementation. |
| 195 void OnHidden() override; | 195 void OnHidden() override; |
| 196 void OnShown() override; | 196 void OnShown() override; |
| 197 void OnPlay() override; |
| 198 void OnPause() override; |
| 199 void OnVolumeMultiplierUpdate(double multiplier) override; |
| 197 | 200 |
| 198 #if defined(OS_ANDROID) // WMPI_CAST | 201 #if defined(OS_ANDROID) // WMPI_CAST |
| 199 bool isRemote() const override; | 202 bool isRemote() const override; |
| 200 void requestRemotePlayback() override; | 203 void requestRemotePlayback() override; |
| 201 void requestRemotePlaybackControl() override; | 204 void requestRemotePlaybackControl() override; |
| 202 | 205 |
| 203 void SetMediaPlayerManager( | 206 void SetMediaPlayerManager( |
| 204 RendererMediaPlayerManagerInterface* media_player_manager); | 207 RendererMediaPlayerManagerInterface* media_player_manager); |
| 205 void OnRemotePlaybackEnded(); | 208 void OnRemotePlaybackEnded(); |
| 206 void OnDisconnectedFromRemoteDevice(double t); | 209 void OnDisconnectedFromRemoteDevice(double t); |
| (...skipping 171 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 378 // |pending_seek_time_| is meaningless when |pending_seek_| is false. | 381 // |pending_seek_time_| is meaningless when |pending_seek_| is false. |
| 379 base::TimeDelta pending_seek_time_; | 382 base::TimeDelta pending_seek_time_; |
| 380 | 383 |
| 381 // Tracks whether to issue time changed notifications during buffering state | 384 // Tracks whether to issue time changed notifications during buffering state |
| 382 // changes. | 385 // changes. |
| 383 bool should_notify_time_changed_; | 386 bool should_notify_time_changed_; |
| 384 | 387 |
| 385 blink::WebMediaPlayerClient* client_; | 388 blink::WebMediaPlayerClient* client_; |
| 386 blink::WebMediaPlayerEncryptedMediaClient* encrypted_client_; | 389 blink::WebMediaPlayerEncryptedMediaClient* encrypted_client_; |
| 387 | 390 |
| 391 // WebMediaPlayer notifies the |delegate_| of playback state changes using |
| 392 // |delegate_id_|; an id provided after registering with the delegate. The |
| 393 // WebMediaPlayer may also receive directives (play, pause) from the delegate |
| 394 // via the WebMediaPlayerDelegate::Observer interface after registration. |
| 388 base::WeakPtr<WebMediaPlayerDelegate> delegate_; | 395 base::WeakPtr<WebMediaPlayerDelegate> delegate_; |
| 396 int delegate_id_; |
| 389 | 397 |
| 390 WebMediaPlayerParams::DeferLoadCB defer_load_cb_; | 398 WebMediaPlayerParams::DeferLoadCB defer_load_cb_; |
| 391 WebMediaPlayerParams::Context3DCB context_3d_cb_; | 399 WebMediaPlayerParams::Context3DCB context_3d_cb_; |
| 392 | 400 |
| 393 // Members for notifying upstream clients about internal memory usage. The | 401 // Members for notifying upstream clients about internal memory usage. The |
| 394 // |adjust_allocated_memory_cb_| must only be called on |main_task_runner_|. | 402 // |adjust_allocated_memory_cb_| must only be called on |main_task_runner_|. |
| 395 base::RepeatingTimer memory_usage_reporting_timer_; | 403 base::RepeatingTimer memory_usage_reporting_timer_; |
| 396 WebMediaPlayerParams::AdjustAllocatedMemoryCB adjust_allocated_memory_cb_; | 404 WebMediaPlayerParams::AdjustAllocatedMemoryCB adjust_allocated_memory_cb_; |
| 397 int64_t last_reported_memory_usage_; | 405 int64_t last_reported_memory_usage_; |
| 398 | 406 |
| (...skipping 28 matching lines...) Expand all Loading... |
| 427 | 435 |
| 428 scoped_ptr<blink::WebContentDecryptionModuleResult> set_cdm_result_; | 436 scoped_ptr<blink::WebContentDecryptionModuleResult> set_cdm_result_; |
| 429 | 437 |
| 430 // Whether a CDM has been successfully attached. | 438 // Whether a CDM has been successfully attached. |
| 431 bool is_cdm_attached_; | 439 bool is_cdm_attached_; |
| 432 | 440 |
| 433 #if defined(OS_ANDROID) // WMPI_CAST | 441 #if defined(OS_ANDROID) // WMPI_CAST |
| 434 WebMediaPlayerCast cast_impl_; | 442 WebMediaPlayerCast cast_impl_; |
| 435 #endif | 443 #endif |
| 436 | 444 |
| 445 // The last volume received by setVolume() and the last volume multiplier from |
| 446 // OnVolumeMultiplierUpdate(). The multiplier is typical 1.0, but may be less |
| 447 // if the WebMediaPlayerDelegate has requested a volume reduction (ducking) |
| 448 // for a transient sound. Playout volume is derived by volume * multiplier. |
| 449 double volume_; |
| 450 double volume_multiplier_; |
| 451 |
| 437 scoped_ptr<RendererFactory> renderer_factory_; | 452 scoped_ptr<RendererFactory> renderer_factory_; |
| 438 | 453 |
| 439 DISALLOW_COPY_AND_ASSIGN(WebMediaPlayerImpl); | 454 DISALLOW_COPY_AND_ASSIGN(WebMediaPlayerImpl); |
| 440 }; | 455 }; |
| 441 | 456 |
| 442 } // namespace media | 457 } // namespace media |
| 443 | 458 |
| 444 #endif // MEDIA_BLINK_WEBMEDIAPLAYER_IMPL_H_ | 459 #endif // MEDIA_BLINK_WEBMEDIAPLAYER_IMPL_H_ |
| OLD | NEW |