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 1084 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1095 base::AutoLock auto_lock(lock_); | 1095 base::AutoLock auto_lock(lock_); |
1096 if (type == DemuxerStream::VIDEO) | 1096 if (type == DemuxerStream::VIDEO) |
1097 return video_.get(); | 1097 return video_.get(); |
1098 | 1098 |
1099 if (type == DemuxerStream::AUDIO) | 1099 if (type == DemuxerStream::AUDIO) |
1100 return audio_.get(); | 1100 return audio_.get(); |
1101 | 1101 |
1102 return NULL; | 1102 return NULL; |
1103 } | 1103 } |
1104 | 1104 |
| 1105 TimeDelta ChunkDemuxer::GetStartTime() const { |
| 1106 return TimeDelta(); |
| 1107 } |
| 1108 |
1105 base::Time ChunkDemuxer::GetTimelineOffset() const { | 1109 base::Time ChunkDemuxer::GetTimelineOffset() const { |
1106 return timeline_offset_; | 1110 return timeline_offset_; |
1107 } | 1111 } |
1108 | 1112 |
1109 Demuxer::Liveness ChunkDemuxer::GetLiveness() const { | 1113 Demuxer::Liveness ChunkDemuxer::GetLiveness() const { |
1110 return liveness_; | 1114 return liveness_; |
1111 } | 1115 } |
1112 | 1116 |
1113 void ChunkDemuxer::StartWaitingForSeek(TimeDelta seek_time) { | 1117 void ChunkDemuxer::StartWaitingForSeek(TimeDelta seek_time) { |
1114 DVLOG(1) << "StartWaitingForSeek()"; | 1118 DVLOG(1) << "StartWaitingForSeek()"; |
(...skipping 481 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1596 | 1600 |
1597 liveness_ = params.liveness; | 1601 liveness_ = params.liveness; |
1598 } | 1602 } |
1599 | 1603 |
1600 // Wait until all streams have initialized. | 1604 // Wait until all streams have initialized. |
1601 if ((!source_id_audio_.empty() && !audio_) || | 1605 if ((!source_id_audio_.empty() && !audio_) || |
1602 (!source_id_video_.empty() && !video_)) { | 1606 (!source_id_video_.empty() && !video_)) { |
1603 return; | 1607 return; |
1604 } | 1608 } |
1605 | 1609 |
1606 SeekAllSources(base::TimeDelta()); | 1610 SeekAllSources(GetStartTime()); |
1607 StartReturningData(); | 1611 StartReturningData(); |
1608 | 1612 |
1609 if (duration_ == kNoTimestamp()) | 1613 if (duration_ == kNoTimestamp()) |
1610 duration_ = kInfiniteDuration(); | 1614 duration_ = kInfiniteDuration(); |
1611 | 1615 |
1612 // The demuxer is now initialized after the |start_timestamp_| was set. | 1616 // The demuxer is now initialized after the |start_timestamp_| was set. |
1613 ChangeState_Locked(INITIALIZED); | 1617 ChangeState_Locked(INITIALIZED); |
1614 base::ResetAndReturn(&init_cb_).Run(PIPELINE_OK); | 1618 base::ResetAndReturn(&init_cb_).Run(PIPELINE_OK); |
1615 } | 1619 } |
1616 | 1620 |
(...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1751 } | 1755 } |
1752 | 1756 |
1753 void ChunkDemuxer::ShutdownAllStreams() { | 1757 void ChunkDemuxer::ShutdownAllStreams() { |
1754 for (SourceStateMap::iterator itr = source_state_map_.begin(); | 1758 for (SourceStateMap::iterator itr = source_state_map_.begin(); |
1755 itr != source_state_map_.end(); ++itr) { | 1759 itr != source_state_map_.end(); ++itr) { |
1756 itr->second->Shutdown(); | 1760 itr->second->Shutdown(); |
1757 } | 1761 } |
1758 } | 1762 } |
1759 | 1763 |
1760 } // namespace media | 1764 } // namespace media |
OLD | NEW |