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

Unified Diff: webrtc/audio/audio_transport_proxy.h

Issue 2454373002: Added an empty AudioTransportProxy to AudioState. (Closed)
Patch Set: Added unit test for recorded data path. Created 4 years, 1 month 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
Index: webrtc/audio/audio_transport_proxy.h
diff --git a/webrtc/audio/audio_transport_proxy.h b/webrtc/audio/audio_transport_proxy.h
new file mode 100644
index 0000000000000000000000000000000000000000..730f50186e2324943d5090c43d7ca0f1c704baea
--- /dev/null
+++ b/webrtc/audio/audio_transport_proxy.h
@@ -0,0 +1,85 @@
+/*
+ * Copyright (c) 2016 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_AUDIO_AUDIO_TRANSPORT_PROXY_H_
+#define WEBRTC_AUDIO_AUDIO_TRANSPORT_PROXY_H_
+
+#include "webrtc/api/audio/audio_mixer.h"
+#include "webrtc/base/constructormagic.h"
+#include "webrtc/modules/audio_device/include/audio_device_defines.h"
+#include "webrtc/modules/audio_processing/include/audio_processing.h"
+
+namespace webrtc {
+
+class AudioTransportProxy : public AudioTransport {
+ public:
+ AudioTransportProxy(AudioTransport* voe_audio_transport,
+ AudioProcessing* apm,
+ AudioMixer* mixer)
+ : voe_audio_transport_(voe_audio_transport) {
the sun 2016/11/14 13:50:09 Move to .cc
aleloi 2016/11/14 14:24:43 For clarity to have all defs in the same place? (D
+ RTC_DCHECK(voe_audio_transport);
+ RTC_DCHECK(apm);
+ }
+
+ ~AudioTransportProxy() override {}
+
+ int32_t RecordedDataIsAvailable(const void* audioSamples,
+ const size_t nSamples,
+ const size_t nBytesPerSample,
+ const size_t nChannels,
+ const uint32_t samplesPerSec,
+ const uint32_t totalDelayMS,
+ const int32_t clockDrift,
+ const uint32_t currentMicLevel,
+ const bool keyPressed,
+ uint32_t& newMicLevel) override {
+ // Pass call through to original audio transport instance.
+ return voe_audio_transport_->RecordedDataIsAvailable(
the sun 2016/11/14 13:50:09 Move to .cc
aleloi 2016/11/14 14:24:42 Done.
+ audioSamples, nSamples, nBytesPerSample, nChannels, samplesPerSec,
+ totalDelayMS, clockDrift, currentMicLevel, keyPressed, newMicLevel);
+ }
+
+ int32_t NeedMorePlayData(const size_t nSamples,
+ const size_t nBytesPerSample,
+ const size_t nChannels,
+ const uint32_t samplesPerSec,
+ void* audioSamples,
+ size_t& nSamplesOut,
+ int64_t* elapsed_time_ms,
+ int64_t* ntp_time_ms) override;
+
+ void PushCaptureData(int voe_channel,
+ const void* audio_data,
+ int bits_per_sample,
+ int sample_rate,
+ size_t number_of_channels,
+ size_t number_of_frames) override {
+ // This is part of deprecated VoE interface operating on specific
+ // VoE channels. It should not be used.
+ RTC_NOTREACHED();
the sun 2016/11/14 13:50:08 Here as well
aleloi 2016/11/14 14:24:43 Done.
+ }
+
+ void PullRenderData(int bits_per_sample,
+ int sample_rate,
+ size_t number_of_channels,
+ size_t number_of_frames,
+ void* audio_data,
+ int64_t* elapsed_time_ms,
+ int64_t* ntp_time_ms) override;
+
+ private:
+ AudioTransport* voe_audio_transport_;
+ AudioFrame frame_for_mixing_;
+
+ RTC_DISALLOW_IMPLICIT_CONSTRUCTORS(AudioTransportProxy);
+};
+} // namespace webrtc
+
+#endif // WEBRTC_AUDIO_AUDIO_TRANSPORT_PROXY_H_

Powered by Google App Engine
This is Rietveld 408576698