aboutsummaryrefslogtreecommitdiff
path: root/webrtc/modules/audio_conference_mixer/interface/audio_conference_mixer_defines.h
diff options
context:
space:
mode:
authorandrew@webrtc.org <andrew@webrtc.org@4adac7df-926f-26a2-2b94-8c16560cd09d>2012-10-22 18:19:23 +0000
committerandrew@webrtc.org <andrew@webrtc.org@4adac7df-926f-26a2-2b94-8c16560cd09d>2012-10-22 18:19:23 +0000
commit14b43beb7ce4440b30dcea31196de5b4a529cb6b (patch)
tree7084ca9d70956417df0bd953736203704b88644e /webrtc/modules/audio_conference_mixer/interface/audio_conference_mixer_defines.h
parent24a419c0c755dea56933cd81fd88d2d334fd7565 (diff)
downloadwebrtc-14b43beb7ce4440b30dcea31196de5b4a529cb6b.tar.gz
Move src/ -> webrtc/
TBR=niklas.enbom@webrtc.org Review URL: https://webrtc-codereview.appspot.com/915006 git-svn-id: http://webrtc.googlecode.com/svn/trunk@2963 4adac7df-926f-26a2-2b94-8c16560cd09d
Diffstat (limited to 'webrtc/modules/audio_conference_mixer/interface/audio_conference_mixer_defines.h')
-rw-r--r--webrtc/modules/audio_conference_mixer/interface/audio_conference_mixer_defines.h106
1 files changed, 106 insertions, 0 deletions
diff --git a/webrtc/modules/audio_conference_mixer/interface/audio_conference_mixer_defines.h b/webrtc/modules/audio_conference_mixer/interface/audio_conference_mixer_defines.h
new file mode 100644
index 0000000000..718470deb8
--- /dev/null
+++ b/webrtc/modules/audio_conference_mixer/interface/audio_conference_mixer_defines.h
@@ -0,0 +1,106 @@
+/*
+ * Copyright (c) 2011 The WebRTC project authors. All Rights Reserved.
+ *
+ * Use of this source code is governed by a BSD-style license
+ * that can be found in the LICENSE file in the root of the source
+ * tree. An additional intellectual property rights grant can be found
+ * in the file PATENTS. All contributing project authors may
+ * be found in the AUTHORS file in the root of the source tree.
+ */
+
+#ifndef WEBRTC_MODULES_AUDIO_CONFERENCE_MIXER_INTERFACE_AUDIO_CONFERENCE_MIXER_DEFINES_H_
+#define WEBRTC_MODULES_AUDIO_CONFERENCE_MIXER_INTERFACE_AUDIO_CONFERENCE_MIXER_DEFINES_H_
+
+#include "map_wrapper.h"
+#include "module_common_types.h"
+#include "typedefs.h"
+
+namespace webrtc {
+class MixHistory;
+
+// A callback class that all mixer participants must inherit from/implement.
+class MixerParticipant
+{
+public:
+ // The implementation of this function should update audioFrame with new
+ // audio every time it's called.
+ //
+ // If it returns -1, the frame will not be added to the mix.
+ virtual WebRtc_Word32 GetAudioFrame(const WebRtc_Word32 id,
+ AudioFrame& audioFrame) = 0;
+
+ // mixed will be set to true if the participant was mixed this mix iteration
+ WebRtc_Word32 IsMixed(bool& mixed) const;
+
+ // This function specifies the sampling frequency needed for the AudioFrame
+ // for future GetAudioFrame(..) calls.
+ virtual WebRtc_Word32 NeededFrequency(const WebRtc_Word32 id) = 0;
+
+ MixHistory* _mixHistory;
+protected:
+ MixerParticipant();
+ virtual ~MixerParticipant();
+};
+
+// Container struct for participant statistics.
+struct ParticipantStatistics
+{
+ WebRtc_Word32 participant;
+ WebRtc_Word32 level;
+};
+
+class AudioMixerStatusReceiver
+{
+public:
+ // Callback function that provides an array of ParticipantStatistics for the
+ // participants that were mixed last mix iteration.
+ virtual void MixedParticipants(
+ const WebRtc_Word32 id,
+ const ParticipantStatistics* participantStatistics,
+ const WebRtc_UWord32 size) = 0;
+ // Callback function that provides an array of the ParticipantStatistics for
+ // the participants that had a positiv VAD last mix iteration.
+ virtual void VADPositiveParticipants(
+ const WebRtc_Word32 id,
+ const ParticipantStatistics* participantStatistics,
+ const WebRtc_UWord32 size) = 0;
+ // Callback function that provides the audio level of the mixed audio frame
+ // from the last mix iteration.
+ virtual void MixedAudioLevel(
+ const WebRtc_Word32 id,
+ const WebRtc_UWord32 level) = 0;
+protected:
+ AudioMixerStatusReceiver() {}
+ virtual ~AudioMixerStatusReceiver() {}
+};
+
+class AudioMixerOutputReceiver
+{
+public:
+ // This callback function provides the mixed audio for this mix iteration.
+ // Note that uniqueAudioFrames is an array of AudioFrame pointers with the
+ // size according to the size parameter.
+ virtual void NewMixedAudio(const WebRtc_Word32 id,
+ const AudioFrame& generalAudioFrame,
+ const AudioFrame** uniqueAudioFrames,
+ const WebRtc_UWord32 size) = 0;
+protected:
+ AudioMixerOutputReceiver() {}
+ virtual ~AudioMixerOutputReceiver() {}
+};
+
+class AudioRelayReceiver
+{
+public:
+ // This callback function provides the mix decision for this mix iteration.
+ // mixerList is a list of elements of the type
+ // [int,MixerParticipant*]
+ virtual void NewAudioToRelay(const WebRtc_Word32 id,
+ const MapWrapper& mixerList) = 0;
+protected:
+ AudioRelayReceiver() {}
+ virtual ~AudioRelayReceiver() {}
+};
+} // namespace webrtc
+
+#endif // WEBRTC_MODULES_AUDIO_CONFERENCE_MIXER_INTERFACE_AUDIO_CONFERENCE_MIXER_DEFINES_H_