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