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

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

Issue 18261007: Migrate webkit/renderer/media/ to content/renderer/media/. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 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 | Annotate | Revision Log
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 25 matching lines...) Expand all
36 } 36 }
37 37
38 namespace WebKit { 38 namespace WebKit {
39 class WebFrame; 39 class WebFrame;
40 } 40 }
41 41
42 namespace webkit { 42 namespace webkit {
43 class WebLayerImpl; 43 class WebLayerImpl;
44 } 44 }
45 45
46 namespace webkit_media { 46 namespace content {
47 class WebMediaPlayerDelegate; 47 class WebMediaPlayerDelegate;
48 class WebMediaPlayerManagerAndroid;
49 class WebMediaPlayerProxyAndroid;
48 50
49 #if defined(GOOGLE_TV) 51 #if defined(GOOGLE_TV)
50 class MediaStreamAudioRenderer; 52 class MediaStreamAudioRenderer;
51 class MediaStreamClient; 53 class MediaStreamClient;
52 #endif 54 #endif
53 }
54
55 namespace content {
56
57 class WebMediaPlayerManagerAndroid;
58 class WebMediaPlayerProxyAndroid;
59 55
60 // This class implements WebKit::WebMediaPlayer by keeping the android 56 // This class implements WebKit::WebMediaPlayer by keeping the android
61 // media player in the browser process. It listens to all the status changes 57 // media player in the browser process. It listens to all the status changes
62 // sent from the browser process and sends playback controls to the media 58 // sent from the browser process and sends playback controls to the media
63 // player. 59 // player.
64 class WebMediaPlayerAndroid 60 class WebMediaPlayerAndroid
65 : public WebKit::WebMediaPlayer, 61 : public WebKit::WebMediaPlayer,
66 public cc::VideoFrameProvider, 62 public cc::VideoFrameProvider,
67 public base::MessageLoop::DestructionObserver, 63 public base::MessageLoop::DestructionObserver,
68 public base::SupportsWeakPtr<WebMediaPlayerAndroid> { 64 public base::SupportsWeakPtr<WebMediaPlayerAndroid> {
69 public: 65 public:
70 // Construct a WebMediaPlayerAndroid object. This class communicates 66 // Construct a WebMediaPlayerAndroid object. This class communicates
71 // with the MediaPlayerAndroid object in the browser process through 67 // with the MediaPlayerAndroid object in the browser process through
72 // |proxy|. 68 // |proxy|.
73 // TODO(qinmin): |frame| argument is used to determine whether the current 69 // TODO(qinmin): |frame| argument is used to determine whether the current
74 // player can enter fullscreen. This logic should probably be moved into 70 // player can enter fullscreen. This logic should probably be moved into
75 // blink, so that enterFullscreen() will not be called if another video is 71 // blink, so that enterFullscreen() will not be called if another video is
76 // already in fullscreen. 72 // already in fullscreen.
77 WebMediaPlayerAndroid( 73 WebMediaPlayerAndroid(
78 WebKit::WebFrame* frame, 74 WebKit::WebFrame* frame,
79 WebKit::WebMediaPlayerClient* client, 75 WebKit::WebMediaPlayerClient* client,
80 base::WeakPtr<webkit_media::WebMediaPlayerDelegate> delegate, 76 base::WeakPtr<WebMediaPlayerDelegate> delegate,
81 WebMediaPlayerManagerAndroid* manager, 77 WebMediaPlayerManagerAndroid* manager,
82 WebMediaPlayerProxyAndroid* proxy, 78 WebMediaPlayerProxyAndroid* proxy,
83 StreamTextureFactory* factory, 79 StreamTextureFactory* factory,
84 media::MediaLog* media_log); 80 media::MediaLog* media_log);
85 virtual ~WebMediaPlayerAndroid(); 81 virtual ~WebMediaPlayerAndroid();
86 82
87 // WebKit::WebMediaPlayer implementation. 83 // WebKit::WebMediaPlayer implementation.
88 virtual void enterFullscreen(); 84 virtual void enterFullscreen();
89 virtual void exitFullscreen(); 85 virtual void exitFullscreen();
90 virtual bool canEnterFullscreen() const; 86 virtual bool canEnterFullscreen() const;
(...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after
223 void OnKeyMessage(const std::string& session_id, 219 void OnKeyMessage(const std::string& session_id,
224 const std::vector<uint8>& message, 220 const std::vector<uint8>& message,
225 const std::string& destination_url); 221 const std::string& destination_url);
226 222
227 void OnNeedKey(const std::string& type, 223 void OnNeedKey(const std::string& type,
228 const std::string& session_id, 224 const std::string& session_id,
229 scoped_ptr<uint8[]> init_data, 225 scoped_ptr<uint8[]> init_data,
230 int init_data_size); 226 int init_data_size);
231 227
232 #if defined(GOOGLE_TV) 228 #if defined(GOOGLE_TV)
233 bool InjectMediaStream(webkit_media::MediaStreamClient* media_stream_client, 229 bool InjectMediaStream(MediaStreamClient* media_stream_client,
234 media::Demuxer* demuxer, 230 media::Demuxer* demuxer,
235 const base::Closure& destroy_demuxer_cb); 231 const base::Closure& destroy_demuxer_cb);
236 #endif 232 #endif
237 233
238 // Called when DemuxerStreamPlayer needs to read data from ChunkDemuxer. 234 // Called when DemuxerStreamPlayer needs to read data from ChunkDemuxer.
239 void OnReadFromDemuxer(media::DemuxerStream::Type type); 235 void OnReadFromDemuxer(media::DemuxerStream::Type type);
240 236
241 protected: 237 protected:
242 // Helper method to update the playing state. 238 // Helper method to update the playing state.
243 void UpdatePlayingState(bool is_playing_); 239 void UpdatePlayingState(bool is_playing_);
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
282 278
283 WebKit::WebFrame* const frame_; 279 WebKit::WebFrame* const frame_;
284 280
285 WebKit::WebMediaPlayerClient* const client_; 281 WebKit::WebMediaPlayerClient* const client_;
286 282
287 // |delegate_| is used to notify the browser process of the player status, so 283 // |delegate_| is used to notify the browser process of the player status, so
288 // that the browser process can control screen locks. 284 // that the browser process can control screen locks.
289 // TODO(qinmin): Currently android mediaplayer takes care of the screen 285 // TODO(qinmin): Currently android mediaplayer takes care of the screen
290 // lock. So this is only used for media source. Will apply this to regular 286 // lock. So this is only used for media source. Will apply this to regular
291 // media tag once http://crbug.com/247892 is fixed. 287 // media tag once http://crbug.com/247892 is fixed.
292 base::WeakPtr<webkit_media::WebMediaPlayerDelegate> delegate_; 288 base::WeakPtr<WebMediaPlayerDelegate> delegate_;
293 289
294 // Save the list of buffered time ranges. 290 // Save the list of buffered time ranges.
295 WebKit::WebTimeRanges buffered_; 291 WebKit::WebTimeRanges buffered_;
296 292
297 // Size of the video. 293 // Size of the video.
298 WebKit::WebSize natural_size_; 294 WebKit::WebSize natural_size_;
299 295
300 // Size that has been sent to StreamTexture. 296 // Size that has been sent to StreamTexture.
301 WebKit::WebSize cached_stream_texture_size_; 297 WebKit::WebSize cached_stream_texture_size_;
302 298
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after
384 // threshold is not defined, so that external surface is never used. 380 // threshold is not defined, so that external surface is never used.
385 int external_surface_threshold_; 381 int external_surface_threshold_;
386 382
387 // A rectangle represents the geometry of video frame, when computed last 383 // A rectangle represents the geometry of video frame, when computed last
388 // time. 384 // time.
389 gfx::RectF last_computed_rect_; 385 gfx::RectF last_computed_rect_;
390 386
391 // Media Stream related fields. 387 // Media Stream related fields.
392 media::Demuxer* demuxer_; 388 media::Demuxer* demuxer_;
393 base::Closure destroy_demuxer_cb_; 389 base::Closure destroy_demuxer_cb_;
394 scoped_refptr<webkit_media::MediaStreamAudioRenderer> audio_renderer_; 390 scoped_refptr<MediaStreamAudioRenderer> audio_renderer_;
395 webkit_media::MediaStreamClient* media_stream_client_; 391 MediaStreamClient* media_stream_client_;
396 #endif 392 #endif
397 393
398 scoped_ptr<MediaSourceDelegate, 394 scoped_ptr<MediaSourceDelegate,
399 MediaSourceDelegate::Destroyer> media_source_delegate_; 395 MediaSourceDelegate::Destroyer> media_source_delegate_;
400 396
401 media::MediaPlayerAndroid::SourceType source_type_; 397 media::MediaPlayerAndroid::SourceType source_type_;
402 398
403 // Proxy object that delegates method calls on Render Thread. 399 // Proxy object that delegates method calls on Render Thread.
404 // This object is created on the Render Thread and is only called in the 400 // This object is created on the Render Thread and is only called in the
405 // destructor. 401 // destructor.
(...skipping 18 matching lines...) Expand all
424 420
425 // The decryptor that manages decryption keys and decrypts encrypted frames. 421 // The decryptor that manages decryption keys and decrypts encrypted frames.
426 scoped_ptr<webkit_media::ProxyDecryptor> decryptor_; 422 scoped_ptr<webkit_media::ProxyDecryptor> decryptor_;
427 423
428 DISALLOW_COPY_AND_ASSIGN(WebMediaPlayerAndroid); 424 DISALLOW_COPY_AND_ASSIGN(WebMediaPlayerAndroid);
429 }; 425 };
430 426
431 } // namespace content 427 } // namespace content
432 428
433 #endif // CONTENT_RENDERER_MEDIA_ANDROID_WEBMEDIAPLAYER_ANDROID_H_ 429 #endif // CONTENT_RENDERER_MEDIA_ANDROID_WEBMEDIAPLAYER_ANDROID_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698