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> |
11 | 11 |
12 #include "base/bind.h" | 12 #include "base/bind.h" |
13 #include "base/callback.h" | 13 #include "base/callback.h" |
14 #include "build/build_config.h" | 14 #include "build/build_config.h" |
15 #include "cc/blink/web_layer_impl.h" | 15 #include "cc/blink/web_layer_impl.h" |
16 #include "cc/layers/video_frame_provider_client_impl.h" | 16 #include "cc/layers/video_frame_provider_client_impl.h" |
17 #include "cc/layers/video_layer.h" | 17 #include "cc/layers/video_layer.h" |
18 #include "content/common/gpu/client/context_provider_command_buffer.h" | 18 #include "content/common/gpu/client/context_provider_command_buffer.h" |
19 #include "content/public/renderer/media_stream_audio_renderer.h" | 19 #include "content/public/renderer/media_stream_audio_renderer.h" |
20 #include "content/public/renderer/media_stream_renderer_factory.h" | 20 #include "content/public/renderer/media_stream_renderer_factory.h" |
21 #include "content/public/renderer/media_stream_video_renderer.h" | 21 #include "content/public/renderer/media_stream_video_renderer.h" |
22 #include "content/renderer/media/web_media_element_source_utils.h" | 22 #include "content/renderer/media/web_media_element_source_utils.h" |
23 #include "content/renderer/media/webmediaplayer_ms_compositor.h" | 23 #include "content/renderer/media/webmediaplayer_ms_compositor.h" |
24 #include "content/renderer/render_frame_impl.h" | 24 #include "content/renderer/render_frame_impl.h" |
25 #include "content/renderer/render_thread_impl.h" | 25 #include "content/renderer/render_thread_impl.h" |
26 #include "media/base/media_content_type.h" | |
26 #include "media/base/media_log.h" | 27 #include "media/base/media_log.h" |
27 #include "media/base/video_frame.h" | 28 #include "media/base/video_frame.h" |
28 #include "media/blink/webmediaplayer_util.h" | 29 #include "media/blink/webmediaplayer_util.h" |
29 #include "third_party/WebKit/public/platform/WebMediaPlayerClient.h" | 30 #include "third_party/WebKit/public/platform/WebMediaPlayerClient.h" |
30 #include "third_party/WebKit/public/platform/WebMediaPlayerSource.h" | 31 #include "third_party/WebKit/public/platform/WebMediaPlayerSource.h" |
31 #include "third_party/WebKit/public/platform/WebRect.h" | 32 #include "third_party/WebKit/public/platform/WebRect.h" |
32 #include "third_party/WebKit/public/platform/WebSize.h" | 33 #include "third_party/WebKit/public/platform/WebSize.h" |
33 | 34 |
34 namespace content { | 35 namespace content { |
35 | 36 |
(...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
174 | 175 |
175 if (audio_renderer_) | 176 if (audio_renderer_) |
176 audio_renderer_->Play(); | 177 audio_renderer_->Play(); |
177 | 178 |
178 if (delegate_) { | 179 if (delegate_) { |
179 // TODO(perkj, magjed): We send a duration of 1 second here to avoid | 180 // TODO(perkj, magjed): We send a duration of 1 second here to avoid |
180 // creating an interactive media session on Android. We'd like to use zero | 181 // creating an interactive media session on Android. We'd like to use zero |
181 // here, but that is treated as an unknown duration and assumed to be | 182 // here, but that is treated as an unknown duration and assumed to be |
182 // interactive. See http://crbug.com/595297 for more details. | 183 // interactive. See http://crbug.com/595297 for more details. |
183 delegate_->DidPlay(delegate_id_, hasVideo(), hasAudio(), false, | 184 delegate_->DidPlay(delegate_id_, hasVideo(), hasAudio(), false, |
184 base::TimeDelta::FromSeconds(1)); | 185 media::MediaContentType::Uncontrollable); |
mlamouri (slow - plz ping)
2016/08/18 14:33:15
Should this be transient to make sure the behaviou
Zhiqiang Zhang (Slow)
2016/08/18 17:31:45
Changed the logic in MediaSession, so that all typ
| |
185 } | 186 } |
186 | 187 |
187 paused_ = false; | 188 paused_ = false; |
188 } | 189 } |
189 | 190 |
190 void WebMediaPlayerMS::pause() { | 191 void WebMediaPlayerMS::pause() { |
191 DVLOG(1) << __FUNCTION__; | 192 DVLOG(1) << __FUNCTION__; |
192 DCHECK(thread_checker_.CalledOnValidThread()); | 193 DCHECK(thread_checker_.CalledOnValidThread()); |
193 | 194 |
194 should_play_upon_shown_ = false; | 195 should_play_upon_shown_ = false; |
(...skipping 341 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
536 void WebMediaPlayerMS::ResetCanvasCache() { | 537 void WebMediaPlayerMS::ResetCanvasCache() { |
537 DCHECK(thread_checker_.CalledOnValidThread()); | 538 DCHECK(thread_checker_.CalledOnValidThread()); |
538 video_renderer_.ResetCache(); | 539 video_renderer_.ResetCache(); |
539 } | 540 } |
540 | 541 |
541 void WebMediaPlayerMS::TriggerResize() { | 542 void WebMediaPlayerMS::TriggerResize() { |
542 get_client()->sizeChanged(); | 543 get_client()->sizeChanged(); |
543 } | 544 } |
544 | 545 |
545 } // namespace content | 546 } // namespace content |
OLD | NEW |