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

Side by Side Diff: Source/web/WebMediaPlayerClientImpl.cpp

Issue 364033003: Eliminate MediaPlayer abstraction(network state) (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Modified the approach as suggested Created 6 years, 5 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 (c) 2009 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2009 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 "config.h" 5 #include "config.h"
6 #include "web/WebMediaPlayerClientImpl.h" 6 #include "web/WebMediaPlayerClientImpl.h"
7 7
8 #include "core/frame/LocalFrame.h" 8 #include "core/frame/LocalFrame.h"
9 #include "core/html/HTMLMediaElement.h" 9 #include "core/html/HTMLMediaElement.h"
10 #include "core/html/TimeRanges.h" 10 #include "core/html/TimeRanges.h"
(...skipping 240 matching lines...) Expand 10 before | Expand all | Expand 10 after
251 return m_webMediaPlayer->seeking(); 251 return m_webMediaPlayer->seeking();
252 return false; 252 return false;
253 } 253 }
254 254
255 void WebMediaPlayerClientImpl::setPoster(const KURL& poster) 255 void WebMediaPlayerClientImpl::setPoster(const KURL& poster)
256 { 256 {
257 if (m_webMediaPlayer) 257 if (m_webMediaPlayer)
258 m_webMediaPlayer->setPoster(WebURL(poster)); 258 m_webMediaPlayer->setPoster(WebURL(poster));
259 } 259 }
260 260
261 MediaPlayer::NetworkState WebMediaPlayerClientImpl::networkState() const
262 {
263 if (m_webMediaPlayer)
264 return static_cast<MediaPlayer::NetworkState>(m_webMediaPlayer->networkS tate());
265 return MediaPlayer::Empty;
266 }
267
268 void WebMediaPlayerClientImpl::paint(GraphicsContext* context, const IntRect& re ct) 261 void WebMediaPlayerClientImpl::paint(GraphicsContext* context, const IntRect& re ct)
269 { 262 {
270 // Normally GraphicsContext operations do nothing when painting is disabled. 263 // Normally GraphicsContext operations do nothing when painting is disabled.
271 // Since we're accessing platformContext() directly we have to manually 264 // Since we're accessing platformContext() directly we have to manually
272 // check. 265 // check.
273 if (m_webMediaPlayer && !context->paintingDisabled()) { 266 if (m_webMediaPlayer && !context->paintingDisabled()) {
274 // On Android, video frame is emitted as GL_TEXTURE_EXTERNAL_OES texture . We use a different path to 267 // On Android, video frame is emitted as GL_TEXTURE_EXTERNAL_OES texture . We use a different path to
275 // paint the video frame into the context. 268 // paint the video frame into the context.
276 #if OS(ANDROID) 269 #if OS(ANDROID)
277 if (m_usePaintOnAndroid) { 270 if (m_usePaintOnAndroid) {
(...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after
415 408
416 void WebMediaPlayerClientImpl::AudioClientImpl::setFormat(size_t numberOfChannel s, float sampleRate) 409 void WebMediaPlayerClientImpl::AudioClientImpl::setFormat(size_t numberOfChannel s, float sampleRate)
417 { 410 {
418 if (m_client) 411 if (m_client)
419 m_client->setFormat(numberOfChannels, sampleRate); 412 m_client->setFormat(numberOfChannels, sampleRate);
420 } 413 }
421 414
422 #endif 415 #endif
423 416
424 } // namespace blink 417 } // namespace blink
OLDNEW
« Source/core/html/HTMLMediaElement.cpp ('K') | « Source/web/WebMediaPlayerClientImpl.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698