Skip to content

Commit

Permalink
Merge mozilla-central to autoland on a CLOSED TREE
Browse files Browse the repository at this point in the history
  • Loading branch information
Stanca Serban committed Aug 2, 2023
2 parents 9ab2978 + cb045e3 commit fadfc4b
Show file tree
Hide file tree
Showing 722 changed files with 17,896 additions and 16,908 deletions.
2 changes: 1 addition & 1 deletion CLOBBER
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,4 @@
# don't change CLOBBER for WebIDL changes any more.


Merge day clobber 2023-07-31
Modified build files in third_party/libwebrtc - Bug 1843113 - Vendor libwebrtc from 8b5bf6dd05
3 changes: 0 additions & 3 deletions dom/media/systemservices/video_engine/desktop_capture_impl.cc
Original file line number Diff line number Diff line change
Expand Up @@ -358,9 +358,6 @@ static DesktopCaptureOptions CreateDesktopCaptureOptions() {
#if defined(WEBRTC_WIN)
if (mozilla::StaticPrefs::media_webrtc_capture_allow_directx()) {
options.set_allow_directx_capturer(true);
options.set_allow_use_magnification_api(false);
} else {
options.set_allow_use_magnification_api(true);
}
options.set_allow_cropping_window_capturer(true);
# if defined(RTC_ENABLE_WIN_WGC)
Expand Down
20 changes: 10 additions & 10 deletions dom/media/webrtc/jsapi/RTCEncodedVideoFrame.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -49,28 +49,28 @@ RTCEncodedVideoFrame::RTCEncodedVideoFrame(
mType = videoFrame.IsKeyFrame() ? RTCEncodedVideoFrameType::Key
: RTCEncodedVideoFrameType::Delta;

if (videoFrame.GetMetadata().GetFrameId().has_value()) {
mMetadata.mFrameId.Construct(*videoFrame.GetMetadata().GetFrameId());
if (videoFrame.Metadata().GetFrameId().has_value()) {
mMetadata.mFrameId.Construct(*videoFrame.Metadata().GetFrameId());
}
mMetadata.mDependencies.Construct();
for (const auto dep : videoFrame.GetMetadata().GetFrameDependencies()) {
for (const auto dep : videoFrame.Metadata().GetFrameDependencies()) {
Unused << mMetadata.mDependencies.Value().AppendElement(
static_cast<unsigned long long>(dep), fallible);
}
mMetadata.mWidth.Construct(videoFrame.GetMetadata().GetWidth());
mMetadata.mHeight.Construct(videoFrame.GetMetadata().GetHeight());
if (videoFrame.GetMetadata().GetSpatialIndex() >= 0) {
mMetadata.mWidth.Construct(videoFrame.Metadata().GetWidth());
mMetadata.mHeight.Construct(videoFrame.Metadata().GetHeight());
if (videoFrame.Metadata().GetSpatialIndex() >= 0) {
mMetadata.mSpatialIndex.Construct(
videoFrame.GetMetadata().GetSpatialIndex());
videoFrame.Metadata().GetSpatialIndex());
}
if (videoFrame.GetMetadata().GetTemporalIndex() >= 0) {
if (videoFrame.Metadata().GetTemporalIndex() >= 0) {
mMetadata.mTemporalIndex.Construct(
videoFrame.GetMetadata().GetTemporalIndex());
videoFrame.Metadata().GetTemporalIndex());
}
mMetadata.mSynchronizationSource.Construct(videoFrame.GetSsrc());
mMetadata.mPayloadType.Construct(videoFrame.GetPayloadType());
mMetadata.mContributingSources.Construct();
for (const auto csrc : videoFrame.GetMetadata().GetCsrcs()) {
for (const auto csrc : videoFrame.Metadata().GetCsrcs()) {
Unused << mMetadata.mContributingSources.Value().AppendElement(csrc,
fallible);
}
Expand Down
6 changes: 3 additions & 3 deletions dom/media/webrtc/jsapi/RTCRtpReceiver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -378,9 +378,9 @@ nsTArray<RefPtr<RTCStatsPromise>> RTCRtpReceiver::GetStatsInternal(
constructCommonInboundRtpStats(local);
local.mJitter.Construct(audioStats->jitter_ms / 1000.0);
local.mPacketsLost.Construct(audioStats->packets_lost);
local.mPacketsReceived.Construct(audioStats->packets_rcvd);
local.mPacketsReceived.Construct(audioStats->packets_received);
local.mPacketsDiscarded.Construct(audioStats->packets_discarded);
local.mBytesReceived.Construct(audioStats->payload_bytes_rcvd);
local.mBytesReceived.Construct(audioStats->payload_bytes_received);
// Always missing from libwebrtc stats
// if (audioStats->estimated_playout_ntp_timestamp_ms) {
// local.mEstimatedPlayoutTimestamp.Construct(
Expand Down Expand Up @@ -409,7 +409,7 @@ nsTArray<RefPtr<RTCStatsPromise>> RTCRtpReceiver::GetStatsInternal(
.ToDom());
}
local.mHeaderBytesReceived.Construct(
audioStats->header_and_padding_bytes_rcvd);
audioStats->header_and_padding_bytes_received);
local.mFecPacketsReceived.Construct(
audioStats->fec_packets_received);
local.mFecPacketsDiscarded.Construct(
Expand Down
2 changes: 1 addition & 1 deletion dom/media/webrtc/jsapi/RTCRtpScriptTransformer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -316,7 +316,7 @@ void RTCRtpScriptTransformer::TransformFrame(
ResolveGenerateKeyFramePromises(videoFrame->GetRid(),
videoFrame->GetTimestamp());
if (!videoFrame->GetRid().empty() &&
videoFrame->GetMetadata().GetSimulcastIdx() == 0) {
videoFrame->Metadata().GetSimulcastIdx() == 0) {
ResolveGenerateKeyFramePromises("", videoFrame->GetTimestamp());
}
}
Expand Down
35 changes: 27 additions & 8 deletions dom/media/webrtc/libwebrtcglue/AudioConduit.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -621,6 +621,32 @@ void WebrtcAudioConduit::OnRtpReceived(webrtc::RtpPacketReceived&& aPacket,
aPacket.SequenceNumber(), aPacket.size(), aPacket.Ssrc(),
aPacket.Ssrc());

// Libwebrtc commit cde4b67d9d now expect calls to
// SourceTracker::GetSources() to happen on the call thread. We'll
// grab the value now while on the call thread, and dispatch to main
// to store the cached value if we have new source information.
// See Bug 1845621.
std::vector<webrtc::RtpSource> sources;
if (mRecvStream) {
sources = mRecvStream->GetSources();
}

bool needsCacheUpdate = false;
{
AutoReadLock lock(mLock);
needsCacheUpdate = sources != mRtpSources;
}

// only dispatch to main if we have new data
if (needsCacheUpdate) {
GetMainThreadSerialEventTarget()->Dispatch(NS_NewRunnableFunction(
__func__, [this, rtpSources = std::move(sources),
self = RefPtr<WebrtcAudioConduit>(this)]() {
AutoWriteLock lock(mLock);
mRtpSources = rtpSources;
}));
}

mRtpPacketEvent.Notify();
if (mCall->Call()) {
mCall->Call()->Receiver()->DeliverRtpPacket(
Expand Down Expand Up @@ -819,14 +845,7 @@ bool WebrtcAudioConduit::IsSamplingFreqSupported(int freq) const {
std::vector<webrtc::RtpSource> WebrtcAudioConduit::GetUpstreamRtpSources()
const {
MOZ_ASSERT(NS_IsMainThread());
std::vector<webrtc::RtpSource> sources;
{
AutoReadLock lock(mLock);
if (mRecvStream) {
sources = mRecvStream->GetSources();
}
}
return sources;
return mRtpSources;
}

/* Return block-length of 10 ms audio frame in number of samples */
Expand Down
4 changes: 4 additions & 0 deletions dom/media/webrtc/libwebrtcglue/AudioConduit.h
Original file line number Diff line number Diff line change
Expand Up @@ -289,6 +289,10 @@ class WebrtcAudioConduit : public AudioSessionConduit,
// To track changes needed to mRtpSendBaseSeqs.
std::map<uint32_t, uint16_t> mRtpSendBaseSeqs_n;

// Written only on the main thread. Guarded by mLock, except for
// reads on the main thread.
std::vector<webrtc::RtpSource> mRtpSources;

// Thread safe
Atomic<bool> mTransportActive = Atomic<bool>(false);
MediaEventProducer<void> mRtcpByeEvent;
Expand Down
35 changes: 27 additions & 8 deletions dom/media/webrtc/libwebrtcglue/VideoConduit.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1535,6 +1535,32 @@ void WebrtcVideoConduit::OnRtpReceived(webrtc::RtpPacketReceived&& aPacket,
aPacket.SequenceNumber(), aPacket.size(), aPacket.Ssrc(),
aPacket.Ssrc());

// Libwebrtc commit cde4b67d9d now expect calls to
// SourceTracker::GetSources() to happen on the call thread. We'll
// grab the value now while on the call thread, and dispatch to main
// to store the cached value if we have new source information.
// See Bug 1845621.
std::vector<webrtc::RtpSource> sources;
if (mRecvStream) {
sources = mRecvStream->GetSources();
}

bool needsCacheUpdate = false;
{
MutexAutoLock lock(mMutex);
needsCacheUpdate = sources != mRtpSources;
}

// only dispatch to main if we have new data
if (needsCacheUpdate) {
GetMainThreadSerialEventTarget()->Dispatch(NS_NewRunnableFunction(
__func__, [this, rtpSources = std::move(sources),
self = RefPtr<WebrtcVideoConduit>(this)]() {
MutexAutoLock lock(mMutex);
mRtpSources = rtpSources;
}));
}

mRtpPacketEvent.Notify();
if (mCall->Call()) {
mCall->Call()->Receiver()->DeliverRtpPacket(
Expand Down Expand Up @@ -1928,14 +1954,7 @@ void WebrtcVideoConduit::SetTransportActive(bool aActive) {
std::vector<webrtc::RtpSource> WebrtcVideoConduit::GetUpstreamRtpSources()
const {
MOZ_ASSERT(NS_IsMainThread());
std::vector<webrtc::RtpSource> sources;
{
MutexAutoLock lock(mMutex);
if (mRecvStream) {
sources = mRecvStream->GetSources();
}
}
return sources;
return mRtpSources;
}

void WebrtcVideoConduit::RequestKeyFrame(FrameTransformerProxy* aProxy) {
Expand Down
4 changes: 4 additions & 0 deletions dom/media/webrtc/libwebrtcglue/VideoConduit.h
Original file line number Diff line number Diff line change
Expand Up @@ -487,6 +487,10 @@ class WebrtcVideoConduit
// Protected by mRendererMonitor
dom::RTCVideoFrameHistoryInternal mReceivedFrameHistory;

// Written only on the main thread. Guarded by mMutex, except for
// reads on the main thread.
std::vector<webrtc::RtpSource> mRtpSources;

// Thread safe
Atomic<bool> mTransportActive = Atomic<bool>(false);
MediaEventProducer<void> mRtcpByeEvent;
Expand Down
18 changes: 9 additions & 9 deletions dom/media/webrtc/third_party_build/default_config_env
Original file line number Diff line number Diff line change
Expand Up @@ -9,34 +9,34 @@ export MOZ_LIBWEBRTC_SRC=$STATE_DIR/moz-libwebrtc
# the commit summary as each upstream commit is vendored into the
# mercurial repository. The bug used for the v106 fast-forward was
# 1800920.
export MOZ_FASTFORWARD_BUG="1839451"
export MOZ_FASTFORWARD_BUG="1843113"

# MOZ_NEXT_LIBWEBRTC_MILESTONE and MOZ_NEXT_FIREFOX_REL_TARGET are
# not used during fast-forward processing, but facilitate generating this
# default config. To generate an default config for the next update, run
# bash dom/media/webrtc/third_party_build/update_default_config_env.sh
export MOZ_NEXT_LIBWEBRTC_MILESTONE=113
export MOZ_NEXT_FIREFOX_REL_TARGET=117
export MOZ_NEXT_LIBWEBRTC_MILESTONE=114
export MOZ_NEXT_FIREFOX_REL_TARGET=118

# For Chromium release branches, see:
# https://chromiumdash.appspot.com/branches

# Chromium's v112 release branch was 5615. This is used to pre-stack
# Chromium's v113 release branch was 5672. This is used to pre-stack
# the previous release branch's commits onto the appropriate base commit
# (the first common commit between trunk and the release branch).
export MOZ_PRIOR_UPSTREAM_BRANCH_HEAD_NUM="5615"
export MOZ_PRIOR_UPSTREAM_BRANCH_HEAD_NUM="5672"

# New target release branch for v113 is branch-heads/5672. This is used
# New target release branch for v114 is branch-heads/5735. This is used
# to calculate the next upstream commit.
export MOZ_TARGET_UPSTREAM_BRANCH_HEAD="branch-heads/5672"
export MOZ_TARGET_UPSTREAM_BRANCH_HEAD="branch-heads/5735"

# For local development 'mozpatches' is fine for a branch name, but when
# pushing the patch stack to github, it should be named something like
# 'moz-mods-chr113-for-rel117'.
# 'moz-mods-chr114-for-rel118'.
export MOZ_LIBWEBRTC_BRANCH="mozpatches"

# After elm has been merged to mozilla-central, the patch stack in
# moz-libwebrtc should be pushed to github. The script
# push_official_branch.sh uses this branch name when pushing to the
# public repo.
export MOZ_LIBWEBRTC_OFFICIAL_BRANCH="moz-mods-chr113-for-rel117"
export MOZ_LIBWEBRTC_OFFICIAL_BRANCH="moz-mods-chr114-for-rel118"
1 change: 1 addition & 0 deletions third_party/libwebrtc/AUTHORS
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,7 @@ Yura Yaroshevich <[email protected]>
Yuriy Pavlyshak <[email protected]>
Yusuke Suzuki <[email protected]>
Pengfei Han <[email protected]>
Yingying Ma <[email protected]>
# END individuals section.

# BEGIN organizations section.
Expand Down
27 changes: 20 additions & 7 deletions third_party/libwebrtc/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -503,6 +503,16 @@ if (!build_with_chromium) {
"api/task_queue",
"api/task_queue:default_task_queue_factory",
"api/test/metrics",
"api/video_codecs:video_decoder_factory_template",
"api/video_codecs:video_decoder_factory_template_dav1d_adapter",
"api/video_codecs:video_decoder_factory_template_libvpx_vp8_adapter",
"api/video_codecs:video_decoder_factory_template_libvpx_vp9_adapter",
"api/video_codecs:video_decoder_factory_template_open_h264_adapter",
"api/video_codecs:video_encoder_factory_template",
"api/video_codecs:video_encoder_factory_template_libaom_av1_adapter",
"api/video_codecs:video_encoder_factory_template_libvpx_vp8_adapter",
"api/video_codecs:video_encoder_factory_template_libvpx_vp9_adapter",
"api/video_codecs:video_encoder_factory_template_open_h264_adapter",
"audio",
"call",
"common_audio",
Expand All @@ -527,6 +537,16 @@ if (!build_with_chromium) {
"api/task_queue",
"api/task_queue:default_task_queue_factory",
"api/test/metrics",
"api/video_codecs:video_decoder_factory_template",
"api/video_codecs:video_decoder_factory_template_dav1d_adapter",
"api/video_codecs:video_decoder_factory_template_libvpx_vp8_adapter",
"api/video_codecs:video_decoder_factory_template_libvpx_vp9_adapter",
"api/video_codecs:video_decoder_factory_template_open_h264_adapter",
"api/video_codecs:video_encoder_factory_template",
"api/video_codecs:video_encoder_factory_template_libaom_av1_adapter",
"api/video_codecs:video_encoder_factory_template_libvpx_vp8_adapter",
"api/video_codecs:video_encoder_factory_template_libvpx_vp9_adapter",
"api/video_codecs:video_encoder_factory_template_open_h264_adapter",
"logging:rtc_event_log_api",
"p2p:rtc_p2p",
"pc:libjingle_peerconnection",
Expand All @@ -542,13 +562,6 @@ if (!build_with_chromium) {
]
}

if (rtc_include_builtin_video_codecs) {
deps += [
"api/video_codecs:builtin_video_decoder_factory",
"api/video_codecs:builtin_video_encoder_factory",
]
}

if (build_with_mozilla) {
deps += [
"api/video:video_frame",
Expand Down
Loading

0 comments on commit fadfc4b

Please sign in to comment.