Commit graph

13 commits

Author SHA1 Message Date
Tommi
c848268ab1 Use SequenceChecker(SequenceChecker::kDetached) in a few places.
This CL is partly a test to see if there's an impact on binary size:
- Not a big difference for binaries (decrease): -776b to -4Kb
- For libraries (libwebrtc.a) it actually increases the size: +40Kb

Secondarily this CL is basically to introduce this pattern to the
code base. In terms of LOC, this makes things slightly more compact.

From:

  class Foo {
   public:
     Foo() {
       checker_.Detach();
     }
   private:
    SequenceChecker checker_;
  };

To:

  class Foo {
   public:
     Foo() = default;
   private:
    SequenceChecker checker_{SequenceChecker::kDetached};
  };

Bug: none
Change-Id: I59fc34ccea10847e13455a349851ce9a0af458e3
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/299020
Commit-Queue: Tomas Gunnarsson <tommi@webrtc.org>
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#39664}
2023-03-24 07:44:18 +00:00
Tommi
20d8d9150c Reland "Remove stopped_ from AudioRtpReceiver and VideoRtpReceiver."
This is a reland of 3ed36c0521

Original change's description:
> Reland "Remove `stopped_` from AudioRtpReceiver and VideoRtpReceiver."
>
> This is a reland of bb57e2d7aa
>
> The difference from the original CL is that a check for
> `state_ == kLive` inside of RemoteAudioSource::AddSink has been removed.
> This caused a side effect that registering the sink while the source
> was in an "initializing" state, failed. The last remaining state
> however, is `kEnded` - but since there's no logic in the class around
> the expected value of the states, the check inside of AddSink()
> doesn't provide an additional value - it's rather a surprise for
> developers if it doesn't succeed. So, now removed.
>
> Original change's description:
> > Remove `stopped_` from AudioRtpReceiver and VideoRtpReceiver.
> >
> > This simplifies the logic in these classes a bit, which makes upcoming
> > change easier. The `stopped_` flag in these classes was essentially
> > the same thing as `media_channel_ == nullptr`, which is what's
> > consistently used now for the same checks.
> >
> > Bug: webrtc:13540
> > Change-Id: Ib60bfad9f28d5ddee8a8d5170c3f2a7ef017a5ca
> > Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/250163
> > Reviewed-by: Harald Alvestrand <hta@webrtc.org>
> > Commit-Queue: Tomas Gunnarsson <tommi@webrtc.org>
> > Cr-Commit-Position: refs/heads/main@{#35907}
>
> Bug: webrtc:13540
> Change-Id: I3e5b3046fae11cb56b50c38c5f08972a6f283dd5
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/251326
> Auto-Submit: Tomas Gunnarsson <tommi@webrtc.org>
> Commit-Queue: Tomas Gunnarsson <tommi@webrtc.org>
> Reviewed-by: Harald Alvestrand <hta@webrtc.org>
> Commit-Queue: Harald Alvestrand <hta@webrtc.org>
> Cr-Commit-Position: refs/heads/main@{#35958}

Bug: webrtc:13540
Change-Id: I6d7d67fddb1ddfc69a302f0f69a9b815f2fd82f7
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/251386
Reviewed-by: Tomas Gunnarsson <tommi@webrtc.org>
Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#35967}
2022-02-09 16:54:06 +00:00
Mirko Bonadei
2da85916ab Revert "Reland "Remove stopped_ from AudioRtpReceiver and VideoRtpReceiver.""
This reverts commit 3ed36c0521.

Reason for revert: Breaks downstream project.

Original change's description:
> Reland "Remove `stopped_` from AudioRtpReceiver and VideoRtpReceiver."
>
> This is a reland of bb57e2d7aa
>
> The difference from the original CL is that a check for
> `state_ == kLive` inside of RemoteAudioSource::AddSink has been removed.
> This caused a side effect that registering the sink while the source
> was in an "initializing" state, failed. The last remaining state
> however, is `kEnded` - but since there's no logic in the class around
> the expected value of the states, the check inside of AddSink()
> doesn't provide an additional value - it's rather a surprise for
> developers if it doesn't succeed. So, now removed.
>
> Original change's description:
> > Remove `stopped_` from AudioRtpReceiver and VideoRtpReceiver.
> >
> > This simplifies the logic in these classes a bit, which makes upcoming
> > change easier. The `stopped_` flag in these classes was essentially
> > the same thing as `media_channel_ == nullptr`, which is what's
> > consistently used now for the same checks.
> >
> > Bug: webrtc:13540
> > Change-Id: Ib60bfad9f28d5ddee8a8d5170c3f2a7ef017a5ca
> > Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/250163
> > Reviewed-by: Harald Alvestrand <hta@webrtc.org>
> > Commit-Queue: Tomas Gunnarsson <tommi@webrtc.org>
> > Cr-Commit-Position: refs/heads/main@{#35907}
>
> Bug: webrtc:13540
> Change-Id: I3e5b3046fae11cb56b50c38c5f08972a6f283dd5
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/251326
> Auto-Submit: Tomas Gunnarsson <tommi@webrtc.org>
> Commit-Queue: Tomas Gunnarsson <tommi@webrtc.org>
> Reviewed-by: Harald Alvestrand <hta@webrtc.org>
> Commit-Queue: Harald Alvestrand <hta@webrtc.org>
> Cr-Commit-Position: refs/heads/main@{#35958}

TBR=ilnik@webrtc.org,tommi@webrtc.org,hta@webrtc.org,webrtc-scoped@luci-project-accounts.iam.gserviceaccount.com

Change-Id: Ieb7235d88c808c78ad0847403be991d4dce1ace6
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: webrtc:13540
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/251383
Owners-Override: Mirko Bonadei <mbonadei@webrtc.org>
Bot-Commit: rubber-stamper@appspot.gserviceaccount.com <rubber-stamper@appspot.gserviceaccount.com>
Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#35963}
2022-02-09 10:55:25 +00:00
Tommi
3ed36c0521 Reland "Remove stopped_ from AudioRtpReceiver and VideoRtpReceiver."
This is a reland of bb57e2d7aa

The difference from the original CL is that a check for
`state_ == kLive` inside of RemoteAudioSource::AddSink has been removed.
This caused a side effect that registering the sink while the source
was in an "initializing" state, failed. The last remaining state
however, is `kEnded` - but since there's no logic in the class around
the expected value of the states, the check inside of AddSink()
doesn't provide an additional value - it's rather a surprise for
developers if it doesn't succeed. So, now removed.

Original change's description:
> Remove `stopped_` from AudioRtpReceiver and VideoRtpReceiver.
>
> This simplifies the logic in these classes a bit, which makes upcoming
> change easier. The `stopped_` flag in these classes was essentially
> the same thing as `media_channel_ == nullptr`, which is what's
> consistently used now for the same checks.
>
> Bug: webrtc:13540
> Change-Id: Ib60bfad9f28d5ddee8a8d5170c3f2a7ef017a5ca
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/250163
> Reviewed-by: Harald Alvestrand <hta@webrtc.org>
> Commit-Queue: Tomas Gunnarsson <tommi@webrtc.org>
> Cr-Commit-Position: refs/heads/main@{#35907}

Bug: webrtc:13540
Change-Id: I3e5b3046fae11cb56b50c38c5f08972a6f283dd5
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/251326
Auto-Submit: Tomas Gunnarsson <tommi@webrtc.org>
Commit-Queue: Tomas Gunnarsson <tommi@webrtc.org>
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Commit-Queue: Harald Alvestrand <hta@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#35958}
2022-02-08 21:41:14 +00:00
Tomas Gunnarsson
30d753a3f7 Revert "Remove stopped_ from AudioRtpReceiver and VideoRtpReceiver."
This reverts commit bb57e2d7aa.

Reason for revert: Speculative revert to see if this is causing
breakage in Chromium

Bug: chromium:13665

Original change's description:
> Remove `stopped_` from AudioRtpReceiver and VideoRtpReceiver.
>
> This simplifies the logic in these classes a bit, which makes upcoming
> change easier. The `stopped_` flag in these classes was essentially
> the same thing as `media_channel_ == nullptr`, which is what's
> consistently used now for the same checks.
>
> Bug: webrtc:13540
> Change-Id: Ib60bfad9f28d5ddee8a8d5170c3f2a7ef017a5ca
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/250163
> Reviewed-by: Harald Alvestrand <hta@webrtc.org>
> Commit-Queue: Tomas Gunnarsson <tommi@webrtc.org>
> Cr-Commit-Position: refs/heads/main@{#35907}

# Not skipping CQ checks because original CL landed > 1 day ago.

Bug: webrtc:13540
Change-Id: I67fb2c26b6931b80e3aab749443122d62a82855d
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/251141
Reviewed-by: Tomas Gunnarsson <tommi@webrtc.org>
Auto-Submit: Tomas Gunnarsson <tommi@webrtc.org>
Reviewed-by: Ilya Nikolaevskiy <ilnik@webrtc.org>
Commit-Queue: Ilya Nikolaevskiy <ilnik@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#35938}
2022-02-07 21:00:53 +00:00
Tommi
bb57e2d7aa Remove stopped_ from AudioRtpReceiver and VideoRtpReceiver.
This simplifies the logic in these classes a bit, which makes upcoming
change easier. The `stopped_` flag in these classes was essentially
the same thing as `media_channel_ == nullptr`, which is what's
consistently used now for the same checks.

Bug: webrtc:13540
Change-Id: Ib60bfad9f28d5ddee8a8d5170c3f2a7ef017a5ca
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/250163
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Commit-Queue: Tomas Gunnarsson <tommi@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#35907}
2022-02-04 14:00:42 +00:00
Tommi
816134a8aa Reland "Fix race between enabled() and set_enabled() in VideoTrack."
This reverts commit 096ad02c02.

Reason for revert: Including a fix for the test issue.

Original change's description:
> Revert "Fix race between enabled() and set_enabled() in VideoTrack."
>
> This reverts commit 5ffefe9d2d.
>
> Reason for revert: Breaks Chromium Android browser tests on fyi bots.
>
> Original change's description:
> > Fix race between enabled() and set_enabled() in VideoTrack.
> >
> > Along the way I introduced VideoSourceBaseGuarded, which is equivalent
> > to VideoSourceBase except that it applies thread checks. I found that
> > it's easy to use VideoSourceBase incorrectly and in fact there appear
> > to be tests that do this.
> >
> > I made the source object const in VideoTrack, as it already was in
> > AudioTrack, and that allowed for making the GetSource() accessors
> > bypass the proxy thread hop and give the caller direct access.
> >
> > Bug: webrtc:12773, b/188139639, webrtc:12780
> > Change-Id: I022175c4239a1306ef54059c131d81411d5124fe
> > Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/219160
> > Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
> > Reviewed-by: Andrey Logvin <landrey@webrtc.org>
> > Commit-Queue: Tommi <tommi@webrtc.org>
> > Cr-Commit-Position: refs/heads/master@{#34096}
>
> TBR=mbonadei@webrtc.org,tommi@webrtc.org,landrey@webrtc.org,webrtc-scoped@luci-project-accounts.iam.gserviceaccount.com
>
> Change-Id: I16323d459c76eb6a87cc602a0048f6ee01c81626
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Bug: webrtc:12773
> Bug: b/188139639
> Bug: webrtc:12780
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/219637
> Reviewed-by: Evan Shrubsole <eshr@google.com>
> Commit-Queue: Evan Shrubsole <eshr@google.com>
> Cr-Commit-Position: refs/heads/master@{#34101}

# Not skipping CQ checks because this is a reland.

Bug: webrtc:12773
Bug: b/188139639
Bug: webrtc:12780
Change-Id: Ib35fe15a6c43de8f286d60aff02b19df1ab76925
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/219639
Reviewed-by: Tommi <tommi@webrtc.org>
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Reviewed-by: Andrey Logvin <landrey@webrtc.org>
Reviewed-by: Evan Shrubsole <eshr@google.com>
Commit-Queue: Tommi <tommi@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#34104}
2021-05-24 16:17:35 +00:00
Evan Shrubsole
096ad02c02 Revert "Fix race between enabled() and set_enabled() in VideoTrack."
This reverts commit 5ffefe9d2d.

Reason for revert: Breaks Chromium Android browser tests on fyi bots.

Original change's description:
> Fix race between enabled() and set_enabled() in VideoTrack.
>
> Along the way I introduced VideoSourceBaseGuarded, which is equivalent
> to VideoSourceBase except that it applies thread checks. I found that
> it's easy to use VideoSourceBase incorrectly and in fact there appear
> to be tests that do this.
>
> I made the source object const in VideoTrack, as it already was in
> AudioTrack, and that allowed for making the GetSource() accessors
> bypass the proxy thread hop and give the caller direct access.
>
> Bug: webrtc:12773, b/188139639, webrtc:12780
> Change-Id: I022175c4239a1306ef54059c131d81411d5124fe
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/219160
> Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
> Reviewed-by: Andrey Logvin <landrey@webrtc.org>
> Commit-Queue: Tommi <tommi@webrtc.org>
> Cr-Commit-Position: refs/heads/master@{#34096}

TBR=mbonadei@webrtc.org,tommi@webrtc.org,landrey@webrtc.org,webrtc-scoped@luci-project-accounts.iam.gserviceaccount.com

Change-Id: I16323d459c76eb6a87cc602a0048f6ee01c81626
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: webrtc:12773
Bug: b/188139639
Bug: webrtc:12780
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/219637
Reviewed-by: Evan Shrubsole <eshr@google.com>
Commit-Queue: Evan Shrubsole <eshr@google.com>
Cr-Commit-Position: refs/heads/master@{#34101}
2021-05-24 14:06:19 +00:00
Tommi
5ffefe9d2d Fix race between enabled() and set_enabled() in VideoTrack.
Along the way I introduced VideoSourceBaseGuarded, which is equivalent
to VideoSourceBase except that it applies thread checks. I found that
it's easy to use VideoSourceBase incorrectly and in fact there appear
to be tests that do this.

I made the source object const in VideoTrack, as it already was in
AudioTrack, and that allowed for making the GetSource() accessors
bypass the proxy thread hop and give the caller direct access.

Bug: webrtc:12773, b/188139639, webrtc:12780
Change-Id: I022175c4239a1306ef54059c131d81411d5124fe
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/219160
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Reviewed-by: Andrey Logvin <landrey@webrtc.org>
Commit-Queue: Tommi <tommi@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#34096}
2021-05-24 09:13:56 +00:00
Jonas Olsson
a4d873786f Format almost everything.
This CL was generated by running

git ls-files | grep -P "(\.h|\.cc)$" | grep -v 'sdk/' | grep -v 'rtc_base/ssl_' | \
grep -v 'fake_rtc_certificate_generator.h' | grep -v 'modules/audio_device/win/' | \
grep -v 'system_wrappers/source/clock.cc' | grep -v 'rtc_base/trace_event.h' | \
grep -v 'modules/audio_coding/codecs/ilbc/' | grep -v 'screen_capturer_mac.h' | \
grep -v 'spl_inl_mips.h' | grep -v 'data_size_unittest.cc' | grep -v 'timestamp_unittest.cc' \
| xargs clang-format -i ; git cl format

Most of these changes are clang-format grouping and reordering includes
differently.

Bug: webrtc:9340
Change-Id: Ic83ddbc169bfacd21883e381b5181c3dd4fe8a63
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/144051
Commit-Queue: Jonas Olsson <jonasolsson@webrtc.org>
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#28505}
2019-07-08 13:45:15 +00:00
Sebastian Jansson
c01367db40 Deprecating ThreadChecker specific interface.
All changes outside thread_checker.h are by:
s/CalledOnValidThread/IsCurrent/
s/DetachFromThread/Detach/

Bug: webrtc:9883
Change-Id: Idbb1086bff0817db58e770116acf4c9d60fae8b3
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/131023
Commit-Queue: Sebastian Jansson <srte@webrtc.org>
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#27494}
2019-04-08 16:58:07 +00:00
Steve Anton
10542f21c8 (4) Rename files to snake_case: update BUILD.gn, include paths, header guards, and DEPS entries
Mechanically generated by running this command:

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

Then manually updating:

tools_webrtc/sanitizers/tsan_suppressions_webrtc.cc

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

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

Bug: webrtc:10159
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Change-Id: I8b05b6eab9b9d18b29c2199bbea239e9add1e690
Reviewed-on: https://webrtc-review.googlesource.com/c/115481
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#26225}
2019-01-11 17:05:20 +00:00
Renamed from pc/videotracksource.cc (Browse further)