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

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: Rebase 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
« no previous file with comments | « Source/web/AssertMatchingEnums.cpp ('k') | Source/web/WebMediaPlayerClientImpl.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 19 matching lines...) Expand all
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();
142 void loadInternal();
143
144 WebCore::HTMLMediaElement& mediaElement() const; 140 WebCore::HTMLMediaElement& mediaElement() const;
145 141
146 #if OS(ANDROID) 142 #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 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
148 // texture internally. It should be removed and replaced by the normal paint path. 144 // texture internally. It should be removed and replaced by the normal paint path.
149 // https://code.google.com/p/skia/issues/detail?id=1189 145 // https://code.google.com/p/skia/issues/detail?id=1189
150 void paintOnAndroid(WebCore::GraphicsContext*, const WebCore::IntRect&, uint 8_t alpha); 146 void paintOnAndroid(WebCore::GraphicsContext*, const WebCore::IntRect&, uint 8_t alpha);
151 SkBitmap m_bitmap; 147 SkBitmap m_bitmap;
152 #endif 148 #endif
153 149
154 WebCore::MediaPlayerClient* m_client; 150 WebCore::MediaPlayerClient* m_client;
155 OwnPtr<WebMediaPlayer> m_webMediaPlayer; 151 OwnPtr<WebMediaPlayer> m_webMediaPlayer;
156 WebCore::KURL m_url;
157 bool m_delayingLoad;
158 WebCore::MediaPlayer::Preload m_preload; 152 WebCore::MediaPlayer::Preload m_preload;
159 bool m_needsWebLayerForVideo; 153 bool m_needsWebLayerForVideo;
160 double m_rate; 154 double m_rate;
161 155
162 #if ENABLE(WEB_AUDIO) 156 #if ENABLE(WEB_AUDIO)
163 // AudioClientImpl wraps an AudioSourceProviderClient. 157 // AudioClientImpl wraps an AudioSourceProviderClient.
164 // When the audio format is known, Chromium calls setFormat() which then dis patches into WebCore. 158 // When the audio format is known, Chromium calls setFormat() which then dis patches into WebCore.
165 159
166 class AudioClientImpl FINAL : public blink::WebAudioSourceProviderClient { 160 class AudioClientImpl FINAL : public blink::WebAudioSourceProviderClient {
167 public: 161 public:
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
199 virtual void provideInput(WebCore::AudioBus*, size_t framesToProcess) OV ERRIDE; 193 virtual void provideInput(WebCore::AudioBus*, size_t framesToProcess) OV ERRIDE;
200 194
201 private: 195 private:
202 WebAudioSourceProvider* m_webAudioSourceProvider; 196 WebAudioSourceProvider* m_webAudioSourceProvider;
203 OwnPtr<AudioClientImpl> m_client; 197 OwnPtr<AudioClientImpl> m_client;
204 Mutex provideInputLock; 198 Mutex provideInputLock;
205 }; 199 };
206 200
207 AudioSourceProviderImpl m_audioSourceProvider; 201 AudioSourceProviderImpl m_audioSourceProvider;
208 #endif 202 #endif
209
210 WebMediaPlayer::LoadType m_loadType;
211 }; 203 };
212 204
213 } // namespace blink 205 } // namespace blink
214 206
215 #endif 207 #endif
OLDNEW
« no previous file with comments | « Source/web/AssertMatchingEnums.cpp ('k') | Source/web/WebMediaPlayerClientImpl.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698