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