Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(196)

Side by Side Diff: content/renderer/media/media_recorder_handler.cc

Issue 2444153002: MediaRecorder: bugfix start() means buffer-forever (Closed)
Patch Set: s/start(1)/start(0)/ Created 4 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « content/renderer/media/media_recorder_handler.h ('k') | content/renderer/media/media_recorder_handler_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698