Index: content/renderer/media/media_recorder_handler.cc |
diff --git a/content/renderer/media/media_recorder_handler.cc b/content/renderer/media/media_recorder_handler.cc |
index d6ef60c9f080883c500f98216cf5fdfab57a9d85..9acc9ec38c680642aec1401806daf9dca0e18404 100644 |
--- a/content/renderer/media/media_recorder_handler.cc |
+++ b/content/renderer/media/media_recorder_handler.cc |
@@ -76,22 +76,20 @@ bool MediaRecorderHandler::start(int timeslice) { |
LOG(WARNING) << "Recording no video tracks is not implemented"; |
return false; |
} |
- // TODO(mcasas): The muxer API supports only one video track. Extend it to |
- // several video tracks, see http://crbug.com/528523. |
- LOG_IF(WARNING, video_tracks.size() > 1u) << "Recording multiple video" |
- << " tracks is not implemented. Only recording first video track."; |
- const blink::WebMediaStreamTrack& video_track = video_tracks[0]; |
- if (video_track.isNull()) |
- return false; |
- |
- const VideoTrackRecorder::OnEncodedVideoCB on_encoded_video_cb = |
- media::BindToCurrentLoop(base::Bind(&MediaRecorderHandler::OnEncodedVideo, |
- weak_factory_.GetWeakPtr())); |
- video_recorders_.push_back(new VideoTrackRecorder(video_track, |
- on_encoded_video_cb)); |
+ for (const blink::WebMediaStreamTrack& video_track : video_tracks) { |
+ if (video_track.isNull()) { |
+ LOG(WARNING) << "|video_track| is null"; |
+ continue; |
+ } |
+ |
+ const VideoTrackRecorder::OnEncodedVideoCB on_encoded_video_cb = |
+ media::BindToCurrentLoop(webm_muxer_->GenerateOnEncodedVideoCallback()); |
+ video_recorders_.push_back( |
+ new VideoTrackRecorder(video_track, on_encoded_video_cb)); |
+ recording_ = true; |
+ } |
- recording_ = true; |
return true; |
} |
@@ -118,18 +116,6 @@ void MediaRecorderHandler::resume() { |
NOTIMPLEMENTED(); |
} |
-void MediaRecorderHandler::OnEncodedVideo( |
- const scoped_refptr<media::VideoFrame>& video_frame, |
- scoped_ptr<std::string> encoded_data, |
- base::TimeTicks timestamp, |
- bool is_key_frame) { |
- DCHECK(main_render_thread_checker_.CalledOnValidThread()); |
- if (webm_muxer_) { |
- webm_muxer_->OnEncodedVideo(video_frame, encoded_data.Pass(), timestamp, |
- is_key_frame); |
- } |
-} |
- |
void MediaRecorderHandler::WriteData(base::StringPiece data) { |
DCHECK(main_render_thread_checker_.CalledOnValidThread()); |
client_->writeData(data.data(), data.length(), false /* lastInSlice */); |