This CL updates the WebRTC code to stop using the old VideoRenderer and
VideoRenderer.I420Frame classes and instead use the new VideoSink and
VideoFrame classes.
This CL is the first step and the old classes are still left in the code
for now to keep backwards compatibility.
Bug: webrtc:9181
Change-Id: Ib0caa18cbaa2758b7859e850ddcaba003cfb06d6
Reviewed-on: https://webrtc-review.googlesource.com/71662
Reviewed-by: Sami Kalliomäki <sakal@webrtc.org>
Commit-Queue: Magnus Jedvert <magjed@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#22989}
PeerConnectionFactory.initialize() should be the first call before
any other call to the Android WebRTC API. The reason this is important
is mainly because PeerConnectionFactory.initialize() loads the native
C++ code, so all other WebRTC calls that rely on native calls will fail
before this has been done.
Bug: webrtc:7474, webrtc:9153
Change-Id: Id0cb78eaf18ea036f39d616d00ac6e32696266bb
Reviewed-on: https://webrtc-review.googlesource.com/70428
Commit-Queue: Magnus Jedvert <magjed@webrtc.org>
Reviewed-by: Sami Kalliomäki <sakal@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#22954}
Fixes a mismatch between "useHardware" and "disableBuiltIn" when
creating JavaAudioDeviceModule.
Bug: webrtc:7452
Change-Id: Ia5572822dc4514ff9a06811af1bdbb8362a2c71c
Reviewed-on: https://webrtc-review.googlesource.com/69987
Reviewed-by: Gustaf Ullberg <gustaf@webrtc.org>
Reviewed-by: Sami Kalliomäki <sakal@webrtc.org>
Commit-Queue: Paulina Hensman <phensman@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#22908}
This CL introduces sdk/android/api/org/webrtc/audio/AudioDeviceModule.java,
which is the new interface for audio device modules on Android.
This CL also refactors the main AudioDeviceModule implementation, which
is sdk/android/api/org/webrtc/audio/JavaAudioDeviceModule.java and makes
it conform to the new interface. The old code used global static methods
to configure the audio device code. This CL gets rid of all that and uses
a builder pattern in JavaAudioDeviceModule instead. The only two dynamic
methods left in the interface are setSpeakerMute() and setMicrophoneMute().
Removing the global static methods allowed a significant cleanup, and e.g.
the file sdk/android/src/jni/audio_device/audio_manager.cc has been
completely removed.
The PeerConnectionFactory interface is also updated to allow passing in
an external AudioDeviceModule. The current built-in ADM is encapsulated
under LegacyAudioDeviceModule.java, which is the default for now to
ensure backwards compatibility.
Bug: webrtc:7452
Change-Id: I64d5f4dba9a004da001f1acb2bd0c1b1f2b64f21
Reviewed-on: https://webrtc-review.googlesource.com/65360
Commit-Queue: Magnus Jedvert <magjed@webrtc.org>
Reviewed-by: Magnus Jedvert <magjed@webrtc.org>
Reviewed-by: Paulina Hensman <phensman@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#22765}
The class called AudioDeviceModule today is an implementation of a
future interface. We want to reserve the name AudioDeviceModule for
the actual interface. The implementation class has been renamed to
JavaAudioDeviceModule. 'Java' here refers to the fact that the
implementation is using android.media.AudioRecord as input and
android.media.AudioTrack as output, and this is opposed to native
AudioDeviceModule implementations such as OpenSLES and AAudio.
Bug: webrtc:7452
Change-Id: Ifc243c2e169b12a50128ee3252f06d574aa7b358
Reviewed-on: https://webrtc-review.googlesource.com/65400
Reviewed-by: Paulina Hensman <phensman@webrtc.org>
Commit-Queue: Magnus Jedvert <magjed@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#22673}
This CL refactors the way RecordedAudioToFileController is connected to
AudioRecord. Instead of allowing to dynamically set and update the
AudioSamplesCallback, it's set once at start time and then stopping is
implemented in RecordedAudioToFileController by simply ignoring calls to
onWebRtcAudioRecordSamplesReady.
The reason for this CL is to reduce the amount of methods we need to
add to the future AudioDeviceModule interface. The more functionality
we can move to creation time in the ctor, the less methods we need to
have in the interface.
Bug: webrtc:7452
Change-Id: I462df275d8579c848e1d2c86cbd8e881da89cbf3
Reviewed-on: https://webrtc-review.googlesource.com/64988
Reviewed-by: Magnus Jedvert <magjed@webrtc.org>
Reviewed-by: Paulina Hensman <phensman@webrtc.org>
Commit-Queue: Magnus Jedvert <magjed@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#22653}
To facilitate testing both the old and new AudioDeviceModule path, a
setting is added to AppRTC. Enable "Use legacy audio device" to use
the old path.
Bug: webrtc:7452
Change-Id: I221378ac7bb0fa4e543c3fd081c7a322621621a0
Reviewed-on: https://webrtc-review.googlesource.com/64760
Reviewed-by: Henrik Andreassson <henrika@webrtc.org>
Commit-Queue: Paulina Hensman <phensman@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#22609}
This CL contains some follow-up fixes for
https://webrtc-review.googlesource.com/c/src/+/60541. It removes all use
of the old voiceengine implementation from AppRTCMobile.
Bug: webrtc:7452
Change-Id: Iea21a4b3be1f3cbb5062831164fffb2c8051d858
Reviewed-on: https://webrtc-review.googlesource.com/63480
Commit-Queue: Magnus Jedvert <magjed@webrtc.org>
Reviewed-by: Paulina Hensman <phensman@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#22530}
This CL adds a stand-alone Android AudioDeviceModule in the
sdk/android folder. It's forked from modules/audio_device/android/
and then simplified for the Android case. The stand-alone Android
ADM is available both in the native_api and also under a field trial
in the Java API.
Bug: webrtc:7452
Change-Id: If6e558026bd0ccb52f56d78ac833339a5789d300
Reviewed-on: https://webrtc-review.googlesource.com/60541
Commit-Queue: Magnus Jedvert <magjed@webrtc.org>
Reviewed-by: Magnus Jedvert <magjed@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#22517}
This updates AppRTC to use addTrack instead of addStream, and removes
the use of onAddStream, because we no longer have to wait for this to be
fired to set the remote track's video renderers.
Bug: webrtc:8869
Change-Id: I1ecae684a9bc4b30512e8c5d717e72b52c589831
Reviewed-on: https://webrtc-review.googlesource.com/57840
Commit-Queue: Seth Hampson <shampson@webrtc.org>
Reviewed-by: Sami Kalliomäki <sakal@webrtc.org>
Reviewed-by: Steve Anton <steveanton@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#22318}
This removes the routing for the deprecated audio control setting
Bug: none
Change-Id: If7a134ee487b80a653ba982768ba74ce2d539e0a
Reviewed-on: https://webrtc-review.googlesource.com/58941
Reviewed-by: Henrik Andreassson <henrika@webrtc.org>
Reviewed-by: Per Åhgren <peah@webrtc.org>
Reviewed-by: Sami Kalliomäki <sakal@webrtc.org>
Commit-Queue: Sam Zackrisson <saza@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#22288}
We want to evaluate the impact on battery consumption from using the
fullscreen HW scaling.
Bug: None
Change-Id: If5becf02c6eaf77f9d0877827db39773ae17fc05
Reviewed-on: https://webrtc-review.googlesource.com/59101
Reviewed-by: Sami Kalliomäki <sakal@webrtc.org>
Commit-Queue: Magnus Jedvert <magjed@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#22243}
Uses new WebRtcAudioRecordSamplesReadyCallback which was added recently in
https://webrtc-review.googlesource.com/c/src/+/49981.
This CL:
- Serves as a test of new WebRtcAudioRecordSamplesReadyCallback.
- Useful for debugging purposes since it records the most native raw audio.
Bug: None
Change-Id: I57375cbf237c171e045b0bdb05f7ae1401930fbc
Reviewed-on: https://webrtc-review.googlesource.com/53120
Commit-Queue: Henrik Andreassson <henrika@webrtc.org>
Reviewed-by: Sami Kalliomäki <sakal@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#22128}
Enable diagnostic packet and event recording as in the "webrtc-internal"
setting in Chromium.
Bug: webrtc:8859
Change-Id: I1d4a19e0dd60133cdd0d4e18a55780623b65653c
Reviewed-on: https://webrtc-review.googlesource.com/49541
Commit-Queue: Qingsi Wang <qingsi@google.com>
Reviewed-by: Sami Kalliomäki <sakal@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#21987}
cpuMonitor is actually null at the time of the call, but it works
because isSupported doesn't touch 'this' (being a static call).
Bug: None
Change-Id: I177807ee04075d16356878ec72262546d0547aa1
Reviewed-on: https://webrtc-review.googlesource.com/51861
Reviewed-by: Sami Kalliomäki <sakal@webrtc.org>
Commit-Queue: Patrik Höglund <phoglund@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#21983}
This CL fixes an issue where the aecdump file handle gets garbage
collected and closed early in the call.
Bug: webrtc:8822
Change-Id: I959908da164b0ec61ccd976fc52f3d919da11b52
Reviewed-on: https://webrtc-review.googlesource.com/46103
Reviewed-by: Sami Kalliomäki <sakal@webrtc.org>
Commit-Queue: Gustaf Ullberg <gustaf@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#21839}
Implements the dynamic permission model required by the newer SDK and
changes the theme.
Bug: webrtc:8803
Change-Id: I3ea23a25b27f196fcffd018c7cdd2ff6255b62d9
Reviewed-on: https://webrtc-review.googlesource.com/44400
Commit-Queue: Sami Kalliomäki <sakal@webrtc.org>
Reviewed-by: Anders Carlsson <andersc@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#21788}
C++ API allows passing all configuration through RTCConfiguration
object. This adds all values previously passed through PC constraints
to Java RTCConfiguration object and deprecates API that takes PC
contraints.
Using the deprecated API overrides the values in RTCConfigration
object.
Bug: webrtc:8663, webrtc:8662
Change-Id: I128432c3caba74403513fb1347ff58830c643885
Reviewed-on: https://webrtc-review.googlesource.com/33460
Reviewed-by: Magnus Jedvert <magjed@webrtc.org>
Reviewed-by: Taylor Brandstetter <deadbeef@webrtc.org>
Commit-Queue: Sami Kalliomäki <sakal@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#21357}
Previously, wrapped native codec instances would leak the native object
if it was never used. This change fixes it by changing getNative method
to createNative.
Also fixes "Video codec hardware acceleration" setting in AppRTCMobile.
Bug: webrtc:7925
Change-Id: I53f6dc1dd5e37dea8d14278423122dede17719c5
Reviewed-on: https://webrtc-review.googlesource.com/24881
Reviewed-by: Magnus Jedvert <magjed@webrtc.org>
Commit-Queue: Sami Kalliomäki <sakal@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#20859}
This is a debug feature and should be disabled by default. Any client
that needs this functionality should call setEnableInternalTracer.
Bug: webrtc:8553
Change-Id: I78d718ebb95fc5cb8c464327b5b36e385ccfa9c0
Reviewed-on: https://webrtc-review.googlesource.com/24540
Commit-Queue: Sami Kalliomäki <sakal@webrtc.org>
Reviewed-by: Magnus Jedvert <magjed@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#20814}
This is similar to https://webrtc-review.googlesource.com/c/src/+/3620
for iOS.
Using the new WebRtcMediaEngineFactory::Create API, the built-in
software video codecs are no longer appended to the injected codecs.
To be able to use the software codecs, they are exposed as Java
classes through SoftwareVideoEncoderFactory etc.
There is also a new DefaultVideoEncoderFactory used by AppRTCMobile.
This factory tries to use hardware implementations where available,
but falls back to using the injected software codecs.
The HardwareVideoEncoderFactory is temporarily also falling back on
the software codecs in its default configuration in order to
maintain backwards compatibility.
Bug: webrtc:7925
Change-Id: I3e8c5ed492ccd160aca968986ad217d7978a951c
Reviewed-on: https://webrtc-review.googlesource.com/17480
Reviewed-by: Sami Kalliomäki <sakal@webrtc.org>
Reviewed-by: Magnus Jedvert <magjed@webrtc.org>
Commit-Queue: Anders Carlsson <andersc@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#20647}
In https://chromium-review.googlesource.com/c/chromium/src/+/750645
Chromium started to use an ErrorProne plugin to discourage synchronized
public methods (an encourage the usage of synchronized blocks).
In order to unblock the Chromium Roll we can suppress these warnings
and decide if we want to align with Chromium on this check or ask
them to make it optional.
More details in the bug.
TBR=magjed@webrtc.org
Bug: webrtc:8491
Change-Id: Ie77a324e54aab44a4f59853959549f1d21f884a0
No-Try: True
Reviewed-on: https://webrtc-review.googlesource.com/20060
Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org>
Reviewed-by: Sami Kalliomäki <sakal@webrtc.org>
Reviewed-by: Henrik Andreassson <henrika@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#20569}
Second attempt to land https://webrtc-review.googlesource.com/c/src/+/15481.
This time with an extra (dummy) interface to ensure that we don't
break downstream clients.
Improves native Android audio implementations.
Bug: webrtc:8453
Change-Id: I659a3013ae523a2588e4c41ca44b7d0d2d65efb7
Reviewed-on: https://webrtc-review.googlesource.com/16425
Commit-Queue: Henrik Andreassson <henrika@webrtc.org>
Reviewed-by: Sami Kalliomäki <sakal@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#20462}
This is done in preparation to make all javac warnings into errors for
WebRTC targets.
Bug: webrtc:6597
Change-Id: I402043157bd75943adf0de52111e5a1bb179c6d1
Reviewed-on: https://webrtc-review.googlesource.com/15104
Commit-Queue: Sami Kalliomäki <sakal@webrtc.org>
Reviewed-by: Magnus Jedvert <magjed@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#20450}
Apparently WebSocketObserver gets garbage collected if it is not stored
by us. This caused some external tests to break.
Bug: None
Change-Id: If62786e84f84a5a63172d67962bb4de8ae3e8479
Reviewed-on: https://webrtc-review.googlesource.com/16100
Reviewed-by: Magnus Jedvert <magjed@webrtc.org>
Commit-Queue: Sami Kalliomäki <sakal@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#20449}
Summary:
Adds AudioTrackStartErrorCode to separate different types of error
codes in combination with StartPlayout.
Harmonizes WebRtcAudioRecord and WebRtcAudioTrack implementations
to ensure that init/start/stop is performed identically.
Adds thread checking in WebRtcAudio track.
Bug: webrtc:8453
Change-Id: Ic913e888ff9493c9cc748a7b4dae43eb6b37fa85
Reviewed-on: https://webrtc-review.googlesource.com/15481
Commit-Queue: Henrik Andreassson <henrika@webrtc.org>
Reviewed-by: Alex Glaznev <glaznev@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#20448}
peerConnectionParameters.videoCodec can be null in some cases.
Previously, this would cause a crash in AppRTCMobile.
Bug: b/67938523
Change-Id: I30ebf0f91fad23a3cf34946736b9f4e6c266277f
Reviewed-on: https://webrtc-review.googlesource.com/14200
Reviewed-by: Magnus Jedvert <magjed@webrtc.org>
Commit-Queue: Sami Kalliomäki <sakal@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#20372}
TBR=magjed@webrtc.org
This is a reland of bc675ff3fa
Original change's description:
> Reland "Use injectable hardware video decoder/encoder in AppRTCMobile."
>
> This is a reland of 0cbaf1a6f6
> Original change's description:
> > Use injectable hardware video decoder/encoder in AppRTCMobile.
> >
> > Also include a small fix for getting the encoder queue.
> >
> > Bug: webrtc:7760
> > Change-Id: I96dc8ffb363b90382276d88148f81d5f89dca5f2
> > Reviewed-on: https://webrtc-review.googlesource.com/2683
> > Commit-Queue: Sami Kalliomäki <sakal@webrtc.org>
> > Reviewed-by: Magnus Jedvert <magjed@webrtc.org>
> > Cr-Commit-Position: refs/heads/master@{#20022}
>
> Bug: webrtc:7760
> Change-Id: Ia82129fde7abb59120ba5bb23938db9eb576ae91
> Reviewed-on: https://webrtc-review.googlesource.com/4701
> Commit-Queue: Sami Kalliomäki <sakal@webrtc.org>
> Reviewed-by: Magnus Jedvert <magjed@webrtc.org>
> Cr-Commit-Position: refs/heads/master@{#20080}
Bug: webrtc:7760
Change-Id: I5f9bcbf0f18ac3d6b2d2d500300218e885e37d71
Reviewed-on: https://webrtc-review.googlesource.com/9383
Reviewed-by: Sami Kalliomäki <sakal@webrtc.org>
Commit-Queue: Sami Kalliomäki <sakal@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#20302}
I couldn't repro the problem locally, speculatively reland to see if the issue
was solved by recent changes.
TBR=magjed@webrtc.org
This is a reland of bc675ff3fa
Original change's description:
> Reland "Use injectable hardware video decoder/encoder in AppRTCMobile."
>
> This is a reland of 0cbaf1a6f6
> Original change's description:
> > Use injectable hardware video decoder/encoder in AppRTCMobile.
> >
> > Also include a small fix for getting the encoder queue.
> >
> > Bug: webrtc:7760
> > Change-Id: I96dc8ffb363b90382276d88148f81d5f89dca5f2
> > Reviewed-on: https://webrtc-review.googlesource.com/2683
> > Commit-Queue: Sami Kalliomäki <sakal@webrtc.org>
> > Reviewed-by: Magnus Jedvert <magjed@webrtc.org>
> > Cr-Commit-Position: refs/heads/master@{#20022}
>
> Bug: webrtc:7760
> Change-Id: Ia82129fde7abb59120ba5bb23938db9eb576ae91
> Reviewed-on: https://webrtc-review.googlesource.com/4701
> Commit-Queue: Sami Kalliomäki <sakal@webrtc.org>
> Reviewed-by: Magnus Jedvert <magjed@webrtc.org>
> Cr-Commit-Position: refs/heads/master@{#20080}
Bug: webrtc:7760
Change-Id: If2131b4cdac58cb4d26521fa31e657e29085e0b7
Reviewed-on: https://webrtc-review.googlesource.com/6804
Reviewed-by: Sami Kalliomäki <sakal@webrtc.org>
Commit-Queue: Sami Kalliomäki <sakal@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#20275}