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

Side by Side Diff: webrtc/audio/audio_receive_stream.h

Issue 2709723003: Initial implementation of RtpTransportControllerReceive and related interfaces.
Patch Set: Fix audio. Created 3 years, 8 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
1 /* 1 /*
2 * Copyright (c) 2015 The WebRTC project authors. All Rights Reserved. 2 * Copyright (c) 2015 The WebRTC project authors. All Rights Reserved.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license 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 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 6 * tree. An additional intellectual property rights grant can be found
7 * in the file PATENTS. All contributing project authors may 7 * in the file PATENTS. All contributing project authors may
8 * be found in the AUTHORS file in the root of the source tree. 8 * be found in the AUTHORS file in the root of the source tree.
9 */ 9 */
10 10
11 #ifndef WEBRTC_AUDIO_AUDIO_RECEIVE_STREAM_H_ 11 #ifndef WEBRTC_AUDIO_AUDIO_RECEIVE_STREAM_H_
12 #define WEBRTC_AUDIO_AUDIO_RECEIVE_STREAM_H_ 12 #define WEBRTC_AUDIO_AUDIO_RECEIVE_STREAM_H_
13 13
14 #include <memory> 14 #include <memory>
15 15
16 #include "webrtc/api/audio/audio_mixer.h" 16 #include "webrtc/api/audio/audio_mixer.h"
17 #include "webrtc/audio/audio_state.h" 17 #include "webrtc/audio/audio_state.h"
18 #include "webrtc/base/constructormagic.h" 18 #include "webrtc/base/constructormagic.h"
19 #include "webrtc/base/thread_checker.h" 19 #include "webrtc/base/thread_checker.h"
20 #include "webrtc/call/audio_receive_stream.h" 20 #include "webrtc/call/audio_receive_stream.h"
21 #include "webrtc/call/rtp_transport_controller_receive.h"
21 #include "webrtc/call/syncable.h" 22 #include "webrtc/call/syncable.h"
23 #include "webrtc/modules/rtp_rtcp/source/rtp_header_extension.h"
24 #include "webrtc/modules/rtp_rtcp/source/rtp_packet_received.h"
the sun 2017/04/18 09:59:00 We only need forward decl here.
nisse-webrtc 2017/04/19 08:35:43 Done.
22 25
23 namespace webrtc { 26 namespace webrtc {
24 class PacketRouter; 27 class PacketRouter;
25 class RtcEventLog; 28 class RtcEventLog;
26 class RtpPacketReceived; 29 class RtpPacketReceived;
27 30
28 namespace voe { 31 namespace voe {
29 class ChannelProxy; 32 class ChannelProxy;
30 } // namespace voe 33 } // namespace voe
31 34
32 namespace internal { 35 namespace internal {
33 class AudioSendStream; 36 class AudioSendStream;
34 37
35 class AudioReceiveStream final : public webrtc::AudioReceiveStream, 38 class AudioReceiveStream final : public webrtc::RtpPacketReceiverInterface,
39 public webrtc::AudioReceiveStream,
36 public AudioMixer::Source, 40 public AudioMixer::Source,
37 public Syncable { 41 public Syncable {
38 public: 42 public:
39 AudioReceiveStream(PacketRouter* packet_router, 43 AudioReceiveStream(PacketRouter* packet_router,
40 const webrtc::AudioReceiveStream::Config& config, 44 const webrtc::AudioReceiveStream::Config& config,
41 const rtc::scoped_refptr<webrtc::AudioState>& audio_state, 45 const rtc::scoped_refptr<webrtc::AudioState>& audio_state,
42 webrtc::RtcEventLog* event_log); 46 webrtc::RtcEventLog* event_log);
43 ~AudioReceiveStream() override; 47 ~AudioReceiveStream() override;
44 48
45 // webrtc::AudioReceiveStream implementation. 49 // webrtc::AudioReceiveStream implementation.
46 void Start() override; 50 void Start() override;
47 void Stop() override; 51 void Stop() override;
48 webrtc::AudioReceiveStream::Stats GetStats() const override; 52 webrtc::AudioReceiveStream::Stats GetStats() const override;
49 int GetOutputLevel() const override; 53 int GetOutputLevel() const override;
50 void SetSink(std::unique_ptr<AudioSinkInterface> sink) override; 54 void SetSink(std::unique_ptr<AudioSinkInterface> sink) override;
51 void SetGain(float gain) override; 55 void SetGain(float gain) override;
52 56
53 // TODO(nisse): Intended to be part of an RtpPacketReceiver interface. 57 // webrtc::RtpPacketReceiverInterface implementation
54 void OnRtpPacket(const RtpPacketReceived& packet); 58 bool OnRtpPacketReceive(RtpPacketReceived* packet) override;
55 59
56 // AudioMixer::Source 60 // AudioMixer::Source
57 AudioFrameInfo GetAudioFrameWithInfo(int sample_rate_hz, 61 AudioFrameInfo GetAudioFrameWithInfo(int sample_rate_hz,
58 AudioFrame* audio_frame) override; 62 AudioFrame* audio_frame) override;
59 int Ssrc() const override; 63 int Ssrc() const override;
60 int PreferredSampleRate() const override; 64 int PreferredSampleRate() const override;
61 65
62 // Syncable 66 // Syncable
63 int id() const override; 67 int id() const override;
64 rtc::Optional<Syncable::Info> GetInfo() const override; 68 rtc::Optional<Syncable::Info> GetInfo() const override;
65 uint32_t GetPlayoutTimestamp() const override; 69 uint32_t GetPlayoutTimestamp() const override;
66 void SetMinimumPlayoutDelay(int delay_ms) override; 70 void SetMinimumPlayoutDelay(int delay_ms) override;
67 71
68 void AssociateSendStream(AudioSendStream* send_stream); 72 void AssociateSendStream(AudioSendStream* send_stream);
69 void SignalNetworkState(NetworkState state); 73 void SignalNetworkState(NetworkState state);
70 bool DeliverRtcp(const uint8_t* packet, size_t length); 74 bool DeliverRtcp(const uint8_t* packet, size_t length);
71 const webrtc::AudioReceiveStream::Config& config() const; 75 const webrtc::AudioReceiveStream::Config& config() const;
72 76
73 private: 77 private:
74 VoiceEngine* voice_engine() const; 78 VoiceEngine* voice_engine() const;
75 AudioState* audio_state() const; 79 AudioState* audio_state() const;
76 int SetVoiceEnginePlayout(bool playout); 80 int SetVoiceEnginePlayout(bool playout);
77 81
78 rtc::ThreadChecker worker_thread_checker_; 82 rtc::ThreadChecker worker_thread_checker_;
79 rtc::ThreadChecker module_process_thread_checker_; 83 rtc::ThreadChecker module_process_thread_checker_;
80 const webrtc::AudioReceiveStream::Config config_; 84 const webrtc::AudioReceiveStream::Config config_;
85 RtpHeaderExtensionMap rtp_header_extensions_;
86
81 rtc::scoped_refptr<webrtc::AudioState> audio_state_; 87 rtc::scoped_refptr<webrtc::AudioState> audio_state_;
82 std::unique_ptr<voe::ChannelProxy> channel_proxy_; 88 std::unique_ptr<voe::ChannelProxy> channel_proxy_;
83 89
84 bool playing_ ACCESS_ON(worker_thread_checker_) = false; 90 bool playing_ ACCESS_ON(worker_thread_checker_) = false;
85 91
86 RTC_DISALLOW_IMPLICIT_CONSTRUCTORS(AudioReceiveStream); 92 RTC_DISALLOW_IMPLICIT_CONSTRUCTORS(AudioReceiveStream);
87 }; 93 };
88 } // namespace internal 94 } // namespace internal
89 } // namespace webrtc 95 } // namespace webrtc
90 96
91 #endif // WEBRTC_AUDIO_AUDIO_RECEIVE_STREAM_H_ 97 #endif // WEBRTC_AUDIO_AUDIO_RECEIVE_STREAM_H_
OLDNEW
« no previous file with comments | « no previous file | webrtc/audio/audio_receive_stream.cc » ('j') | webrtc/audio/audio_receive_stream.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698