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

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

Issue 8661002: Fire CanPlayThrough immediately for local and streaming media files (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 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
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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"
(...skipping 273 matching lines...) Expand 10 before | Expand all | Expand 10 after
284 media_stream_client_->GetVideoDecoder(url, message_loop_factory_.get()); 284 media_stream_client_->GetVideoDecoder(url, message_loop_factory_.get());
285 if (new_decoder.get()) { 285 if (new_decoder.get()) {
286 // Remove the default decoder. 286 // Remove the default decoder.
287 scoped_refptr<media::VideoDecoder> old_videodecoder; 287 scoped_refptr<media::VideoDecoder> old_videodecoder;
288 filter_collection_->SelectVideoDecoder(&old_videodecoder); 288 filter_collection_->SelectVideoDecoder(&old_videodecoder);
289 filter_collection_->AddVideoDecoder(new_decoder.get()); 289 filter_collection_->AddVideoDecoder(new_decoder.get());
290 has_video = true; 290 has_video = true;
291 } 291 }
292 292
293 // TODO(wjia): add audio decoder handling when it's available. 293 // TODO(wjia): add audio decoder handling when it's available.
294 if (has_video || has_audio) 294 if (has_video || has_audio) {
295 filter_collection_->SetDemuxerFactory( 295 filter_collection_->SetDemuxerFactory(
296 new media::DummyDemuxerFactory(has_video, has_audio)); 296 new media::DummyDemuxerFactory(has_video, has_audio));
297 pipeline_->SetMediaStream(true);
298 }
297 } 299 }
298 300
299 // Handle any volume changes that occured before load(). 301 // Handle any volume changes that occured before load().
300 setVolume(GetClient()->volume()); 302 setVolume(GetClient()->volume());
301 // Get the preload value. 303 // Get the preload value.
302 setPreload(GetClient()->preload()); 304 setPreload(GetClient()->preload());
303 305
304 // Initialize the pipeline. 306 // Initialize the pipeline.
305 SetNetworkState(WebKit::WebMediaPlayer::Loading); 307 SetNetworkState(WebKit::WebMediaPlayer::Loading);
306 SetReadyState(WebKit::WebMediaPlayer::HaveNothing); 308 SetReadyState(WebKit::WebMediaPlayer::HaveNothing);
(...skipping 601 matching lines...) Expand 10 before | Expand all | Expand 10 after
908 return client_; 910 return client_;
909 } 911 }
910 912
911 void WebMediaPlayerImpl::IncrementExternallyAllocatedMemory() { 913 void WebMediaPlayerImpl::IncrementExternallyAllocatedMemory() {
912 DCHECK_EQ(main_loop_, MessageLoop::current()); 914 DCHECK_EQ(main_loop_, MessageLoop::current());
913 incremented_externally_allocated_memory_ = true; 915 incremented_externally_allocated_memory_ = true;
914 v8::V8::AdjustAmountOfExternalAllocatedMemory(kPlayerExtraMemory); 916 v8::V8::AdjustAmountOfExternalAllocatedMemory(kPlayerExtraMemory);
915 } 917 }
916 918
917 } // namespace webkit_media 919 } // namespace webkit_media
OLDNEW
« media/base/download_rate_monitor.cc ('K') | « media/base/pipeline_impl.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698