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

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

Issue 1647773002: MediaStream audio sourcing: Bypass audio processing for non-WebRTC cases. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: NOT FOR REVIEW -- This will be broken-up across multiple CLs. Created 4 years, 10 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() && 138 !audio_tracks.isEmpty() && MediaStreamAudioTrack::Get(audio_tracks[0]);
139 MediaStreamAudioTrack::GetTrack(audio_tracks[0]);
140 139
141 webm_muxer_.reset(new media::WebmMuxer( 140 webm_muxer_.reset(new media::WebmMuxer(
142 use_vp9_ ? media::kCodecVP9 : media::kCodecVP8, 141 use_vp9_ ? media::kCodecVP9 : media::kCodecVP8,
143 video_tracks.size() > 0, use_audio_tracks, 142 video_tracks.size() > 0, use_audio_tracks,
144 base::Bind(&MediaRecorderHandler::WriteData, 143 base::Bind(&MediaRecorderHandler::WriteData,
145 weak_factory_.GetWeakPtr()))); 144 weak_factory_.GetWeakPtr())));
146 145
147 if (!video_tracks.isEmpty()) { 146 if (!video_tracks.isEmpty()) {
148 // TODO(mcasas): The muxer API supports only one video track. Extend it to 147 // TODO(mcasas): The muxer API supports only one video track. Extend it to
149 // several video tracks, see http://crbug.com/528523. 148 // several video tracks, see http://crbug.com/528523.
(...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after
261 recorder->OnData(audio_bus, timestamp); 260 recorder->OnData(audio_bus, timestamp);
262 } 261 }
263 262
264 void MediaRecorderHandler::SetAudioFormatForTesting( 263 void MediaRecorderHandler::SetAudioFormatForTesting(
265 const media::AudioParameters& params) { 264 const media::AudioParameters& params) {
266 for (auto* recorder : audio_recorders_) 265 for (auto* recorder : audio_recorders_)
267 recorder->OnSetFormat(params); 266 recorder->OnSetFormat(params);
268 } 267 }
269 268
270 } // namespace content 269 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698