| 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 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 88 virtual bool needsWebLayerForVideo() const OVERRIDE; | 88 virtual bool needsWebLayerForVideo() const OVERRIDE; |
| 89 virtual void setWebLayer(WebLayer*) OVERRIDE; | 89 virtual void setWebLayer(WebLayer*) OVERRIDE; |
| 90 virtual void addTextTrack(WebInbandTextTrack*) OVERRIDE; | 90 virtual void addTextTrack(WebInbandTextTrack*) OVERRIDE; |
| 91 virtual void removeTextTrack(WebInbandTextTrack*) OVERRIDE; | 91 virtual void removeTextTrack(WebInbandTextTrack*) OVERRIDE; |
| 92 virtual void mediaSourceOpened(WebMediaSource*) OVERRIDE; | 92 virtual void mediaSourceOpened(WebMediaSource*) OVERRIDE; |
| 93 virtual void requestFullscreen() OVERRIDE; | 93 virtual void requestFullscreen() OVERRIDE; |
| 94 virtual void requestSeek(double) OVERRIDE; | 94 virtual void requestSeek(double) OVERRIDE; |
| 95 | 95 |
| 96 // MediaPlayer methods: | 96 // MediaPlayer methods: |
| 97 virtual WebMediaPlayer* webMediaPlayer() const OVERRIDE; | 97 virtual WebMediaPlayer* webMediaPlayer() const OVERRIDE; |
| 98 virtual void load(WebMediaPlayer::LoadType, const WTF::String& url) OVERRIDE
; | 98 virtual void load(WebMediaPlayer::LoadType, const WTF::String& url, WebMedia
Player::CORSMode) OVERRIDE; |
| 99 virtual void play() OVERRIDE; | 99 virtual void play() OVERRIDE; |
| 100 virtual void pause() OVERRIDE; | 100 virtual void pause() OVERRIDE; |
| 101 virtual void prepareToPlay() OVERRIDE; | |
| 102 virtual bool supportsSave() const OVERRIDE; | 101 virtual bool supportsSave() const OVERRIDE; |
| 103 virtual WebCore::IntSize naturalSize() const OVERRIDE; | 102 virtual WebCore::IntSize naturalSize() const OVERRIDE; |
| 104 virtual bool hasVideo() const OVERRIDE; | 103 virtual bool hasVideo() const OVERRIDE; |
| 105 virtual bool hasAudio() const OVERRIDE; | 104 virtual bool hasAudio() const OVERRIDE; |
| 106 virtual double duration() const OVERRIDE; | 105 virtual double duration() const OVERRIDE; |
| 107 virtual double currentTime() const OVERRIDE; | 106 virtual double currentTime() const OVERRIDE; |
| 108 virtual void seek(double time) OVERRIDE; | 107 virtual void seek(double time) OVERRIDE; |
| 109 virtual bool seeking() const OVERRIDE; | 108 virtual bool seeking() const OVERRIDE; |
| 110 virtual double rate() const OVERRIDE; | 109 virtual double rate() const OVERRIDE; |
| 111 virtual void setRate(double) OVERRIDE; | 110 virtual void setRate(double) OVERRIDE; |
| (...skipping 19 matching lines...) Expand all Loading... |
| 131 virtual void hideFullscreenOverlay() OVERRIDE; | 130 virtual void hideFullscreenOverlay() OVERRIDE; |
| 132 virtual bool canShowFullscreenOverlay() const OVERRIDE; | 131 virtual bool canShowFullscreenOverlay() const OVERRIDE; |
| 133 | 132 |
| 134 #if ENABLE(WEB_AUDIO) | 133 #if ENABLE(WEB_AUDIO) |
| 135 virtual WebCore::AudioSourceProvider* audioSourceProvider() OVERRIDE; | 134 virtual WebCore::AudioSourceProvider* audioSourceProvider() OVERRIDE; |
| 136 #endif | 135 #endif |
| 137 | 136 |
| 138 private: | 137 private: |
| 139 explicit WebMediaPlayerClientImpl(WebCore::MediaPlayerClient*); | 138 explicit WebMediaPlayerClientImpl(WebCore::MediaPlayerClient*); |
| 140 | 139 |
| 141 void startDelayedLoad(); | 140 WebCore::HTMLMediaElement& mediaElement() const; |
| 142 void loadInternal(); | |
| 143 | 141 |
| 144 WebCore::HTMLMediaElement& mediaElement() const; | 142 WebCore::MediaPlayerClient* m_client; |
| 143 OwnPtr<WebMediaPlayer> m_webMediaPlayer; |
| 144 WebCore::MediaPlayer::Preload m_preload; |
| 145 bool m_needsWebLayerForVideo; |
| 146 double m_rate; |
| 145 | 147 |
| 146 #if OS(ANDROID) | 148 #if OS(ANDROID) |
| 147 // 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 | 149 // 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 |
| 148 // texture internally. It should be removed and replaced by the normal paint
path. | 150 // texture internally. It should be removed and replaced by the normal paint
path. |
| 149 // https://code.google.com/p/skia/issues/detail?id=1189 | 151 // https://code.google.com/p/skia/issues/detail?id=1189 |
| 150 void paintOnAndroid(WebCore::GraphicsContext*, const WebCore::IntRect&, uint
8_t alpha); | 152 void paintOnAndroid(WebCore::GraphicsContext*, const WebCore::IntRect&, uint
8_t alpha); |
| 151 SkBitmap m_bitmap; | 153 SkBitmap m_bitmap; |
| 154 bool m_usePaintOnAndroid; |
| 152 #endif | 155 #endif |
| 153 | 156 |
| 154 WebCore::MediaPlayerClient* m_client; | |
| 155 OwnPtr<WebMediaPlayer> m_webMediaPlayer; | |
| 156 WebCore::KURL m_url; | |
| 157 bool m_delayingLoad; | |
| 158 WebCore::MediaPlayer::Preload m_preload; | |
| 159 bool m_needsWebLayerForVideo; | |
| 160 double m_rate; | |
| 161 | |
| 162 #if ENABLE(WEB_AUDIO) | 157 #if ENABLE(WEB_AUDIO) |
| 163 // AudioClientImpl wraps an AudioSourceProviderClient. | 158 // AudioClientImpl wraps an AudioSourceProviderClient. |
| 164 // When the audio format is known, Chromium calls setFormat() which then dis
patches into WebCore. | 159 // When the audio format is known, Chromium calls setFormat() which then dis
patches into WebCore. |
| 165 | 160 |
| 166 class AudioClientImpl FINAL : public blink::WebAudioSourceProviderClient { | 161 class AudioClientImpl FINAL : public blink::WebAudioSourceProviderClient { |
| 167 public: | 162 public: |
| 168 AudioClientImpl(WebCore::AudioSourceProviderClient* client) | 163 AudioClientImpl(WebCore::AudioSourceProviderClient* client) |
| 169 : m_client(client) | 164 : m_client(client) |
| 170 { | 165 { |
| 171 } | 166 } |
| (...skipping 27 matching lines...) Expand all Loading... |
| 199 virtual void provideInput(WebCore::AudioBus*, size_t framesToProcess) OV
ERRIDE; | 194 virtual void provideInput(WebCore::AudioBus*, size_t framesToProcess) OV
ERRIDE; |
| 200 | 195 |
| 201 private: | 196 private: |
| 202 WebAudioSourceProvider* m_webAudioSourceProvider; | 197 WebAudioSourceProvider* m_webAudioSourceProvider; |
| 203 OwnPtr<AudioClientImpl> m_client; | 198 OwnPtr<AudioClientImpl> m_client; |
| 204 Mutex provideInputLock; | 199 Mutex provideInputLock; |
| 205 }; | 200 }; |
| 206 | 201 |
| 207 AudioSourceProviderImpl m_audioSourceProvider; | 202 AudioSourceProviderImpl m_audioSourceProvider; |
| 208 #endif | 203 #endif |
| 209 | |
| 210 WebMediaPlayer::LoadType m_loadType; | |
| 211 }; | 204 }; |
| 212 | 205 |
| 213 } // namespace blink | 206 } // namespace blink |
| 214 | 207 |
| 215 #endif | 208 #endif |
| OLD | NEW |