Commit graph

6 commits

Author SHA1 Message Date
Markus Handell
aee5b17f66 DecodeSynchronizer: avoid duplicate tick callback registration.
With repeated CreateSynchronizedFrameScheduler/Stop calls, the
DecodeSynchronizer can register & keep multiple callbacks in
the metronome. Fix this to only keep at most one callback
installed.

Fixed: chromium:1434747
Change-Id: I61f67a871339dbcc7560e9d545a5217f361a9b87
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/303840
Reviewed-by: Ilya Nikolaevskiy <ilnik@webrtc.org>
Reviewed-by: Henrik Boström <hbos@webrtc.org>
Commit-Queue: Markus Handell <handellm@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#39964}
2023-04-28 10:50:57 +00:00
Markus Handell
527701a8f2 Increase tracing fidelity for investigation.
This CL adds tracing for investigating issues reported by
Intel when testing out VSyncDecoding.

Bug: chromium:1434747
Change-Id: If2f62fa4ac9fd2fba4e34daabcb5933a4cc395cb
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/301982
Reviewed-by: Ilya Nikolaevskiy <ilnik@webrtc.org>
Auto-Submit: Markus Handell <handellm@webrtc.org>
Commit-Queue: Ilya Nikolaevskiy <ilnik@webrtc.org>
Commit-Queue: Markus Handell <handellm@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#39904}
2023-04-20 09:42:10 +00:00
Evan Shrubsole
57fe5cd7db Allow SynchronizedFrameDecodeScheduler::Stop to be run multiple times
Stop being called twice can happen in tests since the VideoReceiveStream
destructor calls Stop so any test calling Stop may invoke it twice. This
is a general problem that all things that the VideoReceiveStream have to
able to be stopped multiple times.

Bug: b/270932185
Change-Id: Ic25810d5ab73e8a07cf3b16685c578f4c0aa7fbd
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/295580
Auto-Submit: Evan Shrubsole <eshr@webrtc.org>
Reviewed-by: Erik Språng <sprang@webrtc.org>
Commit-Queue: Evan Shrubsole <eshr@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#39452}
2023-03-02 13:10:37 +00:00
Markus Handell
be400e465b Metronome: disable & refactor for single-threaded operation.
The Chromium implementation unfortunately has a rare deadlock.
Rather than patching that up, we're changing the metronome
implementation to be able to use a single-threaded environment
instead.

The metronome functionality is disabled in VideoReceiveStream2
construction inside call.cc.

The new design does not have listener registration or
deresigstration and instead accepts and invokes callbacks, on
the same sequence that requested the callback. This allows
the clients to use features such as WeakPtrFactories or
ScopedThreadSafety for cancellation.

The CL will be followed up with cleanup CLs that removes
registration APIs once downstream consumers have adapted.

Bug: chromium:1381982
Change-Id: I43732d1971e2276c39b431a04365cd2fc3c55c25
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/282280
Reviewed-by: Per Kjellander <perkj@webrtc.org>
Reviewed-by: Erik Språng <sprang@webrtc.org>
Reviewed-by: Evan Shrubsole <eshr@webrtc.org>
Commit-Queue: Markus Handell <handellm@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#38582}
2022-11-08 12:23:40 +00:00
Evan Shrubsole
c5a91449d6 Clean up FrameDecodeScheduler
* Migrate callback to one-time absl::AnyInvocable.
* Clean tests to use MockFunction.
* Use main thread instead of helper function in unittests.
* Fix some spelling mistakes.

Bug: None
Change-Id: I6145f5f5e2748dfa5278898cfdfd762c1840ff8d
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/274170
Reviewed-by: Ilya Nikolaevskiy <ilnik@webrtc.org>
Commit-Queue: Evan Shrubsole <eshr@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#38016}
2022-09-06 08:24:48 +00:00
Evan Shrubsole
6cd6d8ecfd Introduce Sync-Decoding based on Metronome
Adds new class DecodeSynchronizer that will coalesce the decoding
of received streams on the metronome. This feature is experimental and
is backed by a field trial WebRTC-FrameBuffer3.

This experiment now has 3 arms to it,

"WebRTC-FrameBuffer3/arm:FrameBuffer2/": Default, uses old frame buffer.
"WebRTC-FrameBuffer3/arm:FrameBuffer3/": Uses new frame buffer.
"WebRTC-FrameBuffer3/arm:SyncDecoding/": Uses new frame buffer with
frame scheduled on the metronome.

The SyncDecoding arm will not work until it is wired up in the follow-up
CL.

This change also makes the following modifications,
* Adds FakeMetronome utilities for tests using a metronome.
* Makes FrameDecodeScheduler an interface. The default implementation is
TaskQueueFrameDecodeScheduler.
* FrameDecodeScheduler now has a Stop() method, which must be called
before destruction.


TBR=philipel@webrtc.org

Change-Id: I58a306bb883604b0be3eb2a04b3d07dbdf185c71
Bug: webrtc:13658
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/250665
Reviewed-by: Henrik Boström <hbos@webrtc.org>
Reviewed-by: Ilya Nikolaevskiy <ilnik@webrtc.org>
Reviewed-by: Stefan Holmer <holmer@google.com>
Reviewed-by: Stefan Holmer <stefan@webrtc.org>
Commit-Queue: Evan Shrubsole <eshr@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#35988}
2022-02-14 11:14:00 +00:00