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 1123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1134 base::AutoLock auto_lock(lock_); | 1134 base::AutoLock auto_lock(lock_); |
1135 if (type == DemuxerStream::VIDEO) | 1135 if (type == DemuxerStream::VIDEO) |
1136 return video_.get(); | 1136 return video_.get(); |
1137 | 1137 |
1138 if (type == DemuxerStream::AUDIO) | 1138 if (type == DemuxerStream::AUDIO) |
1139 return audio_.get(); | 1139 return audio_.get(); |
1140 | 1140 |
1141 return NULL; | 1141 return NULL; |
1142 } | 1142 } |
1143 | 1143 |
| 1144 TimeDelta ChunkDemuxer::GetStartTime() const { |
| 1145 return TimeDelta(); |
| 1146 } |
| 1147 |
1144 Demuxer::Liveness ChunkDemuxer::GetLiveness() const { | 1148 Demuxer::Liveness ChunkDemuxer::GetLiveness() const { |
1145 return liveness_; | 1149 return liveness_; |
1146 } | 1150 } |
1147 | 1151 |
1148 void ChunkDemuxer::StartWaitingForSeek(TimeDelta seek_time) { | 1152 void ChunkDemuxer::StartWaitingForSeek(TimeDelta seek_time) { |
1149 DVLOG(1) << "StartWaitingForSeek()"; | 1153 DVLOG(1) << "StartWaitingForSeek()"; |
1150 base::AutoLock auto_lock(lock_); | 1154 base::AutoLock auto_lock(lock_); |
1151 DCHECK(state_ == INITIALIZED || state_ == ENDED || state_ == SHUTDOWN || | 1155 DCHECK(state_ == INITIALIZED || state_ == ENDED || state_ == SHUTDOWN || |
1152 state_ == PARSE_ERROR) << state_; | 1156 state_ == PARSE_ERROR) << state_; |
1153 DCHECK(seek_cb_.is_null()); | 1157 DCHECK(seek_cb_.is_null()); |
(...skipping 481 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1635 | 1639 |
1636 liveness_ = params.liveness; | 1640 liveness_ = params.liveness; |
1637 } | 1641 } |
1638 | 1642 |
1639 // Wait until all streams have initialized. | 1643 // Wait until all streams have initialized. |
1640 if ((!source_id_audio_.empty() && !audio_) || | 1644 if ((!source_id_audio_.empty() && !audio_) || |
1641 (!source_id_video_.empty() && !video_)) { | 1645 (!source_id_video_.empty() && !video_)) { |
1642 return; | 1646 return; |
1643 } | 1647 } |
1644 | 1648 |
1645 SeekAllSources(base::TimeDelta()); | 1649 SeekAllSources(GetStartTime()); |
1646 StartReturningData(); | 1650 StartReturningData(); |
1647 | 1651 |
1648 if (duration_ == kNoTimestamp()) | 1652 if (duration_ == kNoTimestamp()) |
1649 duration_ = kInfiniteDuration(); | 1653 duration_ = kInfiniteDuration(); |
1650 | 1654 |
1651 // The demuxer is now initialized after the |start_timestamp_| was set. | 1655 // The demuxer is now initialized after the |start_timestamp_| was set. |
1652 ChangeState_Locked(INITIALIZED); | 1656 ChangeState_Locked(INITIALIZED); |
1653 base::ResetAndReturn(&init_cb_).Run(PIPELINE_OK); | 1657 base::ResetAndReturn(&init_cb_).Run(PIPELINE_OK); |
1654 } | 1658 } |
1655 | 1659 |
(...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1790 } | 1794 } |
1791 | 1795 |
1792 void ChunkDemuxer::ShutdownAllStreams() { | 1796 void ChunkDemuxer::ShutdownAllStreams() { |
1793 for (SourceStateMap::iterator itr = source_state_map_.begin(); | 1797 for (SourceStateMap::iterator itr = source_state_map_.begin(); |
1794 itr != source_state_map_.end(); ++itr) { | 1798 itr != source_state_map_.end(); ++itr) { |
1795 itr->second->Shutdown(); | 1799 itr->second->Shutdown(); |
1796 } | 1800 } |
1797 } | 1801 } |
1798 | 1802 |
1799 } // namespace media | 1803 } // namespace media |
OLD | NEW |