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