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

Side by Side Diff: talk/media/webrtc/webrtcvoe.h

Issue 1505253004: Support for remote audio into tracks (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Change when we fire callbacks for external media Created 5 years 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 * libjingle 2 * libjingle
3 * Copyright 2004 Google Inc. 3 * Copyright 2004 Google Inc.
4 * 4 *
5 * Redistribution and use in source and binary forms, with or without 5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are met: 6 * modification, are permitted provided that the following conditions are met:
7 * 7 *
8 * 1. Redistributions of source code must retain the above copyright notice, 8 * 1. Redistributions of source code must retain the above copyright notice,
9 * this list of conditions and the following disclaimer. 9 * this list of conditions and the following disclaimer.
10 * 2. Redistributions in binary form must reproduce the above copyright notice, 10 * 2. Redistributions in binary form must reproduce the above copyright notice,
(...skipping 19 matching lines...) Expand all
30 30
31 #include "talk/media/webrtc/webrtccommon.h" 31 #include "talk/media/webrtc/webrtccommon.h"
32 #include "webrtc/base/common.h" 32 #include "webrtc/base/common.h"
33 33
34 #include "webrtc/common_types.h" 34 #include "webrtc/common_types.h"
35 #include "webrtc/modules/audio_device/include/audio_device.h" 35 #include "webrtc/modules/audio_device/include/audio_device.h"
36 #include "webrtc/voice_engine/include/voe_audio_processing.h" 36 #include "webrtc/voice_engine/include/voe_audio_processing.h"
37 #include "webrtc/voice_engine/include/voe_base.h" 37 #include "webrtc/voice_engine/include/voe_base.h"
38 #include "webrtc/voice_engine/include/voe_codec.h" 38 #include "webrtc/voice_engine/include/voe_codec.h"
39 #include "webrtc/voice_engine/include/voe_errors.h" 39 #include "webrtc/voice_engine/include/voe_errors.h"
40 #include "webrtc/voice_engine/include/voe_external_media.h"
40 #include "webrtc/voice_engine/include/voe_hardware.h" 41 #include "webrtc/voice_engine/include/voe_hardware.h"
41 #include "webrtc/voice_engine/include/voe_network.h" 42 #include "webrtc/voice_engine/include/voe_network.h"
42 #include "webrtc/voice_engine/include/voe_rtp_rtcp.h" 43 #include "webrtc/voice_engine/include/voe_rtp_rtcp.h"
43 #include "webrtc/voice_engine/include/voe_volume_control.h" 44 #include "webrtc/voice_engine/include/voe_volume_control.h"
44 45
45 namespace cricket { 46 namespace cricket {
46 // automatically handles lifetime of WebRtc VoiceEngine 47 // automatically handles lifetime of WebRtc VoiceEngine
47 class scoped_voe_engine { 48 class scoped_voe_engine {
48 public: 49 public:
49 explicit scoped_voe_engine(webrtc::VoiceEngine* e) : ptr(e) {} 50 explicit scoped_voe_engine(webrtc::VoiceEngine* e) : ptr(e) {}
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
82 83
83 private: 84 private:
84 T* ptr; 85 T* ptr;
85 }; 86 };
86 87
87 // Utility class for aggregating the various WebRTC interface. 88 // Utility class for aggregating the various WebRTC interface.
88 // Fake implementations can also be injected for testing. 89 // Fake implementations can also be injected for testing.
89 class VoEWrapper { 90 class VoEWrapper {
90 public: 91 public:
91 VoEWrapper() 92 VoEWrapper()
92 : engine_(webrtc::VoiceEngine::Create()), processing_(engine_), 93 : engine_(webrtc::VoiceEngine::Create()),
93 base_(engine_), codec_(engine_), 94 processing_(engine_),
94 hw_(engine_), network_(engine_), 95 base_(engine_),
95 rtp_(engine_), volume_(engine_) { 96 codec_(engine_),
96 } 97 hw_(engine_),
98 network_(engine_),
99 rtp_(engine_),
100 volume_(engine_),
101 external_media_(engine_) {}
the sun 2015/12/10 12:36:32 I'm working towards deprecating the old VoE interf
97 VoEWrapper(webrtc::VoEAudioProcessing* processing, 102 VoEWrapper(webrtc::VoEAudioProcessing* processing,
98 webrtc::VoEBase* base, 103 webrtc::VoEBase* base,
99 webrtc::VoECodec* codec, 104 webrtc::VoECodec* codec,
100 webrtc::VoEHardware* hw, 105 webrtc::VoEHardware* hw,
101 webrtc::VoENetwork* network, 106 webrtc::VoENetwork* network,
102 webrtc::VoERTP_RTCP* rtp, 107 webrtc::VoERTP_RTCP* rtp,
103 webrtc::VoEVolumeControl* volume) 108 webrtc::VoEVolumeControl* volume,
109 webrtc::VoEExternalMedia* external_media)
104 : engine_(NULL), 110 : engine_(NULL),
105 processing_(processing), 111 processing_(processing),
106 base_(base), 112 base_(base),
107 codec_(codec), 113 codec_(codec),
108 hw_(hw), 114 hw_(hw),
109 network_(network), 115 network_(network),
110 rtp_(rtp), 116 rtp_(rtp),
111 volume_(volume) { 117 volume_(volume),
112 } 118 external_media_(external_media) {}
113 ~VoEWrapper() {} 119 ~VoEWrapper() {}
114 webrtc::VoiceEngine* engine() const { return engine_.get(); } 120 webrtc::VoiceEngine* engine() const { return engine_.get(); }
115 webrtc::VoEAudioProcessing* processing() const { return processing_.get(); } 121 webrtc::VoEAudioProcessing* processing() const { return processing_.get(); }
116 webrtc::VoEBase* base() const { return base_.get(); } 122 webrtc::VoEBase* base() const { return base_.get(); }
117 webrtc::VoECodec* codec() const { return codec_.get(); } 123 webrtc::VoECodec* codec() const { return codec_.get(); }
118 webrtc::VoEHardware* hw() const { return hw_.get(); } 124 webrtc::VoEHardware* hw() const { return hw_.get(); }
119 webrtc::VoENetwork* network() const { return network_.get(); } 125 webrtc::VoENetwork* network() const { return network_.get(); }
120 webrtc::VoERTP_RTCP* rtp() const { return rtp_.get(); } 126 webrtc::VoERTP_RTCP* rtp() const { return rtp_.get(); }
121 webrtc::VoEVolumeControl* volume() const { return volume_.get(); } 127 webrtc::VoEVolumeControl* volume() const { return volume_.get(); }
128 webrtc::VoEExternalMedia* external_media() const {
129 return external_media_.get();
130 }
122 int error() { return base_->LastError(); } 131 int error() { return base_->LastError(); }
123 132
124 private: 133 private:
125 scoped_voe_engine engine_; 134 scoped_voe_engine engine_;
126 scoped_voe_ptr<webrtc::VoEAudioProcessing> processing_; 135 scoped_voe_ptr<webrtc::VoEAudioProcessing> processing_;
127 scoped_voe_ptr<webrtc::VoEBase> base_; 136 scoped_voe_ptr<webrtc::VoEBase> base_;
128 scoped_voe_ptr<webrtc::VoECodec> codec_; 137 scoped_voe_ptr<webrtc::VoECodec> codec_;
129 scoped_voe_ptr<webrtc::VoEHardware> hw_; 138 scoped_voe_ptr<webrtc::VoEHardware> hw_;
130 scoped_voe_ptr<webrtc::VoENetwork> network_; 139 scoped_voe_ptr<webrtc::VoENetwork> network_;
131 scoped_voe_ptr<webrtc::VoERTP_RTCP> rtp_; 140 scoped_voe_ptr<webrtc::VoERTP_RTCP> rtp_;
132 scoped_voe_ptr<webrtc::VoEVolumeControl> volume_; 141 scoped_voe_ptr<webrtc::VoEVolumeControl> volume_;
142 scoped_voe_ptr<webrtc::VoEExternalMedia> external_media_;
133 }; 143 };
134 } // namespace cricket 144 } // namespace cricket
135 145
136 #endif // TALK_MEDIA_WEBRTCVOE_H_ 146 #endif // TALK_MEDIA_WEBRTCVOE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698