Commit graph

1051 commits

Author SHA1 Message Date
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
0421294df0 Enable RTC mode in Google HW AV1 encoder
Bug: b/274179852
Change-Id: Id987fa8b73468532304f856bc97d40238f93b266
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/302180
Commit-Queue: Sergey Silkin <ssilkin@webrtc.org>
Reviewed-by: Philip Eliasson <philipel@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#39921}
2023-04-21 16:38:06 +00:00
Jared Siskin
6f86f6af00 Format /sdk
git ls-files | grep -e  "\(\.h\|\.cc\)$" | grep -e  "^sdk/" | xargs clang-format -i ; git cl format
after landing: add to .git-blame-ignore-revs

Bug: webrtc:15082
Change-Id: If05d3c7555c4f2bf25e387249932787a93aa39c5
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/302060
Commit-Queue: Harald Alvestrand <hta@webrtc.org>
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#39913}
2023-04-21 04:30:57 +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
Sergey Silkin
6cf12bbe32 Fetch encoded QP before releasing output buffer
Before this change we first released output frame buffer in the code path which prepends config buffer to a keyframe and then called getOutputFormat(index). getOutputFormat(index) throws an exception if index points to a released buffer. This change rearranges calls such that getOutputFormat(index) always executed before releaseOutputBuffer(index).

Bug: webrtc:15015
Change-Id: Ia64f5d8e7483aeeb316d1a71c0cb79233f4bbee9
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/301364
Commit-Queue: Sergey Silkin <ssilkin@webrtc.org>
Reviewed-by: Philip Eliasson <philipel@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#39874}
2023-04-17 12:31:32 +00:00
Sergey Silkin
89facfc421 Fix potential null pointer access in HardwareVideoEncoder
There was no check for null in the code that prepends config buffer to key frame buffer. It is not a requirement for codec to deliver config buffer. Some codecs probably do not do that.

Bug: none
Change-Id: Id9c57efc5d1de5f569fa773313da4db3cd8b074c
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/299900
Reviewed-by: Erik Språng <sprang@webrtc.org>
Commit-Queue: Sergey Silkin <ssilkin@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#39807}
2023-04-11 13:50:41 +00:00
Philip Eliasson
7454fdd12b Revert "Replace BuiltinVideo{Encoder,Decoder}Factory with Video{Encoder,Decoder}FactoryTemplate."
This reverts commit d2535a53cf.

Reason for revert: breaks downstream

Original change's description:
> Replace BuiltinVideo{Encoder,Decoder}Factory with Video{Encoder,Decoder}FactoryTemplate.
>
> Bug: webrtc:13573
> Change-Id: I07e4fe9be938ba2540351b73ff22a090c68afa00
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/299663
> Reviewed-by: Sergey Silkin <ssilkin@webrtc.org>
> Commit-Queue: Philip Eliasson <philipel@webrtc.org>
> Cr-Commit-Position: refs/heads/main@{#39777}

Bug: webrtc:13573
Change-Id: I4d60383a46db4fdddd61e58b53c4ed07773434b2
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/300543
Commit-Queue: Philip Eliasson <philipel@webrtc.org>
Bot-Commit: rubber-stamper@appspot.gserviceaccount.com <rubber-stamper@appspot.gserviceaccount.com>
Reviewed-by: Philip Eliasson <philipel@webrtc.org>
Owners-Override: Philip Eliasson <philipel@webrtc.org>
Auto-Submit: Philip Eliasson <philipel@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#39783}
2023-04-06 14:21:30 +00:00
philipel
d2535a53cf Replace BuiltinVideo{Encoder,Decoder}Factory with Video{Encoder,Decoder}FactoryTemplate.
Bug: webrtc:13573
Change-Id: I07e4fe9be938ba2540351b73ff22a090c68afa00
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/299663
Reviewed-by: Sergey Silkin <ssilkin@webrtc.org>
Commit-Queue: Philip Eliasson <philipel@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#39777}
2023-04-06 09:04:11 +00:00
landrey
a3ff334cf1 Remove dependency to android_support_test_runner in webrtc
Make WebRTC compatible with changes introduced in https://crbug.com/1428304

Bug: chromium:1428304
Change-Id: I464a09545dc3a158ea4108bb63c7b8c4a05adc6b
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/300263
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Commit-Queue: Andrey Logvin <landrey@webrtc.org>
Reviewed-by: Xavier Lepaul‎ <xalep@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#39763}
2023-04-05 08:40:19 +00:00
Sergey Silkin
910b225d82 Fetch encoded QP from MediaCodec encoders
It is a part of "encoding statistics" feature [1] available in Android SDK 33. Local testing revealed that for HW VP8/9 encoders we get QP in range [0,64] which is not what WebRTC quality scaler expects. Exclude VP8/9 encoders for now.

[1] https://developer.android.com/reference/android/media/MediaFormat#VIDEO_ENCODING_STATISTICS_LEVEL_1

Bug: webrtc:15015
Change-Id: I8af2fd96afb34e18cb3e2cc3562b10149324c16e
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/298306
Commit-Queue: Sergey Silkin <ssilkin@webrtc.org>
Reviewed-by: Erik Språng <sprang@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#39722}
2023-03-30 10:19:22 +00:00
Magnus Jedvert
49572e3438 Add support for JavaToNativeFloatArray
Change-Id: I75482debc163d2c5f173cad644cd25ceb2996b38

Bug: webrtc:15047
Change-Id: I75482debc163d2c5f173cad644cd25ceb2996b38
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/299240
Reviewed-by: Paulina Hensman <phensman@webrtc.org>
Commit-Queue: Magnus Jedvert <magjed@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#39713}
2023-03-29 11:03:30 +00:00
Sergey Silkin
2d1fa4713f Use MediaCodec API keys and values directly
Replace locally-defined keys and values with constants from MediaCodec API (MediaFormat.KEY_..., etc). Value of a constant field is resolved at compile time according to 13.1.1 [1]. I.e., it is safe to reference a constant field not available in older API (MediaCodec API ignores unrecognized MediaFormat.KEY_ values).

[1] https://docs.oracle.com/javase/specs/jls/se20/html/jls-13.html#jls-13.1

Bug: none
Change-Id: I3c63cfd67cc22db1b957f908508b434d36d88806
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/298940
Commit-Queue: Sergey Silkin <ssilkin@webrtc.org>
Reviewed-by: Linus Nilsson <lnilsson@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#39668}
2023-03-24 13:59:54 +00:00
Magnus Jedvert
342bbe1ad4 Allow const pointer in NativeToJavaPointer
Bug: webrtc:15032
Change-Id: I3355e3e5d6fdc15652ffb0d6d0ff0328f49fcadb
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/298900
Commit-Queue: Magnus Jedvert <magjed@webrtc.org>
Reviewed-by: Fabian Bergmark <fabianbergmark@google.com>
Cr-Commit-Position: refs/heads/main@{#39652}
2023-03-23 11:11:05 +00:00
Harald Alvestrand
041ecb87f5 New PeerConnectionFactory::CreateVideoTrack with refcounted source
Bug: webrtc:15017
Change-Id: I04c794d8959583bb4cc5c3898f4175783ec49f16
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/249363
Reviewed-by: Henrik Boström <hbos@webrtc.org>
Reviewed-by: Tomas Gunnarsson <tommi@webrtc.org>
Commit-Queue: Harald Alvestrand <hta@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#39635}
2023-03-22 09:10:27 +00:00
Sergey Silkin
0af2bc639a Add H265 to VideoCodecMimeType
This enables testing HW H265 codecs on devices where the support is available.

Bug: b/261160916, webrtc:14852
Change-Id: I32d102fcf483ea4ba46d6f5161342dbb584e7cc9
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/298040
Commit-Queue: Sergey Silkin <ssilkin@webrtc.org>
Reviewed-by: Åsa Persson <asapersson@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#39591}
2023-03-17 15:28:11 +00:00
Sergey Silkin
a02f90691e Remove resolution alignment requirement (part 2)
https://webrtc-review.googlesource.com/c/src/+/296340 removed hard resolution alignment requirement from HardwareVideoEncoder.initEncode(). This CL removes the hard resolution alignment requirement from HardwareVideoEncoder.resetCodec().

Bug: webrtc:13089
Change-Id: Ia9fcd4d6a7ea16509ec3f12c3c78a76d1eb6c6f0
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/296520
Commit-Queue: Sergey Silkin <ssilkin@webrtc.org>
Reviewed-by: Åsa Persson <asapersson@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#39498}
2023-03-07 17:18:55 +00:00
Sergey Silkin
5c978cb262 Remove resolution alignment requirement
This partially reverts https://webrtc-review.googlesource.com/c/src/+/229460. HW encoder wrapper still requires 16x16 alignment but InitEncode() doesn't fail if input resolution doesn't satisfy this requirement.

If encoder can't handle 16x16 then it should return error from MediaCodec.configure(). Many HW encoder can handle resolutions not multiple of 16. Having strict requirement for resolution alignment in InitEncode() blocks usage and testing of these encoders.

This change doesn't affect WebRTC in Chrome Android since RTC encoder wrapper requires 16x16 alignment: https://source.chromium.org/chromium/chromium/src/+/main:media/gpu/android/android_video_encode_accelerator.cc;drc=4abbb981443d7403566ef8aff05fdaca1e837da3;l=494

Bug: webrtc:13089
Change-Id: I0c39908bbcd7d0740a9ee8afa022ba443ffdb4de
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/296340
Commit-Queue: Sergey Silkin <ssilkin@webrtc.org>
Reviewed-by: Ilya Nikolaevskiy <ilnik@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#39487}
2023-03-06 16:51:03 +00:00
Sergey Silkin
c494846bdf Set is_hardware_accelerated=true in JNI decoder wrapper
Assume that all Java decoders are hardware-accelerated.

Bug: b/261160916, webrtc:14852
Change-Id: I4c61839258c86ec9322b82d291542e2df6fd2ff1
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/295863
Reviewed-by: Erik Språng <sprang@webrtc.org>
Commit-Queue: Sergey Silkin <ssilkin@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#39457}
2023-03-02 15:12:20 +00:00
Sergey Silkin
2bdf79ac91 Handle frame_types=null in VideoEncoderWrapper::Encode()
frame_types=null is a valid input for Encoder(). VP8/VP9/H264 software encoder wrappers can handle frame_types=null.

Bug: b/261160916, webrtc:14852
Change-Id: I96ed98d553546ecbe70ff0356f314496f838c535
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/293260
Reviewed-by: Rasmus Brandt <brandtr@webrtc.org>
Commit-Queue: Sergey Silkin <ssilkin@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#39325}
2023-02-16 11:09:51 +00:00
Sergey Silkin
831664294c Allow getScalingSettings to be called from any thread
Scaling settings is a static property of the encoder wrapper. It has no any dependencies on underlaying HW codec and can be fetched from any thread.

getScalingSettings is called from VideoEncoderWrapper ctor [1]. Presence of checkIsOnValidThread() in getScalingSettings caused capturing of thread [2]. That required all following codec calls to be done from the thread that created the codec.

[1] https://source.chromium.org/chromium/chromium/src/+/main:third_party/webrtc/sdk/android/src/jni/video_encoder_wrapper.cc;drc=c05a1be5b49f5c03b6955b05bcbf47609e1b0381;l=41

[2] https://source.chromium.org/chromium/chromium/src/+/main:third_party/webrtc/rtc_base/java/src/org/webrtc/ThreadUtils.java;l=30

Bug: b/261160916, webrtc:14852
Change-Id: I7bb18bc8e3b371d83ccd44d4a5a096f716c0a0e2
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/291807
Reviewed-by: Rasmus Brandt <brandtr@webrtc.org>
Commit-Queue: Sergey Silkin <ssilkin@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#39303}
2023-02-13 15:14:42 +00:00
Florent Castelli
a6b9924988 Remove all usage of //rtc_base target
Bug: webrtc:9838
Change-Id: If813dbb426b4dc848185b64c0349d03fa9c059f2
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/290986
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Auto-Submit: Florent Castelli <orphis@webrtc.org>
Commit-Queue: Florent Castelli <orphis@webrtc.org>
Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#39116}
2023-01-16 14:36:06 +00:00
Florent Castelli
a138c6c8a5 Split rtc_base into multiple targets
Keeping the headers to allow compatibility with current users
that expect the headers to be in that target before they are
also updated.

Bug: webrtc:9838
Change-Id: I8b1e88850958e92c043686587a37791f01860220
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/290569
Commit-Queue: Florent Castelli <orphis@webrtc.org>
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Auto-Submit: Florent Castelli <orphis@webrtc.org>
Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#39031}
2023-01-09 12:21:25 +00:00
Philipp Hancke
b81823a5f0 stats: use Timestamp instead of uint64_t
making it clear what unit is being used.

BUG=webrtc:13756

Change-Id: I6354d35a8e02bb93a905ccf32cb0b294b4813e41
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/289460
Commit-Queue: Philipp Hancke <phancke@microsoft.com>
Reviewed-by: Henrik Boström <hbos@webrtc.org>
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#39008}
2023-01-05 08:37:31 +00:00
Harald Alvestrand
794d599741 Split media_channel and its dependencies from the rtc_media_base target
This helps in figuring out which dependencies exist, and gets closer
to obeying the "one target per .cc file" rule.

Test failures seem unrelated, so using No-Try.

No-Try: true
Bug: webrtc:14775
Change-Id: Id25466c8b8fe628d05c819cf7c69ae6d8421c6cf
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/288020
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Commit-Queue: Harald Alvestrand <hta@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#38910}
2022-12-16 12:15:22 +00:00
Byoungchan Lee
4a680f11ae Removed outdated comment of Notifier
Notifier is thread-hostile, and we have added a SequenceChecker
on https://webrtc-review.googlesource.com/c/src/+/252520 ,
so this comment is no longer needed.

Bug: None
Change-Id: I39f7f75a786dd27d2f6299d85676e7182d9032eb
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/288180
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Auto-Submit: Daniel.L (Byoungchan) Lee <daniel.l@hpcnt.com>
Commit-Queue: Harald Alvestrand <hta@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#38899}
2022-12-15 13:17:41 +00:00
Jonas Oreland
c0c65387ae AndroidNetworkMonitor - loosen assumptions even more
This cl/ attempts to fix (rather) rare crashes in
OnNetworkConnected_n by loosening the assumptions
that a network handle will keep it's network name.

With this cl/ it is possible that a NetworkHandle
can call OnNetworkConnected_n with one interface name
and then directly afterwards call it with another (
w/o an OnNetworkDisconnected_n inbetween).

This is the only scenario in which I could see the previous
crash occurring.

i.e
OnNetworkConnected(handle, "some-if-name")
OnNetworkConnected(handle, "some-other-name")

- previously this caused crash,
- now this is treated as if there was an OnNetworkDisconnected(handle) in between.

---

Also 1: shamelessly copy TYPE_MOBILE_DUN & TYPE_MOBILE_HIPRI from chromium: 87987f0e76

Also 2: Modify testcase not to use real interface names, so I can ran them on personal test phone w/o the real networks interfering.

Bug: webrtc:13741
Change-Id: I5480d5ce7031c2b5c09b958064076d02b3db1248
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/285980
Commit-Queue: Jonas Oreland <jonaso@webrtc.org>
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#38808}
2022-12-05 10:01:01 +00:00
Byoungchan Lee
a639528a43 Fix AndroidNetworkMonitorTests crash due to DCHECK failure
AndroidNetworkMonitor::SetNetworkInfos assumes this method is called
only once, but unittests calls it twice.
One is called by the startMonitoring Java method, and the other is
called by each test.
Because of this, these tests will not succeed if dcheck_always_on is true.

To solve this problem, use OnNetworkConnected_n
instead of SetNetworkInfos in each test.

Bug: None
Change-Id: I027706ad5ccd597a91e3a66f15e181ee22d4aaa9
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/285861
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Reviewed-by: Jonas Oreland <jonaso@webrtc.org>
Commit-Queue: Daniel.L (Byoungchan) Lee <daniel.l@hpcnt.com>
Cr-Commit-Position: refs/heads/main@{#38798}
2022-12-02 13:37:27 +00:00
Roberto Perez
b05968e5ec Do not create DtmfSender for video sender.
On Android bindings, do not build a DtmfSender instance in a
RtpSender if its video kind is Video.
This will prevent showing an error when trying to access
that DtmfSender instance that has no native reference

Bug: webrtc:14680
Change-Id: Iba67a12cae8604c032915156b581af269f6ed265
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/283742
Commit-Queue: Sergey Silkin <ssilkin@webrtc.org>
Reviewed-by: Sergey Silkin <ssilkin@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#38724}
2022-11-24 10:58:17 +00:00
Florent Castelli
acabb3641b pc: Add asynchronous RtpSender::SetParameters() call
As the synchronous version only posts a task to recreate the encoder
later, it is not possible to catch errors and state changes that
could appear then.
The asynchronous version of SetParameters() aims to solve this by
providing a callback to wait for the completion of the encoder
reconfiguration, allowing any error to be propagate and subsequent
getParameters() call to have up to date information.

Bug: webrtc:11607
Change-Id: I5548e75aa14a97f8d9c0c94df1e72e9cd40887b2
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/278420
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Commit-Queue: Florent Castelli <orphis@webrtc.org>
Reviewed-by: Erik Språng <sprang@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#38627}
2022-11-15 15:31:40 +00:00
Sergey Silkin
c97651cbb4 Reland "Call native codec factories from Android ones."
This is a reland of commit 937a59268e

Check if codec requested in createEncoder/Decoder is supported and return null if not.

Original change's description:
> Call native codec factories from Android ones.
>
> Android video codec factories are expected to be synchronised with the native ones in terms on supported codecs. But before this change there were differences:
>
> 1. Native decoder factory keeps AV1 support behind RTC_DAV1D_IN_INTERNAL_DECODER_FACTORY while Android decoder factory advertises AV1 unconditionally;
>
> 2. Native encoder factory advertises AV1 if RTC_USE_LIBAOM_AV1_ENCODER is enabled while Android encoder factory never advertises AV1.
>
> This CL synchronises the codecs set in Android factories with that of native factories by calling native factories from Android ones.
>
> Bug: webrtc:13573, b/257272020
> Change-Id: I99d801eda0c5f3400bac222b9b08d719f1a6ed72
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/282240
> Reviewed-by: Rasmus Brandt <brandtr@webrtc.org>
> Commit-Queue: Sergey Silkin <ssilkin@webrtc.org>
> Reviewed-by: Xavier Lepaul‎ <xalep@webrtc.org>
> Cr-Commit-Position: refs/heads/main@{#38583}

Bug: webrtc:13573, b/257272020
Change-Id: Ida7bb9a2954b836a07ad560de29c1f8088264b77
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/282802
Reviewed-by: Xavier Lepaul‎ <xalep@webrtc.org>
Commit-Queue: Sergey Silkin <ssilkin@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#38607}
2022-11-10 16:29:49 +00:00
Andrey Logvin
7dbd77c8b9 Revert "Call native codec factories from Android ones."
This reverts commit 937a59268e.

Reason for revert: Breaks downstream project

Original change's description:
> Call native codec factories from Android ones.
>
> Android video codec factories are expected to be synchronised with the native ones in terms on supported codecs. But before this change there were differences:
>
> 1. Native decoder factory keeps AV1 support behind RTC_DAV1D_IN_INTERNAL_DECODER_FACTORY while Android decoder factory advertises AV1 unconditionally;
>
> 2. Native encoder factory advertises AV1 if RTC_USE_LIBAOM_AV1_ENCODER is enabled while Android encoder factory never advertises AV1.
>
> This CL synchronises the codecs set in Android factories with that of native factories by calling native factories from Android ones.
>
> Bug: webrtc:13573, b/257272020
> Change-Id: I99d801eda0c5f3400bac222b9b08d719f1a6ed72
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/282240
> Reviewed-by: Rasmus Brandt <brandtr@webrtc.org>
> Commit-Queue: Sergey Silkin <ssilkin@webrtc.org>
> Reviewed-by: Xavier Lepaul‎ <xalep@webrtc.org>
> Cr-Commit-Position: refs/heads/main@{#38583}

Bug: webrtc:13573, b/257272020
Change-Id: I8128f5fc5d86902e35ab2812c984169c4b106118
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/282800
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Auto-Submit: Andrey Logvin <landrey@google.com>
Owners-Override: Mirko Bonadei <mbonadei@webrtc.org>
Bot-Commit: rubber-stamper@appspot.gserviceaccount.com <rubber-stamper@appspot.gserviceaccount.com>
Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#38586}
2022-11-09 08:08:17 +00:00
Sergey Silkin
937a59268e Call native codec factories from Android ones.
Android video codec factories are expected to be synchronised with the native ones in terms on supported codecs. But before this change there were differences:

1. Native decoder factory keeps AV1 support behind RTC_DAV1D_IN_INTERNAL_DECODER_FACTORY while Android decoder factory advertises AV1 unconditionally;

2. Native encoder factory advertises AV1 if RTC_USE_LIBAOM_AV1_ENCODER is enabled while Android encoder factory never advertises AV1.

This CL synchronises the codecs set in Android factories with that of native factories by calling native factories from Android ones.

Bug: webrtc:13573, b/257272020
Change-Id: I99d801eda0c5f3400bac222b9b08d719f1a6ed72
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/282240
Reviewed-by: Rasmus Brandt <brandtr@webrtc.org>
Commit-Queue: Sergey Silkin <ssilkin@webrtc.org>
Reviewed-by: Xavier Lepaul‎ <xalep@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#38583}
2022-11-08 12:40:56 +00:00
Henrik Boström
f36d607c4a Remove the possibility to disable IPv6 in Java and ObjC.
It's deprecated and has been removed from Chrome. Let's follow suite.

// Passing all but unrelated bots
NOTRY=True

Bug: webrtc:14608
Change-Id: I6f2601af5b1dc08164230ebf15db2d2f1754f9e5
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/280740
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Commit-Queue: Henrik Boström <hbos@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#38488}
2022-10-27 19:45:58 +00:00
Saúl Ibarra Corretgé
4a1c9ecc5c Cleanup old Android check for pre 4.4 versions
The minSdk is 21.

Bug: webrtc:13780
Change-Id: If21ffab16b21d957c1d1a9b6912d09cd2bc309ef
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/279902
Commit-Queue: Xavier Lepaul‎ <xalep@webrtc.org>
Reviewed-by: Xavier Lepaul‎ <xalep@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#38456}
2022-10-24 10:50:29 +00:00
philipel
aafcc43440 Remove libaom av1 encoder from SoftwareVideoEncoderFactory.
Bug: webrtc:13573
Change-Id: If2948cf144e0b670f4fa6fabb06e2a14b4a8e281
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/279561
Commit-Queue: Philip Eliasson <philipel@webrtc.org>
Reviewed-by: Xavier Lepaul‎ <xalep@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#38430}
2022-10-18 12:10:42 +00:00
Roberto Perez
4dc6e05ac9 Expose peer connection's getStats by RtpSender/Receiver in Android SDK
Currently if you want to obtain the stats for a specific sender/receiver
in Android, you need to call peerConnection.getStats() and filter
manually the result by sender.

pc.getStats(receiver/sender) exists in c++ and ios but was not exposed
in Android

Bug: webrtc:14547
Change-Id: I9954434880f0f93821fcd2e2de24a875e8d136ae
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/275880
Reviewed-by: Xavier Lepaul‎ <xalep@webrtc.org>
Commit-Queue: Sergey Silkin <ssilkin@webrtc.org>
Reviewed-by: Sergey Silkin <ssilkin@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#38428}
2022-10-18 09:41:26 +00:00
Mirko Bonadei
5d17b7e05e Include jni.h in jni_int_wrapper.h.
This is needed in order to use jint and make the header self contained.

Bug: b/251890128
Change-Id: Ie6c323113370a1d49f68c783137292e1c0be07d2
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/278780
Commit-Queue: Xavier Lepaul‎ <xalep@webrtc.org>
Reviewed-by: Xavier Lepaul‎ <xalep@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#38351}
2022-10-11 12:30:32 +00:00
Mirko Bonadei
4e013482fc Add missing dependency and remove nogncheck.
Bug: b/251890128
Change-Id: Ie511aa9de38601914948c2583778fa4b6c891f98
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/278681
Commit-Queue: Xavier Lepaul‎ <xalep@webrtc.org>
Reviewed-by: Xavier Lepaul‎ <xalep@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#38350}
2022-10-11 12:29:29 +00:00
Mirko Bonadei
a97dc0579c Remove jni_generator_helper.h from video_jni.
This is already part of native_api_jni.

Bug: b/251890128
Change-Id: Iae11fb676df788d992d3cb8ed21c68f7fe2552a9
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/278630
Reviewed-by: Artem Titov <titovartem@webrtc.org>
Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#38346}
2022-10-11 09:47:27 +00:00
Mirko Bonadei
9d9c2d5795 Make header files self contained.
This CL adds #includes to header files in order to make them
self contained after the preprocessor pass.

Bug: b/251890128
Change-Id: I81c3ba38fb8ab8a2bbd151ba99aa871fae9f1b1b
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/278422
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#38327}
2022-10-08 08:38:36 +00:00
philipel
0c4563c0c4 Remove the libaom av1 decoder.
Bug: webrtc:14267
Change-Id: I95a416b25fa20d4dea6896e05beb59789621f1fa
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/268305
Reviewed-by: Sergey Silkin <ssilkin@webrtc.org>
Reviewed-by: Erik Språng <sprang@webrtc.org>
Commit-Queue: Philip Eliasson <philipel@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#38253}
2022-09-30 08:42:25 +00:00
Magnus Jedvert
c7d1f11646 Android: Expose VideoFrame.TextureBuffer.applyTransformMatrix
Bug: None
Change-Id: Id1c35dd1aa231ea25831d0354b8125d6c29d3834
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/274708
Commit-Queue: Magnus Jedvert <magjed@webrtc.org>
Reviewed-by: Fabian Bergmark <fabianbergmark@google.com>
Cr-Commit-Position: refs/heads/main@{#38061}
2022-09-12 13:50:17 +00:00
Sergey Silkin
ceb71cd557 Switch encoder on any critical frame encode error (returncode < 0)
Before this change encoder switch was triggered only if encode() returns WEBRTC_VIDEO_CODEC_ENCODER_FAILURE. Android HW encoder wrapper never return this error code. It returns WEBRTC_VIDEO_CODEC_FALLBACK_SOFTWARE [1, 2] or WEBRTC_VIDEO_CODEC_ERROR [3].

Change value of WEBRTC_VIDEO_CODEC_TARGET_BITRATE_OVERSHOOT from -14 to 5 to avoid it to be interpreted as a critical error.

[1] https://source.chromium.org/chromium/chromium/src/+/main:third_party/webrtc/sdk/android/src/jni/video_encoder_wrapper.cc;drc=c05a1be5b49f5c03b6955b05bcbf47609e1b0381;l=324

[2] https://source.chromium.org/chromium/chromium/src/+/main:third_party/webrtc/sdk/android/src/jni/video_encoder_wrapper.cc;drc=c05a1be5b49f5c03b6955b05bcbf47609e1b0381;l=335

[3] https://source.chromium.org/chromium/chromium/src/+/main:third_party/webrtc/sdk/android/src/jni/video_encoder_wrapper.cc;drc=c05a1be5b49f5c03b6955b05bcbf47609e1b0381;l=331

Bug: b/243402636
Change-Id: Iaf0129f3f9d71c07bb06804fe1f92a1f84f6da26
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/274402
Reviewed-by: Philip Eliasson <philipel@webrtc.org>
Commit-Queue: Sergey Silkin <ssilkin@webrtc.org>
Reviewed-by: Erik Språng <sprang@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#38060}
2022-09-12 12:43:17 +00:00
Danil Chapovalov
9e09a1f327 Replace Thread::Invoke with Thread::BlockingCall
BlockingCall doesn't take rtc::Location parameter and thus most of the dependencies on location can be removed

Bug: webrtc:11318
Change-Id: I91a17e342dd9a9e3e2c8f7fbe267474c98a8d0e5
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/274620
Reviewed-by: Tomas Gunnarsson <tommi@webrtc.org>
Commit-Queue: Danil Chapovalov <danilchap@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#38045}
2022-09-09 10:44:17 +00:00
Danil Chapovalov
2acdda84ca Update android peer connection factory wrapper away from rtc::MessageHandler
Bug: webrtc:9702
Change-Id: Iab87e8e31a52d91b127ed03f5c356d4ccb4619cc
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/274140
Reviewed-by: Xavier Lepaul‎ <xalep@webrtc.org>
Commit-Queue: Xavier Lepaul‎ <xalep@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#38033}
2022-09-08 08:07:06 +00:00