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

Side by Side Diff: webkit/media/webmediaplayer_impl.cc

Issue 11434076: Encrypted Media: Check WebKit::WebRuntimeFeatures::isEncryptedMediaEnabled() in WebMediaPlayerImpl. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: remove headers that we don't use Created 8 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 "webkit/media/webmediaplayer_impl.h" 5 #include "webkit/media/webmediaplayer_impl.h"
6 6
7 #include <limits> 7 #include <limits>
8 #include <string> 8 #include <string>
9 #include <vector> 9 #include <vector>
10 10
11 #include "base/bind.h" 11 #include "base/bind.h"
12 #include "base/callback.h" 12 #include "base/callback.h"
13 #include "base/command_line.h"
14 #include "base/message_loop_proxy.h" 13 #include "base/message_loop_proxy.h"
15 #include "base/metrics/histogram.h" 14 #include "base/metrics/histogram.h"
16 #include "base/string_number_conversions.h" 15 #include "base/string_number_conversions.h"
17 #include "base/synchronization/waitable_event.h" 16 #include "base/synchronization/waitable_event.h"
18 #include "media/audio/null_audio_sink.h" 17 #include "media/audio/null_audio_sink.h"
19 #include "media/base/bind_to_loop.h" 18 #include "media/base/bind_to_loop.h"
20 #include "media/base/filter_collection.h" 19 #include "media/base/filter_collection.h"
21 #include "media/base/limits.h" 20 #include "media/base/limits.h"
22 #include "media/base/media_log.h" 21 #include "media/base/media_log.h"
23 #include "media/base/media_switches.h"
24 #include "media/base/pipeline.h" 22 #include "media/base/pipeline.h"
25 #include "media/base/video_frame.h" 23 #include "media/base/video_frame.h"
26 #include "media/filters/audio_renderer_impl.h" 24 #include "media/filters/audio_renderer_impl.h"
27 #include "media/filters/chunk_demuxer.h" 25 #include "media/filters/chunk_demuxer.h"
28 #include "media/filters/video_renderer_base.h" 26 #include "media/filters/video_renderer_base.h"
27 #include "third_party/WebKit/Source/WebKit/chromium/public/WebRuntimeFeatures.h"
29 #include "third_party/WebKit/Source/WebKit/chromium/public/WebVideoFrame.h" 28 #include "third_party/WebKit/Source/WebKit/chromium/public/WebVideoFrame.h"
30 #include "third_party/WebKit/Source/WebKit/chromium/public/WebView.h" 29 #include "third_party/WebKit/Source/WebKit/chromium/public/WebView.h"
31 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebRect.h" 30 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebRect.h"
32 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebSize.h" 31 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebSize.h"
33 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebString.h" 32 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebString.h"
34 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebURL.h" 33 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebURL.h"
35 #include "v8/include/v8.h" 34 #include "v8/include/v8.h"
36 #include "webkit/media/buffered_data_source.h" 35 #include "webkit/media/buffered_data_source.h"
37 #include "webkit/media/filter_helpers.h" 36 #include "webkit/media/filter_helpers.h"
38 #include "webkit/media/webmediaplayer_delegate.h" 37 #include "webkit/media/webmediaplayer_delegate.h"
(...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after
180 base::Bind(&WebMediaPlayerProxy::Repaint, proxy_), 179 base::Bind(&WebMediaPlayerProxy::Repaint, proxy_),
181 BIND_TO_RENDER_LOOP(&WebMediaPlayerImpl::SetOpaque), 180 BIND_TO_RENDER_LOOP(&WebMediaPlayerImpl::SetOpaque),
182 true); 181 true);
183 filter_collection_->AddVideoRenderer(video_renderer); 182 filter_collection_->AddVideoRenderer(video_renderer);
184 proxy_->set_frame_provider(video_renderer); 183 proxy_->set_frame_provider(video_renderer);
185 184
186 // Create default audio renderer. 185 // Create default audio renderer.
187 filter_collection_->AddAudioRenderer( 186 filter_collection_->AddAudioRenderer(
188 new media::AudioRendererImpl(new media::NullAudioSink())); 187 new media::AudioRendererImpl(new media::NullAudioSink()));
189 188
190 const CommandLine* cmd_line = CommandLine::ForCurrentProcess(); 189 if (WebKit::WebRuntimeFeatures::isEncryptedMediaEnabled()) {
191 if (cmd_line->HasSwitch(switches::kEnableEncryptedMedia)) {
192 decryptor_.reset(new ProxyDecryptor(message_loop_factory_->GetMessageLoop( 190 decryptor_.reset(new ProxyDecryptor(message_loop_factory_->GetMessageLoop(
193 media::MessageLoopFactory::kPipeline), proxy_.get(), client, frame)); 191 media::MessageLoopFactory::kPipeline), proxy_.get(), client, frame));
194 } 192 }
195 } 193 }
196 194
197 WebMediaPlayerImpl::~WebMediaPlayerImpl() { 195 WebMediaPlayerImpl::~WebMediaPlayerImpl() {
198 DCHECK_EQ(main_loop_, MessageLoop::current()); 196 DCHECK_EQ(main_loop_, MessageLoop::current());
199 Destroy(); 197 Destroy();
200 media_log_->AddEvent( 198 media_log_->AddEvent(
201 media_log_->CreateEvent(media::MediaLogEvent::WEBMEDIAPLAYER_DESTROYED)); 199 media_log_->CreateEvent(media::MediaLogEvent::WEBMEDIAPLAYER_DESTROYED));
(...skipping 1000 matching lines...) Expand 10 before | Expand all | Expand 10 after
1202 return audio_source_provider_; 1200 return audio_source_provider_;
1203 } 1201 }
1204 1202
1205 void WebMediaPlayerImpl::IncrementExternallyAllocatedMemory() { 1203 void WebMediaPlayerImpl::IncrementExternallyAllocatedMemory() {
1206 DCHECK_EQ(main_loop_, MessageLoop::current()); 1204 DCHECK_EQ(main_loop_, MessageLoop::current());
1207 incremented_externally_allocated_memory_ = true; 1205 incremented_externally_allocated_memory_ = true;
1208 v8::V8::AdjustAmountOfExternalAllocatedMemory(kPlayerExtraMemory); 1206 v8::V8::AdjustAmountOfExternalAllocatedMemory(kPlayerExtraMemory);
1209 } 1207 }
1210 1208
1211 } // namespace webkit_media 1209 } // namespace webkit_media
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698