| 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 <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <string> | 10 #include <string> |
| 11 #include <vector> | 11 #include <vector> |
| 12 | 12 |
| 13 #include "base/macros.h" | 13 #include "base/macros.h" |
| 14 #include "base/memory/ref_counted.h" | 14 #include "base/memory/ref_counted.h" |
| 15 #include "base/memory/scoped_ptr.h" | 15 #include "base/memory/scoped_ptr.h" |
| 16 #include "base/memory/weak_ptr.h" | 16 #include "base/memory/weak_ptr.h" |
| 17 #include "base/threading/thread_checker.h" | 17 #include "base/threading/thread_checker.h" |
| 18 #include "base/time/default_tick_clock.h" | 18 #include "base/time/default_tick_clock.h" |
| 19 #include "base/time/time.h" | 19 #include "base/time/time.h" |
| 20 #include "cc/layers/video_frame_provider.h" | 20 #include "cc/layers/video_frame_provider.h" |
| 21 #include "content/common/media/media_player_messages_enums_android.h" | 21 #include "content/common/media/media_player_messages_enums_android.h" |
| 22 #include "content/public/renderer/render_frame_observer.h" | 22 #include "content/public/renderer/render_frame_observer.h" |
| 23 #include "content/renderer/media/android/media_info_loader.h" | 23 #include "content/renderer/media/android/media_info_loader.h" |
| 24 #include "content/renderer/media/android/media_source_delegate.h" | 24 #include "content/renderer/media/android/media_source_delegate.h" |
| 25 #include "content/renderer/media/android/renderer_media_player_manager.h" |
| 25 #include "content/renderer/media/android/stream_texture_factory.h" | 26 #include "content/renderer/media/android/stream_texture_factory.h" |
| 26 #include "gpu/command_buffer/common/mailbox.h" | 27 #include "gpu/command_buffer/common/mailbox.h" |
| 27 #include "media/base/android/media_player_android.h" | 28 #include "media/base/android/media_player_android.h" |
| 28 #include "media/base/cdm_context.h" | 29 #include "media/base/cdm_context.h" |
| 29 #include "media/base/demuxer_stream.h" | 30 #include "media/base/demuxer_stream.h" |
| 30 #include "media/base/media_keys.h" | 31 #include "media/base/media_keys.h" |
| 31 #include "media/base/time_delta_interpolator.h" | 32 #include "media/base/time_delta_interpolator.h" |
| 32 #include "media/blink/webmediaplayer_params.h" | 33 #include "media/blink/webmediaplayer_params.h" |
| 33 #include "media/cdm/proxy_decryptor.h" | 34 #include "media/cdm/proxy_decryptor.h" |
| 34 #include "third_party/WebKit/public/platform/WebGraphicsContext3D.h" | 35 #include "third_party/WebKit/public/platform/WebGraphicsContext3D.h" |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 74 class RendererCdmManager; | 75 class RendererCdmManager; |
| 75 class RendererMediaPlayerManager; | 76 class RendererMediaPlayerManager; |
| 76 | 77 |
| 77 // This class implements blink::WebMediaPlayer by keeping the android | 78 // This class implements blink::WebMediaPlayer by keeping the android |
| 78 // media player in the browser process. It listens to all the status changes | 79 // media player in the browser process. It listens to all the status changes |
| 79 // sent from the browser process and sends playback controls to the media | 80 // sent from the browser process and sends playback controls to the media |
| 80 // player. | 81 // player. |
| 81 class WebMediaPlayerAndroid : public blink::WebMediaPlayer, | 82 class WebMediaPlayerAndroid : public blink::WebMediaPlayer, |
| 82 public cc::VideoFrameProvider, | 83 public cc::VideoFrameProvider, |
| 83 public RenderFrameObserver, | 84 public RenderFrameObserver, |
| 84 public StreamTextureFactoryContextObserver { | 85 public StreamTextureFactoryContextObserver, |
| 86 public content::RendererMediaPlayerInterface { |
| 85 public: | 87 public: |
| 86 // Construct a WebMediaPlayerAndroid object. This class communicates with the | 88 // Construct a WebMediaPlayerAndroid object. This class communicates with the |
| 87 // MediaPlayerAndroid object in the browser process through |proxy|. | 89 // MediaPlayerAndroid object in the browser process through |proxy|. |
| 88 // TODO(qinmin): |frame| argument is used to determine whether the current | 90 // TODO(qinmin): |frame| argument is used to determine whether the current |
| 89 // player can enter fullscreen. This logic should probably be moved into | 91 // player can enter fullscreen. This logic should probably be moved into |
| 90 // blink, so that enterFullscreen() will not be called if another video is | 92 // blink, so that enterFullscreen() will not be called if another video is |
| 91 // already in fullscreen. | 93 // already in fullscreen. |
| 92 WebMediaPlayerAndroid( | 94 WebMediaPlayerAndroid( |
| 93 blink::WebFrame* frame, | 95 blink::WebFrame* frame, |
| 94 blink::WebMediaPlayerClient* client, | 96 blink::WebMediaPlayerClient* client, |
| (...skipping 444 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 539 | 541 |
| 540 // NOTE: Weak pointers must be invalidated before all other member variables. | 542 // NOTE: Weak pointers must be invalidated before all other member variables. |
| 541 base::WeakPtrFactory<WebMediaPlayerAndroid> weak_factory_; | 543 base::WeakPtrFactory<WebMediaPlayerAndroid> weak_factory_; |
| 542 | 544 |
| 543 DISALLOW_COPY_AND_ASSIGN(WebMediaPlayerAndroid); | 545 DISALLOW_COPY_AND_ASSIGN(WebMediaPlayerAndroid); |
| 544 }; | 546 }; |
| 545 | 547 |
| 546 } // namespace content | 548 } // namespace content |
| 547 | 549 |
| 548 #endif // CONTENT_RENDERER_MEDIA_ANDROID_WEBMEDIAPLAYER_ANDROID_H_ | 550 #endif // CONTENT_RENDERER_MEDIA_ANDROID_WEBMEDIAPLAYER_ANDROID_H_ |
| OLD | NEW |