Skip to content

Commit f3a09b8

Browse files
committed
Merge branch 'master' into feat/frame-encryptor-interface
2 parents ef3ca8d + fb0940c commit f3a09b8

File tree

94 files changed

+7182
-6599
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

94 files changed

+7182
-6599
lines changed

BUILD.gn

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,13 @@ rtc_shared_library("libwebrtc") {
4141
]
4242
}
4343

44+
if (is_linux) {
45+
defines += [
46+
"WEBRTC_LINUX",
47+
"WEBRTC_POSIX",
48+
]
49+
}
50+
4451
public_configs = [ ":external_config" ]
4552

4653
sources = [
@@ -215,7 +222,7 @@ rtc_shared_library("libwebrtc") {
215222
"include/rtc_desktop_capturer.h",
216223
"include/rtc_desktop_device.h",
217224
"include/rtc_desktop_media_list.h",
218-
"src/interanl/desktop_capturer.h",
225+
"src/internal/desktop_capturer.h",
219226
"src/internal/desktop_capturer.cc",
220227
"src/rtc_desktop_capturer_impl.cc",
221228
"src/rtc_desktop_capturer_impl.h",

include/base/portable.h

Lines changed: 8 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -48,12 +48,10 @@ class string {
4848
LIB_PORTABLE_API string();
4949
LIB_PORTABLE_API void init(const char* str, size_t len);
5050
LIB_PORTABLE_API void destroy();
51-
51+
5252
inline string(const char* str) { init(str, strlen(str)); }
5353

54-
inline string(const std::string& str) {
55-
init(str.c_str(), str.length());
56-
}
54+
inline string(const std::string& str) { init(str.c_str(), str.length()); }
5755

5856
inline string(const string& o) {
5957
init(o.m_dynamic == 0 ? o.m_buf : o.m_dynamic, o.m_length);
@@ -73,9 +71,7 @@ class string {
7371
return *this;
7472
}
7573

76-
inline size_t size() {
77-
return m_length;
78-
}
74+
inline size_t size() { return m_length; }
7975

8076
inline const char* c_string() const {
8177
return m_dynamic == 0 ? m_buf : m_dynamic;
@@ -86,7 +82,7 @@ class string {
8682
}
8783
};
8884

89-
inline std::string to_std_string(const string& str) {
85+
inline std::string to_std_string(const string& str) {
9086
return str.std_string();
9187
}
9288

@@ -106,7 +102,8 @@ class vector {
106102

107103
public:
108104
class move_ref {
109-
friend class vector;
105+
friend class vector;
106+
110107
private:
111108
vector<T>& m_ref;
112109
move_ref(vector<T>& ref) : m_ref(ref) {}
@@ -155,10 +152,7 @@ class vector {
155152
}
156153
}
157154

158-
159-
~vector() {
160-
destroy_all();
161-
}
155+
~vector() { destroy_all(); }
162156

163157
vector<T>& operator=(const vector<T>& o) {
164158
if (m_size < o.m_size) {
@@ -207,7 +201,7 @@ class vector {
207201
T& operator[](size_t i) { return m_array[i]; }
208202

209203
const T& operator[](size_t i) const { return m_array[i]; }
210-
204+
211205
void clear() { destroy_all(); }
212206

213207
protected:

include/rtc_audio_device.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ namespace libwebrtc {
88
class RTCAudioDevice : public RefCountInterface {
99
public:
1010
typedef fixed_size_function<void()> OnDeviceChangeCallback;
11+
1112
public:
1213
static const int kAdmMaxDeviceNameSize = 128;
1314
static const int kAdmMaxFileNameSize = 512;

include/rtc_data_channel.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,9 @@ class RTCDataChannelObserver {
3434

3535
class RTCDataChannel : public RefCountInterface {
3636
public:
37-
virtual void Send(const uint8_t* data, uint32_t size, bool binary = false) = 0;
37+
virtual void Send(const uint8_t* data,
38+
uint32_t size,
39+
bool binary = false) = 0;
3840

3941
virtual void Close() = 0;
4042

include/rtc_desktop_capturer.h

Lines changed: 14 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,30 @@
11
#ifndef LIB_WEBRTC_RTC_DESKTOP_CAPTURER_HXX
22
#define LIB_WEBRTC_RTC_DESKTOP_CAPTURER_HXX
33

4+
#include "rtc_desktop_media_list.h"
45
#include "rtc_types.h"
56
#include "rtc_video_device.h"
6-
#include "rtc_desktop_media_list.h"
77

88
namespace libwebrtc {
99

1010
class DesktopCapturerObserver;
1111

1212
class RTCDesktopCapturer : public RefCountInterface {
13-
public:
14-
enum CaptureState { CS_RUNNING, CS_STOPPED, CS_FAILED};
13+
public:
14+
enum CaptureState { CS_RUNNING, CS_STOPPED, CS_FAILED };
15+
1516
public:
1617
virtual void RegisterDesktopCapturerObserver(
1718
DesktopCapturerObserver* observer) = 0;
1819

1920
virtual void DeRegisterDesktopCapturerObserver() = 0;
2021

2122
virtual CaptureState Start(uint32_t fps) = 0;
22-
23+
virtual CaptureState Start(uint32_t fps,
24+
uint32_t x,
25+
uint32_t y,
26+
uint32_t w,
27+
uint32_t h) = 0;
2328
virtual void Stop() = 0;
2429

2530
virtual bool IsRunning() = 0;
@@ -30,16 +35,16 @@ class RTCDesktopCapturer : public RefCountInterface {
3035
};
3136

3237
class DesktopCapturerObserver {
33-
public:
38+
public:
3439
virtual void OnStart(scoped_refptr<RTCDesktopCapturer> capturer) = 0;
3540
virtual void OnPaused(scoped_refptr<RTCDesktopCapturer> capturer) = 0;
3641
virtual void OnStop(scoped_refptr<RTCDesktopCapturer> capturer) = 0;
3742
virtual void OnError(scoped_refptr<RTCDesktopCapturer> capturer) = 0;
3843

39-
protected:
40-
~DesktopCapturerObserver() {}
44+
protected:
45+
~DesktopCapturerObserver() {}
4146
};
4247

43-
} //namespace libwebrtc
48+
} // namespace libwebrtc
4449

45-
#endif // LIB_WEBRTC_RTC_DESKTOP_CAPTURER_HXX
50+
#endif // LIB_WEBRTC_RTC_DESKTOP_CAPTURER_HXX

include/rtc_desktop_device.h

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,15 @@ class RTCDesktopMediaList;
1111

1212
class RTCDesktopDevice : public RefCountInterface {
1313
public:
14-
virtual scoped_refptr<RTCDesktopCapturer> CreateDesktopCapturer(scoped_refptr<MediaSource> source) = 0;
15-
virtual scoped_refptr<RTCDesktopMediaList> GetDesktopMediaList(DesktopType type) = 0;
14+
virtual scoped_refptr<RTCDesktopCapturer> CreateDesktopCapturer(
15+
scoped_refptr<MediaSource> source) = 0;
16+
virtual scoped_refptr<RTCDesktopMediaList> GetDesktopMediaList(
17+
DesktopType type) = 0;
18+
1619
protected:
1720
virtual ~RTCDesktopDevice() {}
1821
};
1922

20-
} // namespace libwebrtc
23+
} // namespace libwebrtc
2124

2225
#endif // LIB_WEBRTC_RTC_VIDEO_DEVICE_HXX

include/rtc_desktop_media_list.h

Lines changed: 18 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -20,45 +20,47 @@ class MediaSource : public RefCountInterface {
2020

2121
virtual bool UpdateThumbnail() = 0;
2222

23-
protected:
23+
protected:
2424
virtual ~MediaSource() {}
2525
};
2626

2727
class MediaListObserver {
28-
public:
29-
virtual void OnMediaSourceAdded(scoped_refptr<MediaSource> source) = 0;
30-
31-
virtual void OnMediaSourceRemoved(scoped_refptr<MediaSource> source) = 0;
28+
public:
29+
virtual void OnMediaSourceAdded(scoped_refptr<MediaSource> source) = 0;
30+
31+
virtual void OnMediaSourceRemoved(scoped_refptr<MediaSource> source) = 0;
3232

33-
virtual void OnMediaSourceNameChanged(scoped_refptr<MediaSource> source) = 0;
33+
virtual void OnMediaSourceNameChanged(scoped_refptr<MediaSource> source) = 0;
3434

35-
virtual void OnMediaSourceThumbnailChanged(scoped_refptr<MediaSource> source) = 0;
35+
virtual void OnMediaSourceThumbnailChanged(
36+
scoped_refptr<MediaSource> source) = 0;
3637

37-
protected:
38-
virtual ~MediaListObserver() {}
38+
protected:
39+
virtual ~MediaListObserver() {}
3940
};
4041

4142
class RTCDesktopMediaList : public RefCountInterface {
4243
public:
43-
virtual void RegisterMediaListObserver(
44-
MediaListObserver* observer) = 0;
44+
virtual void RegisterMediaListObserver(MediaListObserver* observer) = 0;
4545

4646
virtual void DeRegisterMediaListObserver() = 0;
4747

4848
virtual DesktopType type() const = 0;
4949

50-
virtual int32_t UpdateSourceList(bool force_reload = false, bool get_thumbnail = true) = 0;
50+
virtual int32_t UpdateSourceList(bool force_reload = false,
51+
bool get_thumbnail = true) = 0;
5152

5253
virtual int GetSourceCount() const = 0;
53-
54+
5455
virtual scoped_refptr<MediaSource> GetSource(int index) = 0;
5556

56-
virtual bool GetThumbnail(scoped_refptr<MediaSource> source, bool notify = false) = 0;
57+
virtual bool GetThumbnail(scoped_refptr<MediaSource> source,
58+
bool notify = false) = 0;
5759

5860
protected:
5961
~RTCDesktopMediaList() {}
6062
};
6163

62-
} //namespace libwebrtc
64+
} // namespace libwebrtc
6365

64-
#endif // LIB_WEBRTC_RTC_DESKTOP_MEDIA_LIST_HXX
66+
#endif // LIB_WEBRTC_RTC_DESKTOP_MEDIA_LIST_HXX

include/rtc_frame_cryptor.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,10 @@ class KeyManager : public RefCountInterface {
2222
LIB_WEBRTC_API static scoped_refptr<KeyManager> Create();
2323

2424
/// Set the key at the given index.
25-
virtual bool setKey(int index, vector<uint8_t> key) = 0;
25+
virtual bool SetKey(int index, vector<uint8_t> key) = 0;
2626

2727
/// Set the keys.
28-
virtual bool setKeys(vector<vector<uint8_t>> keys) = 0;
28+
virtual bool SetKeys(vector<vector<uint8_t>> keys) = 0;
2929

3030
/// Get the keys.
3131
virtual const vector<vector<uint8_t>> keys() const = 0;

include/rtc_mediaconstraints.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@ class RTCMediaConstraints : public RefCountInterface {
1717
kDAEchoCancellation; // googDAEchoCancellation
1818
LIB_WEBRTC_API static const char* kAutoGainControl; // googAutoGainControl
1919
LIB_WEBRTC_API static const char* kNoiseSuppression; // googNoiseSuppression
20-
LIB_WEBRTC_API static const char* kHighpassFilter; // googHighpassFilter
21-
LIB_WEBRTC_API static const char* kAudioMirroring; // googAudioMirroring
20+
LIB_WEBRTC_API static const char* kHighpassFilter; // googHighpassFilter
21+
LIB_WEBRTC_API static const char* kAudioMirroring; // googAudioMirroring
2222
LIB_WEBRTC_API static const char*
2323
kAudioNetworkAdaptorConfig; // goodAudioNetworkAdaptorConfig
2424

include/rtc_peerconnection.h

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -56,8 +56,8 @@ enum RTCIceConnectionState {
5656
};
5757

5858
class RTCStatsMember : public RefCountInterface {
59-
public:
60-
// Member value types.
59+
public:
60+
// Member value types.
6161
enum Type {
6262
kBool, // bool
6363
kInt32, // int32_t
@@ -78,6 +78,7 @@ class RTCStatsMember : public RefCountInterface {
7878
kMapStringUint64, // std::map<std::string, uint64_t>
7979
kMapStringDouble, // std::map<std::string, double>
8080
};
81+
8182
public:
8283
virtual string GetName() const = 0;
8384
virtual Type GetType() const = 0;
@@ -99,7 +100,8 @@ class RTCStatsMember : public RefCountInterface {
99100
virtual vector<string> ValueSequenceString() const = 0;
100101
virtual map<string, uint64_t> ValueMapStringUint64() const = 0;
101102
virtual map<string, double> ValueMapStringDouble() const = 0;
102-
protected:
103+
104+
protected:
103105
virtual ~RTCStatsMember() {}
104106
};
105107

@@ -173,7 +175,8 @@ class RTCPeerConnection : public RefCountInterface {
173175

174176
virtual int RemoveStream(scoped_refptr<RTCMediaStream> stream) = 0;
175177

176-
virtual scoped_refptr<RTCMediaStream> CreateLocalMediaStream(const string stream_id) = 0;
178+
virtual scoped_refptr<RTCMediaStream> CreateLocalMediaStream(
179+
const string stream_id) = 0;
177180

178181
virtual scoped_refptr<RTCDataChannel> CreateDataChannel(
179182
const string label,

include/rtc_peerconnection_factory.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,8 @@ class RTCPeerConnectionFactory : public RefCountInterface {
3434
virtual scoped_refptr<RTCAudioDevice> GetAudioDevice() = 0;
3535

3636
virtual scoped_refptr<RTCVideoDevice> GetVideoDevice() = 0;
37-
#ifdef RTC_DESKTOP_DEVICE
38-
virtual scoped_refptr<RTCDesktopDevice> GetDesktopDevice() = 0;
37+
#ifdef RTC_DESKTOP_DEVICE
38+
virtual scoped_refptr<RTCDesktopDevice> GetDesktopDevice() = 0;
3939
#endif
4040
virtual scoped_refptr<RTCAudioSource> CreateAudioSource(
4141
const string audio_source_label) = 0;
@@ -44,7 +44,7 @@ class RTCPeerConnectionFactory : public RefCountInterface {
4444
scoped_refptr<RTCVideoCapturer> capturer,
4545
const string video_source_label,
4646
scoped_refptr<RTCMediaConstraints> constraints) = 0;
47-
#ifdef RTC_DESKTOP_DEVICE
47+
#ifdef RTC_DESKTOP_DEVICE
4848
virtual scoped_refptr<RTCVideoSource> CreateDesktopSource(
4949
scoped_refptr<RTCDesktopCapturer> capturer,
5050
const string video_source_label,

include/rtc_types.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,8 @@ namespace libwebrtc {
2020

2121
enum { kMaxIceServerSize = 8 };
2222

23-
//template <typename T>
24-
//using vector = bsp::inlined_vector<T, 16, true>;
23+
// template <typename T>
24+
// using vector = bsp::inlined_vector<T, 16, true>;
2525

2626
template <typename Key, typename T>
2727
using map = std::map<Key, T>;
@@ -32,8 +32,8 @@ enum class RTCMediaType { ANY, AUDIO, VIDEO, DATA };
3232

3333
using string = portable::string;
3434

35-
//template <typename Key, typename T>
36-
//using map = portable::map<Key, T>;
35+
// template <typename Key, typename T>
36+
// using map = portable::map<Key, T>;
3737

3838
template <typename T>
3939
using vector = portable::vector<T>;

src/internal/desktop_capturer.cc

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
11
#include "desktop_capturer.h"
22

3-
namespace libwebrtc {
4-
5-
} //namespace libwebrtc
3+
namespace libwebrtc {} // namespace libwebrtc

0 commit comments

Comments
 (0)