Commit graph

15 commits

Author SHA1 Message Date
Danil Chapovalov
95eeaa7aca Migrate video/ to absl::AnyInvocable based TaskQueueBase interface
Bug: webrtc:14245
Change-Id: Ibd98d3a0c548443578953ef3e25aee9919eea3d3
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/267980
Commit-Queue: Danil Chapovalov <danilchap@webrtc.org>
Reviewed-by: Erik Språng <sprang@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#37465}
2022-07-06 14:40:25 +00:00
Johannes Kron
da843fee1a Remove WebRTC.Video.DecodeTimePerFrameInMs. histograms
The decode time per frame and codec profile histograms were added
temporarily to make it possible to get an overview of the decode
time distributions. This fine grained information is not needed
longer and the histograms can be deleted.

Bug: chromium:1007526
Change-Id: Ie59627a88813e0710700cf0e13eedd6627010266
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/266496
Reviewed-by: Ilya Nikolaevskiy <ilnik@webrtc.org>
Commit-Queue: Johannes Kron <kron@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#37316}
2022-06-23 13:01:42 +00:00
Philipp Hancke
d970b0901b measure decode time in TimeDelta instead of ms
increasing precision since summing up rounded values leads to
a rounding error, in particular for small frames which take very
little time to decode.

BUG=webrtc:12526,webrtc:13756

Change-Id: I647c702808856a002c746ed9f115aa9bcaddc1f3
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/262810
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Reviewed-by: Danil Chapovalov <danilchap@webrtc.org>
Commit-Queue: Philipp Hancke <philipp.hancke@googlemail.com>
Cr-Commit-Position: refs/heads/main@{#37249}
2022-06-17 09:57:27 +00:00
Artem Titov
c374d11fac Move to_queued_task.h and pending_task_safety_flag.h into public API
Bug: b/235812579
Change-Id: I9fa3dc4a65044df8b44fff4e9bfeac7233fa381c
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/266080
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Commit-Queue: Artem Titov <titovartem@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#37248}
2022-06-17 09:20:39 +00:00
Tommi
f6f4543304 Rename VideoReceiveStream to VideoReceiveStreamInterface
Bug: webrtc:7484
Change-Id: I653cfe46486e0396897dd333069a894d67e3c07b
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/262769
Commit-Queue: Tomas Gunnarsson <tommi@webrtc.org>
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#36958}
2022-05-22 10:54:38 +00:00
Philipp Hancke
0359ba2225 stats: add frame assembly time stats
implements a total frame assembly time statistic that measures the
cumulative time between the arrival of the first packet of a frame
(the lowest reception time) and the time all packets of the frame have
been received (i.e. the highest reception time)

This is similar to totalProcessingDelay
  https://w3c.github.io/webrtc-stats/#dom-rtcinboundrtpstreamstats-totalprocessingdelay
in particular with respect to only being incremented for frames that are being decoded but does not include the amount of time spent decoding the frame.

This statistic is useful for evaluating mechanisms like NACK and FEC
and gives some insight into the behavior of the pacer sending the
packets.
Note that for frames with just a single packet the assembly time will be zero. In order to calculate an average assembly time an additional frames_assembled_from_multiple_packets counter for frames with more than a single packet is added.

Currently this is a nonstandard stat so will only show up in webrtc-internals and not in getStats. Formally it can be defined as

totalAssemblyTime of type double
	Only exists for video. 	The sum of the time, in seconds, each video frame takes from the time the first RTP packet is received (reception timestamp) and to the time the last RTP packet of a frame is received.
    Given the complexities involved, the time of arrival or the reception timestamp is measured as close to the network layer as possible.

    This metric is not incremented for frames that are not decoded, i.e., framesDropped, partialFramesLost or frames that fail decoding for other reasons (if any). Only incremented for frames consisting of more than one RTP packet. The average frame assembly time can be calculated by dividing the totalAssemblyTime with framesAssembledFromMultiplePacket.

framesAssembledFromMultiplePacket of type unsigned long
	Only exists for video. It represents the total number of frames correctly decoded for this RTP stream that consist of more than one RTP packet.
	For such frames the totalAssemblyTime is incremented.

BUG=webrtc:13986

Change-Id: Ie0ae431d72a57a0001c3240daba8eda35955f04e
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/260920
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Reviewed-by: Henrik Boström <hbos@webrtc.org>
Commit-Queue: Harald Alvestrand <hta@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#36922}
2022-05-18 09:16:10 +00:00
Philipp Hancke
a16a6a6341 stats: implement inbound-rtp totalProcessingDelay for video
https://w3c.github.io/webrtc-stats/#dom-rtcinboundrtpstreamstats-totalprocessingdelay

BUG=webrtc:13984

Change-Id: Ifd821bd8553add46218f09a11366096d62f5d09f
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/259768
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Commit-Queue: Henrik Boström <hbos@webrtc.org>
Reviewed-by: Henrik Boström <hbos@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#36732}
2022-05-02 10:56:22 +00:00
Jonas Oreland
8ca06137dc WebRTC-DeprecateGlobalFieldTrialString/Enabled/ - part 4/inf
convert almost all of video/ (and the collateral)

Bug: webrtc:10335
Change-Id: Ic94e05937f54d11ee8a635b6b66fd146962d9f11
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/254601
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Commit-Queue: Jonas Oreland <jonaso@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#36192}
2022-03-14 14:36:35 +00:00
Tommi
b2db9890c5 ReceiveStatisticsProxy: Remove dependency on VideoReceiveStream::Config.
The config struct is big and in order to control access to its state,
some of which isn't always const, we need to limit raw unlocked access
to it from other classes.

Bug: none
Change-Id: I4513c41486e79ef6c5cfd6376122ab338ad94642
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/229921
Reviewed-by: Niels Moller <nisse@webrtc.org>
Commit-Queue: Tommi <tommi@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#34835}
2021-08-24 07:11:21 +00:00
Artem Titov
ab30d72b72 Use backticks not vertical bars to denote variables in comments for /video
Bug: webrtc:12338
Change-Id: I47958800407482894ff6f17c1887dce907fdf35a
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/227030
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Commit-Queue: Artem Titov <titovartem@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#34585}
2021-07-28 13:22:27 +00:00
Tommi
674b0c8111 Move ReceiveStatisticsProxy stats variables to the worker thread.
This reduces locking on the decoder thread and moves all stats
management to the worker thread, which also avoids contention between
querying for these stats and the threads where the media processing happens..

Bug: webrtc:11489,webrtc:11490
Change-Id: I802577eab6b48edcbe124c02a1b793a640b74181
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/174205
Commit-Queue: Tommi <tommi@webrtc.org>
Reviewed-by: Rasmus Brandt <brandtr@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#31202}
2020-05-10 20:43:40 +00:00
Tommi
d93bf127cd Call OnDecodedFrame asynchronously on the worker thread.
This offloads the decoder thread with managing histograms,
moves the management over to the thread on which they're queried.
This will allow us to remove more locking from the decoder threads
and avoid contention when querying for stats.

Bug: webrtc:11489
Change-Id: I563c90a0ed01e0b3598ee314d8118622216a2e0f
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/174201
Commit-Queue: Tommi <tommi@webrtc.org>
Reviewed-by: Rasmus Brandt <brandtr@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#31201}
2020-05-10 19:35:40 +00:00
Tommi
d7e08c8cf8 Move processing of frame meta data for OnFrame/OnRenderedFrame to the worker thread
Bug: webrtc:11489
Change-Id: I9f88fec0aef449fd8923c5eec81cddf9ee42316b
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/174220
Commit-Queue: Tommi <tommi@webrtc.org>
Reviewed-by: Philip Eliasson <philipel@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#31199}
2020-05-10 11:47:52 +00:00
Tommi
553c869c58 Start consolidating management/querying of stats on the Call thread.
Call is instantiated on what we traditionally call the 'worker thread'
in PeerConnection terms. Call statistics are however gathered, processed
and reported in a number of different ways, which results in a lot of
locking, which is also unpredictable due to the those actions themselves
contending with other parts of the system.

Designating the worker thread as the general owner of the stats, helps
us keeps things regular and avoids loading unrelated task queues/threads
with reporting things like histograms or locking up due to a call to
GetStats().

This is a reland of remaining changes from https://webrtc-review.googlesource.com/c/src/+/172847:
This applies the changes from the above CL to the forked files and
switches call.cc over to using the forked implementation.

Bug: webrtc:11489
Change-Id: I93ad560500806ddd0e6df1448b1bcf5a1aae7583
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/174000
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Reviewed-by: Magnus Flodman <mflodman@webrtc.org>
Reviewed-by: Danil Chapovalov <danilchap@webrtc.org>
Commit-Queue: Tommi <tommi@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#31186}
2020-05-08 07:24:39 +00:00
Tommi
74fc574cbc Fork a few VideoReceiveStream related classes.
We'll need to deprecate the previous classes due to being used externally
as an API.

Bug: webrtc:11489
Change-Id: I64de29c8adae304d0b7628e24dd0abc5be6387ba
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/173960
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Commit-Queue: Tommi <tommi@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#31136}
2020-04-27 09:25:47 +00:00