There is a race condition in NetworkMonitor where native observers may be removed concurrently with a notification being dispatched, leading to a dangling pointer dereference (trying to dispatch an observer that was already removed and destroyed), and from there a crash with access violation.
By ensuring dispatching to native observers is done within the synchronization lock that guards additions/removals of native observers protects against this race condition.
Since native observers callbacks are posted to the networking thread in the C++ side anyway, there should be no risk of deadlock/starvation due to long-running observers.
Bug: webrtc:15837
Change-Id: Id2b788f102dbd25de76ceed434c4cd68aa9a569e
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/338643
Reviewed-by: Taylor Brandstetter <deadbeef@webrtc.org>
Commit-Queue: Harald Alvestrand <hta@webrtc.org>
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#42256}
And add PORTALLOCATOR_ENABLE_ANY_ADDRESS_PORTS
which makes WebRTC allocate an unbound port.
BUG=None
Tested: Manually (not the flag, but that it doesn't break anything)
Change-Id: Iba541eb366f111e5ab7844bb3a2dc25ca0838cfe
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/347881
Commit-Queue: Jonas Oreland <jonaso@webrtc.org>
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#42119}
This way VP8Decoder and DecoderFallback would use propagated instead of global field trials.
Bug: webrtc:15791, webrtc:10335
Change-Id: I5ad5fae38f5b9379bc6376334562c154fbc56e39
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/340040
Reviewed-by: Sergey Silkin <ssilkin@webrtc.org>
Auto-Submit: Danil Chapovalov <danilchap@webrtc.org>
Commit-Queue: Sergey Silkin <ssilkin@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#41763}
Force and thus guarantee VideoDecoder created through java wrappers get access to the webrtc::Environment
Bug: webrtc:15791
Change-Id: I3f145937c0b914c8e34b24e1ecc55da756551069
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/338441
Reviewed-by: Sergey Silkin <ssilkin@webrtc.org>
Commit-Queue: Danil Chapovalov <danilchap@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#41745}
The regression obseverved on Samung devices the last time was caused
by the not detaching the context/surface prior to releasing an
EGLSurface or EGLContext. This was fine on most devices but obviously
not all.
Bug: b/225229697
Change-Id: I1849c772f3ed3e8819c748d997e5261289c4b2bc
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/321842
Commit-Queue: Linus Nilsson <lnilsson@webrtc.org>
Reviewed-by: Zoé Lepaul <xalep@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#40844}
This makes it show up as an individual track in perfetto
allowing rendering to be more easily inspected.
https://screenshot.googleplex.com/3eyicjpxdKaG3oE
Bug: b/217863437
Change-Id: I2710a8709141fda50ec613390161ab9c6526b931
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/328381
Auto-Submit: Linus Nilsson <lnilsson@webrtc.org>
Commit-Queue: Linus Nilsson <lnilsson@webrtc.org>
Reviewed-by: Zoé Lepaul <xalep@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#41222}
This gives the option to synchronize rendering updates with
the display refresh cycle and limit effective updates to a certain frame
rate.
go/meet-android-synchronized-rendering
Bug: b/217863437
Change-Id: I4938a10f4e80d98a17e28f2e397fbb95117a3e4c
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/325061
Reviewed-by: Ranveer Aggarwal <ranvr@webrtc.org>
Commit-Queue: Linus Nilsson <lnilsson@webrtc.org>
Reviewed-by: Sergey Silkin <ssilkin@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#41012}
RenderSynchronizer is used to coordinate video rendering updates
to a specific frame rate target and aligned to display refresh cycles.
go/meet-android-synchronized-rendering
Bug: b/217863437
Change-Id: Ie329c4c2eccfb0c9aee9b90f7ddbc370919d5e86
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/324840
Reviewed-by: Ranveer Aggarwal <ranvr@webrtc.org>
Reviewed-by: Sergey Silkin <ssilkin@webrtc.org>
Commit-Queue: Linus Nilsson <lnilsson@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#41004}
LegacyAudioDeviceModule depends on
org.webrtc.voiceengine.WebRtcAudioTrack and
org.webrtc.voiceengine.WebRtcAudioRecord, which were removed in
https://webrtc.googlesource.com/src/+/6fc700ec3d1f86d06e203011aa8f375f32b39d9e.
Including LegacyAudioDeviceModule results in build failures like:
> /builds/worker/checkouts/gecko/third_party/libwebrtc/sdk/android/api/org/webrtc/audio/LegacyAudioDeviceModule.java:13: error: package org.webrtc.voiceengine does not exist
> import org.webrtc.voiceengine.WebRtcAudioRecord;
> ^
> /builds/worker/checkouts/gecko/third_party/libwebrtc/sdk/android/api/org/webrtc/audio/LegacyAudioDeviceModule.java:14: error: package org.webrtc.voiceengine does not exist
> import org.webrtc.voiceengine.WebRtcAudioTrack;
> ^
> /builds/worker/checkouts/gecko/third_party/libwebrtc/sdk/android/api/org/webrtc/audio/LegacyAudioDeviceModule.java:39: error: non-static method setSpeakerMute(boolean) cannot be referenced from a static context
> WebRtcAudioTrack.setSpeakerMute(mute);
> ^
> /builds/worker/checkouts/gecko/third_party/libwebrtc/sdk/android/api/org/webrtc/audio/LegacyAudioDeviceModule.java:44: error: non-static method setMicrophoneMute(boolean) cannot be referenced from a static context
> WebRtcAudioRecord.setMicrophoneMute(mute);
Bug: webrtc:7452
Change-Id: Icaa4447ec6dc274d89f827ce4d1cc13c3e9f55ad
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/323880
Reviewed-by: Henrik Andreassson <henrika@webrtc.org>
Commit-Queue: Henrik Andreassson <henrika@webrtc.org>
Reviewed-by: Björn Terelius <terelius@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#40953}
The regression obseverved on Samung devices the last time was caused
by the not detaching the context/surface prior to releasing an
EGLSurface or EGLContext. This was fine on most devices but obviously
not all.
Bug: b/225229697
Change-Id: I1849c772f3ed3e8819c748d997e5261289c4b2bc
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/321842
Commit-Queue: Linus Nilsson <lnilsson@webrtc.org>
Reviewed-by: Zoé Lepaul <xalep@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#40844}
This allows EglRenderer to be able to share render thread and EGLContext
with others.
go/meet-android-eglcontext-reduction
Bug: b/225229697
Change-Id: I896c8082ef8b64f5b544fa2eda7303fbca3985d1
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/316881
Reviewed-by: Xavier Lepaul <xalep@webrtc.org>
Commit-Queue: Linus Nilsson <lnilsson@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#40574}
This avoids the need of hard coding the values to use networkIgnoreMask on Android platform.
Bug: None
Change-Id: Ib5e860913cec2c6d41cfa1b778cb122d0bfe1300
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/311780
Reviewed-by: Sergey Silkin <ssilkin@webrtc.org>
Commit-Queue: Sergey Silkin <ssilkin@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#40541}
This allows EglRenderer to preserve existing behavior of
not sending any more tasks to the render thread after an
GL exception has been thrown.
Bug: b/225229697
Change-Id: I09e7cc48bf139aab4c9e147c2b24972ccd401672
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/311548
Reviewed-by: Sergey Silkin <ssilkin@webrtc.org>
Commit-Queue: Linus Nilsson <lnilsson@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#40419}
Not doing so seems to have caused issues with creating window surfaces
on that context later on.
Bug: b/225229697
Change-Id: Id202c93c4e51d1661e79a4b37751d11fcd64c119
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/311462
Reviewed-by: Xavier Lepaul <xalep@webrtc.org>
Commit-Queue: Linus Nilsson <lnilsson@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#40411}
Is useful for app that has parts in java and parts in native,
that can pass down native pointer rather than java object,
and get the native pointer using up-call.
Many/most other objects expose their native pointer
for these use cases.
BUG=None
Change-Id: I352d4de388525abb09733d38b6af6651770d0498
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/307460
Reviewed-by: Xavier Lepaul <xalep@webrtc.org>
Commit-Queue: Jonas Oreland <jonaso@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#40203}
None of these native methods perform null checks. Some of the Java
delegates were doing some null checks, but calling others with null
parameters would just result in native crashes that often lack context.
These more systematic checks will make debugging easier.
Bug: b/282038690
Change-Id: I3363abeede84c1bd93da397fe87c3d638a607107
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/306961
Reviewed-by: Linus Nilsson <lnilsson@webrtc.org>
Commit-Queue: Xavier Lepaul <xalep@webrtc.org>
Reviewed-by: Ranveer Aggarwal <ranvr@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#40175}
EglThread can be shared by multiple clients each using their own
EglBase instance, but sharing thread and EglConnection.
go/meet-android-eglcontext-reduction
Bug: b/225229697
Change-Id: I2d18b92bdef51362a9dbd9c0af56cb868e29869d
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/305462
Reviewed-by: Magnus Jedvert <magjed@webrtc.org>
Commit-Queue: Linus Nilsson <lnilsson@webrtc.org>
Reviewed-by: Xavier Lepaul <xalep@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#40121}
Recreating the VirtualDisplay will require new user permission dialog,
so resize instead when possible.
Bug: b/281978124
Change-Id: I3b6939720897c038c9e598433372342cf72e001e
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/305560
Reviewed-by: Xavier Lepaul <xalep@webrtc.org>
Commit-Queue: Linus Nilsson <lnilsson@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#40084}
This enables clients of EglBase to keep using it but
share underlying EGLContext with other clients.
go/meet-android-eglcontext-reduction
Bug: b/225229697
Change-Id: I42719f25be7db169c39878b57a5f1487e3c1894e
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/301941
Reviewed-by: Magnus Jedvert <magjed@webrtc.org>
Commit-Queue: Linus Nilsson <lnilsson@webrtc.org>
Reviewed-by: Xavier Lepaul <xalep@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#39961}
https://webrtc-review.googlesource.com/c/src/+/240680 made encoder aware of stride and slice height of input buffer but calculation of buffer size passed to queueInputBuffer() was not updated.
Bug: webrtc:13427
Change-Id: Iba8687f56eda148ac67b331d35c45317a4ec5c59
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/301321
Reviewed-by: Mirta Dvornicic <mirtad@webrtc.org>
Commit-Queue: Sergey Silkin <ssilkin@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#39895}