| OLD | NEW |
| 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 "media/base/composite_filter.h" | 5 #include "media/base/composite_filter.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/callback.h" | 8 #include "base/callback.h" |
| 9 #include "base/message_loop.h" | 9 #include "base/message_loop.h" |
| 10 #include "base/stl_util.h" | 10 #include "base/stl_util.h" |
| 11 | 11 |
| 12 namespace media { | 12 namespace media { |
| 13 | 13 |
| 14 class CompositeFilter::FilterHostImpl : public FilterHost { | 14 class CompositeFilter::FilterHostImpl : public FilterHost { |
| 15 public: | 15 public: |
| 16 FilterHostImpl(CompositeFilter* parent, FilterHost* host); | 16 FilterHostImpl(CompositeFilter* parent, FilterHost* host); |
| 17 | 17 |
| 18 FilterHost* host(); | 18 FilterHost* host(); |
| 19 | 19 |
| 20 // media::FilterHost methods. | 20 // media::FilterHost methods. |
| 21 virtual void SetError(PipelineStatus error) OVERRIDE; | 21 virtual void SetError(PipelineStatus error) OVERRIDE; |
| 22 virtual base::TimeDelta GetTime() const OVERRIDE; | 22 virtual base::TimeDelta GetTime() const OVERRIDE; |
| 23 virtual base::TimeDelta GetDuration() const OVERRIDE; | 23 virtual base::TimeDelta GetDuration() const OVERRIDE; |
| 24 virtual void SetTime(base::TimeDelta time) OVERRIDE; | 24 virtual void SetTime(base::TimeDelta time) OVERRIDE; |
| 25 virtual void SetDuration(base::TimeDelta duration) OVERRIDE; | |
| 26 virtual void SetBufferedTime(base::TimeDelta buffered_time) OVERRIDE; | |
| 27 virtual void SetTotalBytes(int64 total_bytes) OVERRIDE; | |
| 28 virtual void SetBufferedBytes(int64 buffered_bytes) OVERRIDE; | |
| 29 virtual void SetNaturalVideoSize(const gfx::Size& size) OVERRIDE; | 25 virtual void SetNaturalVideoSize(const gfx::Size& size) OVERRIDE; |
| 30 virtual void NotifyEnded() OVERRIDE; | 26 virtual void NotifyEnded() OVERRIDE; |
| 31 virtual void SetNetworkActivity(bool network_activity) OVERRIDE; | |
| 32 virtual void DisableAudioRenderer() OVERRIDE; | 27 virtual void DisableAudioRenderer() OVERRIDE; |
| 33 virtual void SetCurrentReadPosition(int64 offset) OVERRIDE; | |
| 34 virtual int64 GetCurrentReadPosition() OVERRIDE; | |
| 35 | 28 |
| 36 private: | 29 private: |
| 37 CompositeFilter* parent_; | 30 CompositeFilter* parent_; |
| 38 FilterHost* host_; | 31 FilterHost* host_; |
| 39 | 32 |
| 40 DISALLOW_COPY_AND_ASSIGN(FilterHostImpl); | 33 DISALLOW_COPY_AND_ASSIGN(FilterHostImpl); |
| 41 }; | 34 }; |
| 42 | 35 |
| 43 CompositeFilter::CompositeFilter(MessageLoop* message_loop) | 36 CompositeFilter::CompositeFilter(MessageLoop* message_loop) |
| 44 : state_(kCreated), | 37 : state_(kCreated), |
| (...skipping 455 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 500 } | 493 } |
| 501 | 494 |
| 502 base::TimeDelta CompositeFilter::FilterHostImpl::GetDuration() const { | 495 base::TimeDelta CompositeFilter::FilterHostImpl::GetDuration() const { |
| 503 return host_->GetDuration(); | 496 return host_->GetDuration(); |
| 504 } | 497 } |
| 505 | 498 |
| 506 void CompositeFilter::FilterHostImpl::SetTime(base::TimeDelta time) { | 499 void CompositeFilter::FilterHostImpl::SetTime(base::TimeDelta time) { |
| 507 host_->SetTime(time); | 500 host_->SetTime(time); |
| 508 } | 501 } |
| 509 | 502 |
| 510 void CompositeFilter::FilterHostImpl::SetDuration(base::TimeDelta duration) { | |
| 511 host_->SetDuration(duration); | |
| 512 } | |
| 513 | |
| 514 void CompositeFilter::FilterHostImpl::SetBufferedTime( | |
| 515 base::TimeDelta buffered_time) { | |
| 516 host_->SetBufferedTime(buffered_time); | |
| 517 } | |
| 518 | |
| 519 void CompositeFilter::FilterHostImpl::SetTotalBytes(int64 total_bytes) { | |
| 520 host_->SetTotalBytes(total_bytes); | |
| 521 } | |
| 522 | |
| 523 void CompositeFilter::FilterHostImpl::SetBufferedBytes(int64 buffered_bytes) { | |
| 524 host_->SetBufferedBytes(buffered_bytes); | |
| 525 } | |
| 526 | |
| 527 void CompositeFilter::FilterHostImpl::SetNaturalVideoSize( | 503 void CompositeFilter::FilterHostImpl::SetNaturalVideoSize( |
| 528 const gfx::Size& size) { | 504 const gfx::Size& size) { |
| 529 host_->SetNaturalVideoSize(size); | 505 host_->SetNaturalVideoSize(size); |
| 530 } | 506 } |
| 531 | 507 |
| 532 void CompositeFilter::FilterHostImpl::NotifyEnded() { | 508 void CompositeFilter::FilterHostImpl::NotifyEnded() { |
| 533 host_->NotifyEnded(); | 509 host_->NotifyEnded(); |
| 534 } | 510 } |
| 535 | 511 |
| 536 void CompositeFilter::FilterHostImpl::SetNetworkActivity( | |
| 537 bool network_activity) { | |
| 538 host_->SetNetworkActivity(network_activity); | |
| 539 } | |
| 540 | |
| 541 void CompositeFilter::FilterHostImpl::DisableAudioRenderer() { | 512 void CompositeFilter::FilterHostImpl::DisableAudioRenderer() { |
| 542 host_->DisableAudioRenderer(); | 513 host_->DisableAudioRenderer(); |
| 543 } | 514 } |
| 544 | 515 |
| 545 void CompositeFilter::FilterHostImpl::SetCurrentReadPosition(int64 offset) { | |
| 546 host_->SetCurrentReadPosition(offset); | |
| 547 } | |
| 548 | |
| 549 int64 CompositeFilter::FilterHostImpl::GetCurrentReadPosition() { | |
| 550 return host_->GetCurrentReadPosition(); | |
| 551 } | |
| 552 | |
| 553 } // namespace media | 516 } // namespace media |
| OLD | NEW |