OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 "content/renderer/media/media_recorder_handler.h" | 5 #include "content/renderer/media/media_recorder_handler.h" |
6 | 6 |
7 #include <utility> | 7 #include <utility> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/location.h" | 10 #include "base/location.h" |
(...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
133 | 133 |
134 media_stream_ = media_stream; | 134 media_stream_ = media_stream; |
135 DCHECK(client); | 135 DCHECK(client); |
136 client_ = client; | 136 client_ = client; |
137 | 137 |
138 audio_bits_per_second_ = audio_bits_per_second; | 138 audio_bits_per_second_ = audio_bits_per_second; |
139 video_bits_per_second_ = video_bits_per_second; | 139 video_bits_per_second_ = video_bits_per_second; |
140 return true; | 140 return true; |
141 } | 141 } |
142 | 142 |
143 bool MediaRecorderHandler::start() { | |
144 DCHECK(main_render_thread_checker_.CalledOnValidThread()); | |
145 DCHECK(!recording_); | |
146 return start(0); | |
147 } | |
148 | |
149 bool MediaRecorderHandler::start(int timeslice) { | 143 bool MediaRecorderHandler::start(int timeslice) { |
150 DCHECK(main_render_thread_checker_.CalledOnValidThread()); | 144 DCHECK(main_render_thread_checker_.CalledOnValidThread()); |
151 DCHECK(!recording_); | 145 DCHECK(!recording_); |
152 DCHECK(!media_stream_.isNull()); | 146 DCHECK(!media_stream_.isNull()); |
153 DCHECK(timeslice_.is_zero()); | 147 DCHECK(timeslice_.is_zero()); |
154 DCHECK(!webm_muxer_); | 148 DCHECK(!webm_muxer_); |
155 | 149 |
156 timeslice_ = TimeDelta::FromMilliseconds(timeslice); | 150 timeslice_ = TimeDelta::FromMilliseconds(timeslice); |
157 slice_origin_timestamp_ = TimeTicks::Now(); | 151 slice_origin_timestamp_ = TimeTicks::Now(); |
158 | 152 |
(...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
309 recorder->OnData(audio_bus, timestamp); | 303 recorder->OnData(audio_bus, timestamp); |
310 } | 304 } |
311 | 305 |
312 void MediaRecorderHandler::SetAudioFormatForTesting( | 306 void MediaRecorderHandler::SetAudioFormatForTesting( |
313 const media::AudioParameters& params) { | 307 const media::AudioParameters& params) { |
314 for (const auto& recorder : audio_recorders_) | 308 for (const auto& recorder : audio_recorders_) |
315 recorder->OnSetFormat(params); | 309 recorder->OnSetFormat(params); |
316 } | 310 } |
317 | 311 |
318 } // namespace content | 312 } // namespace content |
OLD | NEW |