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

Side by Side 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 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_AUDIO_AUDIO_TRANSPORT_PROXY_H_
12 #define WEBRTC_AUDIO_AUDIO_TRANSPORT_PROXY_H_
13
14 #include "webrtc/api/audio/audio_mixer.h"
15 #include "webrtc/base/constructormagic.h"
16 #include "webrtc/modules/audio_device/include/audio_device_defines.h"
17 #include "webrtc/modules/audio_processing/include/audio_processing.h"
18
19 namespace webrtc {
20
21 class AudioTransportProxy : public AudioTransport {
22 public:
23 AudioTransportProxy(AudioTransport* voe_audio_transport,
24 AudioProcessing* apm,
25 AudioMixer* mixer)
26 : 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
27 RTC_DCHECK(voe_audio_transport);
28 RTC_DCHECK(apm);
29 }
30
31 ~AudioTransportProxy() override {}
32
33 int32_t RecordedDataIsAvailable(const void* audioSamples,
34 const size_t nSamples,
35 const size_t nBytesPerSample,
36 const size_t nChannels,
37 const uint32_t samplesPerSec,
38 const uint32_t totalDelayMS,
39 const int32_t clockDrift,
40 const uint32_t currentMicLevel,
41 const bool keyPressed,
42 uint32_t& newMicLevel) override {
43 // Pass call through to original audio transport instance.
44 return voe_audio_transport_->RecordedDataIsAvailable(
the sun 2016/11/14 13:50:09 Move to .cc
aleloi 2016/11/14 14:24:42 Done.
45 audioSamples, nSamples, nBytesPerSample, nChannels, samplesPerSec,
46 totalDelayMS, clockDrift, currentMicLevel, keyPressed, newMicLevel);
47 }
48
49 int32_t NeedMorePlayData(const size_t nSamples,
50 const size_t nBytesPerSample,
51 const size_t nChannels,
52 const uint32_t samplesPerSec,
53 void* audioSamples,
54 size_t& nSamplesOut,
55 int64_t* elapsed_time_ms,
56 int64_t* ntp_time_ms) override;
57
58 void PushCaptureData(int voe_channel,
59 const void* audio_data,
60 int bits_per_sample,
61 int sample_rate,
62 size_t number_of_channels,
63 size_t number_of_frames) override {
64 // This is part of deprecated VoE interface operating on specific
65 // VoE channels. It should not be used.
66 RTC_NOTREACHED();
the sun 2016/11/14 13:50:08 Here as well
aleloi 2016/11/14 14:24:43 Done.
67 }
68
69 void PullRenderData(int bits_per_sample,
70 int sample_rate,
71 size_t number_of_channels,
72 size_t number_of_frames,
73 void* audio_data,
74 int64_t* elapsed_time_ms,
75 int64_t* ntp_time_ms) override;
76
77 private:
78 AudioTransport* voe_audio_transport_;
79 AudioFrame frame_for_mixing_;
80
81 RTC_DISALLOW_IMPLICIT_CONSTRUCTORS(AudioTransportProxy);
82 };
83 } // namespace webrtc
84
85 #endif // WEBRTC_AUDIO_AUDIO_TRANSPORT_PROXY_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698