| OLD | NEW |
| 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 #include "InbandTextTrackPrivateImpl.h" |
| 8 #include "WebAudioSourceProvider.h" | 9 #include "WebAudioSourceProvider.h" |
| 9 #include "WebDocument.h" | 10 #include "WebDocument.h" |
| 10 #include "WebFrameClient.h" | 11 #include "WebFrameClient.h" |
| 11 #include "WebFrameImpl.h" | 12 #include "WebFrameImpl.h" |
| 12 #include "WebHelperPluginImpl.h" | 13 #include "WebHelperPluginImpl.h" |
| 14 #include "WebInbandTextTrack.h" |
| 13 #include "WebMediaPlayer.h" | 15 #include "WebMediaPlayer.h" |
| 14 #include "WebMediaSourceImpl.h" | 16 #include "WebMediaSourceImpl.h" |
| 15 #include "WebViewImpl.h" | 17 #include "WebViewImpl.h" |
| 16 #include "core/html/HTMLMediaElement.h" | 18 #include "core/html/HTMLMediaElement.h" |
| 17 #include "core/html/TimeRanges.h" | 19 #include "core/html/TimeRanges.h" |
| 18 #include "core/page/Frame.h" | 20 #include "core/page/Frame.h" |
| 19 #include "core/platform/KURL.h" | 21 #include "core/platform/KURL.h" |
| 20 #include "core/platform/NotImplemented.h" | 22 #include "core/platform/NotImplemented.h" |
| 21 #include "core/platform/audio/AudioBus.h" | 23 #include "core/platform/audio/AudioBus.h" |
| 22 #include "core/platform/audio/AudioSourceProvider.h" | 24 #include "core/platform/audio/AudioSourceProvider.h" |
| (...skipping 266 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 289 | 291 |
| 290 if (m_videoLayer) | 292 if (m_videoLayer) |
| 291 GraphicsLayerChromium::unregisterContentsLayer(m_videoLayer); | 293 GraphicsLayerChromium::unregisterContentsLayer(m_videoLayer); |
| 292 m_videoLayer = layer; | 294 m_videoLayer = layer; |
| 293 if (m_videoLayer) { | 295 if (m_videoLayer) { |
| 294 m_videoLayer->setOpaque(m_opaque); | 296 m_videoLayer->setOpaque(m_opaque); |
| 295 GraphicsLayerChromium::registerContentsLayer(m_videoLayer); | 297 GraphicsLayerChromium::registerContentsLayer(m_videoLayer); |
| 296 } | 298 } |
| 297 } | 299 } |
| 298 | 300 |
| 301 void WebMediaPlayerClientImpl::addTextTrack(WebInbandTextTrack* textTrack) |
| 302 { |
| 303 m_mediaPlayer->addTextTrack(adoptRef(new InbandTextTrackPrivateImpl(textTrac
k))); |
| 304 } |
| 305 |
| 306 void WebMediaPlayerClientImpl::removeTextTrack(WebInbandTextTrack* textTrack) |
| 307 { |
| 308 // The following static_cast is safe, because we created the object with the
textTrack |
| 309 // that was passed to addTextTrack. (The object from which we are downcasti
ng includes |
| 310 // WebInbandTextTrack as one of the intefaces from which inherits.) |
| 311 m_mediaPlayer->removeTextTrack(static_cast<InbandTextTrackPrivateImpl*>(text
Track->client())); |
| 312 } |
| 313 |
| 299 // MediaPlayerPrivateInterface ------------------------------------------------- | 314 // MediaPlayerPrivateInterface ------------------------------------------------- |
| 300 | 315 |
| 301 void WebMediaPlayerClientImpl::load(const String& url) | 316 void WebMediaPlayerClientImpl::load(const String& url) |
| 302 { | 317 { |
| 303 m_url = KURL(ParsedURLString, url); | 318 m_url = KURL(ParsedURLString, url); |
| 304 m_mediaSource = 0; | 319 m_mediaSource = 0; |
| 305 loadRequested(); | 320 loadRequested(); |
| 306 } | 321 } |
| 307 | 322 |
| 308 void WebMediaPlayerClientImpl::load(const String& url, PassRefPtr<WebCore::Media
Source> mediaSource) | 323 void WebMediaPlayerClientImpl::load(const String& url, PassRefPtr<WebCore::Media
Source> mediaSource) |
| (...skipping 569 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 878 | 893 |
| 879 void WebMediaPlayerClientImpl::AudioClientImpl::setFormat(size_t numberOfChannel
s, float sampleRate) | 894 void WebMediaPlayerClientImpl::AudioClientImpl::setFormat(size_t numberOfChannel
s, float sampleRate) |
| 880 { | 895 { |
| 881 if (m_client) | 896 if (m_client) |
| 882 m_client->setFormat(numberOfChannels, sampleRate); | 897 m_client->setFormat(numberOfChannels, sampleRate); |
| 883 } | 898 } |
| 884 | 899 |
| 885 #endif | 900 #endif |
| 886 | 901 |
| 887 } // namespace WebKit | 902 } // namespace WebKit |
| OLD | NEW |