| 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 "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 30 matching lines...) Expand all Loading... |
| 41 #include "GrContext.h" | 41 #include "GrContext.h" |
| 42 #include "GrTypes.h" | 42 #include "GrTypes.h" |
| 43 #include "SkCanvas.h" | 43 #include "SkCanvas.h" |
| 44 #include "SkGrPixelRef.h" | 44 #include "SkGrPixelRef.h" |
| 45 #endif | 45 #endif |
| 46 | 46 |
| 47 | 47 |
| 48 #include "wtf/Assertions.h" | 48 #include "wtf/Assertions.h" |
| 49 #include "wtf/text/CString.h" | 49 #include "wtf/text/CString.h" |
| 50 | 50 |
| 51 using namespace blink; | |
| 52 | |
| 53 namespace blink { | 51 namespace blink { |
| 54 | 52 |
| 55 static PassOwnPtr<WebMediaPlayer> createWebMediaPlayer(WebMediaPlayerClient* cli
ent, const WebURL& url, LocalFrame* frame) | 53 static PassOwnPtr<WebMediaPlayer> createWebMediaPlayer(WebMediaPlayerClient* cli
ent, const WebURL& url, LocalFrame* frame) |
| 56 { | 54 { |
| 57 WebLocalFrameImpl* webFrame = WebLocalFrameImpl::fromFrame(frame); | 55 WebLocalFrameImpl* webFrame = WebLocalFrameImpl::fromFrame(frame); |
| 58 | 56 |
| 59 if (!webFrame || !webFrame->client()) | 57 if (!webFrame || !webFrame->client()) |
| 60 return nullptr; | 58 return nullptr; |
| 61 return adoptPtr(webFrame->client()->createMediaPlayer(webFrame, url, client)
); | 59 return adoptPtr(webFrame->client()->createMediaPlayer(webFrame, url, client)
); |
| 62 } | 60 } |
| (...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 124 void WebMediaPlayerClientImpl::keyMessage(const WebString& keySystem, const WebS
tring& sessionId, const unsigned char* message, unsigned messageLength, const We
bURL& defaultURL) | 122 void WebMediaPlayerClientImpl::keyMessage(const WebString& keySystem, const WebS
tring& sessionId, const unsigned char* message, unsigned messageLength, const We
bURL& defaultURL) |
| 125 { | 123 { |
| 126 HTMLMediaElementEncryptedMedia::keyMessage(mediaElement(), keySystem, sessio
nId, message, messageLength, defaultURL); | 124 HTMLMediaElementEncryptedMedia::keyMessage(mediaElement(), keySystem, sessio
nId, message, messageLength, defaultURL); |
| 127 } | 125 } |
| 128 | 126 |
| 129 void WebMediaPlayerClientImpl::keyNeeded(const WebString& contentType, const uns
igned char* initData, unsigned initDataLength) | 127 void WebMediaPlayerClientImpl::keyNeeded(const WebString& contentType, const uns
igned char* initData, unsigned initDataLength) |
| 130 { | 128 { |
| 131 HTMLMediaElementEncryptedMedia::keyNeeded(mediaElement(), contentType, initD
ata, initDataLength); | 129 HTMLMediaElementEncryptedMedia::keyNeeded(mediaElement(), contentType, initD
ata, initDataLength); |
| 132 } | 130 } |
| 133 | 131 |
| 134 void WebMediaPlayerClientImpl::setWebLayer(blink::WebLayer* layer) | 132 void WebMediaPlayerClientImpl::setWebLayer(WebLayer* layer) |
| 135 { | 133 { |
| 136 m_client->mediaPlayerSetWebLayer(layer); | 134 m_client->mediaPlayerSetWebLayer(layer); |
| 137 } | 135 } |
| 138 | 136 |
| 139 WebMediaPlayer::TrackId WebMediaPlayerClientImpl::addAudioTrack(const WebString&
id, AudioTrackKind kind, const WebString& label, const WebString& language, boo
l enabled) | 137 WebMediaPlayer::TrackId WebMediaPlayerClientImpl::addAudioTrack(const WebString&
id, AudioTrackKind kind, const WebString& label, const WebString& language, boo
l enabled) |
| 140 { | 138 { |
| 141 return mediaElement().addAudioTrack(id, kind, label, language, enabled); | 139 return mediaElement().addAudioTrack(id, kind, label, language, enabled); |
| 142 } | 140 } |
| 143 | 141 |
| 144 void WebMediaPlayerClientImpl::removeAudioTrack(WebMediaPlayer::TrackId id) | 142 void WebMediaPlayerClientImpl::removeAudioTrack(WebMediaPlayer::TrackId id) |
| (...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 228 { | 226 { |
| 229 return adoptPtr(new WebMediaPlayerClientImpl(client)); | 227 return adoptPtr(new WebMediaPlayerClientImpl(client)); |
| 230 } | 228 } |
| 231 | 229 |
| 232 WebMediaPlayerClientImpl::WebMediaPlayerClientImpl(MediaPlayerClient* client) | 230 WebMediaPlayerClientImpl::WebMediaPlayerClientImpl(MediaPlayerClient* client) |
| 233 : m_client(client) | 231 : m_client(client) |
| 234 { | 232 { |
| 235 ASSERT(m_client); | 233 ASSERT(m_client); |
| 236 } | 234 } |
| 237 | 235 |
| 238 blink::HTMLMediaElement& WebMediaPlayerClientImpl::mediaElement() const | 236 HTMLMediaElement& WebMediaPlayerClientImpl::mediaElement() const |
| 239 { | 237 { |
| 240 return *static_cast<HTMLMediaElement*>(m_client); | 238 return *static_cast<HTMLMediaElement*>(m_client); |
| 241 } | 239 } |
| 242 | 240 |
| 243 #if ENABLE(WEB_AUDIO) | 241 #if ENABLE(WEB_AUDIO) |
| 244 void WebMediaPlayerClientImpl::AudioSourceProviderImpl::wrap(WebAudioSourceProvi
der* provider) | 242 void WebMediaPlayerClientImpl::AudioSourceProviderImpl::wrap(WebAudioSourceProvi
der* provider) |
| 245 { | 243 { |
| 246 MutexLocker locker(provideInputLock); | 244 MutexLocker locker(provideInputLock); |
| 247 | 245 |
| 248 if (m_webAudioSourceProvider && provider != m_webAudioSourceProvider) | 246 if (m_webAudioSourceProvider && provider != m_webAudioSourceProvider) |
| (...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 294 } | 292 } |
| 295 | 293 |
| 296 void WebMediaPlayerClientImpl::AudioClientImpl::trace(Visitor* visitor) | 294 void WebMediaPlayerClientImpl::AudioClientImpl::trace(Visitor* visitor) |
| 297 { | 295 { |
| 298 visitor->trace(m_client); | 296 visitor->trace(m_client); |
| 299 } | 297 } |
| 300 | 298 |
| 301 #endif | 299 #endif |
| 302 | 300 |
| 303 } // namespace blink | 301 } // namespace blink |
| OLD | NEW |