Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(285)

Side by Side Diff: content/renderer/media/webmediaplayer_ms.cc

Issue 1996043002: Split MediaContentType and AudioFocusType (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: addressed nits Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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/base/video_rotation.h" 29 #include "media/base/video_rotation.h"
29 #include "media/blink/webmediaplayer_util.h" 30 #include "media/blink/webmediaplayer_util.h"
30 #include "third_party/WebKit/public/platform/WebMediaPlayerClient.h" 31 #include "third_party/WebKit/public/platform/WebMediaPlayerClient.h"
31 #include "third_party/WebKit/public/platform/WebMediaPlayerSource.h" 32 #include "third_party/WebKit/public/platform/WebMediaPlayerSource.h"
32 #include "third_party/WebKit/public/platform/WebRect.h" 33 #include "third_party/WebKit/public/platform/WebRect.h"
33 #include "third_party/WebKit/public/platform/WebSize.h" 34 #include "third_party/WebKit/public/platform/WebSize.h"
34 35
35 namespace content { 36 namespace content {
(...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after
176 177
177 if (audio_renderer_) 178 if (audio_renderer_)
178 audio_renderer_->Play(); 179 audio_renderer_->Play();
179 180
180 if (delegate_) { 181 if (delegate_) {
181 // TODO(perkj, magjed): We send a duration of 1 second here to avoid 182 // TODO(perkj, magjed): We send a duration of 1 second here to avoid
182 // creating an interactive media session on Android. We'd like to use zero 183 // creating an interactive media session on Android. We'd like to use zero
183 // here, but that is treated as an unknown duration and assumed to be 184 // here, but that is treated as an unknown duration and assumed to be
184 // interactive. See http://crbug.com/595297 for more details. 185 // interactive. See http://crbug.com/595297 for more details.
185 delegate_->DidPlay(delegate_id_, hasVideo(), hasAudio(), false, 186 delegate_->DidPlay(delegate_id_, hasVideo(), hasAudio(), false,
186 base::TimeDelta::FromSeconds(1)); 187 media::MediaContentType::Uncontrollable);
187 } 188 }
188 189
189 paused_ = false; 190 paused_ = false;
190 } 191 }
191 192
192 void WebMediaPlayerMS::pause() { 193 void WebMediaPlayerMS::pause() {
193 DVLOG(1) << __func__; 194 DVLOG(1) << __func__;
194 DCHECK(thread_checker_.CalledOnValidThread()); 195 DCHECK(thread_checker_.CalledOnValidThread());
195 196
196 should_play_upon_shown_ = false; 197 should_play_upon_shown_ = false;
(...skipping 354 matching lines...) Expand 10 before | Expand all | Expand 10 after
551 void WebMediaPlayerMS::ResetCanvasCache() { 552 void WebMediaPlayerMS::ResetCanvasCache() {
552 DCHECK(thread_checker_.CalledOnValidThread()); 553 DCHECK(thread_checker_.CalledOnValidThread());
553 video_renderer_.ResetCache(); 554 video_renderer_.ResetCache();
554 } 555 }
555 556
556 void WebMediaPlayerMS::TriggerResize() { 557 void WebMediaPlayerMS::TriggerResize() {
557 get_client()->sizeChanged(); 558 get_client()->sizeChanged();
558 } 559 }
559 560
560 } // namespace content 561 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698