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

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

Issue 23072043: Change NeedKeyCB to use std::vector. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix seek_tester, demuxer_bench, and player_x11 Created 7 years, 4 months 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 | Annotate | Revision Log
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 "base/bind.h" 7 #include "base/bind.h"
8 #include "base/command_line.h" 8 #include "base/command_line.h"
9 #include "base/files/file_path.h" 9 #include "base/files/file_path.h"
10 #include "base/logging.h" 10 #include "base/logging.h"
(...skipping 1113 matching lines...) Expand 10 before | Expand all | Expand 10 after
1124 destination_url_gurl); 1124 destination_url_gurl);
1125 } 1125 }
1126 1126
1127 void WebMediaPlayerAndroid::OnMediaSourceOpened( 1127 void WebMediaPlayerAndroid::OnMediaSourceOpened(
1128 WebKit::WebMediaSourceNew* web_media_source) { 1128 WebKit::WebMediaSourceNew* web_media_source) {
1129 client_->mediaSourceOpened(web_media_source); 1129 client_->mediaSourceOpened(web_media_source);
1130 } 1130 }
1131 1131
1132 void WebMediaPlayerAndroid::OnNeedKey(const std::string& session_id, 1132 void WebMediaPlayerAndroid::OnNeedKey(const std::string& session_id,
1133 const std::string& type, 1133 const std::string& type,
1134 scoped_ptr<uint8[]> init_data, 1134 const std::vector<uint8>& init_data) {
1135 int init_data_size) {
1136 // Do not fire NeedKey event if encrypted media is not enabled. 1135 // Do not fire NeedKey event if encrypted media is not enabled.
1137 if (!WebKit::WebRuntimeFeatures::isEncryptedMediaEnabled() && 1136 if (!WebKit::WebRuntimeFeatures::isEncryptedMediaEnabled() &&
1138 !WebKit::WebRuntimeFeatures::isLegacyEncryptedMediaEnabled()) { 1137 !WebKit::WebRuntimeFeatures::isLegacyEncryptedMediaEnabled()) {
1139 return; 1138 return;
1140 } 1139 }
1141 1140
1142 UMA_HISTOGRAM_COUNTS(kMediaEme + std::string("NeedKey"), 1); 1141 UMA_HISTOGRAM_COUNTS(kMediaEme + std::string("NeedKey"), 1);
1143 1142
1144 DCHECK(init_data_type_.empty() || type.empty() || type == init_data_type_); 1143 DCHECK(init_data_type_.empty() || type.empty() || type == init_data_type_);
1145 if (init_data_type_.empty()) 1144 if (init_data_type_.empty())
1146 init_data_type_ = type; 1145 init_data_type_ = type;
1147 1146
1147 const uint8* init_data_ptr = init_data.empty() ? NULL : &init_data[0];
1148 client_->keyNeeded(WebString(), 1148 client_->keyNeeded(WebString(),
1149 WebString::fromUTF8(session_id), 1149 WebString::fromUTF8(session_id),
1150 init_data.get(), 1150 init_data_ptr,
1151 init_data_size); 1151 init_data.size());
1152 } 1152 }
1153 1153
1154 #if defined(GOOGLE_TV) 1154 #if defined(GOOGLE_TV)
1155 bool WebMediaPlayerAndroid::InjectMediaStream( 1155 bool WebMediaPlayerAndroid::InjectMediaStream(
1156 MediaStreamClient* media_stream_client, 1156 MediaStreamClient* media_stream_client,
1157 media::Demuxer* demuxer, 1157 media::Demuxer* demuxer,
1158 const base::Closure& destroy_demuxer_cb) { 1158 const base::Closure& destroy_demuxer_cb) {
1159 DCHECK(!demuxer); 1159 DCHECK(!demuxer);
1160 media_stream_client_ = media_stream_client; 1160 media_stream_client_ = media_stream_client;
1161 demuxer_ = demuxer; 1161 demuxer_ = demuxer;
(...skipping 18 matching lines...) Expand all
1180 1180
1181 void WebMediaPlayerAndroid::exitFullscreen() { 1181 void WebMediaPlayerAndroid::exitFullscreen() {
1182 proxy_->ExitFullscreen(player_id_); 1182 proxy_->ExitFullscreen(player_id_);
1183 } 1183 }
1184 1184
1185 bool WebMediaPlayerAndroid::canEnterFullscreen() const { 1185 bool WebMediaPlayerAndroid::canEnterFullscreen() const {
1186 return manager_->CanEnterFullscreen(frame_); 1186 return manager_->CanEnterFullscreen(frame_);
1187 } 1187 }
1188 1188
1189 } // namespace content 1189 } // namespace content
OLDNEW
« no previous file with comments | « content/renderer/media/android/webmediaplayer_android.h ('k') | content/renderer/media/webmediaplayer_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698