Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1653)

Side by Side Diff: Source/web/WebMediaPlayerClientImpl.h

Issue 192013002: Move deferred loading logic from WebMediaPlayerClientImpl to HTMLMediaElement. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Clean up unnecessary logic and state. Created 6 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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
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 21 matching lines...) Expand all
133 virtual void hideFullscreenOverlay() OVERRIDE; 132 virtual void hideFullscreenOverlay() OVERRIDE;
134 virtual bool canShowFullscreenOverlay() const OVERRIDE; 133 virtual bool canShowFullscreenOverlay() const OVERRIDE;
135 134
136 #if ENABLE(WEB_AUDIO) 135 #if ENABLE(WEB_AUDIO)
137 virtual WebCore::AudioSourceProvider* audioSourceProvider() OVERRIDE; 136 virtual WebCore::AudioSourceProvider* audioSourceProvider() OVERRIDE;
138 #endif 137 #endif
139 138
140 private: 139 private:
141 explicit WebMediaPlayerClientImpl(WebCore::MediaPlayerClient*); 140 explicit WebMediaPlayerClientImpl(WebCore::MediaPlayerClient*);
142 141
143 void startDelayedLoad();
144 void loadInternal();
145
146 WebCore::HTMLMediaElement& mediaElement() const; 142 WebCore::HTMLMediaElement& mediaElement() const;
147 143
148 #if OS(ANDROID) 144 #if OS(ANDROID)
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 145 // 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
150 // texture internally. It should be removed and replaced by the normal paint path. 146 // texture internally. It should be removed and replaced by the normal paint path.
151 // https://code.google.com/p/skia/issues/detail?id=1189 147 // https://code.google.com/p/skia/issues/detail?id=1189
152 void paintOnAndroid(WebCore::GraphicsContext*, WebGraphicsContext3D*, const WebCore::IntRect&, uint8_t alpha); 148 void paintOnAndroid(WebCore::GraphicsContext*, WebGraphicsContext3D*, const WebCore::IntRect&, uint8_t alpha);
153 SkBitmap m_bitmap; 149 SkBitmap m_bitmap;
154 #endif 150 #endif
155 151
156 WebCore::MediaPlayerClient* m_client; 152 WebCore::MediaPlayerClient* m_client;
157 OwnPtr<WebMediaPlayer> m_webMediaPlayer; 153 OwnPtr<WebMediaPlayer> m_webMediaPlayer;
158 WebCore::KURL m_url;
159 bool m_delayingLoad;
160 WebCore::MediaPlayer::Preload m_preload; 154 WebCore::MediaPlayer::Preload m_preload;
161 bool m_needsWebLayerForVideo; 155 bool m_needsWebLayerForVideo;
162 double m_volume; 156 double m_volume;
163 bool m_muted; 157 bool m_muted;
164 double m_rate; 158 double m_rate;
165 159
166 #if ENABLE(WEB_AUDIO) 160 #if ENABLE(WEB_AUDIO)
167 // AudioClientImpl wraps an AudioSourceProviderClient. 161 // AudioClientImpl wraps an AudioSourceProviderClient.
168 // When the audio format is known, Chromium calls setFormat() which then dis patches into WebCore. 162 // When the audio format is known, Chromium calls setFormat() which then dis patches into WebCore.
169 163
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
203 virtual void provideInput(WebCore::AudioBus*, size_t framesToProcess) OV ERRIDE; 197 virtual void provideInput(WebCore::AudioBus*, size_t framesToProcess) OV ERRIDE;
204 198
205 private: 199 private:
206 WebAudioSourceProvider* m_webAudioSourceProvider; 200 WebAudioSourceProvider* m_webAudioSourceProvider;
207 OwnPtr<AudioClientImpl> m_client; 201 OwnPtr<AudioClientImpl> m_client;
208 Mutex provideInputLock; 202 Mutex provideInputLock;
209 }; 203 };
210 204
211 AudioSourceProviderImpl m_audioSourceProvider; 205 AudioSourceProviderImpl m_audioSourceProvider;
212 #endif 206 #endif
213
214 WebMediaPlayer::LoadType m_loadType;
215 }; 207 };
216 208
217 } // namespace blink 209 } // namespace blink
218 210
219 #endif 211 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698