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

Side by Side Diff: content/renderer/media/android/webmediaplayer_android.h

Issue 175223003: HW Video: Make media::VideoFrame handle the sync point of the compositor as well as webgl (Closed) Base URL: https://git.chromium.org/chromium/src.git@master
Patch Set: previous patchset has unrelated code by mistake. 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
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef CONTENT_RENDERER_MEDIA_ANDROID_WEBMEDIAPLAYER_ANDROID_H_ 5 #ifndef CONTENT_RENDERER_MEDIA_ANDROID_WEBMEDIAPLAYER_ANDROID_H_
6 #define CONTENT_RENDERER_MEDIA_ANDROID_WEBMEDIAPLAYER_ANDROID_H_ 6 #define CONTENT_RENDERER_MEDIA_ANDROID_WEBMEDIAPLAYER_ANDROID_H_
7 7
8 #include <jni.h> 8 #include <jni.h>
9 #include <string> 9 #include <string>
10 #include <vector> 10 #include <vector>
(...skipping 219 matching lines...) Expand 10 before | Expand all | Expand 10 after
230 void OnNeedKey(const std::string& type, 230 void OnNeedKey(const std::string& type,
231 const std::vector<uint8>& init_data); 231 const std::vector<uint8>& init_data);
232 232
233 // TODO(xhwang): Implement WebMediaPlayer::setContentDecryptionModule(). 233 // TODO(xhwang): Implement WebMediaPlayer::setContentDecryptionModule().
234 // See: http://crbug.com/224786 234 // See: http://crbug.com/224786
235 235
236 // Can be called on any thread. 236 // Can be called on any thread.
237 static void OnReleaseRemotePlaybackTexture( 237 static void OnReleaseRemotePlaybackTexture(
238 const scoped_refptr<base::MessageLoopProxy>& main_loop, 238 const scoped_refptr<base::MessageLoopProxy>& main_loop,
239 const base::WeakPtr<WebMediaPlayerAndroid>& player, 239 const base::WeakPtr<WebMediaPlayerAndroid>& player,
240 scoped_ptr<gpu::MailboxHolder> mailbox_holder); 240 scoped_ptr<gpu::MailboxHolder> mailbox_holder,
241 const std::vector<uint32>& release_sync_points);
241 242
242 protected: 243 protected:
243 // Helper method to update the playing state. 244 // Helper method to update the playing state.
244 void UpdatePlayingState(bool is_playing_); 245 void UpdatePlayingState(bool is_playing_);
245 246
246 // Helper methods for posting task for setting states and update WebKit. 247 // Helper methods for posting task for setting states and update WebKit.
247 void UpdateNetworkState(blink::WebMediaPlayer::NetworkState state); 248 void UpdateNetworkState(blink::WebMediaPlayer::NetworkState state);
248 void UpdateReadyState(blink::WebMediaPlayer::ReadyState state); 249 void UpdateReadyState(blink::WebMediaPlayer::ReadyState state);
249 void TryCreateStreamTextureProxyIfNeeded(); 250 void TryCreateStreamTextureProxyIfNeeded();
250 void DoCreateStreamTexture(); 251 void DoCreateStreamTexture();
251 252
252 // Helper method to reestablish the surface texture peer for android 253 // Helper method to reestablish the surface texture peer for android
253 // media player. 254 // media player.
254 void EstablishSurfaceTexturePeer(); 255 void EstablishSurfaceTexturePeer();
255 256
256 // Requesting whether the surface texture peer needs to be reestablished. 257 // Requesting whether the surface texture peer needs to be reestablished.
257 void SetNeedsEstablishPeer(bool needs_establish_peer); 258 void SetNeedsEstablishPeer(bool needs_establish_peer);
258 259
259 private: 260 private:
260 void Pause(bool is_media_related_action); 261 void Pause(bool is_media_related_action);
261 void DrawRemotePlaybackIcon(); 262 void DrawRemotePlaybackIcon();
262 void ReallocateVideoFrame(); 263 void ReallocateVideoFrame();
263 void CreateWebLayerIfNeeded(); 264 void CreateWebLayerIfNeeded();
264 void SetCurrentFrameInternal(scoped_refptr<media::VideoFrame>& frame); 265 void SetCurrentFrameInternal(scoped_refptr<media::VideoFrame>& frame);
265 void DidLoadMediaInfo(MediaInfoLoader::Status status); 266 void DidLoadMediaInfo(MediaInfoLoader::Status status);
266 void DoReleaseRemotePlaybackTexture(uint32 sync_point); 267 void DoReleaseRemotePlaybackTexture(
268 const std::vector<uint32>& release_sync_points);
267 269
268 bool IsKeySystemSupported(const std::string& key_system); 270 bool IsKeySystemSupported(const std::string& key_system);
269 271
270 // Actually do the work for generateKeyRequest/addKey so they can easily 272 // Actually do the work for generateKeyRequest/addKey so they can easily
271 // report results to UMA. 273 // report results to UMA.
272 MediaKeyException GenerateKeyRequestInternal(const std::string& key_system, 274 MediaKeyException GenerateKeyRequestInternal(const std::string& key_system,
273 const unsigned char* init_data, 275 const unsigned char* init_data,
274 unsigned init_data_length); 276 unsigned init_data_length);
275 MediaKeyException AddKeyInternal(const std::string& key_system, 277 MediaKeyException AddKeyInternal(const std::string& key_system,
276 const unsigned char* key, 278 const unsigned char* key,
(...skipping 167 matching lines...) Expand 10 before | Expand all | Expand 10 after
444 scoped_ptr<ProxyDecryptor> proxy_decryptor_; 446 scoped_ptr<ProxyDecryptor> proxy_decryptor_;
445 447
446 base::WeakPtrFactory<WebMediaPlayerAndroid> weak_factory_; 448 base::WeakPtrFactory<WebMediaPlayerAndroid> weak_factory_;
447 449
448 DISALLOW_COPY_AND_ASSIGN(WebMediaPlayerAndroid); 450 DISALLOW_COPY_AND_ASSIGN(WebMediaPlayerAndroid);
449 }; 451 };
450 452
451 } // namespace content 453 } // namespace content
452 454
453 #endif // CONTENT_RENDERER_MEDIA_ANDROID_WEBMEDIAPLAYER_ANDROID_H_ 455 #endif // CONTENT_RENDERER_MEDIA_ANDROID_WEBMEDIAPLAYER_ANDROID_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698