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}
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}
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}
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}
Fixing a race condition where session.sampleRate changes before AudioDeviceIOS::HandleValidRouteChange() finishes.
session.sampleRate is read into session_sample_rate at 576 and used at 623 to initialize the audio unit. However, in the call to SetupAudioBuffersForActiveAudioSession() the session.sampleRate is read again and may have changed, resulting in different sample rates used for the buffers and the audio unit. The consequence is a sample rate mismatch with either high pitched or low pitched audio.
The fix is to always use the buffer sample rate for the audio unit.
The DCHECK at 622 would save us in debug, but not in production, hence removed.
Change-Id: I562f1bf7f94d7447139ada2636b02ade7fcd6371
Bug: webrtc:14011
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/260329
Reviewed-by: Henrik Andreasson <henrika@google.com>
Commit-Queue: Peter Hanspers <peterhanspers@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#36708}
convert rtc_base/network and collateral.
This also remove last usage of system_wrappers/field_trials
in p2p/...Yay!
Bug: webrtc:10335
Change-Id: Ie8507b1f52bf7f3067e9b4bf8c81a825e4644fda
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/256640
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Commit-Queue: Jonas Oreland <jonaso@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#36357}
This is part of a large-scale effort to increase adoption of
absl::string_view across the WebRTC code base.
This CL converts the majority of "const std::string&"s in function
parameters under rtc_base/ to absl::string_view.
Bug: webrtc:13579
Change-Id: I2b1e3776aa42326aa405f76bb324a2d233b21dca
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/254081
Reviewed-by: Niels Moller <nisse@webrtc.org>
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Reviewed-by: Xavier Lepaul <xalep@webrtc.org>
Reviewed-by: Anders Lilienthal <andersc@webrtc.org>
Reviewed-by: Per Kjellander <perkj@webrtc.org>
Commit-Queue: Ali Tofigh <alito@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#36239}
Updates all webrtc code, to have a small followup cl to just add the
"explicit" keyword. Patchset #24 passed all webrtc tests, with explicit.
Bug: webrtc:13464
Change-Id: I39863d3752f73209b531120f66916dc9177bf63a
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/242363
Reviewed-by: Tomas Gunnarsson <tommi@webrtc.org>
Commit-Queue: Niels Moller <nisse@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#35718}
the new spelling is more standard and more compact, in particular doesn't need extra include and thus dependency
Bug: None
Change-Id: Iaea69d2154e4d9eff2468514f5734cb3fe016ff8
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/245080
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Commit-Queue: Danil Chapovalov <danilchap@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#35709}
Add implementation of RTC_DCHECK_NOTREACHED equal to the RTC_NOTREACHED.
The new macros will replace the old one when old one's usage will be
removed. The idea of the renaming to provide a clear signal that this
is debug build only macros and will be stripped in the production build.
Bug: webrtc:9065
Change-Id: I4c35d8b03e74a4b3fd1ae75dba2f9c05643101db
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/237802
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Commit-Queue: Artem Titov <titovartem@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#35348}
With this change, we catch audio unit start errors and pipe them to the
audio session. The audio session notifies its delegate, which can then
take appropriate action based on the error code.
The signal follows the same path as the playout glitch detection.
Bug: webrtc:13119
Change-Id: I8c9f9d2a1e3457447d0ce61ad197f7e1c6392837
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/230240
Commit-Queue: Peter Hanspers <peterhanspers@webrtc.org>
Reviewed-by: Henrik Andreassson <henrika@webrtc.org>
Reviewed-by: Xavier Lepaul <xalep@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#34862}
The simulcast_encoder_adapter expects codecs that specify
supports_native_handle to perform resampling/scaling (through
GetEncoderInfo).
This change adds a method to the RTCVideoEncoder to let objc encoders
specify this rather than relying on the default.
Bug: webrtc:13044
Change-Id: I2efcbd42aa4f2048285f451c7b691fdeca111e62
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/227641
Reviewed-by: Kári Helgason <kthelgason@webrtc.org>
Commit-Queue: Peter Hanspers <peterhanspers@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#34683}
With this change, RTCVideoEncoder can specify:
- requested_resolution_alignment,
- apply_alignment_to_all_simulcast_layers
in the same way scaling_settings is specified.
Change-Id: I3de79a2eabaae581d6a9f2ef3e39496b9545a4f5
Bug: webrtc:12829
Change-Id: I3de79a2eabaae581d6a9f2ef3e39496b9545a4f5
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/220933
Reviewed-by: Kári Helgason <kthelgason@webrtc.org>
Reviewed-by: Åsa Persson <asapersson@webrtc.org>
Reviewed-by: Abby Yeh <abbyyeh@webrtc.org>
Commit-Queue: Peter Hanspers <peterhanspers@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#34196}
Removes use of AsyncInvoker, replaced with PendingTaskSafetyFlag. The
latter is extended to support creation on a different thread than
where it will be used, and to support stop and restart.
Bug: webrtc:12339
Change-Id: I28b6e09b1542f50037e842ef5fe3a47d15704b46
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/211002
Commit-Queue: Niels Moller <nisse@webrtc.org>
Reviewed-by: Tommi <tommi@webrtc.org>
Reviewed-by: Kári Helgason <kthelgason@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#33432}