Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
69 commits
Select commit Hold shift + click to select a range
4672721
add LIB_WEBAPI_CALL
Dec 2, 2024
c3c3923
Geri çekme
Dec 2, 2024
92ae88a
First interop methods added.
Dec 4, 2024
789ed0c
add ref_counted_object
Dec 4, 2024
c6a550c
bugfix
Dec 4, 2024
d931b25
minor fix refCount
Dec 5, 2024
3e025a4
add rtc_peerconnection_factory_interop.cc
Dec 5, 2024
8cc2e33
restore RTCPeerConnectionFactory_Create method
Dec 6, 2024
7c212c3
Added rtc_mediaconstraints_interop.cc
Dec 6, 2024
f847d80
Updated portable.h
Dec 6, 2024
acf2e34
Added LibWebRTC_GetErrorMessage method
Dec 7, 2024
7910b08
Bugfix
Dec 7, 2024
64ec054
Bugfix
Dec 7, 2024
0c60df8
Pre definitions regarding the use of desktop devices have been edited.
Dec 9, 2024
0535d5d
I will revert the last commit.
Dec 9, 2024
1a5ac11
Added rtc_audio_device_interop.cc
Dec 9, 2024
c5fae2e
Added rtc_video_device_interop.cc
Dec 10, 2024
ec89f5e
Added RTCVideoCapturer interop methods
Dec 10, 2024
91299b1
Added rtc_desktop_device_interop.cc
Dec 11, 2024
1f9f37c
Added rtc_desktop_media_list_interop.cc
Dec 11, 2024
fe46679
Added callbacks rtc_desktop_media_list_interop.cc
Dec 12, 2024
a861abd
Added MediaSource interop methods
Dec 16, 2024
661a7a3
Updated ReadMe.md
Dec 16, 2024
904e052
Added media track interop methods
Dec 16, 2024
069c161
Added rtc_video_renderer_interop.cc
Dec 17, 2024
5161a92
Added video frame interop methods
Dec 17, 2024
7b778e5
Added video frame interop methods
Dec 17, 2024
0c19d85
Added rtc_video_renderer_impl.h, .cc
Dec 18, 2024
ffb7dbb
Added rtc_video_track_interop methods
Dec 18, 2024
322006b
Added timestamp for video frame
Dec 19, 2024
f37ba79
Updated BUILD.gn
Dec 19, 2024
a4e5727
Added class, struct and enum types.
Dec 20, 2024
952e060
Restore
Dec 20, 2024
6838584
Added data channel interop methods
Dec 21, 2024
f04f0ed
Added sdp_parse_error_interop methods
Dec 22, 2024
836d61a
Added rtc_ice_candidate_interop.cc
Dec 22, 2024
6f18ac9
Added rtc_media_stream_interop.cc
Dec 24, 2024
21e4690
Added empty rtc_peerconnection_interop.cc
Dec 24, 2024
6ddd25b
optimization
Dec 25, 2024
85b6360
Added rtc_base_list.h
Dec 25, 2024
9c19044
Added rtc_media_stream_list_impl
Dec 26, 2024
55a8724
Added rtc_rtp_capabilities_interop.cc
Dec 27, 2024
a795fce
Deleted _list_. List codes have been moved.
Dec 28, 2024
c194998
Added rtc_rtp_parameters_interop.cc
Dec 29, 2024
01f4b58
Added RTCRtpCodecParametersPair and RTCRtpCodecParametersMap
Dec 29, 2024
3e42afc
Added RTCRtpCodecParameters_GetParameters and RTCRtpCodecParameters_S…
Dec 29, 2024
b366a68
Added rtc_rtp_receiver_interop.cc
Dec 31, 2024
5e61952
Added rtc_rtp_sender_interop.cc
Jan 1, 2025
c56ab26
Added rtc_dtls_transport_interop.cc and rtc_dtmf_sender_interop.cc
Jan 2, 2025
9751bd7
Added rtc_rtp_transceiver_interop.cc
Jan 2, 2025
504cf64
Added rtc_peerconnection_impl.cc codes
Jan 3, 2025
90d5a2e
Interop callbacks optimization
Jan 3, 2025
db9bf9c
interop callback optimization
Jan 5, 2025
f6e21f0
BugFix
Jan 5, 2025
141cd49
Added rtc_desktop_capturer_interop.cc
Jan 9, 2025
199c9da
Optimization
Jan 11, 2025
ddcb34f
Created rtc_dummy_video_capturer
Jan 13, 2025
2840c80
Added ScaleFrom method for RTCVideoFrame.
Jan 13, 2025
20051cf
Added ScaleFrom(ARGB) to RTCVideoFrame.
Jan 16, 2025
84f2e44
Updated rtc_video_frame_interop.cc
Jan 16, 2025
2046578
Added Dummy Audio Source
Jan 27, 2025
5234f67
Optimization and added interop methods
Jan 28, 2025
c1492a2
Added Clear method for RTCVideoFrame
Jan 30, 2025
3480a48
Added set_index to RTCAudioData
Feb 4, 2025
0e1d96e
Dummy Video Capturer frame buffer optimization
Feb 8, 2025
f5fb7dd
Added Create method for RTCRtpEncodingParameters and RTCRtpEncodingPa…
Feb 8, 2025
9bb84c7
Added RTCRtpCodecCapabilityList_Create interop method
Feb 9, 2025
38cd79c
Added YUY2 video frame buffer
Feb 11, 2025
227260c
License comments removed.
Oct 26, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
64 changes: 64 additions & 0 deletions BUILD.gn
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import("../webrtc.gni")

declare_args() {
libwebrtc_interop = true
libwebrtc_intel_media_sdk = false
libwebrtc_desktop_capture = true
}
Expand Down Expand Up @@ -68,13 +69,15 @@ rtc_shared_library("libwebrtc") {
"include/base/refcountedobject.h",
"include/base/scoped_ref_ptr.h",
"include/libwebrtc.h",
"include/rtc_base_list.h",
"include/rtc_audio_device.h",
"include/rtc_audio_source.h",
"include/rtc_audio_track.h",
"include/rtc_data_channel.h",
"include/rtc_dtls_transport.h",
"include/rtc_dtmf_sender.h",
"include/rtc_frame_cryptor.h",
"include/rtc_sdp_parse_error.h",
"include/rtc_ice_candidate.h",
"include/rtc_media_stream.h",
"include/rtc_media_track.h",
Expand All @@ -93,13 +96,22 @@ rtc_shared_library("libwebrtc") {
"include/rtc_video_renderer.h",
"include/rtc_video_source.h",
"include/rtc_video_track.h",
"include/rtc_dummy_video_capturer.h",
"include/rtc_audio_data.h",
"include/rtc_dummy_audio_source.h",
"include/helper.h",
"src/helper.cc",
"src/base/portable.cc",
"src/internal/audio_util.cc",
"src/internal/audio_util.h",
"src/internal/vcm_capturer.cc",
"src/internal/vcm_capturer.h",
"src/internal/video_capturer.cc",
"src/internal/video_capturer.h",
"src/internal/dummy_capturer.cc",
"src/internal/dummy_capturer.h",
"src/internal/dummy_audio_capturer.cc",
"src/internal/dummy_audio_capturer.h",
"src/libwebrtc.cc",
"src/rtc_audio_device_impl.cc",
"src/rtc_audio_device_impl.h",
Expand All @@ -115,6 +127,8 @@ rtc_shared_library("libwebrtc") {
"src/rtc_dtmf_sender_impl.h",
"src/rtc_frame_cryptor_impl.cc",
"src/rtc_frame_cryptor_impl.h",
"src/rtc_sdp_parse_error_impl.cc",
"src/rtc_sdp_parse_error_impl.h",
"src/rtc_ice_candidate_impl.cc",
"src/rtc_ice_candidate_impl.h",
"src/rtc_media_stream_impl.cc",
Expand All @@ -141,13 +155,63 @@ rtc_shared_library("libwebrtc") {
"src/rtc_video_device_impl.h",
"src/rtc_video_frame_impl.cc",
"src/rtc_video_frame_impl.h",
"src/rtc_video_renderer_impl.cc",
"src/rtc_video_renderer_impl.h",
"src/rtc_video_sink_adapter.cc",
"src/rtc_video_sink_adapter.h",
"src/rtc_video_source_impl.cc",
"src/rtc_video_source_impl.h",
"src/rtc_video_track_impl.cc",
"src/rtc_video_track_impl.h",
"src/rtc_dummy_video_capturer_impl.cc",
"src/rtc_dummy_video_capturer_impl.h",
"src/rtc_audio_data_impl.cc",
"src/rtc_audio_data_impl.h",
"src/rtc_dummy_audio_source_impl.cc",
"src/rtc_dummy_audio_source_impl.h",
]

# for interop methods
if (is_win && libwebrtc_interop) {
sources += [
"include/interop_macros.h",
"include/interop_api.h",
"src/interop/ref_counted_object_interop.cc",
"src/interop/libwebrtc_interop.cc",
"src/interop/rtc_sdp_parse_error_interop.cc",
"src/interop/rtc_mediaconstraints_interop.cc",
"src/interop/rtc_peerconnection_factory_interop.cc",
"src/interop/rtc_audio_data_interop.cc",
"src/interop/rtc_media_track_interop.cc",
"src/interop/rtc_audio_device_interop.cc",
"src/interop/rtc_audio_track_interop.cc",
"src/interop/rtc_dummy_audio_source_interop.cc",
"src/interop/rtc_video_device_interop.cc",
"src/interop/rtc_video_track_interop.cc",
"src/interop/rtc_video_frame_interop.cc",
"src/interop/rtc_video_renderer_interop.cc",
"src/interop/rtc_dummy_video_capturer_interop.cc",
"src/interop/rtc_data_channel_interop.cc",
"src/interop/rtc_ice_candidate_interop.cc",
"src/interop/rtc_media_stream_interop.cc",
"src/interop/rtc_dtmf_sender_interop.cc",
"src/interop/rtc_dtls_transport_interop.cc",
"src/interop/rtc_rtp_capabilities_interop.cc",
"src/interop/rtc_rtp_parameters_interop.cc",
"src/interop/rtc_rtp_receiver_interop.cc",
"src/interop/rtc_rtp_sender_interop.cc",
"src/interop/rtc_rtp_transceiver_interop.cc",
"src/interop/rtc_peerconnection_interop.cc",
]

if (libwebrtc_desktop_capture) {
sources += [
"src/interop/rtc_desktop_media_list_interop.cc",
"src/interop/rtc_desktop_capturer_interop.cc",
"src/interop/rtc_desktop_device_interop.cc",
]
}
}

# intel media sdk
if (is_win && libwebrtc_intel_media_sdk) {
Expand Down
9 changes: 7 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,13 @@ gclient sync

Confirm that it is currently in the `src`.

```bash
git clone https://github.com/webrtc-sdk/libwebrtc
```patch
- git clone https://github.com/webrtc-sdk/libwebrtc
+ git clone https://github.com/gerd0gdu/libwebrtc
```

```batch
git clone https://github.com/gerd0gdu/libwebrtc
```

### Modify webrtc's src/BUILD.gn file and add libwebrtc to group("default").
Expand Down
74 changes: 72 additions & 2 deletions include/base/portable.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
#include <map>
#include <string>
#include <vector>
#include <sstream>

/**
* This file defines structures that can be passed across shared library/DLL
Expand All @@ -38,6 +39,9 @@ namespace portable {

#define PORTABLE_STRING_BUF_SIZE 48

template <typename T>
class vector;

class string {
private:
char m_buf[PORTABLE_STRING_BUF_SIZE];
Expand All @@ -49,7 +53,11 @@ class string {
LIB_PORTABLE_API void init(const char* str, size_t len);
LIB_PORTABLE_API void destroy();

inline string(const char* str) { init(str, strlen(str)); }
inline string(const char* str)
{
const char* strTemp = str ? str : "\0";
init(strTemp, strlen(strTemp));
}

inline string(const std::string& str) { init(str.c_str(), str.length()); }

Expand All @@ -71,7 +79,7 @@ class string {
return *this;
}

inline size_t size() { return m_length; }
inline size_t size() const { return m_length; }

inline const char* c_string() const {
return m_dynamic == 0 ? m_buf : m_dynamic;
Expand All @@ -80,6 +88,52 @@ class string {
inline std::string std_string() const {
return std::string(m_dynamic == 0 ? m_buf : m_dynamic, m_length);
}

/**
* Makes safe copies up to the size of the output buffer.
*
* @param dest - Output buffer
* @param sz_dest - Size of the output buffer
* @return size_t - Number of characters copied. (excluding the ending character '\0')
*/
inline size_t copy_to(char* dest, size_t sz_dest) const {
if (dest == 0) { return 0; }
*dest = '\0';
if (sz_dest == 0 || m_length == 0) { return 0; }
size_t cch_len = sz_dest - 1;
// safe copy
strncpy(dest, c_string(), cch_len);
dest[cch_len] = '\0';
return cch_len;
}

inline std::vector<string> split(string delimiter, bool removeEmptyEntries = true)
{
std::string input = std_string();
std::string item;
std::vector<string> tokens;
size_t start = 0;
size_t end = input.find(delimiter.c_string());

while (end != std::string::npos) {
item = input.substr(start, end - start);
if (!removeEmptyEntries || item.size() > 0) {
tokens.push_back(item);
}
start = end + delimiter.size();
end = input.find(delimiter.c_string(), start);
}

item = input.substr(start);
if (removeEmptyEntries && item.size() == 0) {
return tokens;
}

tokens.push_back(input.substr(start));
return tokens;
}

static std::string join(string separator, const vector<string>& values);
};

inline std::string to_std_string(const string& str) { return str.std_string(); }
Expand Down Expand Up @@ -213,6 +267,22 @@ class vector {
}
};

inline std::string string::join(string separator, const vector<string>& values)
{
size_t count = values.size();
if (count == 0) {
return std::string();
}
std::string retVal;
for (size_t i = 0; i < count; i++) {
retVal += values[i].std_string();
if ((i + 1) < count) {
retVal += separator.std_string();
}
}
return retVal;
}

template <typename K, typename V>
class pair {
public:
Expand Down
Loading