| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/mojo/services/demuxer_stream_provider_shim.h" | 5 #include "media/mojo/services/demuxer_stream_provider_shim.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/bind_helpers.h" | 8 #include "base/bind_helpers.h" |
| 9 #include "base/callback_helpers.h" | 9 #include "base/callback_helpers.h" |
| 10 | 10 |
| (...skipping 30 matching lines...) Expand all Loading... |
| 41 DemuxerStream* DemuxerStreamProviderShim::GetStream(DemuxerStream::Type type) { | 41 DemuxerStream* DemuxerStreamProviderShim::GetStream(DemuxerStream::Type type) { |
| 42 DCHECK(demuxer_ready_cb_.is_null()); | 42 DCHECK(demuxer_ready_cb_.is_null()); |
| 43 for (auto* stream : streams_) { | 43 for (auto* stream : streams_) { |
| 44 if (stream->type() == type) | 44 if (stream->type() == type) |
| 45 return stream; | 45 return stream; |
| 46 } | 46 } |
| 47 | 47 |
| 48 return nullptr; | 48 return nullptr; |
| 49 } | 49 } |
| 50 | 50 |
| 51 DemuxerStreamProvider::Liveness DemuxerStreamProviderShim::GetLiveness() const { | |
| 52 // TODO(dalecurtis): This should be removed once liveness lives elsewhere, see | |
| 53 // http://crbug.com/420025 | |
| 54 return DemuxerStreamProvider::LIVENESS_UNKNOWN; | |
| 55 } | |
| 56 | |
| 57 void DemuxerStreamProviderShim::OnStreamReady() { | 51 void DemuxerStreamProviderShim::OnStreamReady() { |
| 58 if (++streams_ready_ == streams_.size()) | 52 if (++streams_ready_ == streams_.size()) |
| 59 base::ResetAndReturn(&demuxer_ready_cb_).Run(); | 53 base::ResetAndReturn(&demuxer_ready_cb_).Run(); |
| 60 } | 54 } |
| 61 | 55 |
| 62 } // namespace media | 56 } // namespace media |
| OLD | NEW |