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

Unified Diff: webrtc/modules/audio_mixer/audio_frame_manipulator.cc

Issue 2396803004: Moved MixerAudioSource and removed audio_mixer_defines.h. (Closed)
Patch Set: Renamed AudioFrameWithMuted to AudioFrameWithInfo and changed RemixFrame argument order. Created 4 years, 2 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « webrtc/modules/audio_mixer/audio_frame_manipulator.h ('k') | webrtc/modules/audio_mixer/audio_mixer.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/modules/audio_mixer/audio_frame_manipulator.cc
diff --git a/webrtc/modules/audio_mixer/audio_frame_manipulator.cc b/webrtc/modules/audio_mixer/audio_frame_manipulator.cc
index 7ced9e29fa9e1c522c0c2de0cb3a1a9e990ec386..8678dda6ca9836757bcd23085b336423ea167491 100644
--- a/webrtc/modules/audio_mixer/audio_frame_manipulator.cc
+++ b/webrtc/modules/audio_mixer/audio_frame_manipulator.cc
@@ -8,8 +8,10 @@
* be found in the AUTHORS file in the root of the source tree.
*/
+#include "webrtc/base/checks.h"
#include "webrtc/modules/audio_mixer/audio_frame_manipulator.h"
#include "webrtc/modules/include/module_common_types.h"
+#include "webrtc/modules/utility/include/audio_frame_operations.h"
#include "webrtc/typedefs.h"
namespace webrtc {
@@ -59,4 +61,15 @@ void NewMixerRampOut(AudioFrame* audio_frame) {
(audio_frame->samples_per_channel_ - kRampSize) *
sizeof(audio_frame->data_[0]));
}
+
+void RemixFrame(size_t target_number_of_channels, AudioFrame* frame) {
+ RTC_DCHECK_GE(target_number_of_channels, static_cast<size_t>(1));
+ RTC_DCHECK_LE(target_number_of_channels, static_cast<size_t>(2));
+ if (frame->num_channels_ == 1 && target_number_of_channels == 2) {
+ AudioFrameOperations::MonoToStereo(frame);
+ } else if (frame->num_channels_ == 2 && target_number_of_channels == 1) {
+ AudioFrameOperations::StereoToMono(frame);
+ }
+}
+
} // namespace webrtc
« no previous file with comments | « webrtc/modules/audio_mixer/audio_frame_manipulator.h ('k') | webrtc/modules/audio_mixer/audio_mixer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698