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

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

Issue 6625059: Implementing preload=metadata for video (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Cleanup defer strategy, fix logic bug Created 9 years, 9 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 (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/glue/webmediaplayer_impl.h" 5 #include "webkit/glue/webmediaplayer_impl.h"
6 6
7 #include <limits> 7 #include <limits>
8 #include <string> 8 #include <string>
9 9
10 #include "base/callback.h" 10 #include "base/callback.h"
(...skipping 364 matching lines...) Expand 10 before | Expand all | Expand 10 after
375 filter_collection_->SelectVideoDecoder(&old_videodecoder); 375 filter_collection_->SelectVideoDecoder(&old_videodecoder);
376 media::RTCVideoDecoder* rtc_video_decoder = 376 media::RTCVideoDecoder* rtc_video_decoder =
377 new media::RTCVideoDecoder( 377 new media::RTCVideoDecoder(
378 message_loop_factory_->GetMessageLoop("VideoDecoderThread"), 378 message_loop_factory_->GetMessageLoop("VideoDecoderThread"),
379 url.spec()); 379 url.spec());
380 filter_collection_->AddVideoDecoder(rtc_video_decoder); 380 filter_collection_->AddVideoDecoder(rtc_video_decoder);
381 } 381 }
382 382
383 // Handle any volume changes that occured before load(). 383 // Handle any volume changes that occured before load().
384 setVolume(GetClient()->volume()); 384 setVolume(GetClient()->volume());
385 // Get the preload value.
386 setPreload(static_cast<WebMediaPlayer::Preload>(GetClient()->preload()));
acolwell GONE FROM CHROMIUM 2011/03/25 04:35:28 What is the type of the enum we are casting from?
vrk (LEFT CHROMIUM) 2011/03/25 21:33:32 Oops, I think this is a mistake because of a mista
385 387
386 // Initialize the pipeline. 388 // Initialize the pipeline.
387 SetNetworkState(WebKit::WebMediaPlayer::Loading); 389 SetNetworkState(WebKit::WebMediaPlayer::Loading);
388 SetReadyState(WebKit::WebMediaPlayer::HaveNothing); 390 SetReadyState(WebKit::WebMediaPlayer::HaveNothing);
389 pipeline_->Start( 391 pipeline_->Start(
390 filter_collection_.release(), 392 filter_collection_.release(),
391 url.spec(), 393 url.spec(),
392 NewCallback(proxy_.get(), 394 NewCallback(proxy_.get(),
393 &WebMediaPlayerImpl::Proxy::PipelineInitializationCallback)); 395 &WebMediaPlayerImpl::Proxy::PipelineInitializationCallback));
394 } 396 }
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after
488 pipeline_->SetVolume(volume); 490 pipeline_->SetVolume(volume);
489 } 491 }
490 492
491 void WebMediaPlayerImpl::setVisible(bool visible) { 493 void WebMediaPlayerImpl::setVisible(bool visible) {
492 DCHECK(MessageLoop::current() == main_loop_); 494 DCHECK(MessageLoop::current() == main_loop_);
493 495
494 // TODO(hclam): add appropriate method call when pipeline has it implemented. 496 // TODO(hclam): add appropriate method call when pipeline has it implemented.
495 return; 497 return;
496 } 498 }
497 499
498 bool WebMediaPlayerImpl::setAutoBuffer(bool autoBuffer) { 500 bool WebMediaPlayerImpl::setPreload(WebKit::WebMediaPlayer::Preload preload) {
499 DCHECK(MessageLoop::current() == main_loop_); 501 DCHECK(MessageLoop::current() == main_loop_);
500 502
501 return false; 503 pipeline_->SetPreload(static_cast<media::Preload>(preload));
504
505 return true;
acolwell GONE FROM CHROMIUM 2011/03/25 04:35:28 Why is the return value changing?
vrk (LEFT CHROMIUM) 2011/03/25 21:33:32 Actually I don't think the return value is used or
502 } 506 }
503 507
504 bool WebMediaPlayerImpl::totalBytesKnown() { 508 bool WebMediaPlayerImpl::totalBytesKnown() {
505 DCHECK(MessageLoop::current() == main_loop_); 509 DCHECK(MessageLoop::current() == main_loop_);
506 510
507 return pipeline_->GetTotalBytes() != 0; 511 return pipeline_->GetTotalBytes() != 0;
508 } 512 }
509 513
510 bool WebMediaPlayerImpl::hasVideo() const { 514 bool WebMediaPlayerImpl::hasVideo() const {
511 DCHECK(MessageLoop::current() == main_loop_); 515 DCHECK(MessageLoop::current() == main_loop_);
(...skipping 395 matching lines...) Expand 10 before | Expand all | Expand 10 after
907 } 911 }
908 } 912 }
909 913
910 WebKit::WebMediaPlayerClient* WebMediaPlayerImpl::GetClient() { 914 WebKit::WebMediaPlayerClient* WebMediaPlayerImpl::GetClient() {
911 DCHECK(MessageLoop::current() == main_loop_); 915 DCHECK(MessageLoop::current() == main_loop_);
912 DCHECK(client_); 916 DCHECK(client_);
913 return client_; 917 return client_;
914 } 918 }
915 919
916 } // namespace webkit_glue 920 } // namespace webkit_glue
OLDNEW
« webkit/glue/media/defer_strategy.cc ('K') | « webkit/glue/webmediaplayer_impl.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698