Commit graph

500 commits

Author SHA1 Message Date
Jim Gustafson
a322dda556
Add audio device module for android based on Oboe 2024-07-03 12:28:41 -07:00
Jim Gustafson
16dbd7a436 Remove support for setting mobile aec 2024-06-28 14:28:54 -07:00
Jim Gustafson
99c102adad m126 merge fixes 2024-06-25 14:25:19 -07:00
Jim Gustafson
49c96f3e79 Merge remote-tracking branch 'google/branch-heads/6478' 2024-06-21 16:31:45 -07:00
Jim Gustafson
c43adafcd5 Merge m123/6312 2024-06-12 22:25:35 -07:00
Guy Hershenbaum
94dfe1cc59 Fix NetworkMonitor race condition when dispatching native observers
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}
2024-05-08 08:27:19 +00:00
Jonas Oreland
299b285696 Add PortAllocatorFlags to JAVA API
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}
2024-04-19 07:00:22 +00:00
Danil Chapovalov
007a62d83d Cleanup sdk android code from using VideoEncoderFactory::CreateVideoEncoder
To force webrtc::Environment propagation through android VideoEncoderFactory wrappers

Bug: webrtc:15860
Change-Id: Icad7249b47a5c738b089e09714c729f91eddaf5d
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/342960
Commit-Queue: Danil Chapovalov <danilchap@webrtc.org>
Reviewed-by: Sergey Silkin <ssilkin@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#41936}
2024-03-21 10:18:37 +00:00
Danil Chapovalov
f3096afd48 Propagate Environment to create VideoEncoder through java wrappers
Bug: webrtc:15860
Change-Id: If1a2873a899e1b839822a4b56aa87d4bae70c581
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/342740
Reviewed-by: Sergey Silkin <ssilkin@webrtc.org>
Commit-Queue: Danil Chapovalov <danilchap@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#41887}
2024-03-12 15:34:12 +00:00
Danil Chapovalov
0355f455a4 Use Environment propagated through android sdk
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}
2024-02-19 15:54:39 +00:00
Danil Chapovalov
2eee89e904 Cleanup webrtc::Environment propagation through java wrappers
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}
2024-02-15 13:33:48 +00:00
Jim Gustafson
c37ca3fc86 Merge branch m122 2024-02-14 22:44:28 -08:00
Danil Chapovalov
22b6564d77 Propagate webrtc::Environment to create VideoDecoder through java wrappers
Bug: webrtc:15791
Change-Id: I25976158ef780211355deb934e83d275d4f881e2
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/336980
Reviewed-by: Sergey Silkin <ssilkin@webrtc.org>
Commit-Queue: Danil Chapovalov <danilchap@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#41686}
2024-02-07 11:58:20 +00:00
Linus Nilsson
c8e0a21126 Adopt EglThread in EglRenderer once again.
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}
2024-01-23 09:51:58 -08:00
Jim Gustafson
3d44a9e3b5 Merge branch m120 2024-01-17 12:11:58 -08:00
Linus Nilsson
518e181ab5 Trace render window state using a counter.
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}
2023-11-23 14:56:31 +00:00
Tomas Gunnarsson
3a15ba6fbf Reland^2 "Reland: Remove unsupported configuration value, allow_codec_switching"
This reverts commit 117d847901.

Reason for revert: Downstream error has been corrected.

Original change's description:
> Revert "Reland: Remove unsupported configuration value, `allow_codec_switching`"
>
> This reverts commit 23501a2aa6.
>
> Reason for revert: Breaks downstream features
>
> Original change's description:
> > Reland: Remove unsupported configuration value, `allow_codec_switching`
> >
> > This reverts commit 6b0c5babe0.
> >
> > Reason for revert: Relanding once downstream issues have been addressed
> >
> > Original change's description:
> > > Revert "Remove unsupported configuration value, `allow_codec_switching`"
> > >
> > > This reverts commit 8f7a17f80f.
> > >
> > > Reason for revert: breaks downstream
> > >
> > > Original change's description:
> > > > Remove unsupported configuration value, `allow_codec_switching`
> > > >
> > > > Bug: webrtc:11341
> > > > Change-Id: I8ff598848996bd63ccc572e11f8f69c892a4a459
> > > > Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/324284
> > > > Reviewed-by: Philip Eliasson <philipel@webrtc.org>
> > > > Commit-Queue: Tomas Gunnarsson <tommi@webrtc.org>
> > > > Cr-Commit-Position: refs/heads/main@{#40995}
> > >
> > > Bug: webrtc:11341
> > > Change-Id: I784fd95062fc71f8dcc139b05121985f60709004
> > > No-Presubmit: true
> > > No-Tree-Checks: true
> > > No-Try: true
> > > Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/324780
> > > Owners-Override: Philip Eliasson <philipel@webrtc.org>
> > > Bot-Commit: rubber-stamper@appspot.gserviceaccount.com <rubber-stamper@appspot.gserviceaccount.com>
> > > Commit-Queue: Philip Eliasson <philipel@webrtc.org>
> > > Cr-Commit-Position: refs/heads/main@{#40998}
> >
> > Bug: webrtc:11341
> > Change-Id: I3cb3e699fd76942c51f0f42a99bcb19ac607632e
> > No-Presubmit: true
> > No-Tree-Checks: true
> > No-Try: true
> > Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/324782
> > Bot-Commit: rubber-stamper@appspot.gserviceaccount.com <rubber-stamper@appspot.gserviceaccount.com>
> > Commit-Queue: Tomas Gunnarsson <tommi@webrtc.org>
> > Cr-Commit-Position: refs/heads/main@{#41032}
>
> Bug: webrtc:11341
> Change-Id: I0eb8e6a464a8a51e6359caf8f43231dc275c4f20
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/327382
> Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org>
> Auto-Submit: Tomas Gunnarsson <tommi@webrtc.org>
> Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
> Commit-Queue: Tomas Gunnarsson <tommi@webrtc.org>
> Cr-Commit-Position: refs/heads/main@{#41161}

Bug: webrtc:11341
Change-Id: I4a5390a3b8c5e665b742fc564709847ad8853ba9
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/328160
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Commit-Queue: Tomas Gunnarsson <tommi@webrtc.org>
Reviewed-by: Philip Eliasson <philipel@webrtc.org>
Bot-Commit: rubber-stamper@appspot.gserviceaccount.com <rubber-stamper@appspot.gserviceaccount.com>
Cr-Commit-Position: refs/heads/main@{#41213}
2023-11-22 13:22:08 +00:00
Tomas Gunnarsson
117d847901 Revert "Reland: Remove unsupported configuration value, allow_codec_switching"
This reverts commit 23501a2aa6.

Reason for revert: Breaks downstream features

Original change's description:
> Reland: Remove unsupported configuration value, `allow_codec_switching`
>
> This reverts commit 6b0c5babe0.
>
> Reason for revert: Relanding once downstream issues have been addressed
>
> Original change's description:
> > Revert "Remove unsupported configuration value, `allow_codec_switching`"
> >
> > This reverts commit 8f7a17f80f.
> >
> > Reason for revert: breaks downstream
> >
> > Original change's description:
> > > Remove unsupported configuration value, `allow_codec_switching`
> > >
> > > Bug: webrtc:11341
> > > Change-Id: I8ff598848996bd63ccc572e11f8f69c892a4a459
> > > Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/324284
> > > Reviewed-by: Philip Eliasson <philipel@webrtc.org>
> > > Commit-Queue: Tomas Gunnarsson <tommi@webrtc.org>
> > > Cr-Commit-Position: refs/heads/main@{#40995}
> >
> > Bug: webrtc:11341
> > Change-Id: I784fd95062fc71f8dcc139b05121985f60709004
> > No-Presubmit: true
> > No-Tree-Checks: true
> > No-Try: true
> > Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/324780
> > Owners-Override: Philip Eliasson <philipel@webrtc.org>
> > Bot-Commit: rubber-stamper@appspot.gserviceaccount.com <rubber-stamper@appspot.gserviceaccount.com>
> > Commit-Queue: Philip Eliasson <philipel@webrtc.org>
> > Cr-Commit-Position: refs/heads/main@{#40998}
>
> Bug: webrtc:11341
> Change-Id: I3cb3e699fd76942c51f0f42a99bcb19ac607632e
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/324782
> Bot-Commit: rubber-stamper@appspot.gserviceaccount.com <rubber-stamper@appspot.gserviceaccount.com>
> Commit-Queue: Tomas Gunnarsson <tommi@webrtc.org>
> Cr-Commit-Position: refs/heads/main@{#41032}

Bug: webrtc:11341
Change-Id: I0eb8e6a464a8a51e6359caf8f43231dc275c4f20
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/327382
Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org>
Auto-Submit: Tomas Gunnarsson <tommi@webrtc.org>
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Commit-Queue: Tomas Gunnarsson <tommi@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#41161}
2023-11-15 08:10:28 +00:00
Linus Nilsson
31493acb93 Revert "Adopt EglThread in EglRenderer"
This reverts commit ad3f1bcc1b.

Reason for revert: Causing crashes: b/286664896

Original change's description:
> Adopt EglThread in EglRenderer
>
> 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}

Bug: b/225229697
Change-Id: Ib6f1d787445ca7d679fb114478716526e51a6057
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/319541
Reviewed-by: Jeremy Leconte <jleconte@google.com>
Owners-Override: Jeremy Leconte <jleconte@google.com>
Commit-Queue: Jeremy Leconte <jleconte@google.com>
Cr-Commit-Position: refs/heads/main@{#40734}
2023-11-07 15:00:36 -06:00
inaqui-signal
fa4fd71354 Merge branch 'm118' 2023-11-07 15:00:28 -06:00
Magnus Jedvert
783f1d850e Remove excessive logging in EglRenderer
Bug: None
Change-Id: I26f842395fc36c41de0b791f93a61120f07c9ac9
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/325380
Reviewed-by: Fabian Bergmark <fabianbergmark@google.com>
Commit-Queue: Magnus Jedvert <magjed@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#41044}
2023-10-31 09:08:40 +00:00
Per Åhgren
28a7eed7e1 Add support for setPreferredMicrophoneFieldDimension API call in the WebRTC SDK
Bug: b/306637040
Change-Id: I128a498aa307f6d61406ddcf4917a97ba6ae75db
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/325240
Commit-Queue: Per Åhgren <peah@webrtc.org>
Reviewed-by: Zoé Lepaul <xalep@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#41034}
2023-10-30 08:13:10 +00:00
Tomas Gunnarsson
23501a2aa6 Reland: Remove unsupported configuration value, allow_codec_switching
This reverts commit 6b0c5babe0.

Reason for revert: Relanding once downstream issues have been addressed

Original change's description:
> Revert "Remove unsupported configuration value, `allow_codec_switching`"
>
> This reverts commit 8f7a17f80f.
>
> Reason for revert: breaks downstream
>
> Original change's description:
> > Remove unsupported configuration value, `allow_codec_switching`
> >
> > Bug: webrtc:11341
> > Change-Id: I8ff598848996bd63ccc572e11f8f69c892a4a459
> > Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/324284
> > Reviewed-by: Philip Eliasson <philipel@webrtc.org>
> > Commit-Queue: Tomas Gunnarsson <tommi@webrtc.org>
> > Cr-Commit-Position: refs/heads/main@{#40995}
>
> Bug: webrtc:11341
> Change-Id: I784fd95062fc71f8dcc139b05121985f60709004
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/324780
> Owners-Override: Philip Eliasson <philipel@webrtc.org>
> Bot-Commit: rubber-stamper@appspot.gserviceaccount.com <rubber-stamper@appspot.gserviceaccount.com>
> Commit-Queue: Philip Eliasson <philipel@webrtc.org>
> Cr-Commit-Position: refs/heads/main@{#40998}

Bug: webrtc:11341
Change-Id: I3cb3e699fd76942c51f0f42a99bcb19ac607632e
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/324782
Bot-Commit: rubber-stamper@appspot.gserviceaccount.com <rubber-stamper@appspot.gserviceaccount.com>
Commit-Queue: Tomas Gunnarsson <tommi@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#41032}
2023-10-28 16:07:41 +00:00
Linus Nilsson
40ce7674c4 Adopt RenderSynchronizer in EglThread and EglRenderer
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}
2023-10-26 08:59:24 +00:00
Linus Nilsson
52ac8eccdf Add RenderSynchronizer class
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}
2023-10-25 09:18:56 +00:00
Philip Eliasson
6b0c5babe0 Revert "Remove unsupported configuration value, allow_codec_switching"
This reverts commit 8f7a17f80f.

Reason for revert: breaks downstream

Original change's description:
> Remove unsupported configuration value, `allow_codec_switching`
>
> Bug: webrtc:11341
> Change-Id: I8ff598848996bd63ccc572e11f8f69c892a4a459
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/324284
> Reviewed-by: Philip Eliasson <philipel@webrtc.org>
> Commit-Queue: Tomas Gunnarsson <tommi@webrtc.org>
> Cr-Commit-Position: refs/heads/main@{#40995}

Bug: webrtc:11341
Change-Id: I784fd95062fc71f8dcc139b05121985f60709004
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/324780
Owners-Override: Philip Eliasson <philipel@webrtc.org>
Bot-Commit: rubber-stamper@appspot.gserviceaccount.com <rubber-stamper@appspot.gserviceaccount.com>
Commit-Queue: Philip Eliasson <philipel@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#40998}
2023-10-24 08:19:46 +00:00
Tommi
8f7a17f80f Remove unsupported configuration value, allow_codec_switching
Bug: webrtc:11341
Change-Id: I8ff598848996bd63ccc572e11f8f69c892a4a459
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/324284
Reviewed-by: Philip Eliasson <philipel@webrtc.org>
Commit-Queue: Tomas Gunnarsson <tommi@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#40995}
2023-10-24 05:07:25 +00:00
Andreas Pehrson
1d835705c9 Remove LegacyAudioDeviceModule.java
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}
2023-10-17 14:06:44 +00:00
Linus Nilsson
dd15070b45 Adopt EglThread in EglRenderer once again.
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}
2023-09-29 13:37:21 +00:00
Rashad Sookram
e667578458
Allow configuration of audio jitter buffer max target delay 2023-09-21 12:01:06 -04:00
Linus Nilsson
46c57c6686 Revert "Adopt EglThread in EglRenderer"
This reverts commit ad3f1bcc1b.

Reason for revert: Causing crashes: b/286664896

Original change's description:
> Adopt EglThread in EglRenderer
>
> 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}

Bug: b/225229697
Change-Id: Ib6f1d787445ca7d679fb114478716526e51a6057
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/319541
Reviewed-by: Jeremy Leconte <jleconte@google.com>
Owners-Override: Jeremy Leconte <jleconte@google.com>
Commit-Queue: Jeremy Leconte <jleconte@google.com>
Cr-Commit-Position: refs/heads/main@{#40734}
2023-09-12 06:56:26 +00:00
Per Åhgren
9acda0b8ac Add support for toggling noise suppression effect on Android
Change-Id: I4868bd6531bde08c4108b0941086add210660dcb

Bug: b/279738239
Change-Id: I4868bd6531bde08c4108b0941086add210660dcb
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/318320
Reviewed-by: Xavier Lepaul‎ <xalep@webrtc.org>
Reviewed-by: Per Åhgren <peah@webrtc.org>
Commit-Queue: Per Åhgren <peah@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#40672}
2023-08-31 13:16:58 +00:00
Linus Nilsson
ad3f1bcc1b Adopt EglThread in EglRenderer
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}
2023-08-18 21:05:57 +00:00
Magnus Jedvert
70483a59aa Add unscaled getWidth/Height to TextureBuffer interface
Bug: b/289762633
Change-Id: I36a8c108ca03d464cd4dd08441dc9b64077343c1
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/316860
Commit-Queue: Magnus Jedvert <magjed@webrtc.org>
Reviewed-by: Fabian Bergmark <fabianbergmark@google.com>
Cr-Commit-Position: refs/heads/main@{#40567}
2023-08-18 12:04:32 +00:00
MohamedRisaldarTA
b9876488e9 Exposed Adapter types for Android
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}
2023-08-11 08:29:14 +00:00
inaqui-signal
c570368abc Merge branch 'm116' into 5845 2023-08-09 14:40:20 -05:00
Linus Nilsson
4200233adc Add exception callbacks to EglThread
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}
2023-07-11 20:21:22 +00:00
Linus Nilsson
4e5b89f77b Create the EGLContext on the thread it will be used on.
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}
2023-07-10 10:11:12 +00:00
Linus Nilsson
febf55853b Revert "Adopt EglThread in EglRenderer"
This reverts commit f4d0a493b4.

Reason for revert: Potentially causing crash in eglSurfaceCreationRunnable (b/286664896)

Original change's description:
> Adopt EglThread in EglRenderer
>
> This allows EglRenderer to share render thread EGLContext with other renderers.
> go/meet-android-eglcontext-reduction
>
> Bug: b/225229697
> Change-Id: I8aa41e61ada195fbbe3338c05815b26f3238dd78
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/306281
> Reviewed-by: Xavier Lepaul‎ <xalep@webrtc.org>
> Commit-Queue: Linus Nilsson <lnilsson@webrtc.org>
> Cr-Commit-Position: refs/heads/main@{#40141}

Bug: b/225229697
Change-Id: I4c57ea88047bde6e9782f0ce76bdaacd1bad4af3
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/308580
Commit-Queue: Linus Nilsson <lnilsson@webrtc.org>
Reviewed-by: Xavier Lepaul‎ <xalep@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#40266}
2023-06-13 11:27:27 +00:00
Jonas Oreland
267040e29a Make native VideoTrack pointer public
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}
2023-06-02 07:58:27 +00:00
Xavier Lepaul
c73ea4fc57 More systematic null checks before calling native methods
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}
2023-05-30 09:06:21 +00:00
Yury Yarashevich
87e74f9fb7 Remove unused combined_audio_video_bwe.
Bug: None
Change-Id: Ie539351f98b7a0ebb5f08e0df5c5759a2bcb5588
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/306520
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Reviewed-by: Per Kjellander <perkj@webrtc.org>
Reviewed-by: Stefan Holmer <stefan@webrtc.org>
Commit-Queue: Yury Yarashevich <yura.yaroshevich@gmail.com>
Cr-Commit-Position: refs/heads/main@{#40160}
2023-05-26 15:56:00 +00:00
Linus Nilsson
f4d0a493b4 Adopt EglThread in EglRenderer
This allows EglRenderer to share render thread EGLContext with other renderers.
go/meet-android-eglcontext-reduction

Bug: b/225229697
Change-Id: I8aa41e61ada195fbbe3338c05815b26f3238dd78
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/306281
Reviewed-by: Xavier Lepaul‎ <xalep@webrtc.org>
Commit-Queue: Linus Nilsson <lnilsson@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#40141}
2023-05-25 11:03:53 +00:00
Linus Nilsson
3369729100 Add EglThread class wrapping EglConnection and handler.
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}
2023-05-23 14:02:21 +00:00
Linus Nilsson
cc1ee35a69 Reland "Avoid recreating VirtualDisplay on format changes."
This is a reland of commit fcd1dfad1f

Original change's description:
> Avoid recreating VirtualDisplay on format changes.
>
> 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}

Bug: b/281978124
Change-Id: I35b60de99a8cd5f2555168d98027d3fc781e8b30
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/305781
Reviewed-by: Sergey Silkin <ssilkin@webrtc.org>
Commit-Queue: Linus Nilsson <lnilsson@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#40091}
2023-05-19 12:49:05 +00:00
Mirko Bonadei
510890ba19 Revert "Avoid recreating VirtualDisplay on format changes."
This reverts commit fcd1dfad1f.

Reason for revert: Breaks downstream test.

Original change's description:
> Avoid recreating VirtualDisplay on format changes.
>
> 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}

Bug: b/281978124, b/283063961
Change-Id: I8ec2ba3321be225a673af2a6192819a8a1b79b2c
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/305641
Owners-Override: Mirko Bonadei <mbonadei@webrtc.org>
Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org>
Bot-Commit: rubber-stamper@appspot.gserviceaccount.com <rubber-stamper@appspot.gserviceaccount.com>
Cr-Commit-Position: refs/heads/main@{#40085}
2023-05-17 11:16:51 +00:00
Linus Nilsson
fcd1dfad1f Avoid recreating VirtualDisplay on format changes.
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}
2023-05-17 11:03:58 +00:00
David Liu
784c339f34 Expose setCodecPreferences/getCapabilities for android
Bug: webrtc:15177
Change-Id: If61ef9a87bc4f68d73cef6e681461682ca48f034
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/304880
Reviewed-by: Sergey Silkin <ssilkin@webrtc.org>
Commit-Queue: Sergey Silkin <ssilkin@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#40071}
2023-05-15 19:24:15 +00:00
Linus Nilsson
df4bc33e11 Allow EglBase instances to share EGLConnection.
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}
2023-04-27 19:59:05 +00:00
Sergey Silkin
88429d572b Account for stride when calculating buffer size
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}
2023-04-19 10:10:32 +00:00