| 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/filters/chunk_demuxer.h" | 5 #include "media/filters/chunk_demuxer.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <limits> | 8 #include <limits> |
| 9 #include <list> | 9 #include <list> |
| 10 | 10 |
| (...skipping 1076 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1087 | 1087 |
| 1088 if (IsSeekWaitingForData_Locked()) { | 1088 if (IsSeekWaitingForData_Locked()) { |
| 1089 DVLOG(1) << "Seek() : waiting for more data to arrive."; | 1089 DVLOG(1) << "Seek() : waiting for more data to arrive."; |
| 1090 return; | 1090 return; |
| 1091 } | 1091 } |
| 1092 | 1092 |
| 1093 base::ResetAndReturn(&seek_cb_).Run(PIPELINE_OK); | 1093 base::ResetAndReturn(&seek_cb_).Run(PIPELINE_OK); |
| 1094 } | 1094 } |
| 1095 | 1095 |
| 1096 // Demuxer implementation. | 1096 // Demuxer implementation. |
| 1097 base::Time ChunkDemuxer::GetTimelineOffset() const { |
| 1098 return timeline_offset_; |
| 1099 } |
| 1100 |
| 1097 DemuxerStream* ChunkDemuxer::GetStream(DemuxerStream::Type type) { | 1101 DemuxerStream* ChunkDemuxer::GetStream(DemuxerStream::Type type) { |
| 1098 DCHECK_NE(type, DemuxerStream::TEXT); | 1102 DCHECK_NE(type, DemuxerStream::TEXT); |
| 1099 base::AutoLock auto_lock(lock_); | 1103 base::AutoLock auto_lock(lock_); |
| 1100 if (type == DemuxerStream::VIDEO) | 1104 if (type == DemuxerStream::VIDEO) |
| 1101 return video_.get(); | 1105 return video_.get(); |
| 1102 | 1106 |
| 1103 if (type == DemuxerStream::AUDIO) | 1107 if (type == DemuxerStream::AUDIO) |
| 1104 return audio_.get(); | 1108 return audio_.get(); |
| 1105 | 1109 |
| 1106 return NULL; | 1110 return NULL; |
| 1107 } | 1111 } |
| 1108 | 1112 |
| 1109 base::Time ChunkDemuxer::GetTimelineOffset() const { | |
| 1110 return timeline_offset_; | |
| 1111 } | |
| 1112 | |
| 1113 Demuxer::Liveness ChunkDemuxer::GetLiveness() const { | 1113 Demuxer::Liveness ChunkDemuxer::GetLiveness() const { |
| 1114 return liveness_; | 1114 return liveness_; |
| 1115 } | 1115 } |
| 1116 | 1116 |
| 1117 void ChunkDemuxer::StartWaitingForSeek(TimeDelta seek_time) { | 1117 void ChunkDemuxer::StartWaitingForSeek(TimeDelta seek_time) { |
| 1118 DVLOG(1) << "StartWaitingForSeek()"; | 1118 DVLOG(1) << "StartWaitingForSeek()"; |
| 1119 base::AutoLock auto_lock(lock_); | 1119 base::AutoLock auto_lock(lock_); |
| 1120 DCHECK(state_ == INITIALIZED || state_ == ENDED || state_ == SHUTDOWN || | 1120 DCHECK(state_ == INITIALIZED || state_ == ENDED || state_ == SHUTDOWN || |
| 1121 state_ == PARSE_ERROR) << state_; | 1121 state_ == PARSE_ERROR) << state_; |
| 1122 DCHECK(seek_cb_.is_null()); | 1122 DCHECK(seek_cb_.is_null()); |
| (...skipping 630 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1753 } | 1753 } |
| 1754 | 1754 |
| 1755 void ChunkDemuxer::ShutdownAllStreams() { | 1755 void ChunkDemuxer::ShutdownAllStreams() { |
| 1756 for (SourceStateMap::iterator itr = source_state_map_.begin(); | 1756 for (SourceStateMap::iterator itr = source_state_map_.begin(); |
| 1757 itr != source_state_map_.end(); ++itr) { | 1757 itr != source_state_map_.end(); ++itr) { |
| 1758 itr->second->Shutdown(); | 1758 itr->second->Shutdown(); |
| 1759 } | 1759 } |
| 1760 } | 1760 } |
| 1761 | 1761 |
| 1762 } // namespace media | 1762 } // namespace media |
| OLD | NEW |