Commit graph

40 commits

Author SHA1 Message Date
Paulina Hensman
1ca30a7e41 Decouple input and output sample rate overrides.
We may sometimes want to override only input or only output, or
override them with different values. This change allows setting the
overrides separately.


Change-Id: Ib0c44cb7a3cfa834f997fb6cd54f7cad68705f41
Bug: webrtc:10441
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/128763
Commit-Queue: Paulina Hensman <phensman@webrtc.org>
Reviewed-by: Henrik Andreassson <henrika@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#27236}
2019-03-22 11:56:01 +00:00
Karl Wiberg
c130d42aab Add ability to unwind stack for the current thread
Bug: webrtc:10308
Change-Id: Ia82cb7512524bede8da69bbc747ece6e718733ab
Reviewed-on: https://webrtc-review.googlesource.com/c/124993
Reviewed-by: Magnus Jedvert <magjed@webrtc.org>
Commit-Queue: Karl Wiberg <kwiberg@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#26945}
2019-03-04 10:31:40 +00:00
Mirta Dvornicic
d8b980464c Add scaleResolutionDownBy to RtpParameters.Encoding in Android SDK.
Bug: webrtc:10069
Change-Id: I8130836c495d5584ca3e11e9e3155916b871ab21
Reviewed-on: https://webrtc-review.googlesource.com/c/120926
Reviewed-by: Sami Kalliomäki <sakal@webrtc.org>
Reviewed-by: Rasmus Brandt <brandtr@webrtc.org>
Commit-Queue: Mirta Dvornicic <mirtad@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#26535}
2019-02-04 16:50:24 +00:00
Sami Kalliomäki
ee61f9440a Fix a bug in video_encoder_wrapper where int array was not freed properly.
JNI_COMMIT doesn't actually free the buffer.

From JNI docs:
0: copy back the content and free the elems buffer
JNI_COMMIT: copy back the content but do not free the elems buffer
JNI_ABORT: free the buffer without copying back the possible changes

Also introduces helper methods to help avoid this problem in the
future.

Bug: webrtc:10132
Change-Id: I769df286d3bd186fdf39ee2363e9002f36454509
Reviewed-on: https://webrtc-review.googlesource.com/c/120600
Reviewed-by: Magnus Jedvert <magjed@webrtc.org>
Commit-Queue: Sami Kalliomäki <sakal@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#26529}
2019-02-04 13:12:07 +00:00
Steve Anton
f380284035 (7) Rename files to snake_case: remove forwarding headers
Bug: webrtc:10159
Change-Id: I2ba899e0283b953538c7941c8790213e36d7c70e
Reviewed-on: https://webrtc-review.googlesource.com/c/118561
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Commit-Queue: Steve Anton <steveanton@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#26417}
2019-01-26 00:33:46 +00:00
Magnus Jedvert
7510e4aac5 Reland "Android: Add helper methods for printing native stack traces"
This is a reland of dc32cc00e8

Relanding because this CL was not the culprit for the Chrome bot.
(This code shouldn't even be executed in Chrome).

Original change's description:
> Android: Add helper methods for printing native stack traces
>
> This CL adds utility functions to unwind the stack for a given thread on
> Android ARM devices. This works on top of unwind.h and unwinds native
> (C++) stack traces only. Unwinding a thread from another thread is done
> by overriding the signal handler with a custom function and then
> interrupting the specific thread.
>
> Bug: webrtc:10168
> Change-Id: If5adffd3a6bb57bf502168743e09a7eefc292bf3
> Reviewed-on: https://webrtc-review.googlesource.com/c/118141
> Commit-Queue: Magnus Jedvert <magjed@webrtc.org>
> Reviewed-by: Tommi <tommi@webrtc.org>
> Cr-Commit-Position: refs/heads/master@{#26328}

TBR=tommi

Bug: webrtc:10168
Change-Id: I4c33c2c147cf10c0172c98a55d32dd35a08517c8
Reviewed-on: https://webrtc-review.googlesource.com/c/118704
Reviewed-by: Magnus Jedvert <magjed@webrtc.org>
Commit-Queue: Magnus Jedvert <magjed@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#26341}
2019-01-21 15:18:56 +00:00
Magnus Jedvert
700615fb1c Revert "Android: Add helper methods for printing native stack traces"
This reverts commit dc32cc00e8.

Reason for revert: Seems to be breaking Chromium FYI, https://www.google.com/url?q=https://ci.chromium.org/p/chromium/builders/luci.chromium.webrtc.fyi/WebRTC%2520Chromium%2520FYI%2520Android%2520Tests%2520%2528dbg%2529%2520%2528K%2520Nexus5%2529/1807&sa=D&source=hangouts&ust=1548149426180000&usg=AFQjCNGh9aBqv2wNE12D8-6rn9-AJR-cNg

Original change's description:
> Android: Add helper methods for printing native stack traces
> 
> This CL adds utility functions to unwind the stack for a given thread on
> Android ARM devices. This works on top of unwind.h and unwinds native
> (C++) stack traces only. Unwinding a thread from another thread is done
> by overriding the signal handler with a custom function and then
> interrupting the specific thread.
> 
> Bug: webrtc:10168
> Change-Id: If5adffd3a6bb57bf502168743e09a7eefc292bf3
> Reviewed-on: https://webrtc-review.googlesource.com/c/118141
> Commit-Queue: Magnus Jedvert <magjed@webrtc.org>
> Reviewed-by: Tommi <tommi@webrtc.org>
> Cr-Commit-Position: refs/heads/master@{#26328}

TBR=magjed@webrtc.org,tommi@webrtc.org

Change-Id: I6e01f9226ef60777cb422baeab042bce8944f9ed
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: webrtc:10168
Reviewed-on: https://webrtc-review.googlesource.com/c/118683
Reviewed-by: Magnus Jedvert <magjed@webrtc.org>
Commit-Queue: Magnus Jedvert <magjed@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#26336}
2019-01-21 11:08:36 +00:00
Magnus Jedvert
dc32cc00e8 Android: Add helper methods for printing native stack traces
This CL adds utility functions to unwind the stack for a given thread on
Android ARM devices. This works on top of unwind.h and unwinds native
(C++) stack traces only. Unwinding a thread from another thread is done
by overriding the signal handler with a custom function and then
interrupting the specific thread.

Bug: webrtc:10168
Change-Id: If5adffd3a6bb57bf502168743e09a7eefc292bf3
Reviewed-on: https://webrtc-review.googlesource.com/c/118141
Commit-Queue: Magnus Jedvert <magjed@webrtc.org>
Reviewed-by: Tommi <tommi@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#26328}
2019-01-20 12:01:50 +00:00
Steve Anton
aec15aa810 (5) Rename files to snake_case: install forwarding headers
Mechanically generated with this command:

tools_webrtc/do-renames.sh install all-renames.txt && git cl format

Bug: webrtc:10159
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Change-Id: Ic8e99f71f2da62e5c99863c6d24a8cfe311466cd
Reviewed-on: https://webrtc-review.googlesource.com/c/115682
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#26227}
2019-01-11 17:13:36 +00:00
Steve Anton
10542f21c8 (4) Rename files to snake_case: update BUILD.gn, include paths, header guards, and DEPS entries
Mechanically generated by running this command:

tools_webrtc/do-renames.sh update all-renames.txt && git cl format

Then manually updating:

tools_webrtc/sanitizers/tsan_suppressions_webrtc.cc

Bug: webrtc:10159
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Change-Id: I54824cd91dada8fc3ee3d098f971bc319d477833
Reviewed-on: https://webrtc-review.googlesource.com/c/115653
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#26226}
2019-01-11 17:11:39 +00:00
Steve Anton
1c05765831 (3) Rename files to snake_case: move the files
Mechanically generated with this command:

tools_webrtc/do-rename.sh move all-renames.txt

Bug: webrtc:10159
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Change-Id: I8b05b6eab9b9d18b29c2199bbea239e9add1e690
Reviewed-on: https://webrtc-review.googlesource.com/c/115481
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#26225}
2019-01-11 17:05:20 +00:00
Magnus Jedvert
9514071500 Android: Support externally aligned timestamps
This support is needed if there is a big delay between the creation of
frames and the time they are delivered to the WebRTC C++ layer in
AndroidVideoTrackSource. This is the case if e.g. some heavy video
processing is applied to the frames that takes a couple of hundred
milliseconds. Currently, timestamps coming from Android video sources
are aligned to rtc::TimeMicros() once they reach the WebRTC C++ layer in
AndroidVideoTrackSource. At this point, we "forget" any latency that
might occur before this point, and audio/video sync consequently
suffers.

Bug: webrtc:9991
Change-Id: I7b1aaca9a60a978b9195dd5e5eed4779a0055607
Reviewed-on: https://webrtc-review.googlesource.com/c/110783
Commit-Queue: Magnus Jedvert <magjed@webrtc.org>
Reviewed-by: Sami Kalliomäki <sakal@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#25654}
2018-11-15 11:41:06 +00:00
Yves Gerey
2e00abc98e Reland "[cleanup] Remove useless includes."
Reason for reland: Downstream project fixed.

Original change's description:

> [cleanup] Remove useless includes.
>
> Manual cleanup guided by include-what-you-use diagnostic.
>
> Bug: webrtc:8311
> Change-Id: I00be03392cc7ee005101427ea7dc701621ccea68
> Reviewed-on: https://webrtc-review.googlesource.com/c/103320
> Commit-Queue: Yves Gerey <yvesg@webrtc.org>
> Reviewed-by: Patrik Höglund <phoglund@webrtc.org>
> Cr-Commit-Position: refs/heads/master@{#25013}

Bug: webrtc:8311
Change-Id: Id6ec4aeb798886a90ace640a190eaf16497ba31b
Reviewed-on: https://webrtc-review.googlesource.com/c/104120
Commit-Queue: Yves Gerey <yvesg@webrtc.org>
Reviewed-by: Patrik Höglund <phoglund@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#25034}
2018-10-08 07:44:19 +00:00
Oleh Prypin
96a0f61917 Revert "[cleanup] Remove useless includes."
This reverts commit be8b5348c7.

Reason for revert: Breaks downstream project

Original change's description:
> [cleanup] Remove useless includes.
> 
> Manual cleanup guided by include-what-you-use diagnostic.
> 
> Bug: webrtc:8311
> Change-Id: I00be03392cc7ee005101427ea7dc701621ccea68
> Reviewed-on: https://webrtc-review.googlesource.com/c/103320
> Commit-Queue: Yves Gerey <yvesg@webrtc.org>
> Reviewed-by: Patrik Höglund <phoglund@webrtc.org>
> Cr-Commit-Position: refs/heads/master@{#25013}

TBR=phoglund@google.com,phoglund@webrtc.org,yvesg@webrtc.org

Change-Id: I7a6e1cdfef685173b76f234ad598083043dcd9a0
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: webrtc:8311
Reviewed-on: https://webrtc-review.googlesource.com/c/104022
Reviewed-by: Oleh Prypin <oprypin@webrtc.org>
Commit-Queue: Oleh Prypin <oprypin@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#25015}
2018-10-05 13:13:45 +00:00
Yves Gerey
be8b5348c7 [cleanup] Remove useless includes.
Manual cleanup guided by include-what-you-use diagnostic.

Bug: webrtc:8311
Change-Id: I00be03392cc7ee005101427ea7dc701621ccea68
Reviewed-on: https://webrtc-review.googlesource.com/c/103320
Commit-Queue: Yves Gerey <yvesg@webrtc.org>
Reviewed-by: Patrik Höglund <phoglund@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#25013}
2018-10-05 11:51:06 +00:00
Sami Kalliomäki
05b552f76a Deprecate PeerConnectionFactory#createVideoSource(VideoCapturer).
This is done in preparation of moving VideoCapturer out of
video_api_java. Clients should update to using
createVideoSource(boolean).

CapturerObserver is moved to a separate file because it needs to stay
in video_api_java to allow VideoSource to depend on it.

Bug: webrtc:9496
Change-Id: I3c93f6bc4df553919dcbe05b00ef4c68f2c9ab60
Reviewed-on: https://webrtc-review.googlesource.com/87305
Reviewed-by: Magnus Jedvert <magjed@webrtc.org>
Commit-Queue: Sami Kalliomäki <sakal@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#23868}
2018-07-06 10:35:46 +00:00
Rasmus Brandt
bfd44e0837 Add JavaToNativeVideoCodecInfo to native API.
This conversion function is useful for downstream native codecs
which want to take a VideoCodecInfo in the Java wrapper and use it
as a SdpVideoFormat in the C++ object.

Bug: webrtc:9495
Change-Id: Id2ece708eafd4be648fafff9e94aa13ace504bdf
Reviewed-on: https://webrtc-review.googlesource.com/87381
Commit-Queue: Rasmus Brandt <brandtr@webrtc.org>
Reviewed-by: Sami Kalliomäki <sakal@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#23865}
2018-07-06 09:32:51 +00:00
Karl Wiberg
918f50c5d1 Use absl::make_unique and absl::WrapUnique directly
Instead of going through our wrappers in ptr_util.h.

This CL was generated by the following script:

  git grep -l ptr_util | xargs perl -pi -e 's,#include "rtc_base/ptr_util.h",#include "absl/memory/memory.h",'
  git grep -l MakeUnique | xargs perl -pi -e 's,\b(rtc::)?MakeUnique\b,absl::make_unique,g'
  git grep -l WrapUnique | xargs perl -pi -e 's,\b(rtc::)?WrapUnique\b,absl::WrapUnique,g'
  git checkout -- rtc_base/ptr_util{.h,_unittest.cc}
  git cl format

Followed by manually adding dependencies on
//third_party/abseil-cpp/absl/memory until `gn check` stopped
complaining.

Bug: webrtc:9473
Change-Id: I89ccd363f070479b8c431eb2c3d404a46eaacc1c
Reviewed-on: https://webrtc-review.googlesource.com/86600
Commit-Queue: Karl Wiberg <kwiberg@webrtc.org>
Reviewed-by: Danil Chapovalov <danilchap@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#23850}
2018-07-05 10:59:49 +00:00
Danil Chapovalov
196100efa6 Replace rtc::Optional with absl::optional
This is a no-op change because rtc::Optional is an alias to absl::optional

This CL generated by running script passing top level directories except rtc_base and api

find $@ -type f \( -name \*.h -o -name \*.cc -o -name \*.mm \) \
-exec sed -i 's|rtc::Optional|absl::optional|g' {} \+ \
-exec sed -i 's|rtc::nullopt|absl::nullopt|g' {} \+ \
-exec sed -i 's|#include "api/optional.h"|#include "absl/types/optional.h"|' {} \+

find $@ -type f -name BUILD.gn \
-exec sed -r -i 's|"[\./api]*:optional"|"//third_party/abseil-cpp/absl/types:optional"|' {} \+;

git cl format

Bug: webrtc:9078
Change-Id: I9465c172e65ba6e6ed4e4fdc35b0b265038d6f71
Reviewed-on: https://webrtc-review.googlesource.com/84584
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Commit-Queue: Danil Chapovalov <danilchap@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#23697}
2018-06-21 09:32:56 +00:00
Jiawei Ou
e266c80ce3 Guard the android aaudio headers include with the aaudio preprocessor
Bug: webrtc:9365
Change-Id: Iba7ea24abb1b4d617a61079b3ec2ed2a3148c865
Reviewed-on: https://webrtc-review.googlesource.com/81341
Commit-Queue: Jiawei Ou <ouj@fb.com>
Reviewed-by: Henrik Andreassson <henrika@webrtc.org>
Reviewed-by: Sami Kalliomäki <sakal@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#23539}
2018-06-07 20:00:15 +00:00
Magnus Jedvert
c7da266cb8 Android JNI generation: Set JNI namespace in build files
This CL removes the use of the @JNINamespace annotation and instead
sets the correct JNI namespace in the build file.

Bug: webrtc:8278
Change-Id: Ia4490399e45a97d56b02c260fd80df4edfa092bf
Reviewed-on: https://webrtc-review.googlesource.com/76440
Commit-Queue: Magnus Jedvert <magjed@webrtc.org>
Reviewed-by: Sami Kalliomäki <sakal@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#23299}
2018-05-18 10:44:38 +00:00
Sami Kalliomäki
ff1de0af6b Add Android native API: CreateJavaVideoSource
Adds Android native API for creating VideoTrackSourceInterface objects
that can be fed frames using VideoCapturer.CapturerObserver.

NativeCapturerObserver is moved out of VideoSource because it will now
be used without a VideoSource. It now takes a pointer to
AndroidVideoTrackSource directly instead of VideoTrackSourceProxy.

VideoSource and NativeCapturerObserver JNI code is moved away from
androidvideotracksource.cc to their own files. This allows using
AndroidVideoTrackSource independently.

Bug: webrtc:8769
Change-Id: Ifb9e1eb27d4c8237597d19d932ca6e863abb4d27
Reviewed-on: https://webrtc-review.googlesource.com/76924
Reviewed-by: Paulina Hensman <phensman@webrtc.org>
Commit-Queue: Sami Kalliomäki <sakal@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#23269}
2018-05-17 07:41:51 +00:00
Florent Castelli
b7d9d8346f Implement RtpCodecParameters::parameters
This will return all the fmtp parameters for the codecs, except for
DTMF codes that don't fit the key=value pattern.

Bug: webrtc:7112
Change-Id: I06a203ff64df2c3bc9bc2082cd0f374718b23510
Reviewed-on: https://webrtc-review.googlesource.com/71801
Commit-Queue: Florent Castelli <orphis@webrtc.org>
Reviewed-by: Sami Kalliomäki <sakal@webrtc.org>
Reviewed-by: Kári Helgason <kthelgason@webrtc.org>
Reviewed-by: Taylor Brandstetter <deadbeef@webrtc.org>
Reviewed-by: Steve Anton <steveanton@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#23250}
2018-05-15 17:12:02 +00:00
Magnus Jedvert
8a483be137 Android JNI: Disallow automatic conversion from long to jint
Start using JniIntWrapper from Chromium instead of bypassing
it in jni_generator_helper.h.

Bug: webrtc:8278
Change-Id: I20313e1e610b05f79c210e823ab50cfb2073674e
Reviewed-on: https://webrtc-review.googlesource.com/74841
Reviewed-by: Sami Kalliomäki <sakal@webrtc.org>
Commit-Queue: Magnus Jedvert <magjed@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#23230}
2018-05-15 07:43:05 +00:00
Paulina Hensman
498592d391 Increase logging for Java ADM
The new ADM code removed some redundancies, which led to a decrease in
log output. This especially affected NS and AEC logs. This change
reintroduces these log messages, making debugging easier. "Acoustic
Echo Canceler" has been changed to AEC for easier grepping.

Some new logging is also added.

Bug: webrtc:7452
Change-Id: I9bfb91895931d73d92f3187c8c7c5b7524ac05ba
Reviewed-on: https://webrtc-review.googlesource.com/71401
Commit-Queue: Magnus Jedvert <magjed@webrtc.org>
Reviewed-by: Magnus Jedvert <magjed@webrtc.org>
Reviewed-by: Henrik Andreassson <henrika@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#23003}
2018-04-24 13:50:06 +00:00
Magnus Jedvert
66f1e9eb34 Android: Add AudioDeviceModule interface and clean up implementation code
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}
2018-04-06 10:13:02 +00:00
Magnus Jedvert
e2971ec2ab Android audio manager: Move responsibility of OpenSLES engine
The OpenSLES engine is currently managed by the AudioManager which is
a generic class shared between different kinds of audio input/output.
This CL moves the responsibility of the OpenSLES engine to the actual
OpenSLES implementations.

Bug: webrtc:7452
Change-Id: Iecccb03ec5cd12ce2f3fdc44daaedae27aecf88b
Reviewed-on: https://webrtc-review.googlesource.com/64520
Commit-Queue: Magnus Jedvert <magjed@webrtc.org>
Reviewed-by: Paulina Hensman <phensman@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#22661}
2018-03-28 20:31:26 +00:00
Magnus Jedvert
1a18e0ac46 Android audio code: Replace C++ template with input/output interface
Bug: webrtc:7452
Change-Id: Id816500051e065918bba5c2235d38ad8eb50a8eb
Reviewed-on: https://webrtc-review.googlesource.com/64442
Commit-Queue: Magnus Jedvert <magjed@webrtc.org>
Reviewed-by: Paulina Hensman <phensman@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#22660}
2018-03-28 19:19:37 +00:00
Artem Titov
70899e012f Add support for creating java PCF from native one.
Add support for creating java PeerConnectionFactory from native one
by adding:
1. Constructor from native pointer in java PeerConnectionFactory
2. Method NativeToJavaPeerConnectionFactory in
sdk/android/native/api/peerconnection/peerconnectionfactory.h that
provides ability to convert native factory to java one.

Bug: webrtc:8946
Change-Id: Ibe8b019bd0d45849e2b16d74663d054784526746
Reviewed-on: https://webrtc-review.googlesource.com/62344
Reviewed-by: Sami Kalliomäki <sakal@webrtc.org>
Commit-Queue: Artem Titov <titovartem@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#22564}
2018-03-22 13:37:24 +00:00
Magnus Jedvert
32362a6729 Android: Simplify moved audio device module
This CL performs some simplifications and cleanups of the moved audio code.
 * All JNI interaction now goes from the C++ audio manager calling into
   the Java audio manager. The calls back from the Java code to the C++
   audio manager are removed (this was related to caching audio parameters).
   It's simpler this way because the Java code is now unaware of the C++
   layer and it will be easier to make this into a Java interface.
 * A bunch of state was removed that was related to caching the audio parameters.
 * Some unused functions from audio manager was removed.
 * The Java audio manager no longer depends on ContextUtils, and the context has
   to be passed in externally instead. This is done because we want to get rid of
   ContextUtils eventually.
 * The selection of what AudioDeviceModule to create (AAudio, OpenSLES
   input/output is now exposed in the interface. The reason is that client should
   decide and create what they need explicitly instead of setting blacklists
   in static global WebRTC classes. This will be more modular long term.
 * Selection of what audio device module to create (OpenSLES combinations) no
   longer requires instantiating a C++ AudioManager and is done with static
   enumeration methods instead.

Bug: webrtc:7452
Change-Id: Iba29cf7447a1f6063abd9544d7315e10095167c8
Reviewed-on: https://webrtc-review.googlesource.com/63760
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@{#22542}
2018-03-21 17:48:28 +00:00
Paulina Hensman
89dd7bf924 Move android audio device code into sdk/android
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}
2018-03-20 16:04:33 +00:00
Sami Kalliomäki
3e77afd0d2 Add an example app for Android native API.
The app is a simple loopback demo demonstrating the usage of Android
native API. This is an initial version and I will add support for
HW codecs etc. in the future.

Bug: webrtc:8769
Change-Id: Ifb6209769dabeb8ca3185b969a1ef8afd6d84390
Reviewed-on: https://webrtc-review.googlesource.com/60540
Reviewed-by: Magnus Jedvert <magjed@webrtc.org>
Commit-Queue: Sami Kalliomäki <sakal@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#22385}
2018-03-12 14:22:59 +00:00
Seth Hampson
c384e14707 Add new PeerConnection APIs to the Java SDK.
This adds wrappers to the following native APIs:
- SdpSemantics enum added to the RTCConfiguration
- RtpTransceiver
- PeerConnection.addTrack
- PeerConnection.removeTrack
- PeerConnection.addTransceiver
- PeerConnection.getTransceivers
These APIs are used with the new Unified Plan semantics.

Bug: webrtc:8869
Change-Id: I19443f3ff7ffc91a139ad8276331f09e57cec554
Reviewed-on: https://webrtc-review.googlesource.com/57800
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@{#22317}
2018-03-07 01:17:41 +00:00
Sami Kalliomäki
9ddc14daca Deprecate ContextUtils.getApplicationContext.
Allows passing in the application context to NetworkMonitor in
startMonitoring. The audio code will refactored once it is moved under
sdk/android.

Bug: webrtc:8937
Change-Id: I50c917a845fc4f711899a97d34c04813cc68b68c
Reviewed-on: https://webrtc-review.googlesource.com/58091
Reviewed-by: Magnus Jedvert <magjed@webrtc.org>
Commit-Queue: Sami Kalliomäki <sakal@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#22231}
2018-02-28 15:04:03 +00:00
Sami Kalliomäki
ad148a36ea Add native API for creating AndroidNetworkMonitorFactory.
Moves AndroidNetworkMonitor out of pc folder. Even clients not using
PeerConnection seem to be using it and it doesn't have any dependencies
to the PeerConnection API.

Bug: webrtc:8769
Change-Id: I2bdeff9f5c9925e13388fbc77aa9b264a7583548
Reviewed-on: https://webrtc-review.googlesource.com/53260
Commit-Queue: Sami Kalliomäki <sakal@webrtc.org>
Reviewed-by: Taylor Brandstetter <deadbeef@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#22051}
2018-02-16 12:34:11 +00:00
Sami Kalliomäki
2bde85046a Fix memory leak in NativeToJavaVideoFrame.
This method used to just wrap frame when passed a native frame and
create a new one when passed non-native frame. This caused a memory
leak when a new frame was returned because the caller didn't release
the frame. Now the method always returns a new frame and the caller is
responsible for releasing it.

Bug: webrtc:8892, b/72675429
Change-Id: I06d67a6ed4c059cae1d709c51b0266f9c72fef1a
Reviewed-on: https://webrtc-review.googlesource.com/53840
Reviewed-by: Anders Carlsson <andersc@webrtc.org>
Commit-Queue: Sami Kalliomäki <sakal@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#22033}
2018-02-15 14:26:45 +00:00
Jonathan Yu
fa6a283953 Add wrapper for VideoSink and VideoFrame to Android native_api.
Bug: webrtc:8769
Change-Id: If944b2a52a86666bebf094ec0e3c74c076d6c3d2
Reviewed-on: https://webrtc-review.googlesource.com/50740
Commit-Queue: Sami Kalliomäki <sakal@webrtc.org>
Reviewed-by: Sami Kalliomäki <sakal@webrtc.org>
Reviewed-by: Magnus Jedvert <magjed@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#22001}
2018-02-13 14:10:04 +00:00
Sami Kalliomäki
78498cf5ee Implements JavaToNativeStringMap and adds tests for native API.
Implements JavaToNativeStringMap that is a replacement for
JavaToStdMapStrings. It uses a new template method JavaToNativeMap. Also
adds testing support for native API and a test for JavaToNativeStringMap.

Bug: webrtc:8769
Change-Id: I580d4992a899ebe02da39af450fa51d52ee9b88b
Reviewed-on: https://webrtc-review.googlesource.com/48060
Reviewed-by: Magnus Jedvert <magjed@webrtc.org>
Reviewed-by: Patrik Höglund <phoglund@webrtc.org>
Commit-Queue: Sami Kalliomäki <sakal@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#21967}
2018-02-09 10:34:44 +00:00
Sami Kalliomäki
dff310227d Reorganize code in java_types to logical groups.
Reorganizes methods in java_types.h to logical groups. The order in
the source file matches the order in the header file.

Bug: webrtc:8769
Change-Id: Id3e1e80276a747a3d9952598207ac55493ac46b6
Reviewed-on: https://webrtc-review.googlesource.com/46146
Commit-Queue: Sami Kalliomäki <sakal@webrtc.org>
Reviewed-by: Anders Carlsson <andersc@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#21842}
2018-02-01 13:09:01 +00:00
Sami Kalliomäki
82f96e6a56 Create an experimental Android NDK.
Following files were split:
sdk/android/native_api/jni_helpers.h
  -> sdk/android/native_api/jni/java_types.h
sdk/android/native_api/jni_helpers.cc
  -> sdk/android/native_api/jni/java_types.cc

Skipping presubmit to avoid changing moved code.

Bug: webrtc:8769

Change-Id: I0ef0f6b297b5002322915660d26cca33e91ff05b
No-Presubmit: true
Reviewed-on: https://webrtc-review.googlesource.com/40800
Commit-Queue: Sami Kalliomäki <sakal@webrtc.org>
Reviewed-by: Rasmus Brandt <brandtr@webrtc.org>
Reviewed-by: Anders Carlsson <andersc@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#21799}
2018-01-30 09:33:42 +00:00