Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(21)

Side by Side Diff: content/renderer/media/android/webmediaplayer_android.cc

Issue 784493002: Encrypted Media: Rename NeedKey to EncryptedMediaInitData. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: comments addressed Created 6 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « content/renderer/media/android/webmediaplayer_android.h ('k') | media/base/demuxer.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 243 matching lines...) Expand 10 before | Expand all | Expand 10 after
254 254
255 if (player_type_ == MEDIA_PLAYER_TYPE_MEDIA_SOURCE) { 255 if (player_type_ == MEDIA_PLAYER_TYPE_MEDIA_SOURCE) {
256 media::SetDecryptorReadyCB set_decryptor_ready_cb = 256 media::SetDecryptorReadyCB set_decryptor_ready_cb =
257 media::BindToCurrentLoop( 257 media::BindToCurrentLoop(
258 base::Bind(&WebMediaPlayerAndroid::SetDecryptorReadyCB, 258 base::Bind(&WebMediaPlayerAndroid::SetDecryptorReadyCB,
259 weak_factory_.GetWeakPtr())); 259 weak_factory_.GetWeakPtr()));
260 260
261 media_source_delegate_->InitializeMediaSource( 261 media_source_delegate_->InitializeMediaSource(
262 base::Bind(&WebMediaPlayerAndroid::OnMediaSourceOpened, 262 base::Bind(&WebMediaPlayerAndroid::OnMediaSourceOpened,
263 weak_factory_.GetWeakPtr()), 263 weak_factory_.GetWeakPtr()),
264 base::Bind(&WebMediaPlayerAndroid::OnNeedKey, 264 base::Bind(&WebMediaPlayerAndroid::OnEncryptedMediaInitData,
265 weak_factory_.GetWeakPtr()), 265 weak_factory_.GetWeakPtr()),
266 set_decryptor_ready_cb, 266 set_decryptor_ready_cb,
267 base::Bind(&WebMediaPlayerAndroid::UpdateNetworkState, 267 base::Bind(&WebMediaPlayerAndroid::UpdateNetworkState,
268 weak_factory_.GetWeakPtr()), 268 weak_factory_.GetWeakPtr()),
269 base::Bind(&WebMediaPlayerAndroid::OnDurationChanged, 269 base::Bind(&WebMediaPlayerAndroid::OnDurationChanged,
270 weak_factory_.GetWeakPtr())); 270 weak_factory_.GetWeakPtr()));
271 InitializePlayer(url_, frame_->document().firstPartyForCookies(), 271 InitializePlayer(url_, frame_->document().firstPartyForCookies(),
272 true, demuxer_client_id); 272 true, demuxer_client_id);
273 } 273 }
274 } else { 274 } else {
(...skipping 1449 matching lines...) Expand 10 before | Expand all | Expand 10 after
1724 message.empty() ? NULL : &message[0], 1724 message.empty() ? NULL : &message[0],
1725 message.size(), 1725 message.size(),
1726 destination_url); 1726 destination_url);
1727 } 1727 }
1728 1728
1729 void WebMediaPlayerAndroid::OnMediaSourceOpened( 1729 void WebMediaPlayerAndroid::OnMediaSourceOpened(
1730 blink::WebMediaSource* web_media_source) { 1730 blink::WebMediaSource* web_media_source) {
1731 client_->mediaSourceOpened(web_media_source); 1731 client_->mediaSourceOpened(web_media_source);
1732 } 1732 }
1733 1733
1734 void WebMediaPlayerAndroid::OnNeedKey(const std::string& init_data_type, 1734 void WebMediaPlayerAndroid::OnEncryptedMediaInitData(
1735 const std::vector<uint8>& init_data) { 1735 const std::string& init_data_type,
1736 const std::vector<uint8>& init_data) {
1736 DCHECK(main_thread_checker_.CalledOnValidThread()); 1737 DCHECK(main_thread_checker_.CalledOnValidThread());
1737 1738
1738 // Do not fire NeedKey event if encrypted media is not enabled. 1739 // Do not fire NeedKey event if encrypted media is not enabled.
1739 if (!blink::WebRuntimeFeatures::isPrefixedEncryptedMediaEnabled() && 1740 if (!blink::WebRuntimeFeatures::isPrefixedEncryptedMediaEnabled() &&
1740 !blink::WebRuntimeFeatures::isEncryptedMediaEnabled()) { 1741 !blink::WebRuntimeFeatures::isEncryptedMediaEnabled()) {
1741 return; 1742 return;
1742 } 1743 }
1743 1744
1744 UMA_HISTOGRAM_COUNTS(kMediaEme + std::string("NeedKey"), 1); 1745 UMA_HISTOGRAM_COUNTS(kMediaEme + std::string("NeedKey"), 1);
1745 1746
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
1792 1793
1793 bool WebMediaPlayerAndroid::IsHLSStream() const { 1794 bool WebMediaPlayerAndroid::IsHLSStream() const {
1794 std::string mime; 1795 std::string mime;
1795 GURL url = redirected_url_.is_empty() ? url_ : redirected_url_; 1796 GURL url = redirected_url_.is_empty() ? url_ : redirected_url_;
1796 if (!net::GetMimeTypeFromFile(base::FilePath(url.path()), &mime)) 1797 if (!net::GetMimeTypeFromFile(base::FilePath(url.path()), &mime))
1797 return false; 1798 return false;
1798 return !mime.compare("application/x-mpegurl"); 1799 return !mime.compare("application/x-mpegurl");
1799 } 1800 }
1800 1801
1801 } // namespace content 1802 } // namespace content
OLDNEW
« no previous file with comments | « content/renderer/media/android/webmediaplayer_android.h ('k') | media/base/demuxer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698