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

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

Issue 1830383003: WebmMuxer: add Pause()/Resume() methods and internal time-in-pause (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 9 months 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
« no previous file with comments | « content/renderer/media/audio_track_recorder.cc ('k') | media/muxers/webm_muxer.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 191 matching lines...) Expand 10 before | Expand all | Expand 10 after
202 } 202 }
203 203
204 void MediaRecorderHandler::pause() { 204 void MediaRecorderHandler::pause() {
205 DCHECK(main_render_thread_checker_.CalledOnValidThread()); 205 DCHECK(main_render_thread_checker_.CalledOnValidThread());
206 DCHECK(recording_); 206 DCHECK(recording_);
207 recording_ = false; 207 recording_ = false;
208 for (const auto& video_recorder : video_recorders_) 208 for (const auto& video_recorder : video_recorders_)
209 video_recorder->Pause(); 209 video_recorder->Pause();
210 for (const auto& audio_recorder : audio_recorders_) 210 for (const auto& audio_recorder : audio_recorders_)
211 audio_recorder->Pause(); 211 audio_recorder->Pause();
212 webm_muxer_->Pause();
212 } 213 }
213 214
214 void MediaRecorderHandler::resume() { 215 void MediaRecorderHandler::resume() {
215 DCHECK(main_render_thread_checker_.CalledOnValidThread()); 216 DCHECK(main_render_thread_checker_.CalledOnValidThread());
216 DCHECK(!recording_); 217 DCHECK(!recording_);
217 recording_ = true; 218 recording_ = true;
218 for (const auto& video_recorder : video_recorders_) 219 for (const auto& video_recorder : video_recorders_)
219 video_recorder->Resume(); 220 video_recorder->Resume();
220 for (const auto& audio_recorder : audio_recorders_) 221 for (const auto& audio_recorder : audio_recorders_)
221 audio_recorder->Resume(); 222 audio_recorder->Resume();
223 webm_muxer_->Resume();
222 } 224 }
223 225
224 void MediaRecorderHandler::OnEncodedVideo( 226 void MediaRecorderHandler::OnEncodedVideo(
225 const scoped_refptr<media::VideoFrame>& video_frame, 227 const scoped_refptr<media::VideoFrame>& video_frame,
226 scoped_ptr<std::string> encoded_data, 228 scoped_ptr<std::string> encoded_data,
227 TimeTicks timestamp, 229 TimeTicks timestamp,
228 bool is_key_frame) { 230 bool is_key_frame) {
229 DCHECK(main_render_thread_checker_.CalledOnValidThread()); 231 DCHECK(main_render_thread_checker_.CalledOnValidThread());
230 if (!webm_muxer_) 232 if (!webm_muxer_)
231 return; 233 return;
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
271 recorder->OnData(audio_bus, timestamp); 273 recorder->OnData(audio_bus, timestamp);
272 } 274 }
273 275
274 void MediaRecorderHandler::SetAudioFormatForTesting( 276 void MediaRecorderHandler::SetAudioFormatForTesting(
275 const media::AudioParameters& params) { 277 const media::AudioParameters& params) {
276 for (auto* recorder : audio_recorders_) 278 for (auto* recorder : audio_recorders_)
277 recorder->OnSetFormat(params); 279 recorder->OnSetFormat(params);
278 } 280 }
279 281
280 } // namespace content 282 } // namespace content
OLDNEW
« no previous file with comments | « content/renderer/media/audio_track_recorder.cc ('k') | media/muxers/webm_muxer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698