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