89 Commits

Author SHA1 Message Date
jtteh
3c9a6c0aff Added audioSessionDidActivate and audioSessionDidDectivate so that RTCAudioSession can be notified when the audio session is activated or deactivated by iOS outside of the app.
BUG=webrtc:7446

Review-Url: https://codereview.webrtc.org/2813493004
Cr-Commit-Position: refs/heads/master@{#17743}
2017-04-18 16:09:35 +00:00
kthelgason
ee8b861190 remove module-wide warning suppression.
The warnings in question are benign and should be supressed locally so
we can keep the analysis for the rest of the files.

BUG=webrtc:5748

Review-Url: https://codereview.webrtc.org/2790883002
Cr-Commit-Position: refs/heads/master@{#17485}
2017-03-31 11:50:27 +00:00
haysc
7735b1e932 Add logging around audio session interruptions.
Always treat returning to foreground as interruption ended event, to help fix out of sync issues with interruption state.

BUG=0

Review-Url: https://codereview.webrtc.org/2780263002
Cr-Commit-Position: refs/heads/master@{#17457}
2017-03-29 21:53:32 +00:00
zhihuang
9a1604b027 Include the header <cmath>
The build breaks because there is no implementation of std::abs(double).

BUG=None
TBR=tkchin@webrtc.org

Review-Url: https://codereview.webrtc.org/2743063003
Cr-Commit-Position: refs/heads/master@{#17176}
2017-03-10 21:30:04 +00:00
henrika
b3ebc1aa59 Simplifies FineAudioBuffer by using rtc::Buffer
BUG=NONE

Review-Url: https://codereview.webrtc.org/2715963002
Cr-Commit-Position: refs/heads/master@{#16864}
2017-02-27 13:14:17 +00:00
kthelgason
de6adbe0ba Remove non-ARC code from the codebase.
BUG=webrtc:7198

Review-Url: https://codereview.webrtc.org/2702153004
Cr-Commit-Position: refs/heads/master@{#16765}
2017-02-22 08:42:11 +00:00
kthelgason
1634e16042 Remove use of selectors matching Apple private API names.
This was causing some apps that include WebRTC to be rejected from the
app store.

BUG=webrtc:6382

Review-Url: https://codereview.webrtc.org/2679913002
Cr-Commit-Position: refs/heads/master@{#16462}
2017-02-07 10:48:55 +00:00
aleloi
f3d622d4ad Revert of Disabled two iOS tests due to bot breakage. Affected tests are (patchset #1 id:1 of https://codereview.webrtc.org/2652423002/ )
Reason for revert:
This was false alarm. The next Chromium roll fixed the problem and the bot has been green for 3 builds.

Original issue's description:
> Disabled two iOS tests due to bot breakage. Affected tests are
> AudioDeviceTest.RunPlayoutWithFileAsSource and
> AudioDeviceTest.StartStopRecording
>
> NOTRY=True
> TBR=henrika@webrtc.org
> BUG=7056
>
> Review-Url: https://codereview.webrtc.org/2652423002
> Cr-Commit-Position: refs/heads/master@{#16286}
> Committed: 8e775e16eb

TBR=henrika@webrtc.org
# Skipping CQ checks because original CL landed less than 1 days ago.
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=7056

Review-Url: https://codereview.webrtc.org/2656533005
Cr-Commit-Position: refs/heads/master@{#16289}
2017-01-26 09:50:46 +00:00
aleloi
8e775e16eb Disabled two iOS tests due to bot breakage. Affected tests are
AudioDeviceTest.RunPlayoutWithFileAsSource and
AudioDeviceTest.StartStopRecording

NOTRY=True
TBR=henrika@webrtc.org
BUG=7056

Review-Url: https://codereview.webrtc.org/2652423002
Cr-Commit-Position: refs/heads/master@{#16286}
2017-01-26 09:06:05 +00:00
henrika
526248779a Disables AudioDeviceTest.StartStopPlayout on iOS
BUG=webrtc:6889
NOTRY=True

Review-Url: https://codereview.webrtc.org/2595303002
Cr-Commit-Position: refs/heads/master@{#15753}
2016-12-22 09:36:49 +00:00
kthelgason
beafee3009 Move ios_helpers to sdk folder
BUG=webrtc:5582

Review-Url: https://codereview.webrtc.org/2572743004
Cr-Commit-Position: refs/heads/master@{#15649}
2016-12-16 10:12:42 +00:00
Henrik Kjellander
a5073c0c97 Disable AudioDeviceTest.StartPlayoutOnTwoInstances on iOS
This test fails when running on real iOS devices.

BUG=webrtc:6889
TBR=henrika@webrtc.org

Review-Url: https://codereview.webrtc.org/2576653002 .
Cr-Commit-Position: refs/heads/master@{#15586}
2016-12-14 06:25:24 +00:00
kwiberg
af476c737f RTC_[D]CHECK_op: Remove "u" suffix on integer constants
There's no longer any need to make the two arguments have the same
signedness, so we can drop the "u" suffix on literal integer
arguments.

NOPRESUBMIT=true
BUG=webrtc:6645

Review-Url: https://codereview.webrtc.org/2535593002
Cr-Commit-Position: refs/heads/master@{#15280}
2016-11-28 23:21:51 +00:00
solenberg
5de9b6a3ec Move helpers_ios.cc/.h
- Out from modules/utility/ and into modules/audio_device/ios/ - there they are used.

BUG=none

Review-Url: https://codereview.webrtc.org/2526273002
Cr-Commit-Position: refs/heads/master@{#15236}
2016-11-25 08:47:12 +00:00
henrika
92fd8e6b17 Removes usage of system_wrappers/include/clock.h in audio_device/
BUG=webrtc:6687
NOTRY=TRUE

Review-Url: https://codereview.webrtc.org/2501603002
Cr-Commit-Position: refs/heads/master@{#15084}
2016-11-15 13:38:02 +00:00
aleloi
5de52fd38e Created a mocked AudioTransport.
There are currently two nearly identical classes called
MockAudioTransport defined in two unit tests:
android/audio_transport_unittest.cc and
/ios/audio_transport_unittest_ios.cc

This change defines a common mocked AudioTransport. The two current
mocks are rewritten to use the common one. A GN target is created for
this mock and MockAudioDevice.

This change will allow to provide a mocked AudioTransport to
AudioState in a dependent CL https://codereview.webrtc.org/2454373002/

BUG=webrtc:6346
NOPRESUBMIT=True

Review-Url: https://codereview.webrtc.org/2493483002
Cr-Commit-Position: refs/heads/master@{#15010}
2016-11-10 09:05:39 +00:00
jianjun.zhu
a84aa57799 Use std::abs instead of C-style abs.
BUG=webrtc:6486

Review-Url: https://codereview.webrtc.org/2396823002
Cr-Commit-Position: refs/heads/master@{#14536}
2016-10-06 02:19:30 +00:00
tkchin
5fa51e2947 Add iOS static library GN build script.
NOTRY=True

BUG=webrtc:6372

Review-Url: https://codereview.webrtc.org/2391123002
Cr-Commit-Position: refs/heads/master@{#14532}
2016-10-05 20:16:07 +00:00
kwiberg
ac9f876bc0 Sort #includes that got unsorted when gmock.h and gtest.h moved to webrtc/test/
gmock.h and gtest.h were moved (or rather, got wrappers so that we
could put some icky compatibility hacks in one place instead of 500)
in this CL: https://codereview.webrtc.org/2358993004/

NOPRESUBMIT=true
BUG=webrtc:6398

Review-Url: https://codereview.webrtc.org/2381013002
Cr-Commit-Position: refs/heads/master@{#14464}
2016-10-01 05:29:53 +00:00
kwiberg
77eab70470 Enable the -Wundef warning for clang
NOPRESUBMIT=true
BUG=webrtc:6398

Review-Url: https://codereview.webrtc.org/2358993004
Cr-Commit-Position: refs/heads/master@{#14425}
2016-09-29 00:42:08 +00:00
henrika
f1363fdf57 Adds support for AVAudioSessionSilenceSecondaryAudioHintNotification on iOS
BUG=b/30944297
NOTRY=TRUE

Review-Url: https://codereview.webrtc.org/2366753005
Cr-Commit-Position: refs/heads/master@{#14398}
2016-09-27 13:06:48 +00:00
henrika
dda366611e Fixes minor issue in AudioDeviceTest.RunPlayoutAndRecordingInFullDuplex for iOS.
Followup on https://codereview.webrtc.org/2349263004/

BUG=NONE
NOTRY=TRUE

Review-Url: https://codereview.webrtc.org/2362263002
Cr-Commit-Position: refs/heads/master@{#14374}
2016-09-23 15:42:49 +00:00
henrika
051d151569 Adds audio session status to logs for each valid audio route change on iOS
BUG=b/30944297
NOTRY=TRUE

Review-Url: https://codereview.webrtc.org/2355393005
Cr-Commit-Position: refs/heads/master@{#14355}
2016-09-22 15:48:10 +00:00
henrika
c5aea65b76 Adds output audio volume to iOS logs
BUG=b/30944297
NOTRY=TRUE

Review-Url: https://codereview.webrtc.org/2360583002
Cr-Commit-Position: refs/heads/master@{#14334}
2016-09-21 14:46:01 +00:00
henrika
17802ae258 Ensures that ADM for Android and iOS uses identical states when stopping audio
BUG=b/25975010
TBR=tkchin
NOTRY=TRUE

Review-Url: https://codereview.webrtc.org/2349263004
Cr-Commit-Position: refs/heads/master@{#14328}
2016-09-21 11:55:10 +00:00
maxmorin
1aee0b5bd9 Remove old methods in AudioTransport, make it pass a gn build
when building with default warnings.

This is in preparation for making a gn target for audio_device_tests.

BUG=webrtc:6170, webrtc:163
NOTRY=True

Review-Url: https://codereview.webrtc.org/2219653004
Cr-Commit-Position: refs/heads/master@{#13759}
2016-08-15 18:46:28 +00:00
tkchin
cd2553937e Increase audio buffer duration for iPhone 4s.
NOTRY=True
BUG=

Review-Url: https://codereview.webrtc.org/2193573002
Cr-Commit-Position: refs/heads/master@{#13579}
2016-07-29 17:53:45 +00:00
tkchin
93dd634561 Treat foreground event as interruption end.
NOTRY=True
BUG=

Review-Url: https://codereview.webrtc.org/2181163005
Cr-Commit-Position: refs/heads/master@{#13543}
2016-07-27 17:17:19 +00:00
Max Morin
84cab205f5 UMA log for audio_device Init and Start(Playout|Recording). Make Init return a more specific error code, if possible.
BUG=webrtc:5761
R=asapersson@webrtc.org, henrika@webrtc.org

Review URL: https://codereview.webrtc.org/2103863004 .

Cr-Commit-Position: refs/heads/master@{#13361}
2016-07-01 11:35:31 +00:00
henrika
41ed7e1715 Avoid race when stopping audio unit on iOS
BUG=webrtc:5993
R=tkchin@webrtc.org

Review URL: https://codereview.webrtc.org/2079383002 .

Cr-Commit-Position: refs/heads/master@{#13234}
2016-06-21 09:41:15 +00:00
henrika
86eff72eec Adds logging in combination with restart of audio unit
BUG=
R=tkchin@webrtc.org

Review URL: https://codereview.webrtc.org/2083603002 .

Cr-Commit-Position: refs/heads/master@{#13233}
2016-06-21 09:26:57 +00:00
henrika
2d014be554 Resolves issue with bad audio using BT headsets on iOS.
BUG=webrtc:6004
R=tkchin@webrtc.org

Review URL: https://codereview.webrtc.org/2063733002 .

Cr-Commit-Position: refs/heads/master@{#13165}
2016-06-16 12:27:06 +00:00
Taylor Brandstetter
5d97a9a05b Adding more detail to MessageQueue::Dispatch logging.
Every message will now be traced with the location from which it was
posted, including function name, file and line number.

This CL also writes a normal LOG message when the dispatch took more
than a certain amount of time (currently 50ms).

This logging should help us identify messages that are taking
longer than expected to be dispatched.

R=pthatcher@webrtc.org, tommi@webrtc.org

Review URL: https://codereview.webrtc.org/2019423006 .

Cr-Commit-Position: refs/heads/master@{#13104}
2016-06-10 21:17:33 +00:00
kjellander
080a1e3fa6 Fix iOS GN build and cleanup system_wrappers
Compile fixes for GN on iOS that finally gets our bots green.

Changes to system_wrappers:
* Updated to only use inclusive sources for maintainability
* Add a few missing GN headers.
* Cleanup GYP hack for atomic32_mac.cc
* Renamed changes sources to avoid problems with GYP/GN file
   suffix rules:
  - atomic32_mac.cc -> atomic32_darwin.cc
  - atomic32_posix.cc -> atomic32_non_darwin_unix.cc
See https://code.google.com/p/chromium/codesearch#chromium/src/build/config/BUILDCONFIG.gn&l=325
for details on which extensions can/cannot be used.

BUG=webrtc:5586
NOTRY=True

Review-Url: https://codereview.webrtc.org/1999723002
Cr-Commit-Position: refs/heads/master@{#12897}
2016-05-25 18:37:17 +00:00
tkchin
d251196d37 Provide isAudioEnabled flag to control audio unit.
- Also removes async invoker usage in favor of thread posting

BUG=

Review-Url: https://codereview.webrtc.org/1945563003
Cr-Commit-Position: refs/heads/master@{#12651}
2016-05-07 01:54:21 +00:00
Peter Boström
4adbbcfe7a Move ADM Create() method to public interface.
ADMs were previously created by CreateAudioDeviceModule which was
removed in previous refactoring without a replacement added.

BUG=
R=tommi@webrtc.org

Review URL: https://codereview.webrtc.org/1944883002 .

Cr-Commit-Position: refs/heads/master@{#12613}
2016-05-03 19:51:31 +00:00
tkchin
9eeb6240c9 Build dynamic iOS SDK.
- Places most ObjC code into webrtc/sdk/objc instead.
- New gyp targets to build, strip and export symbols for dylib.
- Removes old script used to generate dylib.

BUG=

Review URL: https://codereview.webrtc.org/1903663002

Cr-Commit-Position: refs/heads/master@{#12524}
2016-04-27 08:54:27 +00:00
tkchin
efdd930dc9 Fix RTCAudioSession crash in removeDelegate.
BUG=

Review URL: https://codereview.webrtc.org/1877643002

Cr-Commit-Position: refs/heads/master@{#12320}
2016-04-11 19:01:06 +00:00
Tze Kwang Chin
307a0922c5 Support delayed AudioUnit initialization.
Applications can choose to decide when to give up control of the
AVAudioSession to WebRTC. Otherwise, behavior should be
unchanged.

Adds a toggle to AppRTCDemo so developers can see the different
paths.

BUG=
R=haysc@webrtc.org

Review URL: https://codereview.webrtc.org/1822543002 .

Cr-Commit-Position: refs/heads/master@{#12080}
2016-03-21 20:58:01 +00:00
Zeke Chin
1300caa3fe Refactor AudioUnit code into its own class.
BUG=
R=haysc@webrtc.org, henrika@webrtc.org

Review URL: https://codereview.webrtc.org/1809343002 .

Cr-Commit-Position: refs/heads/master@{#12056}
2016-03-18 21:39:22 +00:00
tkchin
e54467f73e Use RTCAudioSessionDelegateAdapter in AudioDeviceIOS.
Part 3 of refactor. Also:
- better weak pointer delegate storage + tests
- we now ignore route changes when we're interrupted
- fixed bug where preferred sample rate wasn't set if audio session
   wasn't active

BUG=

Review URL: https://codereview.webrtc.org/1796983004

Cr-Commit-Position: refs/heads/master@{#12007}
2016-03-15 23:54:11 +00:00
tkchin
9f987d3200 Refactor AVAudioSession intialization code.
BUG=

Review URL: https://codereview.webrtc.org/1778793005

Cr-Commit-Position: refs/heads/master@{#11972}
2016-03-13 04:06:34 +00:00
tkchin
0ce3bf9cc4 Fix lock behavior on RTCAudioSession.
In addition:
- Introduces RTCAudioSessionTest
- iOS/Mac gtests now have an autoreleasepool
- Moves ScopedAutoreleasePool to rtc_base_approved
- Introduces route change button in AppRTCDemo

BUG=webrtc:5649

Review URL: https://codereview.webrtc.org/1782363002

Cr-Commit-Position: refs/heads/master@{#11971}
2016-03-13 00:52:13 +00:00
henrika
ab12c47160 Modifies SDK and iOS detection for helper method that needs iOS 9+
BUG=NONE
R=tkchin@webrtc.org

Review URL: https://codereview.webrtc.org/1746023002 .

Cr-Commit-Position: refs/heads/master@{#11861}
2016-03-03 16:00:00 +00:00
henrika
3e60bf0ff3 Adds low complexity audio mode for single core CPUs
BUG=webrtc:5538
R=tkchin@webrtc.org

Review URL: https://codereview.webrtc.org/1723163002 .

Cr-Commit-Position: refs/heads/master@{#11743}
2016-02-24 13:27:22 +00:00
kwiberg
f01633e667 Replace scoped_ptr with unique_ptr in webrtc/modules/audio_device/
BUG=webrtc:5520

Review URL: https://codereview.webrtc.org/1722083002

Cr-Commit-Position: refs/heads/master@{#11740}
2016-02-24 13:00:45 +00:00
Zeke Chin
b3fb71c101 Add RTCAudioSession proxy class.
BUG=
R=haysc@webrtc.org, henrika@webrtc.org

Review URL: https://codereview.webrtc.org/1709853002 .

Cr-Commit-Position: refs/heads/master@{#11676}
2016-02-18 23:44:17 +00:00
Peter Kasting
6955870806 Convert channel counts to size_t.
IIRC, this was originally requested by ajm during review of the other size_t conversions I did over the past year, and I agreed it made sense, but wanted to do it separately since those changes were already gargantuan.

BUG=chromium:81439
TEST=none
R=henrik.lundin@webrtc.org, henrika@webrtc.org, kjellander@webrtc.org, minyue@webrtc.org, perkj@webrtc.org, solenberg@webrtc.org, stefan@webrtc.org, tina.legrand@webrtc.org

Review URL: https://codereview.webrtc.org/1316523002 .

Cr-Commit-Position: refs/heads/master@{#11229}
2016-01-13 00:26:55 +00:00
henrika
30166cb1a8 iOS stability improvement for device switching, including BT devices
BUG=webrtc:5058

Review URL: https://codereview.webrtc.org/1554163002

Cr-Commit-Position: refs/heads/master@{#11168}
2016-01-07 15:23:08 +00:00
henrika
46ea3ce580 AudioDeviceTest.StartPlayoutOnTwoInstances now verifies two active playing streams
TBR=tkchin_webrtc
BUG=b/25343768

Review URL: https://codereview.webrtc.org/1527143007 .

Cr-Commit-Position: refs/heads/master@{#11165}
2016-01-07 14:03:07 +00:00