| OLD | NEW |
| 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 "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" |
| (...skipping 272 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 283 default: | 283 default: |
| 284 ChangeState(kError); | 284 ChangeState(kError); |
| 285 DispatchPendingCallback(PIPELINE_ERROR_INVALID_STATE); | 285 DispatchPendingCallback(PIPELINE_ERROR_INVALID_STATE); |
| 286 } | 286 } |
| 287 } | 287 } |
| 288 | 288 |
| 289 void CompositeFilter::DispatchPendingCallback(PipelineStatus status) { | 289 void CompositeFilter::DispatchPendingCallback(PipelineStatus status) { |
| 290 DCHECK(status_cb_.is_null() ^ callback_.is_null()); | 290 DCHECK(status_cb_.is_null() ^ callback_.is_null()); |
| 291 | 291 |
| 292 if (!status_cb_.is_null()) { | 292 if (!status_cb_.is_null()) { |
| 293 ResetAndRunCB(&status_cb_, status); | 293 status_cb_.ResetAndRun(status); |
| 294 return; | 294 return; |
| 295 } | 295 } |
| 296 | 296 |
| 297 if (!callback_.is_null()) { | 297 if (!callback_.is_null()) { |
| 298 if (status != PIPELINE_OK) | 298 if (status != PIPELINE_OK) |
| 299 SendErrorToHost(status); | 299 SendErrorToHost(status); |
| 300 ResetAndRunCB(&callback_); | 300 callback_.ResetAndRun(); |
| 301 } | 301 } |
| 302 } | 302 } |
| 303 | 303 |
| 304 CompositeFilter::State CompositeFilter::GetNextState(State state) const { | 304 CompositeFilter::State CompositeFilter::GetNextState(State state) const { |
| 305 State ret = kInvalid; | 305 State ret = kInvalid; |
| 306 switch (state) { | 306 switch (state) { |
| 307 case kPlayPending: | 307 case kPlayPending: |
| 308 ret = kPlaying; | 308 ret = kPlaying; |
| 309 break; | 309 break; |
| 310 case kPausePending: | 310 case kPausePending: |
| (...skipping 181 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 492 | 492 |
| 493 void CompositeFilter::FilterHostImpl::NotifyEnded() { | 493 void CompositeFilter::FilterHostImpl::NotifyEnded() { |
| 494 host_->NotifyEnded(); | 494 host_->NotifyEnded(); |
| 495 } | 495 } |
| 496 | 496 |
| 497 void CompositeFilter::FilterHostImpl::DisableAudioRenderer() { | 497 void CompositeFilter::FilterHostImpl::DisableAudioRenderer() { |
| 498 host_->DisableAudioRenderer(); | 498 host_->DisableAudioRenderer(); |
| 499 } | 499 } |
| 500 | 500 |
| 501 } // namespace media | 501 } // namespace media |
| OLD | NEW |