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 #include "content/renderer/media/android/webmediaplayer_android.h" | 5 #include "content/renderer/media/android/webmediaplayer_android.h" |
6 | 6 |
7 #include <limits> | 7 #include <limits> |
8 | 8 |
9 #include "base/android/build_info.h" | 9 #include "base/android/build_info.h" |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
11 #include "base/callback_helpers.h" | 11 #include "base/callback_helpers.h" |
12 #include "base/command_line.h" | 12 #include "base/command_line.h" |
13 #include "base/files/file_path.h" | 13 #include "base/files/file_path.h" |
14 #include "base/logging.h" | 14 #include "base/logging.h" |
15 #include "base/message_loop/message_loop.h" | 15 #include "base/message_loop/message_loop.h" |
16 #include "base/metrics/histogram.h" | 16 #include "base/metrics/histogram.h" |
17 #include "base/strings/string_number_conversions.h" | 17 #include "base/strings/string_number_conversions.h" |
18 #include "base/strings/utf_string_conversions.h" | 18 #include "base/strings/utf_string_conversions.h" |
| 19 #include "cc/blink/web_layer_impl.h" |
19 #include "cc/layers/video_layer.h" | 20 #include "cc/layers/video_layer.h" |
20 #include "content/public/common/content_client.h" | 21 #include "content/public/common/content_client.h" |
21 #include "content/public/common/content_switches.h" | 22 #include "content/public/common/content_switches.h" |
22 #include "content/public/renderer/render_frame.h" | 23 #include "content/public/renderer/render_frame.h" |
23 #include "content/renderer/compositor_bindings/web_layer_impl.h" | |
24 #include "content/renderer/media/android/renderer_demuxer_android.h" | 24 #include "content/renderer/media/android/renderer_demuxer_android.h" |
25 #include "content/renderer/media/android/renderer_media_player_manager.h" | 25 #include "content/renderer/media/android/renderer_media_player_manager.h" |
26 #include "content/renderer/media/crypto/key_systems.h" | 26 #include "content/renderer/media/crypto/key_systems.h" |
27 #include "content/renderer/media/crypto/renderer_cdm_manager.h" | 27 #include "content/renderer/media/crypto/renderer_cdm_manager.h" |
28 #include "content/renderer/media/webcontentdecryptionmodule_impl.h" | 28 #include "content/renderer/media/webcontentdecryptionmodule_impl.h" |
29 #include "content/renderer/media/webmediaplayer_delegate.h" | 29 #include "content/renderer/media/webmediaplayer_delegate.h" |
30 #include "content/renderer/media/webmediaplayer_util.h" | 30 #include "content/renderer/media/webmediaplayer_util.h" |
31 #include "content/renderer/render_frame_impl.h" | 31 #include "content/renderer/render_frame_impl.h" |
32 #include "content/renderer/render_thread_impl.h" | 32 #include "content/renderer/render_thread_impl.h" |
33 #include "gpu/GLES2/gl2extchromium.h" | 33 #include "gpu/GLES2/gl2extchromium.h" |
(...skipping 782 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
816 // For hidden video element (with style "display:none"), ensure the texture | 816 // For hidden video element (with style "display:none"), ensure the texture |
817 // size is set. | 817 // size is set. |
818 if (!is_remote_ && cached_stream_texture_size_ != natural_size_) { | 818 if (!is_remote_ && cached_stream_texture_size_ != natural_size_) { |
819 stream_texture_factory_->SetStreamTextureSize( | 819 stream_texture_factory_->SetStreamTextureSize( |
820 stream_id_, gfx::Size(natural_size_.width, natural_size_.height)); | 820 stream_id_, gfx::Size(natural_size_.width, natural_size_.height)); |
821 cached_stream_texture_size_ = natural_size_; | 821 cached_stream_texture_size_ = natural_size_; |
822 } | 822 } |
823 | 823 |
824 // Lazily allocate compositing layer. | 824 // Lazily allocate compositing layer. |
825 if (!video_weblayer_) { | 825 if (!video_weblayer_) { |
826 video_weblayer_.reset(new WebLayerImpl( | 826 video_weblayer_.reset(new cc_blink::WebLayerImpl( |
827 cc::VideoLayer::Create(this, media::VIDEO_ROTATION_0))); | 827 cc::VideoLayer::Create(this, media::VIDEO_ROTATION_0))); |
828 client_->setWebLayer(video_weblayer_.get()); | 828 client_->setWebLayer(video_weblayer_.get()); |
829 } | 829 } |
830 | 830 |
831 // TODO(qinmin): This is a hack. We need the media element to stop showing the | 831 // TODO(qinmin): This is a hack. We need the media element to stop showing the |
832 // poster image by forcing it to call setDisplayMode(video). Should move the | 832 // poster image by forcing it to call setDisplayMode(video). Should move the |
833 // logic into HTMLMediaElement.cpp. | 833 // logic into HTMLMediaElement.cpp. |
834 client_->timeChanged(); | 834 client_->timeChanged(); |
835 } | 835 } |
836 | 836 |
(...skipping 884 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1721 player_manager_->EnterFullscreen(player_id_, frame_); | 1721 player_manager_->EnterFullscreen(player_id_, frame_); |
1722 SetNeedsEstablishPeer(false); | 1722 SetNeedsEstablishPeer(false); |
1723 } | 1723 } |
1724 } | 1724 } |
1725 | 1725 |
1726 bool WebMediaPlayerAndroid::canEnterFullscreen() const { | 1726 bool WebMediaPlayerAndroid::canEnterFullscreen() const { |
1727 return player_manager_->CanEnterFullscreen(frame_); | 1727 return player_manager_->CanEnterFullscreen(frame_); |
1728 } | 1728 } |
1729 | 1729 |
1730 } // namespace content | 1730 } // namespace content |
OLD | NEW |