OLD | NEW |
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 "media/blink/multibuffer_data_source.h" | 5 #include "media/blink/multibuffer_data_source.h" |
6 | 6 |
7 #include <utility> | 7 #include <utility> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/callback_helpers.h" | 10 #include "base/callback_helpers.h" |
(...skipping 432 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
443 ReadOperation::Run(std::move(read_op_), kReadError); | 443 ReadOperation::Run(std::move(read_op_), kReadError); |
444 } | 444 } |
445 | 445 |
446 void MultibufferDataSource::StopLoader() { | 446 void MultibufferDataSource::StopLoader() { |
447 DCHECK(render_task_runner_->BelongsToCurrentThread()); | 447 DCHECK(render_task_runner_->BelongsToCurrentThread()); |
448 reader_.reset(nullptr); | 448 reader_.reset(nullptr); |
449 } | 449 } |
450 | 450 |
451 void MultibufferDataSource::SetBitrateTask(int bitrate) { | 451 void MultibufferDataSource::SetBitrateTask(int bitrate) { |
452 DCHECK(render_task_runner_->BelongsToCurrentThread()); | 452 DCHECK(render_task_runner_->BelongsToCurrentThread()); |
453 DCHECK(reader_.get()); | |
454 | 453 |
455 bitrate_ = bitrate; | 454 bitrate_ = bitrate; |
456 UpdateBufferSizes(); | 455 UpdateBufferSizes(); |
457 } | 456 } |
458 | 457 |
459 ///////////////////////////////////////////////////////////////////////////// | 458 ///////////////////////////////////////////////////////////////////////////// |
460 // BufferedResourceLoader callback methods. | 459 // BufferedResourceLoader callback methods. |
461 void MultibufferDataSource::StartCallback() { | 460 void MultibufferDataSource::StartCallback() { |
462 DCHECK(render_task_runner_->BelongsToCurrentThread()); | 461 DCHECK(render_task_runner_->BelongsToCurrentThread()); |
463 | 462 |
(...skipping 170 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
634 reader_->SetPinRange(pin_backward, pin_forward); | 633 reader_->SetPinRange(pin_backward, pin_forward); |
635 | 634 |
636 if (preload_ == METADATA) { | 635 if (preload_ == METADATA) { |
637 reader_->SetPreload(0, 0); | 636 reader_->SetPreload(0, 0); |
638 } else { | 637 } else { |
639 reader_->SetPreload(preload_high, preload); | 638 reader_->SetPreload(preload_high, preload); |
640 } | 639 } |
641 } | 640 } |
642 | 641 |
643 } // namespace media | 642 } // namespace media |
OLD | NEW |