Bug 1876843 - Vendor libwebrtc from 78f905e5cc

Upstream commit: https://webrtc.googlesource.com/src/+/78f905e5cccf4a6105c0d246a6104a2bf5bb1cd2
    Move some users to use webrtc::RefCountInterface

    Bug: webrtc:15622
    Change-Id: I2d4c20c726af1a052e161b7689a73d1e5e3eb191
    Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/325526
    Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
    Commit-Queue: Harald Alvestrand <hta@webrtc.org>
    Cr-Commit-Position: refs/heads/main@{#41067}
This commit is contained in:
Jan-Ivar Bruaroey 2024-02-08 09:05:38 -05:00
Родитель 7333aca2d6
Коммит 6628c0fb5d
28 изменённых файлов: 56 добавлений и 45 удалений

3
third_party/libwebrtc/README.moz-ff-commit поставляемый
Просмотреть файл

@ -26925,3 +26925,6 @@ a6ce338a2c
# MOZ_LIBWEBRTC_SRC=/Users/jan-ivar/moz/elm/.moz-fast-forward/moz-libwebrtc MOZ_LIBWEBRTC_BRANCH=mozpatches bash dom/media/webrtc/third_party_build/fast-forward-libwebrtc.sh
# base of lastest vendoring
9aa115358e
# MOZ_LIBWEBRTC_SRC=/Users/jan-ivar/moz/elm/.moz-fast-forward/moz-libwebrtc MOZ_LIBWEBRTC_BRANCH=mozpatches bash dom/media/webrtc/third_party_build/fast-forward-libwebrtc.sh
# base of lastest vendoring
78f905e5cc

2
third_party/libwebrtc/README.mozilla поставляемый
Просмотреть файл

@ -17974,3 +17974,5 @@ libwebrtc updated from /Users/jan-ivar/moz/elm/.moz-fast-forward/moz-libwebrtc c
libwebrtc updated from /Users/jan-ivar/moz/elm/.moz-fast-forward/moz-libwebrtc commit mozpatches on 2024-02-07T17:18:16.542611.
# ./mach python dom/media/webrtc/third_party_build/vendor-libwebrtc.py --from-local /Users/jan-ivar/moz/elm/.moz-fast-forward/moz-libwebrtc --commit mozpatches libwebrtc
libwebrtc updated from /Users/jan-ivar/moz/elm/.moz-fast-forward/moz-libwebrtc commit mozpatches on 2024-02-07T17:19:51.976286.
# ./mach python dom/media/webrtc/third_party_build/vendor-libwebrtc.py --from-local /Users/jan-ivar/moz/elm/.moz-fast-forward/moz-libwebrtc --commit mozpatches libwebrtc
libwebrtc updated from /Users/jan-ivar/moz/elm/.moz-fast-forward/moz-libwebrtc commit mozpatches on 2024-02-08T14:05:27.919737.

Просмотреть файл

@ -32,6 +32,7 @@ rtc_library("audio_codecs_api") {
"..:array_view",
"..:bitrate_allocation",
"..:make_ref_counted",
"..:ref_count",
"..:scoped_refptr",
"../../api:field_trials_view",
"../../rtc_base:buffer",

Просмотреть файл

@ -18,12 +18,12 @@
#include "api/audio_codecs/audio_codec_pair_id.h"
#include "api/audio_codecs/audio_decoder.h"
#include "api/audio_codecs/audio_format.h"
#include "rtc_base/ref_count.h"
#include "api/ref_count.h"
namespace webrtc {
// A factory that creates AudioDecoders.
class AudioDecoderFactory : public rtc::RefCountInterface {
class AudioDecoderFactory : public RefCountInterface {
public:
virtual std::vector<AudioCodecSpec> GetSupportedDecoders() = 0;

Просмотреть файл

@ -116,7 +116,7 @@ class DataChannelObserver {
virtual ~DataChannelObserver() = default;
};
class RTC_EXPORT DataChannelInterface : public rtc::RefCountInterface {
class RTC_EXPORT DataChannelInterface : public RefCountInterface {
public:
// C++ version of: https://www.w3.org/TR/webrtc/#idl-def-rtcdatachannelstate
// Unlikely to change, but keep in sync with DataChannel.java:State and

Просмотреть файл

@ -124,7 +124,7 @@ class RTC_EXPORT RTCStatsReport final
std::string ToJson() const;
protected:
friend class rtc::RefCountedNonVirtual<RTCStatsReport>;
friend class RefCountedNonVirtual<RTCStatsReport>;
~RTCStatsReport() = default;
private:

Просмотреть файл

@ -268,7 +268,7 @@ TEST_P(TaskQueueTest, PostALot) {
explicit BlockingCounter(int initial_count) : count_(initial_count) {}
void DecrementCount() {
if (count_.DecRef() == rtc::RefCountReleaseStatus::kDroppedLastRef) {
if (count_.DecRef() == webrtc::RefCountReleaseStatus::kDroppedLastRef) {
event_.Set();
}
}

1
third_party/libwebrtc/api/video/BUILD.gn поставляемый
Просмотреть файл

@ -67,6 +67,7 @@ rtc_library("video_frame") {
":video_rtp_headers",
"..:array_view",
"..:make_ref_counted",
"..:ref_count",
"..:rtp_packet_info",
"..:scoped_refptr",
"..:video_track_source_constraints",

Просмотреть файл

@ -14,8 +14,8 @@
#include <stdint.h>
#include "api/array_view.h"
#include "api/ref_count.h"
#include "api/scoped_refptr.h"
#include "rtc_base/ref_count.h"
#include "rtc_base/system/rtc_export.h"
namespace webrtc {
@ -44,7 +44,7 @@ class NV12BufferInterface;
// performance by providing an optimized path without intermediate conversions.
// Frame metadata such as rotation and timestamp are stored in
// webrtc::VideoFrame, and not here.
class RTC_EXPORT VideoFrameBuffer : public rtc::RefCountInterface {
class RTC_EXPORT VideoFrameBuffer : public webrtc::RefCountInterface {
public:
// New frame buffer types will be added conservatively when there is an
// opportunity to optimize the path between some pair of video source and

Просмотреть файл

@ -50,6 +50,7 @@ rtc_source_set("audio_device_api") {
"include/audio_device_defines.h",
]
deps = [
"../../api:ref_count",
"../../api:scoped_refptr",
"../../api/task_queue",
"../../rtc_base:checks",

Просмотреть файл

@ -12,16 +12,16 @@
#define MODULES_AUDIO_DEVICE_INCLUDE_AUDIO_DEVICE_H_
#include "absl/types/optional.h"
#include "api/ref_count.h"
#include "api/scoped_refptr.h"
#include "api/task_queue/task_queue_factory.h"
#include "modules/audio_device/include/audio_device_defines.h"
#include "rtc_base/ref_count.h"
namespace webrtc {
class AudioDeviceModuleForTest;
class AudioDeviceModule : public rtc::RefCountInterface {
class AudioDeviceModule : public webrtc::RefCountInterface {
public:
enum AudioLayer {
kPlatformDefaultAudio = 0,

Просмотреть файл

@ -23,8 +23,8 @@ class FakeAudioDeviceModule
// references using scoped_refptr. Current code doesn't always use refcounting
// for this class.
void AddRef() const override {}
rtc::RefCountReleaseStatus Release() const override {
return rtc::RefCountReleaseStatus::kDroppedLastRef;
webrtc::RefCountReleaseStatus Release() const override {
return webrtc::RefCountReleaseStatus::kDroppedLastRef;
}
};

Просмотреть файл

@ -29,6 +29,7 @@ rtc_library("api") {
":audio_frame_view",
":audio_processing_statistics",
"../../api:array_view",
"../../api:ref_count",
"../../api:scoped_refptr",
"../../api/audio:aec3_config",
"../../api/audio:audio_frame_api",

Просмотреть файл

@ -48,7 +48,7 @@ class MockInitialize : public AudioProcessingImpl {
}
MOCK_METHOD(void, AddRef, (), (const, override));
MOCK_METHOD(rtc::RefCountReleaseStatus, Release, (), (const, override));
MOCK_METHOD(RefCountReleaseStatus, Release, (), (const, override));
};
// Creates MockEchoControl instances and provides a raw pointer access to

Просмотреть файл

@ -28,10 +28,10 @@
#include "api/array_view.h"
#include "api/audio/echo_canceller3_config.h"
#include "api/audio/echo_control.h"
#include "api/ref_count.h"
#include "api/scoped_refptr.h"
#include "modules/audio_processing/include/audio_processing_statistics.h"
#include "rtc_base/arraysize.h"
#include "rtc_base/ref_count.h"
#include "rtc_base/system/file_wrapper.h"
#include "rtc_base/system/rtc_export.h"
@ -127,7 +127,7 @@ class CustomProcessing;
// // Close the application...
// apm.reset();
//
class RTC_EXPORT AudioProcessing : public rtc::RefCountInterface {
class RTC_EXPORT AudioProcessing : public RefCountInterface {
public:
// The struct below constitutes the new parameter scheme for the audio
// processing. It is being introduced gradually and until it is fully
@ -912,7 +912,7 @@ class CustomProcessing {
};
// Interface for an echo detector submodule.
class EchoDetector : public rtc::RefCountInterface {
class EchoDetector : public RefCountInterface {
public:
// (Re-)Initializes the submodule.
virtual void Initialize(int capture_sample_rate_hz,

Просмотреть файл

@ -34,7 +34,7 @@ protected:
virtual ~VideoInputFeedBack(){}
};
class VideoCaptureModule : public rtc::RefCountInterface {
class VideoCaptureModule : public RefCountInterface {
public:
// Interface for receiving information about available camera devices.
class DeviceInfo {

Просмотреть файл

@ -133,7 +133,7 @@ index b2857163f1..89e9e9e3b0 100644
struct TaskQueueDeleter {
diff --git a/rtc_base/BUILD.gn b/rtc_base/BUILD.gn
index 6e885a9b1b..6fa8f0d392 100644
index 67d2b86de5..ac237ed4c8 100644
--- a/rtc_base/BUILD.gn
+++ b/rtc_base/BUILD.gn
@@ -1453,21 +1453,6 @@ rtc_library("crc32") {

Просмотреть файл

@ -1233,7 +1233,7 @@ index fb95a6020d..95432a509d 100644
} // namespace videocapturemodule
} // namespace webrtc
diff --git a/modules/video_capture/video_capture.h b/modules/video_capture/video_capture.h
index eddc31414a..e207598d68 100644
index 48920b27c0..f31b239c71 100644
--- a/modules/video_capture/video_capture.h
+++ b/modules/video_capture/video_capture.h
@@ -15,15 +15,44 @@
@ -1256,7 +1256,7 @@ index eddc31414a..e207598d68 100644
+ virtual ~VideoInputFeedBack(){}
+};
+
class VideoCaptureModule : public rtc::RefCountInterface {
class VideoCaptureModule : public RefCountInterface {
public:
// Interface for receiving information about available camera devices.
class DeviceInfo {
@ -1281,7 +1281,7 @@ index eddc31414a..e207598d68 100644
// Returns the available capture devices.
// deviceNumber - Index of capture device.
@@ -38,7 +67,8 @@ class VideoCaptureModule : public rtc::RefCountInterface {
@@ -38,7 +67,8 @@ class VideoCaptureModule : public RefCountInterface {
char* deviceUniqueIdUTF8,
uint32_t deviceUniqueIdUTF8Length,
char* productUniqueIdUTF8 = 0,
@ -1291,7 +1291,7 @@ index eddc31414a..e207598d68 100644
// Returns the number of capabilities this device.
virtual int32_t NumberOfCapabilities(const char* deviceUniqueIdUTF8) = 0;
@@ -70,6 +100,8 @@ class VideoCaptureModule : public rtc::RefCountInterface {
@@ -70,6 +100,8 @@ class VideoCaptureModule : public RefCountInterface {
uint32_t positionY) = 0;
virtual ~DeviceInfo() {}
@ -1300,7 +1300,7 @@ index eddc31414a..e207598d68 100644
};
// Register capture data callback
@@ -79,11 +111,16 @@ class VideoCaptureModule : public rtc::RefCountInterface {
@@ -79,11 +111,16 @@ class VideoCaptureModule : public RefCountInterface {
RawVideoSinkInterface* dataCallback) = 0;
// Remove capture data callback
@ -1560,7 +1560,7 @@ index 0474e7bc17..1953923f81 100644
std::unique_ptr<ScalableVideoController> svc_controller_;
absl::optional<ScalabilityMode> scalability_mode_;
diff --git a/rtc_base/BUILD.gn b/rtc_base/BUILD.gn
index 6fa8f0d392..b2615d166d 100644
index ac237ed4c8..97b56d19c4 100644
--- a/rtc_base/BUILD.gn
+++ b/rtc_base/BUILD.gn
@@ -459,6 +459,12 @@ rtc_library("logging") {

Просмотреть файл

@ -30,7 +30,7 @@ index a4e3e897fd..e777a45f92 100644
enum class CaptureType { kWindow, kScreen, kAnyScreenContent };
diff --git a/modules/video_capture/video_capture.h b/modules/video_capture/video_capture.h
index e207598d68..58485f28e9 100644
index f31b239c71..7279bed476 100644
--- a/modules/video_capture/video_capture.h
+++ b/modules/video_capture/video_capture.h
@@ -13,6 +13,7 @@

Просмотреть файл

@ -732,7 +732,7 @@ index e3188b1ae1..477f9d6095 100644
}
diff --git a/modules/audio_device/BUILD.gn b/modules/audio_device/BUILD.gn
index a59ecec504..4bc3ddb784 100644
index 6f52cf8af1..a135f042db 100644
--- a/modules/audio_device/BUILD.gn
+++ b/modules/audio_device/BUILD.gn
@@ -30,6 +30,7 @@ rtc_source_set("audio_device_default") {
@ -751,7 +751,7 @@ index a59ecec504..4bc3ddb784 100644
rtc_source_set("audio_device_api") {
visibility = [ "*" ]
@@ -62,6 +64,7 @@ rtc_library("audio_device_config") {
@@ -63,6 +65,7 @@ rtc_library("audio_device_config") {
}
rtc_library("audio_device_buffer") {
@ -759,7 +759,7 @@ index a59ecec504..4bc3ddb784 100644
sources = [
"audio_device_buffer.cc",
"audio_device_buffer.h",
@@ -88,6 +91,7 @@ rtc_library("audio_device_buffer") {
@@ -89,6 +92,7 @@ rtc_library("audio_device_buffer") {
"../../system_wrappers:metrics",
]
}
@ -767,7 +767,7 @@ index a59ecec504..4bc3ddb784 100644
rtc_library("audio_device_generic") {
sources = [
@@ -265,6 +269,7 @@ if (!build_with_chromium) {
@@ -266,6 +270,7 @@ if (!build_with_chromium) {
# Contains default implementations of webrtc::AudioDeviceModule for Windows,
# Linux, Mac, iOS and Android.
rtc_library("audio_device_impl") {
@ -775,7 +775,7 @@ index a59ecec504..4bc3ddb784 100644
visibility = [ "*" ]
deps = [
":audio_device_api",
@@ -314,9 +319,9 @@ rtc_library("audio_device_impl") {
@@ -315,9 +320,9 @@ rtc_library("audio_device_impl") {
sources = [ "include/fake_audio_device.h" ]
if (build_with_mozilla) {
@ -788,7 +788,7 @@ index a59ecec504..4bc3ddb784 100644
]
}
@@ -421,6 +426,7 @@ rtc_library("audio_device_impl") {
@@ -422,6 +427,7 @@ rtc_library("audio_device_impl") {
sources += [ "dummy/file_audio_device_factory.h" ]
}
}
@ -796,7 +796,7 @@ index a59ecec504..4bc3ddb784 100644
if (is_mac) {
rtc_source_set("audio_device_impl_frameworks") {
@@ -438,6 +444,7 @@ if (is_mac) {
@@ -439,6 +445,7 @@ if (is_mac) {
}
}
@ -804,7 +804,7 @@ index a59ecec504..4bc3ddb784 100644
rtc_source_set("mock_audio_device") {
visibility = [ "*" ]
testonly = true
@@ -454,8 +461,10 @@ rtc_source_set("mock_audio_device") {
@@ -455,8 +462,10 @@ rtc_source_set("mock_audio_device") {
"../../test:test_support",
]
}
@ -1009,7 +1009,7 @@ index 730ec9bfdd..d473dbb74c 100644
"/config/external/nspr",
"/nsprpub/lib/ds",
diff --git a/rtc_base/BUILD.gn b/rtc_base/BUILD.gn
index b2615d166d..e02826fa4e 100644
index 97b56d19c4..675162739b 100644
--- a/rtc_base/BUILD.gn
+++ b/rtc_base/BUILD.gn
@@ -323,6 +323,7 @@ rtc_library("sample_counter") {
@ -1199,7 +1199,7 @@ index b2615d166d..e02826fa4e 100644
rtc_source_set("gtest_prod") {
sources = [ "gtest_prod_util.h" ]
@@ -2177,7 +2205,7 @@ if (rtc_include_tests) {
@@ -2178,7 +2206,7 @@ if (rtc_include_tests) {
}
}

Просмотреть файл

@ -10,7 +10,7 @@ Mercurial Revision: https://hg.mozilla.org/mozilla-central/rev/e826dfadfe1264c59
1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/modules/video_capture/video_capture.h b/modules/video_capture/video_capture.h
index 58485f28e9..04203033b0 100644
index 7279bed476..db07580921 100644
--- a/modules/video_capture/video_capture.h
+++ b/modules/video_capture/video_capture.h
@@ -16,6 +16,8 @@
@ -22,7 +22,7 @@ index 58485f28e9..04203033b0 100644
#include <set>
#if defined(ANDROID)
@@ -40,15 +42,18 @@ class VideoCaptureModule : public rtc::RefCountInterface {
@@ -40,15 +42,18 @@ class VideoCaptureModule : public RefCountInterface {
virtual uint32_t NumberOfDevices() = 0;
virtual int32_t Refresh() = 0;
virtual void DeviceChange() {
@ -41,7 +41,7 @@ index 58485f28e9..04203033b0 100644
auto it = _inputCallBacks.find(callBack);
if (it != _inputCallBacks.end()) {
_inputCallBacks.erase(it);
@@ -102,7 +107,8 @@ class VideoCaptureModule : public rtc::RefCountInterface {
@@ -102,7 +107,8 @@ class VideoCaptureModule : public RefCountInterface {
virtual ~DeviceInfo() {}
private:

Просмотреть файл

@ -29,7 +29,7 @@ index 8d845e2735..760ceaa3ef 100644
rtc_library("task_queue_test") {
visibility = [ "*" ]
diff --git a/rtc_base/BUILD.gn b/rtc_base/BUILD.gn
index e02826fa4e..6c76c06867 100644
index 675162739b..f085df385a 100644
--- a/rtc_base/BUILD.gn
+++ b/rtc_base/BUILD.gn
@@ -738,10 +738,14 @@ if (is_mac || is_ios) {

Просмотреть файл

@ -13,10 +13,10 @@ Mercurial Revision: https://hg.mozilla.org/mozilla-central/rev/a7362238c9e6fbe0d
1 file changed, 3 insertions(+)
diff --git a/modules/video_capture/video_capture.h b/modules/video_capture/video_capture.h
index 04203033b0..6614032299 100644
index db07580921..43a6a7f832 100644
--- a/modules/video_capture/video_capture.h
+++ b/modules/video_capture/video_capture.h
@@ -154,6 +154,9 @@ class VideoCaptureModule : public rtc::RefCountInterface {
@@ -154,6 +154,9 @@ class VideoCaptureModule : public RefCountInterface {
// Return whether the rotation is applied or left pending.
virtual bool GetApplyRotation() = 0;

Просмотреть файл

@ -76,10 +76,10 @@ index 0bec3eb765..55415845ad 100644
* Fills the membervariable _captureCapabilities with capabilites for the
* given device name.
diff --git a/modules/video_capture/video_capture.h b/modules/video_capture/video_capture.h
index 6614032299..378a53b4d2 100644
index 43a6a7f832..f59c34f8b2 100644
--- a/modules/video_capture/video_capture.h
+++ b/modules/video_capture/video_capture.h
@@ -74,7 +74,8 @@ class VideoCaptureModule : public rtc::RefCountInterface {
@@ -74,7 +74,8 @@ class VideoCaptureModule : public RefCountInterface {
uint32_t deviceUniqueIdUTF8Length,
char* productUniqueIdUTF8 = 0,
uint32_t productUniqueIdUTF8Length = 0,

Просмотреть файл

@ -28,7 +28,7 @@ class MessageDeliverer {
}
private:
struct State : public rtc::RefCountInterface {
struct State : public webrtc::RefCountInterface {
explicit State(DcSctpMessage&& m)
: has_delivered(false), message(std::move(m)) {}
bool has_delivered;

1
third_party/libwebrtc/rtc_base/BUILD.gn поставляемый
Просмотреть файл

@ -1994,6 +1994,7 @@ if (rtc_include_tests) {
":zero_memory",
"../api:array_view",
"../api:make_ref_counted",
"../api:ref_count",
"../api:scoped_refptr",
"../api/numerics",
"../api/units:data_rate",

1
third_party/libwebrtc/rtc_tools/BUILD.gn поставляемый
Просмотреть файл

@ -54,6 +54,7 @@ rtc_library("video_file_reader") {
]
deps = [
"../api:make_ref_counted",
"../api:ref_count",
"../api:scoped_refptr",
"../api/video:video_frame",
"../api/video:video_rtp_headers",

Просмотреть файл

@ -16,16 +16,16 @@
#include <iterator>
#include <string>
#include "api/ref_count.h"
#include "api/scoped_refptr.h"
#include "api/video/video_frame_buffer.h"
#include "rtc_base/ref_count.h"
namespace webrtc {
namespace test {
// Iterable class representing a sequence of I420 buffers. This class is not
// thread safe because it is expected to be backed by a file.
class Video : public rtc::RefCountInterface {
class Video : public RefCountInterface {
public:
class Iterator {
public: