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" |
(...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
157 DCHECK(cdm_manager_); | 157 DCHECK(cdm_manager_); |
158 | 158 |
159 DCHECK(main_thread_checker_.CalledOnValidThread()); | 159 DCHECK(main_thread_checker_.CalledOnValidThread()); |
160 stream_texture_factory_->AddObserver(this); | 160 stream_texture_factory_->AddObserver(this); |
161 | 161 |
162 player_id_ = player_manager_->RegisterMediaPlayer(this); | 162 player_id_ = player_manager_->RegisterMediaPlayer(this); |
163 | 163 |
164 #if defined(VIDEO_HOLE) | 164 #if defined(VIDEO_HOLE) |
165 force_use_overlay_embedded_video_ = CommandLine::ForCurrentProcess()-> | 165 force_use_overlay_embedded_video_ = CommandLine::ForCurrentProcess()-> |
166 HasSwitch(switches::kForceUseOverlayEmbeddedVideo); | 166 HasSwitch(switches::kForceUseOverlayEmbeddedVideo); |
167 if (force_use_overlay_embedded_video_ || | 167 if (force_use_overlay_embedded_video_) { |
168 player_manager_->ShouldUseVideoOverlayForEmbeddedEncryptedVideo()) { | |
qinmin
2014/11/17 19:06:45
If this is true, needs_establish_peer_ will be set
| |
169 // Defer stream texture creation until we are sure it's necessary. | 168 // Defer stream texture creation until we are sure it's necessary. |
170 needs_establish_peer_ = false; | 169 needs_establish_peer_ = false; |
171 current_frame_ = VideoFrame::CreateBlackFrame(gfx::Size(1, 1)); | 170 current_frame_ = VideoFrame::CreateBlackFrame(gfx::Size(1, 1)); |
172 } | 171 } |
173 #endif // defined(VIDEO_HOLE) | 172 #endif // defined(VIDEO_HOLE) |
174 TryCreateStreamTextureProxyIfNeeded(); | 173 TryCreateStreamTextureProxyIfNeeded(); |
175 interpolator_.SetUpperBound(base::TimeDelta()); | 174 interpolator_.SetUpperBound(base::TimeDelta()); |
176 | 175 |
177 // Set the initial CDM, if specified. | 176 // Set the initial CDM, if specified. |
178 if (initial_cdm) { | 177 if (initial_cdm) { |
(...skipping 1646 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1825 | 1824 |
1826 bool WebMediaPlayerAndroid::IsHLSStream() const { | 1825 bool WebMediaPlayerAndroid::IsHLSStream() const { |
1827 std::string mime; | 1826 std::string mime; |
1828 GURL url = redirected_url_.is_empty() ? url_ : redirected_url_; | 1827 GURL url = redirected_url_.is_empty() ? url_ : redirected_url_; |
1829 if (!net::GetMimeTypeFromFile(base::FilePath(url.path()), &mime)) | 1828 if (!net::GetMimeTypeFromFile(base::FilePath(url.path()), &mime)) |
1830 return false; | 1829 return false; |
1831 return !mime.compare("application/x-mpegurl"); | 1830 return !mime.compare("application/x-mpegurl"); |
1832 } | 1831 } |
1833 | 1832 |
1834 } // namespace content | 1833 } // namespace content |
OLD | NEW |