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 #include <string> | 9 #include <string> |
10 #include <vector> | 10 #include <vector> |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
52 class WebLayerImpl; | 52 class WebLayerImpl; |
53 } | 53 } |
54 | 54 |
55 namespace gpu { | 55 namespace gpu { |
56 struct MailboxHolder; | 56 struct MailboxHolder; |
57 } | 57 } |
58 | 58 |
59 namespace media { | 59 namespace media { |
60 class CdmContext; | 60 class CdmContext; |
61 class MediaLog; | 61 class MediaLog; |
| 62 class MediaPermission; |
62 class WebContentDecryptionModuleImpl; | 63 class WebContentDecryptionModuleImpl; |
63 class WebMediaPlayerDelegate; | 64 class WebMediaPlayerDelegate; |
64 } | 65 } |
65 | 66 |
66 namespace content { | 67 namespace content { |
67 | 68 |
68 class RendererCdmManager; | 69 class RendererCdmManager; |
69 class RendererMediaPlayerManager; | 70 class RendererMediaPlayerManager; |
70 | 71 |
71 // This class implements blink::WebMediaPlayer by keeping the android | 72 // This class implements blink::WebMediaPlayer by keeping the android |
(...skipping 10 matching lines...) Expand all Loading... |
82 // TODO(qinmin): |frame| argument is used to determine whether the current | 83 // TODO(qinmin): |frame| argument is used to determine whether the current |
83 // player can enter fullscreen. This logic should probably be moved into | 84 // player can enter fullscreen. This logic should probably be moved into |
84 // blink, so that enterFullscreen() will not be called if another video is | 85 // blink, so that enterFullscreen() will not be called if another video is |
85 // already in fullscreen. | 86 // already in fullscreen. |
86 WebMediaPlayerAndroid( | 87 WebMediaPlayerAndroid( |
87 blink::WebFrame* frame, | 88 blink::WebFrame* frame, |
88 blink::WebMediaPlayerClient* client, | 89 blink::WebMediaPlayerClient* client, |
89 base::WeakPtr<media::WebMediaPlayerDelegate> delegate, | 90 base::WeakPtr<media::WebMediaPlayerDelegate> delegate, |
90 RendererMediaPlayerManager* player_manager, | 91 RendererMediaPlayerManager* player_manager, |
91 RendererCdmManager* cdm_manager, | 92 RendererCdmManager* cdm_manager, |
| 93 media::MediaPermission* media_permission, |
92 blink::WebContentDecryptionModule* initial_cdm, | 94 blink::WebContentDecryptionModule* initial_cdm, |
93 scoped_refptr<StreamTextureFactory> factory, | 95 scoped_refptr<StreamTextureFactory> factory, |
94 const scoped_refptr<base::SingleThreadTaskRunner>& task_runner, | 96 const scoped_refptr<base::SingleThreadTaskRunner>& task_runner, |
95 media::MediaLog* media_log); | 97 media::MediaLog* media_log); |
96 virtual ~WebMediaPlayerAndroid(); | 98 virtual ~WebMediaPlayerAndroid(); |
97 | 99 |
98 // blink::WebMediaPlayer implementation. | 100 // blink::WebMediaPlayer implementation. |
99 virtual void enterFullscreen(); | 101 virtual void enterFullscreen(); |
100 | 102 |
101 // Resource loading. | 103 // Resource loading. |
(...skipping 279 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
381 | 383 |
382 // Manages this object and delegates player calls to the browser process. | 384 // Manages this object and delegates player calls to the browser process. |
383 // Owned by RenderFrameImpl. | 385 // Owned by RenderFrameImpl. |
384 RendererMediaPlayerManager* const player_manager_; | 386 RendererMediaPlayerManager* const player_manager_; |
385 | 387 |
386 // Delegates EME calls to the browser process. Owned by RenderFrameImpl. | 388 // Delegates EME calls to the browser process. Owned by RenderFrameImpl. |
387 // TODO(xhwang): Remove |cdm_manager_| when prefixed EME is deprecated. See | 389 // TODO(xhwang): Remove |cdm_manager_| when prefixed EME is deprecated. See |
388 // http://crbug.com/249976 | 390 // http://crbug.com/249976 |
389 RendererCdmManager* const cdm_manager_; | 391 RendererCdmManager* const cdm_manager_; |
390 | 392 |
| 393 media::MediaPermission* media_permission_; |
| 394 |
391 // Player ID assigned by the |player_manager_|. | 395 // Player ID assigned by the |player_manager_|. |
392 int player_id_; | 396 int player_id_; |
393 | 397 |
394 // Current player states. | 398 // Current player states. |
395 blink::WebMediaPlayer::NetworkState network_state_; | 399 blink::WebMediaPlayer::NetworkState network_state_; |
396 blink::WebMediaPlayer::ReadyState ready_state_; | 400 blink::WebMediaPlayer::ReadyState ready_state_; |
397 | 401 |
398 // GL texture ID allocated to the video. | 402 // GL texture ID allocated to the video. |
399 unsigned int texture_id_; | 403 unsigned int texture_id_; |
400 | 404 |
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
502 | 506 |
503 // NOTE: Weak pointers must be invalidated before all other member variables. | 507 // NOTE: Weak pointers must be invalidated before all other member variables. |
504 base::WeakPtrFactory<WebMediaPlayerAndroid> weak_factory_; | 508 base::WeakPtrFactory<WebMediaPlayerAndroid> weak_factory_; |
505 | 509 |
506 DISALLOW_COPY_AND_ASSIGN(WebMediaPlayerAndroid); | 510 DISALLOW_COPY_AND_ASSIGN(WebMediaPlayerAndroid); |
507 }; | 511 }; |
508 | 512 |
509 } // namespace content | 513 } // namespace content |
510 | 514 |
511 #endif // CONTENT_RENDERER_MEDIA_ANDROID_WEBMEDIAPLAYER_ANDROID_H_ | 515 #endif // CONTENT_RENDERER_MEDIA_ANDROID_WEBMEDIAPLAYER_ANDROID_H_ |
OLD | NEW |