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 #include "content/renderer/media/webmediaplayer_ms.h" | 5 #include "content/renderer/media/webmediaplayer_ms.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 #include <limits> | 8 #include <limits> |
| 9 #include <string> | 9 #include <string> |
| 10 #include <utility> | 10 #include <utility> |
| (...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 174 | 174 |
| 175 if (video_frame_provider_) | 175 if (video_frame_provider_) |
| 176 video_frame_provider_->Resume(); | 176 video_frame_provider_->Resume(); |
| 177 | 177 |
| 178 compositor_->StartRendering(); | 178 compositor_->StartRendering(); |
| 179 | 179 |
| 180 if (audio_renderer_) | 180 if (audio_renderer_) |
| 181 audio_renderer_->Play(); | 181 audio_renderer_->Play(); |
| 182 | 182 |
| 183 if (delegate_) { | 183 if (delegate_) { |
| 184 // TODO(perkj, magjed): We send a duration of 1 second here to avoid | 184 // TODO(perkj, magjed): We use Uncontrollable type here to avoid creating an |
| 185 // creating an interactive media session on Android. We'd like to use zero | 185 // interactive media session on Android. See http://crbug.com/596516 for |
| 186 // here, but that is treated as an unknown duration and assumed to be | 186 // more details. |
| 187 // interactive. See http://crbug.com/595297 for more details. | 187 #if defined(OS_ANDROID) |
| 188 delegate_->DidPlay(delegate_id_, hasVideo(), hasAudio(), false, | 188 delegate_->DidPlay(delegate_id_, hasVideo(), hasAudio(), false, |
| 189 media::MediaContentType::Uncontrollable); | 189 media::MediaContentType::Uncontrollable); |
| 190 #else // defined(OS_ANDROID) | |
| 191 delegate_->DidPlay(delegate_id_, hasVideo(), hasAudio(), false, | |
| 192 media::MediaContentType::Persistent); | |
| 193 #endif // defined(OS_ANDROID) | |
| 190 } | 194 } |
| 191 | 195 |
| 192 paused_ = false; | 196 paused_ = false; |
| 193 } | 197 } |
| 194 | 198 |
| 195 void WebMediaPlayerMS::pause() { | 199 void WebMediaPlayerMS::pause() { |
| 196 DVLOG(1) << __func__; | 200 DVLOG(1) << __func__; |
| 197 DCHECK(thread_checker_.CalledOnValidThread()); | 201 DCHECK(thread_checker_.CalledOnValidThread()); |
| 198 | 202 |
| 199 should_play_upon_shown_ = false; | 203 should_play_upon_shown_ = false; |
| (...skipping 243 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 443 // TODO(perkj, magjed): It's not clear how WebRTC should work with an | 447 // TODO(perkj, magjed): It's not clear how WebRTC should work with an |
| 444 // MediaSession, until these issues are resolved, disable session controls. | 448 // MediaSession, until these issues are resolved, disable session controls. |
| 445 // http://crbug.com/595297. | 449 // http://crbug.com/595297. |
| 446 } | 450 } |
| 447 | 451 |
| 448 void WebMediaPlayerMS::OnPause() { | 452 void WebMediaPlayerMS::OnPause() { |
| 449 // TODO(perkj, magjed): See TODO in Onplay(). | 453 // TODO(perkj, magjed): See TODO in Onplay(). |
| 450 } | 454 } |
| 451 | 455 |
| 452 void WebMediaPlayerMS::OnVolumeMultiplierUpdate(double multiplier) { | 456 void WebMediaPlayerMS::OnVolumeMultiplierUpdate(double multiplier) { |
| 453 volume_multiplier_ = multiplier; | 457 // TODO(perkj, magjed): See TODO in Onplay(). |
|
DaleCurtis
2016/10/20 21:04:41
OnPlay(), fix one on l.453 too?
Zhiqiang Zhang (Slow)
2016/10/20 21:30:31
Done.
| |
| 454 setVolume(volume_); | |
| 455 } | 458 } |
| 456 | 459 |
| 457 bool WebMediaPlayerMS::copyVideoTextureToPlatformTexture( | 460 bool WebMediaPlayerMS::copyVideoTextureToPlatformTexture( |
| 458 gpu::gles2::GLES2Interface* gl, | 461 gpu::gles2::GLES2Interface* gl, |
| 459 unsigned int texture, | 462 unsigned int texture, |
| 460 unsigned int internal_format, | 463 unsigned int internal_format, |
| 461 unsigned int type, | 464 unsigned int type, |
| 462 bool premultiply_alpha, | 465 bool premultiply_alpha, |
| 463 bool flip_y) { | 466 bool flip_y) { |
| 464 TRACE_EVENT0("media", "WebMediaPlayerMS:copyVideoTextureToPlatformTexture"); | 467 TRACE_EVENT0("media", "WebMediaPlayerMS:copyVideoTextureToPlatformTexture"); |
| (...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 562 void WebMediaPlayerMS::ResetCanvasCache() { | 565 void WebMediaPlayerMS::ResetCanvasCache() { |
| 563 DCHECK(thread_checker_.CalledOnValidThread()); | 566 DCHECK(thread_checker_.CalledOnValidThread()); |
| 564 video_renderer_.ResetCache(); | 567 video_renderer_.ResetCache(); |
| 565 } | 568 } |
| 566 | 569 |
| 567 void WebMediaPlayerMS::TriggerResize() { | 570 void WebMediaPlayerMS::TriggerResize() { |
| 568 get_client()->sizeChanged(); | 571 get_client()->sizeChanged(); |
| 569 } | 572 } |
| 570 | 573 |
| 571 } // namespace content | 574 } // namespace content |
| OLD | NEW |