following the removal of ISAC from the code base.
BUG=webrtc:14450
Change-Id: I6faab5391bf0ef563c5dcce0bd5d8a653a87d9c8
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/294523
Reviewed-by: Alessio Bazzica <alessiob@webrtc.org>
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Commit-Queue: Philipp Hancke <phancke@microsoft.com>
Cr-Commit-Position: refs/heads/main@{#39378}
Also, make the iOS audio unittests not run on the simulator by default,
and if someone wants to run the tests one can do
by using the WEBRTC_IOS_RUN_AUDIO_TESTS environment variable.
Bug: webrtc:7812
Change-Id: Ie9fc70872c6617516e2f2c21039489df309b85fb
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/292621
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Commit-Queue: Daniel.L (Byoungchan) Lee <daniel.l@hpcnt.com>
Reviewed-by: Kári Helgason <kthelgason@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#39306}
The test is already disabled on iOS < 16 and fails on iOS 16 with this error:
/../../sdk/objc/unittests/RTCCameraVideoCapturerTests.mm:556: error: -[RTCCameraVideoCapturerTestsWithMockedCaptureSession testStartCaptureSetsOutputDimensionsInvalidPixelFormat] : ((width) equal to ([output.videoSettings[(id)kCVPixelBufferWidthKey] intValue])) failed: ("110") is not equal to ("0")
https://chromium-swarm.appspot.com/task?id=5fc0ac239b2dd110
Change-Id: Ia0a5c4290261b204d5e369dfc62113268ef48127
Bug: webrtc:14829, b/264630045
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/290895
Commit-Queue: Kári Helgason <kthelgason@webrtc.org>
Reviewed-by: Kári Helgason <kthelgason@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#39130}
This is required by some virtual cameras, like Snap Camera from
Snapchat.
Bug: webrtc:14783
Change-Id: I3d841936c17f3f227af9a94a4c3b0f37940d43b2
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/288361
Commit-Queue: Kári Helgason <kthelgason@webrtc.org>
Reviewed-by: Kári Helgason <kthelgason@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#39073}
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}
See commit
https://webrtc.googlesource.com/src/+/c8a6fb2bb8762de17008dee97c5fb6e762f7e056
where the setup methods for RTCCameraVideoCaptureTests' test cases were
lost. Both "setup" where XCTest instead looks for "setUp", and
"setupWithMockedCaptureSession" which isn't called explicitly anywhere.
This commit splits the old RTCCameraVideoCaptureTests into two;
RTCCameraVideoCaptureTests for tests using "setup", and
RTCCameraVideoCaptureTestsWithMockedCaptureSession for tests using
"setupWithMockedCaptureSession".
Bug: webrtc:8382
Change-Id: I64cefff744e12f62d65e04133512de1e10d17d95
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/288601
Reviewed-by: Kári Helgason <kthelgason@webrtc.org>
Reviewed-by: Daniel.L (Byoungchan) Lee <daniel.l@hpcnt.com>
Commit-Queue: Kári Helgason <kthelgason@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#38931}
removes cached pixelbufferpool and instead retrieves current pool from the compressionSession each time (as recommended by apple docs)
Bug: webrtc:14688
Change-Id: I2244e69e7f32b912021db0905b9d5867d0bf6357
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/284240
Reviewed-by: Kári Helgason <kthelgason@webrtc.org>
Commit-Queue: Kári Helgason <kthelgason@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#38920}
The file was renamed, see
https://groups.google.com/u/1/g/discuss-webrtc/c/ZQiP4f_bpw4
Bug: webrtc:14180
Change-Id: Ia76c85ba7d9da6b3a93d0a67a4b6a5187e07e230
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/283084
Commit-Queue: Harald Alvestrand <hta@webrtc.org>
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Auto-Submit: Henrik Boström <hbos@webrtc.org>
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#38616}
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}
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}
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}
Align thread checkers with the class comment,
i.e. ensure AudioDevice is used and destroyed on the same thread it was constructed on, not just the same thread AudioDevice::Init was called.
Bug: webrtc:9702
Change-Id: Ib905978cc8173266151adf26e1b7317f1d3852bc
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/274164
Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org>
Auto-Submit: Danil Chapovalov <danilchap@webrtc.org>
Reviewed-by: Kári Helgason <kthelgason@webrtc.org>
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#38018}
This is a reland of commit 9a0a6a198e
Original change's description:
> Reland "ObjC ADM: record/play implementation via RTCAudioDevice [3/3]"
>
> This is a reland of commit 2b9aaad58f
>
> Original change's description:
> > ObjC ADM: record/play implementation via RTCAudioDevice [3/3]
> >
> > # Overview
> > This CL chain exposes new API from ObjC WebRTC SDK to inject custom
> > means to play and record audio. The goal of CLs is achieved by having
> > additional implementation of `webrtc::AudioDeviceModule`
> > called `ObjCAudioDeviceModule`. The feature
> > of `ObjCAudioDeviceModule` is that it does not directly use any
> > of OS-provided audio APIs like AudioUnit, AVAudioEngine, AudioQueue,
> > AVCaptureSession etc. Instead it delegates communication with specific
> > system audio API to user-injectable audio device instance which
> > implements `RTCAudioDevice` protocol.
> > `RTCAudioDevice` is new API added to ObC WebRTC SDK in the CL chain.
> >
> > # AudioDeviceBuffer
> > `ObjCAudioDeviceModule` does conform to heavy `AudioDeviceModule`
> > interface providing stubs for unrelated methods. It also implements
> > common low-level management of audio device buffer, which glues audio
> > PCM flow to/from WebRTC.
> > `ObjCAudioDeviceModule` owns single `webrtc::AudioDeviceBuffer` which
> > with the help of two `FineAudioBuffer` (one for recording and one for
> > playout) is exchanged audio PCMs with user-provided `RTCAudioDevice`
> > instance.
> > `webrtc::AudioDeviceBuffer` is configured to work with specific audio:
> > it has to know sample rate and channels count of audio being played and
> > recorded. These formats could be different between playout and
> > recording. `ObjCAudioDeviceModule` stores current audio parameters
> > applied to `webrtc::AudioDeviceBuffer` as fields of
> > type `webrtc::AudioParameters`. `RTCAudioDevice` has it's own variable
> > audio parameters like sample rate, channels count and IO buffer
> > duration. The audio parameters of `RTCAudioDevice` must be kept in sync
> > with audio parameters applied to `webrtc::AudioDeviceBuffer`, otherwise
> > audio playout and recording will be corrupted: audio is sent only
> > partially over the wire and/or audio is played with artifacts.
> > `ObjCAudioDeviceModule` reads current `RTCAudioDevice` audio parameters
> > when playout or recording is initialized. Whenever `RTCAudioDevice`
> > audio parameters parameters are changed, there must be a notification to
> > `ObjCAudioDeviceModule` to allow it to reconfigure
> > it's `webrtc::AudioDeviceBuffer`. The notification is performed
> > via `RTCAudioDeviceDelegate` object, which is provided
> > by `ObjCAudioDeviceModule` during initialization of `RTCAudioDevice`.
> >
> > # Threading
> > `ObjCAudioDeviceModule` is stick to same thread between initialization
> > and termination. The only exception is two IO functions invoked by SDK
> > user code presumably from real-time audio IO thread.
> > Implementation of `RTCAudioDevice` may rely on the fact that all the
> > methods of `RTCAudioDevice` are called on the same thread between
> > initialization and termination. `ObjCAudioDeviceModule` is also expect
> > that the implementation of `RTCAudioDevice` will call methods related
> > to notification of audio parameters changes and audio interruption are
> > invoked on `ObjCAudioDeviceModule` thread. To facilitate this
> > requirement `RTCAudioDeviceDelegate` provides two functions to execute
> > sync and async block on `ObjCAudioDeviceModule` thread.
> > Async block could be useful when handling audio session notifications to
> > dispatch whole block re-configuring audio objects used
> > by `RTCAudioDevice` implementation.
> > Sync block could be used to make sure changes to audio parameters
> > of ADB owned by `ObjCAudioDeviceModule` are notified, before interrupted
> > playout/recording restarted.
> >
> > Bug: webrtc:14193
> > Change-Id: I5587ec6bbee3cf02bad70dd59b822feb0ada7f86
> > Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/269006
> > Reviewed-by: Henrik Andreasson <henrika@google.com>
> > Commit-Queue: Yury Yarashevich <yura.yaroshevich@gmail.com>
> > Reviewed-by: Peter Hanspers <peterhanspers@webrtc.org>
> > Reviewed-by: Henrik Andreassson <henrika@webrtc.org>
> > Reviewed-by: Tomas Gunnarsson <tommi@webrtc.org>
> > Cr-Commit-Position: refs/heads/main@{#37928}
>
> Bug: webrtc:14193
> Change-Id: Iaf950d24bb2394a20e50421d5122f72ce46ae840
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/273380
> Commit-Queue: Tomas Gunnarsson <tommi@webrtc.org>
> Reviewed-by: Tomas Gunnarsson <tommi@webrtc.org>
> Cr-Commit-Position: refs/heads/main@{#37946}
Bug: webrtc:14193
Change-Id: I84a6462c233daae7f662224513809b13e7218029
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/273662
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Commit-Queue: Tomas Gunnarsson <tommi@webrtc.org>
Reviewed-by: Henrik Andreassson <henrika@webrtc.org>
Reviewed-by: Tomas Gunnarsson <tommi@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#37977}
This reverts commit 9a0a6a198e.
Reason for revert: Breaks upstream project
Original change's description:
> Reland "ObjC ADM: record/play implementation via RTCAudioDevice [3/3]"
>
> This is a reland of commit 2b9aaad58f
>
> Original change's description:
> > ObjC ADM: record/play implementation via RTCAudioDevice [3/3]
> >
> > # Overview
> > This CL chain exposes new API from ObjC WebRTC SDK to inject custom
> > means to play and record audio. The goal of CLs is achieved by having
> > additional implementation of `webrtc::AudioDeviceModule`
> > called `ObjCAudioDeviceModule`. The feature
> > of `ObjCAudioDeviceModule` is that it does not directly use any
> > of OS-provided audio APIs like AudioUnit, AVAudioEngine, AudioQueue,
> > AVCaptureSession etc. Instead it delegates communication with specific
> > system audio API to user-injectable audio device instance which
> > implements `RTCAudioDevice` protocol.
> > `RTCAudioDevice` is new API added to ObC WebRTC SDK in the CL chain.
> >
> > # AudioDeviceBuffer
> > `ObjCAudioDeviceModule` does conform to heavy `AudioDeviceModule`
> > interface providing stubs for unrelated methods. It also implements
> > common low-level management of audio device buffer, which glues audio
> > PCM flow to/from WebRTC.
> > `ObjCAudioDeviceModule` owns single `webrtc::AudioDeviceBuffer` which
> > with the help of two `FineAudioBuffer` (one for recording and one for
> > playout) is exchanged audio PCMs with user-provided `RTCAudioDevice`
> > instance.
> > `webrtc::AudioDeviceBuffer` is configured to work with specific audio:
> > it has to know sample rate and channels count of audio being played and
> > recorded. These formats could be different between playout and
> > recording. `ObjCAudioDeviceModule` stores current audio parameters
> > applied to `webrtc::AudioDeviceBuffer` as fields of
> > type `webrtc::AudioParameters`. `RTCAudioDevice` has it's own variable
> > audio parameters like sample rate, channels count and IO buffer
> > duration. The audio parameters of `RTCAudioDevice` must be kept in sync
> > with audio parameters applied to `webrtc::AudioDeviceBuffer`, otherwise
> > audio playout and recording will be corrupted: audio is sent only
> > partially over the wire and/or audio is played with artifacts.
> > `ObjCAudioDeviceModule` reads current `RTCAudioDevice` audio parameters
> > when playout or recording is initialized. Whenever `RTCAudioDevice`
> > audio parameters parameters are changed, there must be a notification to
> > `ObjCAudioDeviceModule` to allow it to reconfigure
> > it's `webrtc::AudioDeviceBuffer`. The notification is performed
> > via `RTCAudioDeviceDelegate` object, which is provided
> > by `ObjCAudioDeviceModule` during initialization of `RTCAudioDevice`.
> >
> > # Threading
> > `ObjCAudioDeviceModule` is stick to same thread between initialization
> > and termination. The only exception is two IO functions invoked by SDK
> > user code presumably from real-time audio IO thread.
> > Implementation of `RTCAudioDevice` may rely on the fact that all the
> > methods of `RTCAudioDevice` are called on the same thread between
> > initialization and termination. `ObjCAudioDeviceModule` is also expect
> > that the implementation of `RTCAudioDevice` will call methods related
> > to notification of audio parameters changes and audio interruption are
> > invoked on `ObjCAudioDeviceModule` thread. To facilitate this
> > requirement `RTCAudioDeviceDelegate` provides two functions to execute
> > sync and async block on `ObjCAudioDeviceModule` thread.
> > Async block could be useful when handling audio session notifications to
> > dispatch whole block re-configuring audio objects used
> > by `RTCAudioDevice` implementation.
> > Sync block could be used to make sure changes to audio parameters
> > of ADB owned by `ObjCAudioDeviceModule` are notified, before interrupted
> > playout/recording restarted.
> >
> > Bug: webrtc:14193
> > Change-Id: I5587ec6bbee3cf02bad70dd59b822feb0ada7f86
> > Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/269006
> > Reviewed-by: Henrik Andreasson <henrika@google.com>
> > Commit-Queue: Yury Yarashevich <yura.yaroshevich@gmail.com>
> > Reviewed-by: Peter Hanspers <peterhanspers@webrtc.org>
> > Reviewed-by: Henrik Andreassson <henrika@webrtc.org>
> > Reviewed-by: Tomas Gunnarsson <tommi@webrtc.org>
> > Cr-Commit-Position: refs/heads/main@{#37928}
>
> Bug: webrtc:14193
> Change-Id: Iaf950d24bb2394a20e50421d5122f72ce46ae840
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/273380
> Commit-Queue: Tomas Gunnarsson <tommi@webrtc.org>
> Reviewed-by: Tomas Gunnarsson <tommi@webrtc.org>
> Cr-Commit-Position: refs/heads/main@{#37946}
Bug: webrtc:14193
Change-Id: I5e18cc919ca4bb1cef7d5a11489451a0907f0d66
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/273486
Bot-Commit: rubber-stamper@appspot.gserviceaccount.com <rubber-stamper@appspot.gserviceaccount.com>
Owners-Override: Andrey Logvin <landrey@google.com>
Commit-Queue: Andrey Logvin <landrey@google.com>
Cr-Commit-Position: refs/heads/main@{#37950}
This is a reland of commit 2b9aaad58f
Original change's description:
> ObjC ADM: record/play implementation via RTCAudioDevice [3/3]
>
> # Overview
> This CL chain exposes new API from ObjC WebRTC SDK to inject custom
> means to play and record audio. The goal of CLs is achieved by having
> additional implementation of `webrtc::AudioDeviceModule`
> called `ObjCAudioDeviceModule`. The feature
> of `ObjCAudioDeviceModule` is that it does not directly use any
> of OS-provided audio APIs like AudioUnit, AVAudioEngine, AudioQueue,
> AVCaptureSession etc. Instead it delegates communication with specific
> system audio API to user-injectable audio device instance which
> implements `RTCAudioDevice` protocol.
> `RTCAudioDevice` is new API added to ObC WebRTC SDK in the CL chain.
>
> # AudioDeviceBuffer
> `ObjCAudioDeviceModule` does conform to heavy `AudioDeviceModule`
> interface providing stubs for unrelated methods. It also implements
> common low-level management of audio device buffer, which glues audio
> PCM flow to/from WebRTC.
> `ObjCAudioDeviceModule` owns single `webrtc::AudioDeviceBuffer` which
> with the help of two `FineAudioBuffer` (one for recording and one for
> playout) is exchanged audio PCMs with user-provided `RTCAudioDevice`
> instance.
> `webrtc::AudioDeviceBuffer` is configured to work with specific audio:
> it has to know sample rate and channels count of audio being played and
> recorded. These formats could be different between playout and
> recording. `ObjCAudioDeviceModule` stores current audio parameters
> applied to `webrtc::AudioDeviceBuffer` as fields of
> type `webrtc::AudioParameters`. `RTCAudioDevice` has it's own variable
> audio parameters like sample rate, channels count and IO buffer
> duration. The audio parameters of `RTCAudioDevice` must be kept in sync
> with audio parameters applied to `webrtc::AudioDeviceBuffer`, otherwise
> audio playout and recording will be corrupted: audio is sent only
> partially over the wire and/or audio is played with artifacts.
> `ObjCAudioDeviceModule` reads current `RTCAudioDevice` audio parameters
> when playout or recording is initialized. Whenever `RTCAudioDevice`
> audio parameters parameters are changed, there must be a notification to
> `ObjCAudioDeviceModule` to allow it to reconfigure
> it's `webrtc::AudioDeviceBuffer`. The notification is performed
> via `RTCAudioDeviceDelegate` object, which is provided
> by `ObjCAudioDeviceModule` during initialization of `RTCAudioDevice`.
>
> # Threading
> `ObjCAudioDeviceModule` is stick to same thread between initialization
> and termination. The only exception is two IO functions invoked by SDK
> user code presumably from real-time audio IO thread.
> Implementation of `RTCAudioDevice` may rely on the fact that all the
> methods of `RTCAudioDevice` are called on the same thread between
> initialization and termination. `ObjCAudioDeviceModule` is also expect
> that the implementation of `RTCAudioDevice` will call methods related
> to notification of audio parameters changes and audio interruption are
> invoked on `ObjCAudioDeviceModule` thread. To facilitate this
> requirement `RTCAudioDeviceDelegate` provides two functions to execute
> sync and async block on `ObjCAudioDeviceModule` thread.
> Async block could be useful when handling audio session notifications to
> dispatch whole block re-configuring audio objects used
> by `RTCAudioDevice` implementation.
> Sync block could be used to make sure changes to audio parameters
> of ADB owned by `ObjCAudioDeviceModule` are notified, before interrupted
> playout/recording restarted.
>
> Bug: webrtc:14193
> Change-Id: I5587ec6bbee3cf02bad70dd59b822feb0ada7f86
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/269006
> Reviewed-by: Henrik Andreasson <henrika@google.com>
> Commit-Queue: Yury Yarashevich <yura.yaroshevich@gmail.com>
> Reviewed-by: Peter Hanspers <peterhanspers@webrtc.org>
> Reviewed-by: Henrik Andreassson <henrika@webrtc.org>
> Reviewed-by: Tomas Gunnarsson <tommi@webrtc.org>
> Cr-Commit-Position: refs/heads/main@{#37928}
Bug: webrtc:14193
Change-Id: Iaf950d24bb2394a20e50421d5122f72ce46ae840
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/273380
Commit-Queue: Tomas Gunnarsson <tommi@webrtc.org>
Reviewed-by: Tomas Gunnarsson <tommi@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#37946}
This reverts commit 2b9aaad58f.
Reason for revert: Breaks upstream project
Original change's description:
> ObjC ADM: record/play implementation via RTCAudioDevice [3/3]
>
> # Overview
> This CL chain exposes new API from ObjC WebRTC SDK to inject custom
> means to play and record audio. The goal of CLs is achieved by having
> additional implementation of `webrtc::AudioDeviceModule`
> called `ObjCAudioDeviceModule`. The feature
> of `ObjCAudioDeviceModule` is that it does not directly use any
> of OS-provided audio APIs like AudioUnit, AVAudioEngine, AudioQueue,
> AVCaptureSession etc. Instead it delegates communication with specific
> system audio API to user-injectable audio device instance which
> implements `RTCAudioDevice` protocol.
> `RTCAudioDevice` is new API added to ObC WebRTC SDK in the CL chain.
>
> # AudioDeviceBuffer
> `ObjCAudioDeviceModule` does conform to heavy `AudioDeviceModule`
> interface providing stubs for unrelated methods. It also implements
> common low-level management of audio device buffer, which glues audio
> PCM flow to/from WebRTC.
> `ObjCAudioDeviceModule` owns single `webrtc::AudioDeviceBuffer` which
> with the help of two `FineAudioBuffer` (one for recording and one for
> playout) is exchanged audio PCMs with user-provided `RTCAudioDevice`
> instance.
> `webrtc::AudioDeviceBuffer` is configured to work with specific audio:
> it has to know sample rate and channels count of audio being played and
> recorded. These formats could be different between playout and
> recording. `ObjCAudioDeviceModule` stores current audio parameters
> applied to `webrtc::AudioDeviceBuffer` as fields of
> type `webrtc::AudioParameters`. `RTCAudioDevice` has it's own variable
> audio parameters like sample rate, channels count and IO buffer
> duration. The audio parameters of `RTCAudioDevice` must be kept in sync
> with audio parameters applied to `webrtc::AudioDeviceBuffer`, otherwise
> audio playout and recording will be corrupted: audio is sent only
> partially over the wire and/or audio is played with artifacts.
> `ObjCAudioDeviceModule` reads current `RTCAudioDevice` audio parameters
> when playout or recording is initialized. Whenever `RTCAudioDevice`
> audio parameters parameters are changed, there must be a notification to
> `ObjCAudioDeviceModule` to allow it to reconfigure
> it's `webrtc::AudioDeviceBuffer`. The notification is performed
> via `RTCAudioDeviceDelegate` object, which is provided
> by `ObjCAudioDeviceModule` during initialization of `RTCAudioDevice`.
>
> # Threading
> `ObjCAudioDeviceModule` is stick to same thread between initialization
> and termination. The only exception is two IO functions invoked by SDK
> user code presumably from real-time audio IO thread.
> Implementation of `RTCAudioDevice` may rely on the fact that all the
> methods of `RTCAudioDevice` are called on the same thread between
> initialization and termination. `ObjCAudioDeviceModule` is also expect
> that the implementation of `RTCAudioDevice` will call methods related
> to notification of audio parameters changes and audio interruption are
> invoked on `ObjCAudioDeviceModule` thread. To facilitate this
> requirement `RTCAudioDeviceDelegate` provides two functions to execute
> sync and async block on `ObjCAudioDeviceModule` thread.
> Async block could be useful when handling audio session notifications to
> dispatch whole block re-configuring audio objects used
> by `RTCAudioDevice` implementation.
> Sync block could be used to make sure changes to audio parameters
> of ADB owned by `ObjCAudioDeviceModule` are notified, before interrupted
> playout/recording restarted.
>
> Bug: webrtc:14193
> Change-Id: I5587ec6bbee3cf02bad70dd59b822feb0ada7f86
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/269006
> Reviewed-by: Henrik Andreasson <henrika@google.com>
> Commit-Queue: Yury Yarashevich <yura.yaroshevich@gmail.com>
> Reviewed-by: Peter Hanspers <peterhanspers@webrtc.org>
> Reviewed-by: Henrik Andreassson <henrika@webrtc.org>
> Reviewed-by: Tomas Gunnarsson <tommi@webrtc.org>
> Cr-Commit-Position: refs/heads/main@{#37928}
Bug: webrtc:14193
Change-Id: I6e759a91664c1f6f60e862d72e45f75c51d7297a
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/273340
Auto-Submit: Andrey Logvin <landrey@google.com>
Bot-Commit: rubber-stamper@appspot.gserviceaccount.com <rubber-stamper@appspot.gserviceaccount.com>
Commit-Queue: Andrey Logvin <landrey@google.com>
Owners-Override: Andrey Logvin <landrey@google.com>
Cr-Commit-Position: refs/heads/main@{#37931}
# Overview
This CL chain exposes new API from ObjC WebRTC SDK to inject custom
means to play and record audio. The goal of CLs is achieved by having
additional implementation of `webrtc::AudioDeviceModule`
called `ObjCAudioDeviceModule`. The feature
of `ObjCAudioDeviceModule` is that it does not directly use any
of OS-provided audio APIs like AudioUnit, AVAudioEngine, AudioQueue,
AVCaptureSession etc. Instead it delegates communication with specific
system audio API to user-injectable audio device instance which
implements `RTCAudioDevice` protocol.
`RTCAudioDevice` is new API added to ObC WebRTC SDK in the CL chain.
# AudioDeviceBuffer
`ObjCAudioDeviceModule` does conform to heavy `AudioDeviceModule`
interface providing stubs for unrelated methods. It also implements
common low-level management of audio device buffer, which glues audio
PCM flow to/from WebRTC.
`ObjCAudioDeviceModule` owns single `webrtc::AudioDeviceBuffer` which
with the help of two `FineAudioBuffer` (one for recording and one for
playout) is exchanged audio PCMs with user-provided `RTCAudioDevice`
instance.
`webrtc::AudioDeviceBuffer` is configured to work with specific audio:
it has to know sample rate and channels count of audio being played and
recorded. These formats could be different between playout and
recording. `ObjCAudioDeviceModule` stores current audio parameters
applied to `webrtc::AudioDeviceBuffer` as fields of
type `webrtc::AudioParameters`. `RTCAudioDevice` has it's own variable
audio parameters like sample rate, channels count and IO buffer
duration. The audio parameters of `RTCAudioDevice` must be kept in sync
with audio parameters applied to `webrtc::AudioDeviceBuffer`, otherwise
audio playout and recording will be corrupted: audio is sent only
partially over the wire and/or audio is played with artifacts.
`ObjCAudioDeviceModule` reads current `RTCAudioDevice` audio parameters
when playout or recording is initialized. Whenever `RTCAudioDevice`
audio parameters parameters are changed, there must be a notification to
`ObjCAudioDeviceModule` to allow it to reconfigure
it's `webrtc::AudioDeviceBuffer`. The notification is performed
via `RTCAudioDeviceDelegate` object, which is provided
by `ObjCAudioDeviceModule` during initialization of `RTCAudioDevice`.
# Threading
`ObjCAudioDeviceModule` is stick to same thread between initialization
and termination. The only exception is two IO functions invoked by SDK
user code presumably from real-time audio IO thread.
Implementation of `RTCAudioDevice` may rely on the fact that all the
methods of `RTCAudioDevice` are called on the same thread between
initialization and termination. `ObjCAudioDeviceModule` is also expect
that the implementation of `RTCAudioDevice` will call methods related
to notification of audio parameters changes and audio interruption are
invoked on `ObjCAudioDeviceModule` thread. To facilitate this
requirement `RTCAudioDeviceDelegate` provides two functions to execute
sync and async block on `ObjCAudioDeviceModule` thread.
Async block could be useful when handling audio session notifications to
dispatch whole block re-configuring audio objects used
by `RTCAudioDevice` implementation.
Sync block could be used to make sure changes to audio parameters
of ADB owned by `ObjCAudioDeviceModule` are notified, before interrupted
playout/recording restarted.
Bug: webrtc:14193
Change-Id: I5587ec6bbee3cf02bad70dd59b822feb0ada7f86
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/269006
Reviewed-by: Henrik Andreasson <henrika@google.com>
Commit-Queue: Yury Yarashevich <yura.yaroshevich@gmail.com>
Reviewed-by: Peter Hanspers <peterhanspers@webrtc.org>
Reviewed-by: Henrik Andreassson <henrika@webrtc.org>
Reviewed-by: Tomas Gunnarsson <tommi@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#37928}
This reverts commit 83db78e854.
Reason for revert: Some tests in Chromium's blink no longer compile because of the change in the signature of the CreateDefaultTaskQueueFactory() function.
Original change's description:
> Add TaskQueueStdlib experiment.
>
> Bug: webrtc:14389
> Change-Id: I23c6e0ae675748ec35a99c334104dd2654995a33
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/265802
> Commit-Queue: Ali Tofigh <alito@webrtc.org>
> Reviewed-by: Harald Alvestrand <hta@webrtc.org>
> Reviewed-by: Tomas Gunnarsson <tommi@webrtc.org>
> Reviewed-by: Jonas Oreland <jonaso@webrtc.org>
> Cr-Commit-Position: refs/heads/main@{#37888}
Bug: webrtc:14389
Change-Id: If3e63d6b4ab9e838dc5020b88076a73fd29916e4
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/272920
Bot-Commit: rubber-stamper@appspot.gserviceaccount.com <rubber-stamper@appspot.gserviceaccount.com>
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Commit-Queue: Harald Alvestrand <hta@webrtc.org>
Auto-Submit: Ali Tofigh <alito@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#37902}
The default implementation of CropAndScale uses ToI420() and then Scale,
and this implementation behaves inefficiently with RTCCVPixelBuffer.
Bug: None
Change-Id: I422ef80d124db0354a2e696892e882a78db445bb
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/271140
Reviewed-by: Kári Helgason <kthelgason@webrtc.org>
Commit-Queue: Daniel.L (Byoungchan) Lee <daniel.l@hpcnt.com>
Auto-Submit: Daniel.L (Byoungchan) Lee <daniel.l@hpcnt.com>
Commit-Queue: Kári Helgason <kthelgason@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#37877}
These tests were failing on mac-11 machines but seem to do fine on mac-12.
Bug: webrtc:13989,webrtc:13991
Change-Id: I11fb2302046fbb06b0824a4adc543a446405991b
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/272363
Reviewed-by: Peter Hanspers <peterhanspers@webrtc.org>
Reviewed-by: Magnus Jedvert <magjed@webrtc.org>
Commit-Queue: Jeremy Leconte <jleconte@google.com>
Cr-Commit-Position: refs/heads/main@{#37843}
If the source image has a native handle and the encoder supports
the native handle, the encoder is expected to be able to correctly
sample/scale the source.
And VTCompressionSession can handle this, so DCHECK the frame
resolution only if the frame buffer is not native.
Bug: webrtc:14318
Change-Id: Id19c2f3bd86e9a2e1034d20e0255b4adc04a781f
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/270144
Reviewed-by: Kári Helgason <kthelgason@webrtc.org>
Commit-Queue: Kári Helgason <kthelgason@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#37730}
Most calls to C++ PeerConnection and related classes are proxied
to internal threads in WebRTC. However, there is no such thing
in the Obj-C SDK.
It would be nice to proxy methods in the Obj-C SDK as well.
RTCMediaStream and RTCVideoTrack have NSMutableArray members,
and it can throw NSRangeException when it has race conditions,
so that it would be a good starting point.
Also, remove some NSAsserts as its condition isn't a fatal error,
and it doesn't affect the production already.
Bug: None
Change-Id: I10b44a9c773d62a5c04c254986733a6b67d51617
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/262840
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Commit-Queue: Daniel.L (Byoungchan) Lee <daniel.l@hpcnt.com>
Reviewed-by: Kári Helgason <kthelgason@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#37283}
This reverts commit 8cd7b0a7ba.
The assumption in AndroidNetworkMonitor that an interface name
is unique has turned out to be incorrect :( for some (weird) devices,
i.e ccmni0.
It is unclear if it is a permanent setup or a transient state.
This cl/ changes the impl. to cope with that, the last
OnNetworkConnected_n "owns" the interface name, and when
OnNetworkDisconnected_n runs, we check if we're "owner"
and maybe set a new "owner" (if we're not "owner" we do nothing).
New testcases added.
I also
1) change NetworkMonitorInterface to return a struct
with all the information that is requested with interface name
as key.
2) Change Network.cc adding (debug) assertions that network
properties can't change inside a loop (in one thread).
Original change's description:
> Revert "Reset all maps in AndroidNetworkMonitor Start()/Stop()"
>
> This reverts commit 02293096f9.
>
> Reason for revert: mysterious crashes in android_network_monitor.cc
>
> Original change's description:
> > Reset all maps in AndroidNetworkMonitor Start()/Stop()
> >
> > This cl/ fixes another race condition with the recent additions
> > to NetworkMonitorAutoDetect (getAllNetworksFromCache).
> >
> > The getAllNetworksFromCache-feature uses the by the Android team
> > preferred way of enumerating networks, i.e to register network listeners.
> >
> > Th recent fix to add IsAdapterAvailable, https://webrtc-review.googlesource.com/c/src/+/257400
> > contained a bug in that the adapter_type_by_name_ map was not
> > reset either on disconnect or Start/Stop.
> >
> > This cl/ addresses that including unit test.
> > It also de-obfuscates NetworkMonitor so that it always
> > calls NotifyOfActiveNetworkList on startMonitoring even
> > if list.size() == 0. This should not matter but makes
> > code easier to understand.
> >
> > Bug: webrtc:13741
> > Change-Id: I438b877eebf769a8b2e7292b697ef1c0a349b24f
> > Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/258721
> > Reviewed-by: Harald Alvestrand <hta@webrtc.org>
> > Commit-Queue: Jonas Oreland <jonaso@webrtc.org>
> > Cr-Commit-Position: refs/heads/main@{#36530}
>
> Bug: webrtc:13741
> Change-Id: I36fbf63f658d3e8048e13959cbebfbd14df12b14
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/264146
> Reviewed-by: Tomas Gunnarsson <tommi@webrtc.org>
> Commit-Queue: Jonas Oreland <jonaso@webrtc.org>
> Cr-Commit-Position: refs/heads/main@{#37016}
Bug: webrtc:13741
Change-Id: Ib4eb072b775e493b564528f0be94c685b70ec20f
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/264421
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Commit-Queue: Jonas Oreland <jonaso@webrtc.org>
Reviewed-by: Tomas Gunnarsson <tommi@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#37056}
This reverts commit 181ea6e414.
Reason for revert: Breaks downstream project. Kári will help to land it next week.
Original change's description:
> Add a prefix for objc category.
>
> According to the Google Objective-C style [1], category names should
> start with an appropriate prefix. WebRTC has some category definitions
> for system interfaces, but it doesn't use prefixes.
>
> $ otool -ov WebRTC.framework/WebRTC | grep -E "^[0-9a-z]{16} 0x[0-9a-z]+ __OBJC_._CATEGORY" | grep -v "_RTC"
> 0000000002160840 0x217c3c0 __OBJC_$_CATEGORY_UIDevice_$_H264Profile
> 0000000002160850 0x21808b8 __OBJC_$_CATEGORY_AVCaptureSession_$_DevicePosition
> 0000000002160858 0x2180968 __OBJC_$_CATEGORY_NSString_$_StdString
> 0000000002160860 0x21809c8 __OBJC_$_CATEGORY_NSString_$_AbslStringView
>
> To avoid conflicts, prefix the names and methods of those categories.
> Also remove sdk/objc/Framework/Classes/Common/NSString+StdString.h as
> it is not used by any other files.
>
> [1] https://google.github.io/styleguide/objcguide.html#category-naming
>
> Bug: webrtc:13884
> Change-Id: I2cf2742af198ab4e0bfb15c0476d72971e50ceee
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/262341
> Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
> Reviewed-by: Kári Helgason <kthelgason@webrtc.org>
> Commit-Queue: Daniel.L (Byoungchan) Lee <daniel.l@hpcnt.com>
> Reviewed-by: Artem Titov <titovartem@webrtc.org>
> Cr-Commit-Position: refs/heads/main@{#36880}
Bug: webrtc:13884
Change-Id: I85257088e4a3a62e01ff925ab5e77af83b078ef3
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/262420
Bot-Commit: rubber-stamper@appspot.gserviceaccount.com <rubber-stamper@appspot.gserviceaccount.com>
Commit-Queue: Artem Titov <titovartem@webrtc.org>
Auto-Submit: Artem Titov <titovartem@webrtc.org>
Owners-Override: Artem Titov <titovartem@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#36885}