Skip to content

Commit ee2e48a

Browse files
authored
disable desktop source on linux (#34)
1 parent daa2818 commit ee2e48a

File tree

4 files changed

+28
-16
lines changed

4 files changed

+28
-16
lines changed

BUILD.gn

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@ rtc_shared_library("libwebrtc"){
2525
"include/rtc_audio_track.h",
2626
"include/rtc_audio_source.h",
2727
"include/rtc_data_channel.h",
28-
"include/rtc_desktop_device.h",
2928
"include/rtc_ice_candidate.h",
3029
"include/rtc_media_stream.h",
3130
"include/rtc_media_track.h",
@@ -63,8 +62,6 @@ rtc_shared_library("libwebrtc"){
6362
"src/rtc_audio_track_impl.cc",
6463
"src/rtc_data_channel_impl.h",
6564
"src/rtc_data_channel_impl.cc",
66-
"src/rtc_desktop_device_impl.h",
67-
"src/rtc_desktop_device_impl.cc",
6865
"src/rtc_ice_candidate_impl.h",
6966
"src/rtc_ice_candidate_impl.cc",
7067
"src/rtc_peerconnection_impl.h",
@@ -91,8 +88,7 @@ rtc_shared_library("libwebrtc"){
9188
"src/internal/video_capturer.cc",
9289
"src/internal/vcm_capturer.h",
9390
"src/internal/vcm_capturer.cc",
94-
"src/interanl/desktop_capturer.h",
95-
"src/internal/desktop_capturer.cc",
91+
9692
"src/rtc_rtp_sender_impl.cc",
9793
"src/rtc_rtp_sender_impl.h",
9894
"src/rtc_rtp_transceiver_impl.cc",
@@ -150,7 +146,6 @@ rtc_shared_library("libwebrtc"){
150146
defines = [
151147
"USE_LIBYUV",
152148
"WEBRTC_INCLUDE_INTERNAL_AUDIO_DEVICE",
153-
"USE_INTEL_MEDIA_SDK",
154149
]
155150

156151
if(is_win) {
@@ -190,7 +185,6 @@ rtc_shared_library("libwebrtc"){
190185
"../media:rtc_media",
191186
"../media:rtc_media_base",
192187
"../modules/audio_device:audio_device",
193-
"../modules/desktop_capture",
194188
"../modules/audio_processing:api",
195189
"../modules/audio_processing:audio_processing",
196190
"../modules/video_capture:video_capture_module",
@@ -201,6 +195,18 @@ rtc_shared_library("libwebrtc"){
201195
]
202196
libs = []
203197

198+
199+
if(is_win) {
200+
defines += [ "RTC_DESKTOP_DEVICE"]
201+
sources += [
202+
"include/rtc_desktop_device.h",
203+
"src/rtc_desktop_device_impl.h",
204+
"src/rtc_desktop_device_impl.cc",
205+
"src/interanl/desktop_capturer.h",
206+
"src/internal/desktop_capturer.cc",
207+
]
208+
deps += ["../modules/desktop_capture"]
209+
}
204210
if(is_win) {
205211
libs += [ "libmfx_vs2015.lib" ]
206212
lib_dirs = [ "src\win\lib\x64" ]

include/rtc_peerconnection_factory.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,22 +32,22 @@ class RTCPeerConnectionFactory : public RefCountInterface {
3232
virtual scoped_refptr<RTCAudioDevice> GetAudioDevice() = 0;
3333

3434
virtual scoped_refptr<RTCVideoDevice> GetVideoDevice() = 0;
35-
35+
#ifdef RTC_DESKTOP_DEVICE
3636
virtual scoped_refptr<RTCDesktopDevice> GetDesktopDevice() = 0;
37-
37+
#endif
3838
virtual scoped_refptr<RTCAudioSource> CreateAudioSource(
3939
const string audio_source_label) = 0;
4040

4141
virtual scoped_refptr<RTCVideoSource> CreateVideoSource(
4242
scoped_refptr<RTCVideoCapturer> capturer,
4343
const string video_source_label,
4444
scoped_refptr<RTCMediaConstraints> constraints) = 0;
45-
45+
#ifdef RTC_DESKTOP_DEVICE
4646
virtual scoped_refptr<RTCVideoSource> CreateDesktopSource(
4747
scoped_refptr<RTCDesktopCapturer> capturer,
4848
const string video_source_label,
4949
scoped_refptr<RTCMediaConstraints> constraints) = 0;
50-
50+
#endif
5151
virtual scoped_refptr<RTCAudioTrack> CreateAudioTrack(
5252
scoped_refptr<RTCAudioSource> source,
5353
const string track_id) = 0;

src/rtc_peerconnection_factory_impl.cc

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,7 @@ scoped_refptr<RTCAudioSource> RTCPeerConnectionFactoryImpl::CreateAudioSource(
159159
new RefCountedObject<RTCAudioSourceImpl>(rtc_source_track));
160160
return source;
161161
}
162-
162+
#ifdef RTC_DESKTOP_DEVICE
163163
scoped_refptr<RTCDesktopDevice>
164164
RTCPeerConnectionFactoryImpl::GetDesktopDevice() {
165165
if (!desktop_device_impl_) {
@@ -168,7 +168,7 @@ RTCPeerConnectionFactoryImpl::GetDesktopDevice() {
168168
}
169169
return desktop_device_impl_;
170170
}
171-
171+
#endif
172172
scoped_refptr<RTCVideoSource> RTCPeerConnectionFactoryImpl::CreateVideoSource(
173173
scoped_refptr<RTCVideoCapturer> capturer,
174174
const string video_source_label,
@@ -204,6 +204,7 @@ scoped_refptr<RTCVideoSource> RTCPeerConnectionFactoryImpl::CreateVideoSource_s(
204204
return source;
205205
}
206206

207+
#ifdef RTC_DESKTOP_DEVICE
207208
scoped_refptr<RTCVideoSource> RTCPeerConnectionFactoryImpl::CreateDesktopSource(
208209
scoped_refptr<RTCDesktopCapturer> capturer,
209210
const string video_source_label,
@@ -227,7 +228,7 @@ scoped_refptr<RTCVideoSource> RTCPeerConnectionFactoryImpl::CreateVideoSource_d(
227228
scoped_refptr<RTCDesktopCapturer> capturer,
228229
const char* video_source_label,
229230
scoped_refptr<RTCMediaConstraints> constraints) {
230-
231+
231232
RTCDesktopCapturerImpl* capturer_impl =
232233
static_cast<RTCDesktopCapturerImpl*>(capturer.get());
233234

@@ -243,6 +244,7 @@ scoped_refptr<RTCVideoSource> RTCPeerConnectionFactoryImpl::CreateVideoSource_d(
243244

244245
return source;
245246
}
247+
#endif
246248

247249
scoped_refptr<RTCMediaStream> RTCPeerConnectionFactoryImpl::CreateStream(
248250
const string stream_id) {

src/rtc_peerconnection_factory_impl.h

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,9 @@
22
#define LIB_WEBRTC_MEDIA_SESSION_FACTORY_IMPL_HXX
33

44
#include "rtc_audio_device_impl.h"
5+
#ifdef RTC_DESKTOP_DEVICE
56
#include "rtc_desktop_device_impl.h"
7+
#endif
68
#include "rtc_peerconnection.h"
79
#include "rtc_peerconnection_factory.h"
810
#include "rtc_video_device_impl.h"
@@ -44,14 +46,14 @@ class RTCPeerConnectionFactoryImpl : public RTCPeerConnectionFactory {
4446
scoped_refptr<RTCVideoCapturer> capturer,
4547
const string video_source_label,
4648
scoped_refptr<RTCMediaConstraints> constraints) override;
47-
49+
#ifdef RTC_DESKTOP_DEVICE
4850
virtual scoped_refptr<RTCVideoSource> CreateDesktopSource(
4951
scoped_refptr<RTCDesktopCapturer> capturer,
5052
const string video_source_label,
5153
scoped_refptr<RTCMediaConstraints> constraints) override;
5254

5355
virtual scoped_refptr<RTCDesktopDevice> GetDesktopDevice() override;
54-
56+
#endif
5557
virtual scoped_refptr<RTCAudioTrack> CreateAudioTrack(
5658
scoped_refptr<RTCAudioSource> source,
5759
const string track_id) override;
@@ -92,7 +94,9 @@ class RTCPeerConnectionFactoryImpl : public RTCPeerConnectionFactory {
9294
rtc::scoped_refptr<webrtc::AudioDeviceModule> audio_device_module_;
9395
scoped_refptr<AudioDeviceImpl> audio_device_impl_;
9496
scoped_refptr<RTCVideoDeviceImpl> video_device_impl_;
97+
#ifdef RTC_DESKTOP_DEVICE
9598
scoped_refptr<RTCDesktopDeviceImpl> desktop_device_impl_;
99+
#endif
96100
std::list<scoped_refptr<RTCPeerConnection>> peerconnections_;
97101
std::unique_ptr<webrtc::TaskQueueFactory> task_queue_factory_;
98102
};

0 commit comments

Comments
 (0)