As documented in webrtc:11908 this cleanup is fairly invasive and
when a part of a frequently executed code path, can be quite costly
in terms of performance overhead. This is currently the case with
synchronous calls between threads (Thread) as well with our proxy
api classes.
With this CL, all code in WebRTC should now either be using MessageHandlerAutoCleanup
or calling MessageHandler(false) explicitly.
Next steps will be to update external code to either depend on the
AutoCleanup variant, or call MessageHandler(false).
Changing the proxy classes to use TaskQueue set of concepts instead of
MessageHandler. This avoids the perf overhead related to the cleanup
above as well as incompatibility with the thread policy checks in
Thread that some current external users of the proxies would otherwise
run into (if we were to use Thread::Send() for synchronous call).
Following this we'll move the cleanup step into the AutoCleanup class
and an RTC_DCHECK that all calls to the MessageHandler are setting
the flag to false, before eventually removing the flag and make
MessageHandler pure virtual.
Bug: webrtc:11908
Change-Id: Idf4ff9bcc8438cb8c583777e282005e0bc511c8f
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/183442
Reviewed-by: Artem Titov <titovartem@webrtc.org>
Commit-Queue: Tommi <tommi@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#32049}
This reverts commit 0e96535be9.
Reason for revert: Downstream test failure
Original change's description:
> Inlines NullAudioPoller functionality into AudioState class.
>
> As part of this, we also use TaskQueue and RepeatedTask rather
> than rtc::Thread + rtc::MessageHandler. With the ultimate goal of
> deprecating rtc::Thread.
>
> Bug: webrtc:9883
> Change-Id: I2fb851ac31ee2431435d51de78ff446572512201
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/167528
> Commit-Queue: Sebastian Jansson <srte@webrtc.org>
> Reviewed-by: Sam Zackrisson <saza@webrtc.org>
> Cr-Commit-Position: refs/heads/master@{#30430}
TBR=saza@webrtc.org,srte@webrtc.org
Change-Id: I4c77259f7b6477fc1cb79350f2d47817f106770d
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: webrtc:9883
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/168046
Reviewed-by: Sebastian Jansson <srte@webrtc.org>
Commit-Queue: Sebastian Jansson <srte@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#30431}
As part of this, we also use TaskQueue and RepeatedTask rather
than rtc::Thread + rtc::MessageHandler. With the ultimate goal of
deprecating rtc::Thread.
Bug: webrtc:9883
Change-Id: I2fb851ac31ee2431435d51de78ff446572512201
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/167528
Commit-Queue: Sebastian Jansson <srte@webrtc.org>
Reviewed-by: Sam Zackrisson <saza@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#30430}
This CL is the result of running include-what-you-use tool on part
of the code base (audio target and dependencies) plus manual fixes.
bug: webrtc:8311
Change-Id: I277d281ce943c3ecc1bd45fd8d83055931743604
Reviewed-on: https://webrtc-review.googlesource.com/c/106280
Commit-Queue: Yves Gerey <yvesg@google.com>
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Reviewed-by: Patrik Höglund <phoglund@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#25311}
Second attempt to land https://webrtc-review.googlesource.com/c/src/+/16180
Now removes voice_engine dependency from peerconnection and fixes a minor
const issue in NullAudioPoller.
TBR=solenberg
Bug: webrtc:7313
Change-Id: Ibfddbdc76118581e4a4dc64575203f84c1659e5c
Reviewed-on: https://webrtc-review.googlesource.com/17784
Reviewed-by: Henrik Andreassson <henrika@webrtc.org>
Commit-Queue: Henrik Andreassson <henrika@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#20526}
This reverts commit 90bace0958.
Reason for revert: The original problem of this CL has been fixed in https://webrtc-review.googlesource.com/17540 but sounds like it is also adding voice_engine as a dependency of pc:peerconnection. We should investigate this because probably we can avoid it.
Original change's description:
> Add SetAudioPlayout and SetAudioRecording methods to the PeerConnection API
>
> (this CL is based on the work by Taylor and Steve in https://webrtc-review.googlesource.com/c/src/+/10201)
>
> This SetAudioPlayout method lets applications disable audio playout while
> still processing incoming audio data and generating statistics on the
> received audio.
>
> This may be useful if the application wants to set up media flows as
> soon as possible, but isn't ready to play audio yet. Currently, native
> applications don't have any API point to control this, unless they
> completely implement their own AudioDeviceModule.
>
> The SetAudioRecording works in a similar fashion but for the recorded
> audio. One difference is that calling SetAudioRecording(false) does not
> keep any audio processing alive.
>
> TBR=solenberg
>
> Bug: webrtc:7313
> Change-Id: I0aa075f6bfef9818f1080f85a8ff7842fb0750aa
> Reviewed-on: https://webrtc-review.googlesource.com/16180
> Reviewed-by: Henrik Andreassson <henrika@webrtc.org>
> Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
> Commit-Queue: Henrik Andreassson <henrika@webrtc.org>
> Cr-Commit-Position: refs/heads/master@{#20499}
TBR=solenberg@webrtc.org,henrika@webrtc.org,kwiberg@webrtc.org
Change-Id: I8431227e21dbffcfed3dd0e6bd7ce26c4ce09394
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: webrtc:7313
Reviewed-on: https://webrtc-review.googlesource.com/17701
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#20512}
(this CL is based on the work by Taylor and Steve in https://webrtc-review.googlesource.com/c/src/+/10201)
This SetAudioPlayout method lets applications disable audio playout while
still processing incoming audio data and generating statistics on the
received audio.
This may be useful if the application wants to set up media flows as
soon as possible, but isn't ready to play audio yet. Currently, native
applications don't have any API point to control this, unless they
completely implement their own AudioDeviceModule.
The SetAudioRecording works in a similar fashion but for the recorded
audio. One difference is that calling SetAudioRecording(false) does not
keep any audio processing alive.
TBR=solenberg
Bug: webrtc:7313
Change-Id: I0aa075f6bfef9818f1080f85a8ff7842fb0750aa
Reviewed-on: https://webrtc-review.googlesource.com/16180
Reviewed-by: Henrik Andreassson <henrika@webrtc.org>
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Commit-Queue: Henrik Andreassson <henrika@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#20499}