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

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

Issue 10535029: Add support for encrypted WebM files as defined in the RFC. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Updated encrypted WebM test data. Created 8 years, 6 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
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 9
10 #include "base/bind.h" 10 #include "base/bind.h"
11 #include "base/callback.h" 11 #include "base/callback.h"
12 #include "base/command_line.h" 12 #include "base/command_line.h"
13 #include "base/message_loop_proxy.h" 13 #include "base/message_loop_proxy.h"
14 #include "base/metrics/histogram.h" 14 #include "base/metrics/histogram.h"
15 #include "base/string_number_conversions.h" 15 #include "base/string_number_conversions.h"
16 #include "base/synchronization/waitable_event.h" 16 #include "base/synchronization/waitable_event.h"
17 #include "media/audio/null_audio_sink.h" 17 #include "media/audio/null_audio_sink.h"
18 #include "media/base/filter_collection.h" 18 #include "media/base/filter_collection.h"
19 #include "media/base/limits.h" 19 #include "media/base/limits.h"
20 #include "media/base/media_log.h" 20 #include "media/base/media_log.h"
21 #include "media/base/media_switches.h" 21 #include "media/base/media_switches.h"
22 #include "media/base/pipeline.h" 22 #include "media/base/pipeline.h"
23 #include "media/base/video_frame.h" 23 #include "media/base/video_frame.h"
24 #include "media/crypto/aes_decryptor.h" 24 #include "media/crypto/hmac_aes_decryptor.h"
25 #include "media/filters/audio_renderer_impl.h" 25 #include "media/filters/audio_renderer_impl.h"
26 #include "media/filters/video_renderer_base.h" 26 #include "media/filters/video_renderer_base.h"
27 #include "third_party/WebKit/Source/WebKit/chromium/public/WebVideoFrame.h" 27 #include "third_party/WebKit/Source/WebKit/chromium/public/WebVideoFrame.h"
28 #include "third_party/WebKit/Source/WebKit/chromium/public/WebView.h" 28 #include "third_party/WebKit/Source/WebKit/chromium/public/WebView.h"
29 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebRect.h" 29 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebRect.h"
30 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebSize.h" 30 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebSize.h"
31 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebString.h" 31 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebString.h"
32 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebURL.h" 32 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebURL.h"
33 #include "v8/include/v8.h" 33 #include "v8/include/v8.h"
34 #include "webkit/media/buffered_data_source.h" 34 #include "webkit/media/buffered_data_source.h"
(...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after
148 base::Bind(&WebMediaPlayerProxy::Repaint, proxy_), 148 base::Bind(&WebMediaPlayerProxy::Repaint, proxy_),
149 base::Bind(&WebMediaPlayerProxy::SetOpaque, proxy_.get()), 149 base::Bind(&WebMediaPlayerProxy::SetOpaque, proxy_.get()),
150 true); 150 true);
151 filter_collection_->AddVideoRenderer(video_renderer); 151 filter_collection_->AddVideoRenderer(video_renderer);
152 proxy_->set_frame_provider(video_renderer); 152 proxy_->set_frame_provider(video_renderer);
153 153
154 // Create default audio renderer. 154 // Create default audio renderer.
155 filter_collection_->AddAudioRenderer( 155 filter_collection_->AddAudioRenderer(
156 new media::AudioRendererImpl(new media::NullAudioSink())); 156 new media::AudioRendererImpl(new media::NullAudioSink()));
157 157
158 decryptor_.reset(new media::AesDecryptor()); 158 decryptor_.reset(new media::HmacAesDecryptor());
159 } 159 }
160 160
161 WebMediaPlayerImpl::~WebMediaPlayerImpl() { 161 WebMediaPlayerImpl::~WebMediaPlayerImpl() {
162 DCHECK_EQ(main_loop_, MessageLoop::current()); 162 DCHECK_EQ(main_loop_, MessageLoop::current());
163 Destroy(); 163 Destroy();
164 media_log_->AddEvent( 164 media_log_->AddEvent(
165 media_log_->CreateEvent(media::MediaLogEvent::WEBMEDIAPLAYER_DESTROYED)); 165 media_log_->CreateEvent(media::MediaLogEvent::WEBMEDIAPLAYER_DESTROYED));
166 166
167 if (delegate_) 167 if (delegate_)
168 delegate_->PlayerGone(this); 168 delegate_->PlayerGone(this);
(...skipping 875 matching lines...) Expand 10 before | Expand all | Expand 10 after
1044 return audio_source_provider_; 1044 return audio_source_provider_;
1045 } 1045 }
1046 1046
1047 void WebMediaPlayerImpl::IncrementExternallyAllocatedMemory() { 1047 void WebMediaPlayerImpl::IncrementExternallyAllocatedMemory() {
1048 DCHECK_EQ(main_loop_, MessageLoop::current()); 1048 DCHECK_EQ(main_loop_, MessageLoop::current());
1049 incremented_externally_allocated_memory_ = true; 1049 incremented_externally_allocated_memory_ = true;
1050 v8::V8::AdjustAmountOfExternalAllocatedMemory(kPlayerExtraMemory); 1050 v8::V8::AdjustAmountOfExternalAllocatedMemory(kPlayerExtraMemory);
1051 } 1051 }
1052 1052
1053 } // namespace webkit_media 1053 } // namespace webkit_media
OLDNEW
« webkit/media/filter_helpers.h ('K') | « webkit/media/webmediaplayer_impl.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698