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

Side by Side Diff: webrtc/modules/audio_mixer/audio_mixer.h

Issue 2111293003: Removed callback between old AudioConferenceMixer and OutputMixer. The audio frame with mixed audio… (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@new_mixer_format
Patch Set: Removed asserts, decreased lock holding time & minor changes. Created 4 years, 5 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
(Empty)
1 /*
2 * Copyright (c) 2016 The WebRTC project authors. All Rights Reserved.
3 *
4 * Use of this source code is governed by a BSD-style license
5 * that can be found in the LICENSE file in the root of the source
6 * tree. An additional intellectual property rights grant can be found
7 * in the file PATENTS. All contributing project authors may
8 * be found in the AUTHORS file in the root of the source tree.
9 */
10
11 #ifndef WEBRTC_MODULES_AUDIO_MIXER_AUDIO_MIXER_H_
12 #define WEBRTC_MODULES_AUDIO_MIXER_AUDIO_MIXER_H_
13
14 #include "webrtc/base/criticalsection.h"
15 #include "webrtc/common_audio/resampler/include/push_resampler.h"
16 #include "webrtc/common_types.h"
17 #include "webrtc/modules/audio_mixer/include/new_audio_conference_mixer.h"
18 #include "webrtc/modules/audio_mixer/include/audio_mixer_defines.h"
19 #include "webrtc/modules/utility/include/file_recorder.h"
20 #include "webrtc/voice_engine/level_indicator.h"
21 #include "webrtc/voice_engine/voice_engine_defines.h"
22
23 namespace webrtc {
24
25 class AudioProcessing;
26 class FileWrapper;
27 class VoEMediaProcess;
28
29 namespace voe {
30 class Statistics;
31
32 // Note: this class is in the process of being rewritten and merged
33 // with AudioConferenceMixer. Expect inheritance chains to be changed,
34 // member functions removed or renamed.
35 class AudioMixer : public FileCallback {
36 public:
37 static int32_t Create(AudioMixer*& mixer, uint32_t instanceId); // NOLINT
38
39 static void Destroy(AudioMixer*& mixer); // NOLINT
40
41 int32_t SetEngineInformation(Statistics& engineStatistics); // NOLINT
42
43 int32_t SetAudioProcessingModule(AudioProcessing* audioProcessingModule);
44
45 // VoEExternalMedia
46 int RegisterExternalMediaProcessing(VoEMediaProcess& // NOLINT
47 proccess_object);
48
49 int DeRegisterExternalMediaProcessing();
50
51 int32_t MixActiveChannels();
52
53 int32_t DoOperationsOnCombinedSignal(bool feed_data_to_apm);
54
55 int32_t SetMixabilityStatus(MixerAudioSource& participant, // NOLINT
56 bool mixable);
57
58 int32_t SetAnonymousMixabilityStatus(MixerAudioSource& participant, // NOLINT
59 bool mixable);
60
61 int GetMixedAudio(int sample_rate_hz,
62 size_t num_channels,
63 AudioFrame* audioFrame);
64
65 // VoEVolumeControl
66 int GetSpeechOutputLevel(uint32_t& level); // NOLINT
67
68 int GetSpeechOutputLevelFullRange(uint32_t& level); // NOLINT
69
70 int SetOutputVolumePan(float left, float right);
71
72 int GetOutputVolumePan(float& left, float& right); // NOLINT
73
74 // VoEFile
75 int StartRecordingPlayout(const char* fileName, const CodecInst* codecInst);
76
77 int StartRecordingPlayout(OutStream* stream, const CodecInst* codecInst);
78 int StopRecordingPlayout();
79
80 virtual ~AudioMixer();
81
82 // For file recording
83 void PlayNotification(int32_t id, uint32_t durationMs);
84
85 void RecordNotification(int32_t id, uint32_t durationMs);
86
87 void PlayFileEnded(int32_t id);
88 void RecordFileEnded(int32_t id);
89
90 private:
91 explicit AudioMixer(uint32_t instanceId);
92
93 // uses
94 Statistics* _engineStatisticsPtr;
95 AudioProcessing* _audioProcessingModulePtr;
96
97 rtc::CriticalSection _callbackCritSect;
98 // protect the _outputFileRecorderPtr and _outputFileRecording
99 rtc::CriticalSection _fileCritSect;
100 NewAudioConferenceMixer& _mixerModule;
101 AudioFrame _audioFrame;
102 // Converts mixed audio to the audio device output rate.
103 PushResampler<int16_t> resampler_;
104 // Converts mixed audio to the audio processing rate.
105 PushResampler<int16_t> audioproc_resampler_;
106 AudioLevel _audioLevel; // measures audio level for the combined signal
107 int _instanceId;
108 VoEMediaProcess* _externalMediaCallbackPtr;
109 bool _externalMedia;
110 float _panLeft;
111 float _panRight;
112 int _mixingFrequencyHz;
113 FileRecorder* _outputFileRecorderPtr;
114 bool _outputFileRecording;
115 };
116
117 } // namespace voe
118
119 } // namespace webrtc
120
121 #endif // WEBRTC_MODULES_AUDIO_MIXER_AUDIO_MIXER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698