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

Side by Side Diff: Source/WebKit/chromium/src/WebMediaPlayerClientImpl.cpp

Issue 13674022: Remove MEDIA_SOURCE feature define. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@blink-master
Patch Set: Rebase Created 7 years, 8 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 "WebMediaPlayerClientImpl.h" 6 #include "WebMediaPlayerClientImpl.h"
7 7
8 #if ENABLE(VIDEO) 8 #if ENABLE(VIDEO)
9 9
10 #include "AudioBus.h" 10 #include "AudioBus.h"
(...skipping 281 matching lines...) Expand 10 before | Expand all | Expand 10 after
292 m_videoLayer->setOpaque(m_opaque); 292 m_videoLayer->setOpaque(m_opaque);
293 GraphicsLayerChromium::registerContentsLayer(m_videoLayer); 293 GraphicsLayerChromium::registerContentsLayer(m_videoLayer);
294 } 294 }
295 } 295 }
296 296
297 // MediaPlayerPrivateInterface ------------------------------------------------- 297 // MediaPlayerPrivateInterface -------------------------------------------------
298 298
299 void WebMediaPlayerClientImpl::load(const String& url) 299 void WebMediaPlayerClientImpl::load(const String& url)
300 { 300 {
301 m_url = KURL(ParsedURLString, url); 301 m_url = KURL(ParsedURLString, url);
302 #if ENABLE(MEDIA_SOURCE)
303 m_mediaSource = 0; 302 m_mediaSource = 0;
304 #endif
305 loadRequested(); 303 loadRequested();
306 } 304 }
307 305
308 #if ENABLE(MEDIA_SOURCE)
309 void WebMediaPlayerClientImpl::load(const String& url, PassRefPtr<WebCore::Media Source> mediaSource) 306 void WebMediaPlayerClientImpl::load(const String& url, PassRefPtr<WebCore::Media Source> mediaSource)
310 { 307 {
311 m_url = KURL(ParsedURLString, url); 308 m_url = KURL(ParsedURLString, url);
312 m_mediaSource = mediaSource; 309 m_mediaSource = mediaSource;
313 loadRequested(); 310 loadRequested();
314 } 311 }
315 #endif
316 312
317 void WebMediaPlayerClientImpl::loadRequested() 313 void WebMediaPlayerClientImpl::loadRequested()
318 { 314 {
319 if (m_preload == MediaPlayer::None) { 315 if (m_preload == MediaPlayer::None) {
320 #if ENABLE(WEB_AUDIO) 316 #if ENABLE(WEB_AUDIO)
321 m_audioSourceProvider.wrap(0); // Clear weak reference to m_webMediaPlay er's WebAudioSourceProvider. 317 m_audioSourceProvider.wrap(0); // Clear weak reference to m_webMediaPlay er's WebAudioSourceProvider.
322 #endif 318 #endif
323 m_webMediaPlayer.clear(); 319 m_webMediaPlayer.clear();
324 m_delayingLoad = true; 320 m_delayingLoad = true;
325 } else 321 } else
(...skipping 15 matching lines...) Expand all
341 m_needsWebLayerForVideo = frame->contentRenderer()->compositor()->hasAcceler atedCompositing(); 337 m_needsWebLayerForVideo = frame->contentRenderer()->compositor()->hasAcceler atedCompositing();
342 338
343 m_webMediaPlayer = createWebMediaPlayer(this, m_url, frame); 339 m_webMediaPlayer = createWebMediaPlayer(this, m_url, frame);
344 if (m_webMediaPlayer) { 340 if (m_webMediaPlayer) {
345 #if ENABLE(WEB_AUDIO) 341 #if ENABLE(WEB_AUDIO)
346 // Make sure if we create/re-create the WebMediaPlayer that we update ou r wrapper. 342 // Make sure if we create/re-create the WebMediaPlayer that we update ou r wrapper.
347 m_audioSourceProvider.wrap(m_webMediaPlayer->audioSourceProvider()); 343 m_audioSourceProvider.wrap(m_webMediaPlayer->audioSourceProvider());
348 #endif 344 #endif
349 345
350 WebMediaPlayer::CORSMode corsMode = static_cast<WebMediaPlayer::CORSMode >(m_mediaPlayer->mediaPlayerClient()->mediaPlayerCORSMode()); 346 WebMediaPlayer::CORSMode corsMode = static_cast<WebMediaPlayer::CORSMode >(m_mediaPlayer->mediaPlayerClient()->mediaPlayerCORSMode());
351 #if ENABLE(MEDIA_SOURCE)
352 if (m_mediaSource) { 347 if (m_mediaSource) {
353 m_webMediaPlayer->load(m_url, new WebMediaSourceImpl(m_mediaSource), corsMode); 348 m_webMediaPlayer->load(m_url, new WebMediaSourceImpl(m_mediaSource), corsMode);
354 return; 349 return;
355 } 350 }
356 #endif
357 m_webMediaPlayer->load(m_url, corsMode); 351 m_webMediaPlayer->load(m_url, corsMode);
358 } 352 }
359 } 353 }
360 354
361 void WebMediaPlayerClientImpl::cancelLoad() 355 void WebMediaPlayerClientImpl::cancelLoad()
362 { 356 {
363 if (m_webMediaPlayer) 357 if (m_webMediaPlayer)
364 m_webMediaPlayer->cancelLoad(); 358 m_webMediaPlayer->cancelLoad();
365 } 359 }
366 360
(...skipping 462 matching lines...) Expand 10 before | Expand all | Expand 10 after
829 { 823 {
830 if (m_client) 824 if (m_client)
831 m_client->setFormat(numberOfChannels, sampleRate); 825 m_client->setFormat(numberOfChannels, sampleRate);
832 } 826 }
833 827
834 #endif 828 #endif
835 829
836 } // namespace WebKit 830 } // namespace WebKit
837 831
838 #endif // ENABLE(VIDEO) 832 #endif // ENABLE(VIDEO)
OLDNEW
« no previous file with comments | « Source/WebKit/chromium/src/WebMediaPlayerClientImpl.h ('k') | Source/WebKit/chromium/src/WebMediaSourceImpl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698