| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2009 Google Inc. All rights reserved. | 2 * Copyright (C) 2009 Google Inc. All rights reserved. |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
| 6 * met: | 6 * met: |
| 7 * | 7 * |
| 8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
| 9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
| 10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
| (...skipping 17 matching lines...) Expand all Loading... |
| 28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| 29 */ | 29 */ |
| 30 | 30 |
| 31 #ifndef WebMediaPlayerClientImpl_h | 31 #ifndef WebMediaPlayerClientImpl_h |
| 32 #define WebMediaPlayerClientImpl_h | 32 #define WebMediaPlayerClientImpl_h |
| 33 | 33 |
| 34 #include "platform/audio/AudioSourceProvider.h" | 34 #include "platform/audio/AudioSourceProvider.h" |
| 35 #include "platform/graphics/media/MediaPlayer.h" | 35 #include "platform/graphics/media/MediaPlayer.h" |
| 36 #include "public/platform/WebAudioSourceProviderClient.h" | 36 #include "public/platform/WebAudioSourceProviderClient.h" |
| 37 #include "public/platform/WebMediaPlayerClient.h" | 37 #include "public/platform/WebMediaPlayerClient.h" |
| 38 #include "third_party/khronos/GLES2/gl2.h" | |
| 39 #if OS(ANDROID) | |
| 40 #include "third_party/skia/include/core/SkBitmap.h" | |
| 41 #include "third_party/skia/include/core/SkRefCnt.h" | |
| 42 #include "third_party/skia/include/gpu/GrTexture.h" | |
| 43 #endif | |
| 44 #include "platform/weborigin/KURL.h" | 38 #include "platform/weborigin/KURL.h" |
| 45 #include "wtf/OwnPtr.h" | 39 #include "wtf/OwnPtr.h" |
| 46 #include "wtf/PassOwnPtr.h" | 40 #include "wtf/PassOwnPtr.h" |
| 47 #include "wtf/ThreadingPrimitives.h" | 41 #include "wtf/ThreadingPrimitives.h" |
| 48 | 42 |
| 49 namespace blink { | 43 namespace blink { |
| 50 class AudioSourceProviderClient; | 44 class AudioSourceProviderClient; |
| 51 class HTMLMediaElement; | 45 class HTMLMediaElement; |
| 52 } | 46 } |
| 53 | 47 |
| 54 namespace blink { | 48 namespace blink { |
| 55 | 49 |
| 56 class WebAudioSourceProvider; | 50 class WebAudioSourceProvider; |
| 57 class WebContentDecryptionModule; | 51 class WebContentDecryptionModule; |
| 58 class WebMediaPlayer; | 52 class WebMediaPlayer; |
| 59 class WebGraphicsContext3D; | |
| 60 | 53 |
| 61 // This class serves as a bridge between blink::MediaPlayer and | 54 // This class serves as a bridge between blink::MediaPlayer and |
| 62 // blink::WebMediaPlayer. | 55 // blink::WebMediaPlayer. |
| 63 class WebMediaPlayerClientImpl FINAL : public blink::MediaPlayer, public WebMedi
aPlayerClient { | 56 class WebMediaPlayerClientImpl FINAL : public blink::MediaPlayer, public WebMedi
aPlayerClient { |
| 64 | 57 |
| 65 public: | 58 public: |
| 66 static PassOwnPtr<blink::MediaPlayer> create(blink::MediaPlayerClient*); | 59 static PassOwnPtr<blink::MediaPlayer> create(blink::MediaPlayerClient*); |
| 67 | 60 |
| 68 virtual ~WebMediaPlayerClientImpl(); | 61 virtual ~WebMediaPlayerClientImpl(); |
| 69 | 62 |
| (...skipping 21 matching lines...) Expand all Loading... |
| 91 virtual void removeVideoTrack(WebMediaPlayer::TrackId) OVERRIDE; | 84 virtual void removeVideoTrack(WebMediaPlayer::TrackId) OVERRIDE; |
| 92 virtual void addTextTrack(WebInbandTextTrack*) OVERRIDE; | 85 virtual void addTextTrack(WebInbandTextTrack*) OVERRIDE; |
| 93 virtual void removeTextTrack(WebInbandTextTrack*) OVERRIDE; | 86 virtual void removeTextTrack(WebInbandTextTrack*) OVERRIDE; |
| 94 virtual void mediaSourceOpened(WebMediaSource*) OVERRIDE; | 87 virtual void mediaSourceOpened(WebMediaSource*) OVERRIDE; |
| 95 virtual void requestFullscreen() OVERRIDE; | 88 virtual void requestFullscreen() OVERRIDE; |
| 96 virtual void requestSeek(double) OVERRIDE; | 89 virtual void requestSeek(double) OVERRIDE; |
| 97 | 90 |
| 98 // MediaPlayer methods: | 91 // MediaPlayer methods: |
| 99 virtual WebMediaPlayer* webMediaPlayer() const OVERRIDE; | 92 virtual WebMediaPlayer* webMediaPlayer() const OVERRIDE; |
| 100 virtual void load(WebMediaPlayer::LoadType, const WTF::String& url, WebMedia
Player::CORSMode) OVERRIDE; | 93 virtual void load(WebMediaPlayer::LoadType, const WTF::String& url, WebMedia
Player::CORSMode) OVERRIDE; |
| 101 virtual void paint(blink::GraphicsContext*, const blink::IntRect&) OVERRIDE; | |
| 102 virtual bool copyVideoTextureToPlatformTexture(WebGraphicsContext3D*, Platfo
rm3DObject texture, GLint level, GLenum type, GLenum internalFormat, bool premul
tiplyAlpha, bool flipY) OVERRIDE; | |
| 103 virtual void setPreload(blink::MediaPlayer::Preload) OVERRIDE; | 94 virtual void setPreload(blink::MediaPlayer::Preload) OVERRIDE; |
| 104 | 95 |
| 105 #if ENABLE(WEB_AUDIO) | 96 #if ENABLE(WEB_AUDIO) |
| 106 virtual blink::AudioSourceProvider* audioSourceProvider() OVERRIDE; | 97 virtual blink::AudioSourceProvider* audioSourceProvider() OVERRIDE; |
| 107 #endif | 98 #endif |
| 108 | 99 |
| 109 private: | 100 private: |
| 110 explicit WebMediaPlayerClientImpl(blink::MediaPlayerClient*); | 101 explicit WebMediaPlayerClientImpl(blink::MediaPlayerClient*); |
| 111 | 102 |
| 112 blink::HTMLMediaElement& mediaElement() const; | 103 blink::HTMLMediaElement& mediaElement() const; |
| 113 | 104 |
| 114 blink::MediaPlayerClient* m_client; | 105 blink::MediaPlayerClient* m_client; |
| 115 OwnPtr<WebMediaPlayer> m_webMediaPlayer; | 106 OwnPtr<WebMediaPlayer> m_webMediaPlayer; |
| 116 blink::MediaPlayer::Preload m_preload; | 107 blink::MediaPlayer::Preload m_preload; |
| 117 | 108 |
| 118 #if OS(ANDROID) | |
| 119 // FIXME: This path "only works" on Android. It is a workaround for the prob
lem that Skia could not handle Android's GL_TEXTURE_EXTERNAL_OES | |
| 120 // texture internally. It should be removed and replaced by the normal paint
path. | |
| 121 // https://code.google.com/p/skia/issues/detail?id=1189 | |
| 122 void paintOnAndroid(blink::GraphicsContext*, const blink::IntRect&, uint8_t
alpha); | |
| 123 SkBitmap m_bitmap; | |
| 124 bool m_usePaintOnAndroid; | |
| 125 #endif | |
| 126 | |
| 127 #if ENABLE(WEB_AUDIO) | 109 #if ENABLE(WEB_AUDIO) |
| 128 // AudioClientImpl wraps an AudioSourceProviderClient. | 110 // AudioClientImpl wraps an AudioSourceProviderClient. |
| 129 // When the audio format is known, Chromium calls setFormat() which then dis
patches into WebCore. | 111 // When the audio format is known, Chromium calls setFormat() which then dis
patches into WebCore. |
| 130 | 112 |
| 131 class AudioClientImpl FINAL : public blink::WebAudioSourceProviderClient { | 113 class AudioClientImpl FINAL : public blink::WebAudioSourceProviderClient { |
| 132 public: | 114 public: |
| 133 AudioClientImpl(blink::AudioSourceProviderClient* client) | 115 AudioClientImpl(blink::AudioSourceProviderClient* client) |
| 134 : m_client(client) | 116 : m_client(client) |
| 135 { | 117 { |
| 136 } | 118 } |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 169 Mutex provideInputLock; | 151 Mutex provideInputLock; |
| 170 }; | 152 }; |
| 171 | 153 |
| 172 AudioSourceProviderImpl m_audioSourceProvider; | 154 AudioSourceProviderImpl m_audioSourceProvider; |
| 173 #endif | 155 #endif |
| 174 }; | 156 }; |
| 175 | 157 |
| 176 } // namespace blink | 158 } // namespace blink |
| 177 | 159 |
| 178 #endif | 160 #endif |
| OLD | NEW |