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

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

Issue 409793006: Eliminate MediaPlayer abstraction(paint APIs- chromium changes) (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 5 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 11 matching lines...) Expand all
22 #include "content/renderer/media/android/stream_texture_factory.h" 22 #include "content/renderer/media/android/stream_texture_factory.h"
23 #include "content/renderer/media/crypto/proxy_decryptor.h" 23 #include "content/renderer/media/crypto/proxy_decryptor.h"
24 #include "gpu/command_buffer/common/mailbox.h" 24 #include "gpu/command_buffer/common/mailbox.h"
25 #include "media/base/android/media_player_android.h" 25 #include "media/base/android/media_player_android.h"
26 #include "media/base/demuxer_stream.h" 26 #include "media/base/demuxer_stream.h"
27 #include "media/base/media_keys.h" 27 #include "media/base/media_keys.h"
28 #include "third_party/WebKit/public/platform/WebGraphicsContext3D.h" 28 #include "third_party/WebKit/public/platform/WebGraphicsContext3D.h"
29 #include "third_party/WebKit/public/platform/WebMediaPlayer.h" 29 #include "third_party/WebKit/public/platform/WebMediaPlayer.h"
30 #include "third_party/WebKit/public/platform/WebSize.h" 30 #include "third_party/WebKit/public/platform/WebSize.h"
31 #include "third_party/WebKit/public/platform/WebURL.h" 31 #include "third_party/WebKit/public/platform/WebURL.h"
32 #include "third_party/skia/include/core/SkBitmap.h"
33 #include "third_party/skia/include/gpu/GrContext.h"
34 #include "third_party/skia/include/gpu/SkGrPixelRef.h"
32 #include "ui/gfx/rect_f.h" 35 #include "ui/gfx/rect_f.h"
33 36
34 namespace base { 37 namespace base {
35 class MessageLoopProxy; 38 class MessageLoopProxy;
36 } 39 }
37 40
38 namespace blink { 41 namespace blink {
39 class WebContentDecryptionModule; 42 class WebContentDecryptionModule;
40 class WebFrame; 43 class WebFrame;
41 class WebURL; 44 class WebURL;
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
95 virtual void seek(double seconds); 98 virtual void seek(double seconds);
96 virtual bool supportsSave() const; 99 virtual bool supportsSave() const;
97 virtual void setRate(double rate); 100 virtual void setRate(double rate);
98 virtual void setVolume(double volume); 101 virtual void setVolume(double volume);
99 virtual blink::WebTimeRanges buffered() const; 102 virtual blink::WebTimeRanges buffered() const;
100 virtual double maxTimeSeekable() const; 103 virtual double maxTimeSeekable() const;
101 104
102 // Poster image, as defined in the <video> element. 105 // Poster image, as defined in the <video> element.
103 virtual void setPoster(const blink::WebURL& poster) OVERRIDE; 106 virtual void setPoster(const blink::WebURL& poster) OVERRIDE;
104 107
108 // FIXME: This path "only works" on Android. It is a workaround for the proble m that Skia could not handle Android's GL_TEXTURE_EXTERNAL_OES
109 // texture internally. It should be removed and replaced by the normal paint p ath.
110 // https://code.google.com/p/skia/issues/detail?id=1189
105 // Methods for painting. 111 // Methods for painting.
106 virtual void paint(blink::WebCanvas* canvas, 112 virtual void paint(blink::WebCanvas* canvas,
107 const blink::WebRect& rect, 113 const blink::WebRect& rect,
108 unsigned char alpha); 114 unsigned char alpha);
109 115
110 virtual bool copyVideoTextureToPlatformTexture( 116 virtual bool copyVideoTextureToPlatformTexture(
111 blink::WebGraphicsContext3D* web_graphics_context, 117 blink::WebGraphicsContext3D* web_graphics_context,
112 unsigned int texture, 118 unsigned int texture,
113 unsigned int level, 119 unsigned int level,
114 unsigned int internal_format, 120 unsigned int internal_format,
(...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after
269 const std::string& session_id); 275 const std::string& session_id);
270 MediaKeyException CancelKeyRequestInternal(const std::string& key_system, 276 MediaKeyException CancelKeyRequestInternal(const std::string& key_system,
271 const std::string& session_id); 277 const std::string& session_id);
272 278
273 // Requests that this object notifies when a decryptor is ready through the 279 // Requests that this object notifies when a decryptor is ready through the
274 // |decryptor_ready_cb| provided. 280 // |decryptor_ready_cb| provided.
275 // If |decryptor_ready_cb| is null, the existing callback will be fired with 281 // If |decryptor_ready_cb| is null, the existing callback will be fired with
276 // NULL immediately and reset. 282 // NULL immediately and reset.
277 void SetDecryptorReadyCB(const media::DecryptorReadyCB& decryptor_ready_cb); 283 void SetDecryptorReadyCB(const media::DecryptorReadyCB& decryptor_ready_cb);
278 284
285 bool ensureTextureBackedSkBitmap(GrContext* gr, SkBitmap& bitmap, const blink: :WebSize& size, GrSurfaceOrigin origin, GrPixelConfig config);
qinmin 2014/07/25 17:01:10 s/ensure/Ensure/
Srirama 2014/07/25 18:06:29 Done.
286
279 blink::WebFrame* const frame_; 287 blink::WebFrame* const frame_;
280 288
281 blink::WebMediaPlayerClient* const client_; 289 blink::WebMediaPlayerClient* const client_;
282 290
283 // |delegate_| is used to notify the browser process of the player status, so 291 // |delegate_| is used to notify the browser process of the player status, so
284 // that the browser process can control screen locks. 292 // that the browser process can control screen locks.
285 // TODO(qinmin): Currently android mediaplayer takes care of the screen 293 // TODO(qinmin): Currently android mediaplayer takes care of the screen
286 // lock. So this is only used for media source. Will apply this to regular 294 // lock. So this is only used for media source. Will apply this to regular
287 // media tag once http://crbug.com/247892 is fixed. 295 // media tag once http://crbug.com/247892 is fixed.
288 base::WeakPtr<WebMediaPlayerDelegate> delegate_; 296 base::WeakPtr<WebMediaPlayerDelegate> delegate_;
(...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after
435 // Non-owned pointer to the CDM. Updated via calls to 443 // Non-owned pointer to the CDM. Updated via calls to
436 // setContentDecryptionModule(). 444 // setContentDecryptionModule().
437 WebContentDecryptionModuleImpl* web_cdm_; 445 WebContentDecryptionModuleImpl* web_cdm_;
438 446
439 // This is only Used by Clear Key key system implementation, where a renderer 447 // This is only Used by Clear Key key system implementation, where a renderer
440 // side CDM will be used. This is similar to WebMediaPlayerImpl. For other key 448 // side CDM will be used. This is similar to WebMediaPlayerImpl. For other key
441 // systems, a browser side CDM will be used and we set CDM by calling 449 // systems, a browser side CDM will be used and we set CDM by calling
442 // player_manager_->SetCdm() directly. 450 // player_manager_->SetCdm() directly.
443 media::DecryptorReadyCB decryptor_ready_cb_; 451 media::DecryptorReadyCB decryptor_ready_cb_;
444 452
453 SkBitmap m_bitmap;
qinmin 2014/07/25 17:01:10 chromium doesn't use this naming scheme, use bitma
Srirama 2014/07/25 18:06:29 Done. Changed name to bitmap_ and regarding whethe
454
445 // NOTE: Weak pointers must be invalidated before all other member variables. 455 // NOTE: Weak pointers must be invalidated before all other member variables.
446 base::WeakPtrFactory<WebMediaPlayerAndroid> weak_factory_; 456 base::WeakPtrFactory<WebMediaPlayerAndroid> weak_factory_;
447 457
448 DISALLOW_COPY_AND_ASSIGN(WebMediaPlayerAndroid); 458 DISALLOW_COPY_AND_ASSIGN(WebMediaPlayerAndroid);
449 }; 459 };
450 460
451 } // namespace content 461 } // namespace content
452 462
453 #endif // CONTENT_RENDERER_MEDIA_ANDROID_WEBMEDIAPLAYER_ANDROID_H_ 463 #endif // CONTENT_RENDERER_MEDIA_ANDROID_WEBMEDIAPLAYER_ANDROID_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698