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

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: Fixed review comments 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 155 matching lines...) Expand 10 before | Expand all | Expand 10 after
270 const std::string& session_id); 276 const std::string& session_id);
271 MediaKeyException CancelKeyRequestInternal(const std::string& key_system, 277 MediaKeyException CancelKeyRequestInternal(const std::string& key_system,
272 const std::string& session_id); 278 const std::string& session_id);
273 279
274 // Requests that this object notifies when a decryptor is ready through the 280 // Requests that this object notifies when a decryptor is ready through the
275 // |decryptor_ready_cb| provided. 281 // |decryptor_ready_cb| provided.
276 // If |decryptor_ready_cb| is null, the existing callback will be fired with 282 // If |decryptor_ready_cb| is null, the existing callback will be fired with
277 // NULL immediately and reset. 283 // NULL immediately and reset.
278 void SetDecryptorReadyCB(const media::DecryptorReadyCB& decryptor_ready_cb); 284 void SetDecryptorReadyCB(const media::DecryptorReadyCB& decryptor_ready_cb);
279 285
286 bool EnsureTextureBackedSkBitmap(GrContext* gr, SkBitmap& bitmap, const blink: :WebSize& size, GrSurfaceOrigin origin, GrPixelConfig config);
287
280 blink::WebFrame* const frame_; 288 blink::WebFrame* const frame_;
281 289
282 blink::WebMediaPlayerClient* const client_; 290 blink::WebMediaPlayerClient* const client_;
283 291
284 // |delegate_| is used to notify the browser process of the player status, so 292 // |delegate_| is used to notify the browser process of the player status, so
285 // that the browser process can control screen locks. 293 // that the browser process can control screen locks.
286 // TODO(qinmin): Currently android mediaplayer takes care of the screen 294 // TODO(qinmin): Currently android mediaplayer takes care of the screen
287 // lock. So this is only used for media source. Will apply this to regular 295 // lock. So this is only used for media source. Will apply this to regular
288 // media tag once http://crbug.com/247892 is fixed. 296 // media tag once http://crbug.com/247892 is fixed.
289 base::WeakPtr<WebMediaPlayerDelegate> delegate_; 297 base::WeakPtr<WebMediaPlayerDelegate> delegate_;
(...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after
429 // Non-owned pointer to the CDM. Updated via calls to 437 // Non-owned pointer to the CDM. Updated via calls to
430 // setContentDecryptionModule(). 438 // setContentDecryptionModule().
431 WebContentDecryptionModuleImpl* web_cdm_; 439 WebContentDecryptionModuleImpl* web_cdm_;
432 440
433 // This is only Used by Clear Key key system implementation, where a renderer 441 // This is only Used by Clear Key key system implementation, where a renderer
434 // side CDM will be used. This is similar to WebMediaPlayerImpl. For other key 442 // side CDM will be used. This is similar to WebMediaPlayerImpl. For other key
435 // systems, a browser side CDM will be used and we set CDM by calling 443 // systems, a browser side CDM will be used and we set CDM by calling
436 // player_manager_->SetCdm() directly. 444 // player_manager_->SetCdm() directly.
437 media::DecryptorReadyCB decryptor_ready_cb_; 445 media::DecryptorReadyCB decryptor_ready_cb_;
438 446
447 SkBitmap bitmap_;
448
439 // NOTE: Weak pointers must be invalidated before all other member variables. 449 // NOTE: Weak pointers must be invalidated before all other member variables.
440 base::WeakPtrFactory<WebMediaPlayerAndroid> weak_factory_; 450 base::WeakPtrFactory<WebMediaPlayerAndroid> weak_factory_;
441 451
442 DISALLOW_COPY_AND_ASSIGN(WebMediaPlayerAndroid); 452 DISALLOW_COPY_AND_ASSIGN(WebMediaPlayerAndroid);
443 }; 453 };
444 454
445 } // namespace content 455 } // namespace content
446 456
447 #endif // CONTENT_RENDERER_MEDIA_ANDROID_WEBMEDIAPLAYER_ANDROID_H_ 457 #endif // CONTENT_RENDERER_MEDIA_ANDROID_WEBMEDIAPLAYER_ANDROID_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698