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

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

Issue 1780653002: Revert of MediaStream audio object graph untangling and clean-ups. (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
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 117 matching lines...) Expand 10 before | Expand all | Expand 10 after
128 blink::WebVector<blink::WebMediaStreamTrack> video_tracks, audio_tracks; 128 blink::WebVector<blink::WebMediaStreamTrack> video_tracks, audio_tracks;
129 media_stream_.videoTracks(video_tracks); 129 media_stream_.videoTracks(video_tracks);
130 media_stream_.audioTracks(audio_tracks); 130 media_stream_.audioTracks(audio_tracks);
131 131
132 if (video_tracks.isEmpty() && audio_tracks.isEmpty()) { 132 if (video_tracks.isEmpty() && audio_tracks.isEmpty()) {
133 LOG(WARNING) << __FUNCTION__ << ": no media tracks."; 133 LOG(WARNING) << __FUNCTION__ << ": no media tracks.";
134 return false; 134 return false;
135 } 135 }
136 136
137 const bool use_audio_tracks = 137 const bool use_audio_tracks =
138 !audio_tracks.isEmpty() && MediaStreamAudioTrack::From(audio_tracks[0]); 138 !audio_tracks.isEmpty() &&
139 MediaStreamAudioTrack::GetTrack(audio_tracks[0]);
139 140
140 webm_muxer_.reset(new media::WebmMuxer( 141 webm_muxer_.reset(new media::WebmMuxer(
141 use_vp9_ ? media::kCodecVP9 : media::kCodecVP8, 142 use_vp9_ ? media::kCodecVP9 : media::kCodecVP8,
142 video_tracks.size() > 0, use_audio_tracks, 143 video_tracks.size() > 0, use_audio_tracks,
143 base::Bind(&MediaRecorderHandler::WriteData, 144 base::Bind(&MediaRecorderHandler::WriteData,
144 weak_factory_.GetWeakPtr()))); 145 weak_factory_.GetWeakPtr())));
145 146
146 if (!video_tracks.isEmpty()) { 147 if (!video_tracks.isEmpty()) {
147 // TODO(mcasas): The muxer API supports only one video track. Extend it to 148 // TODO(mcasas): The muxer API supports only one video track. Extend it to
148 // several video tracks, see http://crbug.com/528523. 149 // several video tracks, see http://crbug.com/528523.
(...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after
260 recorder->OnData(audio_bus, timestamp); 261 recorder->OnData(audio_bus, timestamp);
261 } 262 }
262 263
263 void MediaRecorderHandler::SetAudioFormatForTesting( 264 void MediaRecorderHandler::SetAudioFormatForTesting(
264 const media::AudioParameters& params) { 265 const media::AudioParameters& params) {
265 for (auto* recorder : audio_recorders_) 266 for (auto* recorder : audio_recorders_)
266 recorder->OnSetFormat(params); 267 recorder->OnSetFormat(params);
267 } 268 }
268 269
269 } // namespace content 270 } // namespace content
OLDNEW
« no previous file with comments | « content/renderer/media/audio_track_recorder_unittest.cc ('k') | content/renderer/media/media_stream_audio_level_calculator.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698