OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 "base/bind.h" | 5 #include "base/bind.h" |
6 #include "base/logging.h" | 6 #include "base/logging.h" |
7 #include "base/message_loop.h" | 7 #include "base/message_loop.h" |
8 #include "base/string_number_conversions.h" | 8 #include "base/string_number_conversions.h" |
9 #include "base/string_split.h" | 9 #include "base/string_split.h" |
10 #include "base/string_util.h" | 10 #include "base/string_util.h" |
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
91 } | 91 } |
92 | 92 |
93 StreamSwitchManager::~StreamSwitchManager() {} | 93 StreamSwitchManager::~StreamSwitchManager() {} |
94 | 94 |
95 void StreamSwitchManager::Play() { | 95 void StreamSwitchManager::Play() { |
96 DCHECK_EQ(MessageLoop::current(), message_loop_); | 96 DCHECK_EQ(MessageLoop::current(), message_loop_); |
97 DCHECK(!playing_); | 97 DCHECK(!playing_); |
98 playing_ = true; | 98 playing_ = true; |
99 | 99 |
100 if (video_ids_.size() > 1) { | 100 if (video_ids_.size() > 1) { |
101 timer_.Start(FROM_HERE, | 101 timer_.Start(base::TimeDelta::FromMilliseconds(kSwitchTimerPeriod), |
102 base::TimeDelta::FromMilliseconds(kSwitchTimerPeriod), | |
103 this, &StreamSwitchManager::OnSwitchTimer); | 102 this, &StreamSwitchManager::OnSwitchTimer); |
104 } | 103 } |
105 } | 104 } |
106 | 105 |
107 void StreamSwitchManager::Pause() { | 106 void StreamSwitchManager::Pause() { |
108 DCHECK_EQ(MessageLoop::current(), message_loop_); | 107 DCHECK_EQ(MessageLoop::current(), message_loop_); |
109 DCHECK(playing_); | 108 DCHECK(playing_); |
110 playing_ = false; | 109 playing_ = false; |
111 timer_.Stop(); | 110 timer_.Stop(); |
112 } | 111 } |
(...skipping 918 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1031 delete cb; | 1030 delete cb; |
1032 return; | 1031 return; |
1033 } | 1032 } |
1034 DemuxerAccumulator* accumulator = new DemuxerAccumulator( | 1033 DemuxerAccumulator* accumulator = new DemuxerAccumulator( |
1035 audio_index, video_index, urls.size(), cb); | 1034 audio_index, video_index, urls.size(), cb); |
1036 for (size_t i = 0; i < urls.size(); ++i) | 1035 for (size_t i = 0; i < urls.size(); ++i) |
1037 delegate_factory_->Build(urls[i], accumulator->GetNthCallback(i)); | 1036 delegate_factory_->Build(urls[i], accumulator->GetNthCallback(i)); |
1038 } | 1037 } |
1039 | 1038 |
1040 } // namespace media | 1039 } // namespace media |
OLD | NEW |