Commit graph

247 commits

Author SHA1 Message Date
Jonas Oreland
80c87d7151 RtpEncodingParameters::request_resolution patch 2
This cl/ implements configuring of encode resolution
in the video_stream_encoder (webrtc_video_engine) in
a way that is independent of frame resolution (i.e
not using scale_resolution_down_by).

The cl/ reuses the VideoAdapter as is, and hence
the output resolution will be the same as it is today.

Anticipated further patches
3) Hook up resource adaptation
4) Let VideoSource do adaption if possible

Bug: webrtc:14451
Change-Id: I881b031c5b23be26cacfe138730154f1cb1b66a8
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/276742
Reviewed-by: Artem Titov <titovartem@webrtc.org>
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Reviewed-by: Henrik Boström <hbos@webrtc.org>
Reviewed-by: Ilya Nikolaevskiy <ilnik@webrtc.org>
Reviewed-by: Rasmus Brandt <brandtr@webrtc.org>
Commit-Queue: Jonas Oreland <jonaso@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#38245}
2022-09-29 14:10:44 +00:00
Johannes Kron
bb591c49e8 Change the default setting for PreStreamDecoders/LazyDecoderCreation
The experiment has been approved for a full launch. Changing the
default value so that no decoder is created before the stream starts.
All decoders are created lazily on demand when we receive payload
data of the corresponding type.

Bug: chromium:1319864
Change-Id: Ifb412bbe49a7577a45c340496d5b8572ebc1ba44
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/277120
Auto-Submit: Johannes Kron <kron@webrtc.org>
Reviewed-by: Ilya Nikolaevskiy <ilnik@webrtc.org>
Commit-Queue: Ilya Nikolaevskiy <ilnik@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#38232}
2022-09-28 11:40:22 +00:00
Jonas Oreland
1262eb5ebc Move EncoderStreamFactory into own file
This cl/ is a NOP refactoring,
moving the EncoderStreamFactory from within webrtc_video_engine.cc
into own file in video/. simulcast.cc is collateral.

Bug: webrtc:14451
Change-Id: Ia69b9241d8cd8a12be6628d887701f2e244c07cc
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/276861
Reviewed-by: Artem Titov <titovartem@webrtc.org>
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Reviewed-by: Rasmus Brandt <brandtr@webrtc.org>
Commit-Queue: Jonas Oreland <jonaso@webrtc.org>
Reviewed-by: Ilya Nikolaevskiy <ilnik@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#38224}
2022-09-27 17:29:11 +00:00
Erik Språng
7aaeb5a270 Create pre-allocated decoders on the decoder thread.
This way we're sure instantiation, configuration and decode calls all
happen on the decoder queue - making thread checking easier in the
actual decoder classes.

Bug: None
Change-Id: Ia98f47009f26b34eb8dad2ee0b4ddcde082d1994
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/272022
Reviewed-by: Evan Shrubsole <eshr@webrtc.org>
Auto-Submit: Erik Språng <sprang@webrtc.org>
Commit-Queue: Evan Shrubsole <eshr@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#37825}
2022-08-18 13:14:26 +00:00
Tommi
dfc4d81fd3 [WebRtcVideoReceiveStream] Construct flexfec stream on demand.
...for payload type changes and avoid recreating the main video stream.

Bug: webrtc:11993
Change-Id: I03e44ff25d88caeb082a2e44b2e802d3b9392feb
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/269244
Reviewed-by: Danil Chapovalov <danilchap@webrtc.org>
Commit-Queue: Tomas Gunnarsson <tommi@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#37666}
2022-08-02 16:33:04 +00:00
Tommi
185f10c082 [WebRtcVideoReceiveStream] Add ability to config flexfec post init.
Bug: webrtc:11993
Change-Id: I35d7e645e18b7cb4a86645ea52c8958063f13d3c
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/269243
Reviewed-by: Danil Chapovalov <danilchap@webrtc.org>
Commit-Queue: Tomas Gunnarsson <tommi@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#37661}
2022-08-02 11:37:26 +00:00
Erik Språng
a3f2e72008 Fix potential UAF in unit test.
In WebRtcVideoChannelBaseTest.EncoderSelectorSwitchCodec a mock encoder
selecter or stack allocated and then registered with the channel.
Since this test uses real-time clocks/threads, there is a chance that
the selector callback will be called after the mock goes out of scope,
but before the test had time to be torn down.

This CL fixes that by simply de-registering the callback before the
end of the test.

Bug: b/239855550
Change-Id: Ibb38a914933494fd04c963b9a13f2cc4aee160d6
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/269402
Auto-Submit: Erik Språng <sprang@webrtc.org>
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#37618}
2022-07-26 09:19:34 +00:00
Erik Språng
5793ed8ff9 Remove unused field trial WebRTC-SendBufferSizeBytes
Bug: webrtc:9637
Change-Id: Ie4bf5caa3977f1824f6dc1014b1feacf6ebfe670
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/269386
Commit-Queue: Erik Språng <sprang@webrtc.org>
Reviewed-by: Philip Eliasson <philipel@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#37617}
2022-07-26 07:26:14 +00:00
Erik Språng
d460c31309 Make sure VideoStream target bitrate is not higher than max.
Bug: webrtc:14017
Change-Id: Ic59811f4ec84e429839440cea8a70c05d7795cc4
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/269388
Auto-Submit: Erik Språng <sprang@webrtc.org>
Commit-Queue: Erik Språng <sprang@webrtc.org>
Reviewed-by: Philip Eliasson <philipel@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#37614}
2022-07-25 20:34:48 +00:00
Erik Språng
b6ff84b516 Reland "When VP9 SVC is used, use SvcConfig to set max bitrate for the stream."
This is a reland of commit 3afb8e2431

Patchset 1 is the original CL. Patchset 2 contains a fix:
Depending on call site, the number of spatial layers for VP9 might be
signalled in three different ways. One of them was afaict only used in
out perf tests, and resulted in the max bitrate being incorrectly
capped.
The fix now checks that field too.

Original change's description:
> When VP9 SVC is used, use SvcConfig to set max bitrate for the stream.
>
> Currently, a default max bitrate is determined within WebRtcVideoEngine,
> which maxes out at 2.5Mbps - and that limits the max bitrate deteremined
> by SvcConfig for resolutions above 720p.
>
> This does not affect simulcast, as WebRtcVideoEngine already knows to
> trust the rate allocation in simulcast.cc instead.
>
> Bug: webrtc:14017
> Change-Id: I0c310a6fd496e9e5a10eae45838900068aa1ae2d
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/267160
> Reviewed-by: Ilya Nikolaevskiy <ilnik@webrtc.org>
> Commit-Queue: Erik Språng <sprang@webrtc.org>
> Cr-Commit-Position: refs/heads/main@{#37370}

Bug: webrtc:14017, webrtc:14234
Change-Id: Idcaf4321a20c917e4049522c577336ddcfc7ffbb
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/267860
Auto-Submit: Erik Språng <sprang@webrtc.org>
Reviewed-by: Ilya Nikolaevskiy <ilnik@webrtc.org>
Commit-Queue: Ilya Nikolaevskiy <ilnik@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#37446}
2022-07-05 14:19:33 +00:00
Erik Språng
4f1af1156f Revert "When VP9 SVC is used, use SvcConfig to set max bitrate for the stream."
This reverts commit 3afb8e2431.

Reason for revert: Causes some unexpected perf regressions.

Original change's description:
> When VP9 SVC is used, use SvcConfig to set max bitrate for the stream.
>
> Currently, a default max bitrate is determined within WebRtcVideoEngine,
> which maxes out at 2.5Mbps - and that limits the max bitrate deteremined
> by SvcConfig for resolutions above 720p.
>
> This does not affect simulcast, as WebRtcVideoEngine already knows to
> trust the rate allocation in simulcast.cc instead.
>
> Bug: webrtc:14017
> Change-Id: I0c310a6fd496e9e5a10eae45838900068aa1ae2d
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/267160
> Reviewed-by: Ilya Nikolaevskiy <ilnik@webrtc.org>
> Commit-Queue: Erik Språng <sprang@webrtc.org>
> Cr-Commit-Position: refs/heads/main@{#37370}

Bug: webrtc:14017
Change-Id: I1e45ee3f78deb50a9057d648146b1a6360782aa3
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/267800
Commit-Queue: Ilya Nikolaevskiy <ilnik@webrtc.org>
Bot-Commit: rubber-stamper@appspot.gserviceaccount.com <rubber-stamper@appspot.gserviceaccount.com>
Reviewed-by: Erik Språng <sprang@webrtc.org>
Auto-Submit: Erik Språng <sprang@webrtc.org>
Reviewed-by: Ilya Nikolaevskiy <ilnik@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#37438}
2022-07-05 10:25:23 +00:00
Niels Möller
c8152fe4a8 Update/delete old TODOs
Bug: webrtc:10198
Change-Id: I226768c2a6bd97ffcd0638e5bc6a1c286b71815f
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/267704
Commit-Queue: Niels Moller <nisse@webrtc.org>
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#37435}
2022-07-05 09:44:53 +00:00
Erik Språng
3afb8e2431 When VP9 SVC is used, use SvcConfig to set max bitrate for the stream.
Currently, a default max bitrate is determined within WebRtcVideoEngine,
which maxes out at 2.5Mbps - and that limits the max bitrate deteremined
by SvcConfig for resolutions above 720p.

This does not affect simulcast, as WebRtcVideoEngine already knows to
trust the rate allocation in simulcast.cc instead.

Bug: webrtc:14017
Change-Id: I0c310a6fd496e9e5a10eae45838900068aa1ae2d
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/267160
Reviewed-by: Ilya Nikolaevskiy <ilnik@webrtc.org>
Commit-Queue: Erik Språng <sprang@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#37370}
2022-06-29 14:23:08 +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
Jonas Oreland
6545516a14 RtpSenderInterface::SetEncoderSelector
This cl/ adds a way of setting an EncoderSelector on a specific
RtpSenderInterface. This makes it possible to easily use different
EncoderSelector on different streams within the same or different PeerConnections.

The cl/ is almost identical to the impl. of RtpSenderInterface::SetFrameEncryptor.

Iff a EncoderSelector is set on the RtpSender, it will take precedence
over the VideoEncoderFactory::GetEncoderSelector.

Bug: webrtc:14122
Change-Id: Ief4f7c06df7f1ef4ce3245de304a48e9de0ad587
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/264542
Reviewed-by: Rasmus Brandt <brandtr@webrtc.org>
Commit-Queue: Jonas Oreland <jonaso@webrtc.org>
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#37150}
2022-06-08 11:06:52 +00:00
Tommi
a136ed4085 Add SetTransportCc to ReceiveStreamInterface.
Setting the transport cc flag was only possible post creation for
audio receive streams, while video receive streams need to be recreated.

This CL moves the setter for transport_cc() to where the getter is and
adds boiler plate implementations for the video streams. For audio
streams this splits "SetUseTransportCcAndNackHistory" into two methods,
SetTransportCc and SetNackHistory.

Bug: none
Change-Id: Idbec8217aef10ee77907cebaecdc27b4b0fb18e4
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/264443
Commit-Queue: Tomas Gunnarsson <tommi@webrtc.org>
Reviewed-by: Niels Moller <nisse@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#37038}
2022-05-30 14:07:04 +00:00
Harald Alvestrand
485457f050 Delete ChannelManager class
Bug: webrtc:13931
Change-Id: I331aed0e304f89a0c53d8db20ab2c9733ebbb34c
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/263120
Reviewed-by: Florent Castelli <orphis@webrtc.org>
Reviewed-by: Henrik Boström <hbos@webrtc.org>
Commit-Queue: Harald Alvestrand <hta@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#36970}
2022-05-23 10:06:26 +00:00
Harald Alvestrand
c3fa7c38b2 Remove remaining trampoline functions from channel_manager
This is part of the project to delete the class entirely.
The CL also adds an "use_rtx" parameter to the function for listing
video codecs, rather than filtering those away afterwards.

Bug: webrtc:13931
Change-Id: I96b9b18c694a1c0986ccf22face76ef4c704d372
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/262666
Reviewed-by: Henrik Boström <hbos@webrtc.org>
Commit-Queue: Harald Alvestrand <hta@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#36963}
2022-05-23 08:09:06 +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
Niels Möller
83830f316e Delete TestListener and top-level thread wrapping.
Instead use rtc::AutoThread in tests that need that.

Bug: webrtc:9714
Change-Id: I1f33b1b2d321770d062504dd9ef86d66a345dd42
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/254681
Reviewed-by: Tomas Gunnarsson <tommi@webrtc.org>
Commit-Queue: Niels Moller <nisse@webrtc.org>
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#36950}
2022-05-20 15:21:21 +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
Asa Persson
2698353d43 Disable quality scaling if multiple spatial layers are requested for VP9
VP9 automaticResizeOn is disabled if more than one spatial layer is configured via scalability mode.

Bug: webrtc:13960
Change-Id: I7c6351bca6d2f32bcc7391894e8dcc9e74ca2050
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/261315
Reviewed-by: Niels Moller <nisse@webrtc.org>
Commit-Queue: Åsa Persson <asapersson@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#36897}
2022-05-16 15:11:24 +00:00
Niels Möller
807328fec7 Move frame drop config to VideoCodec and VideoEncoderConfig.
Intend to delete corresponding codec-specific settings in a followup.

Bug: webrtc:6883
Change-Id: I78ab07729a5aee1055f80d39d8f7289beb6721e1
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/262244
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Commit-Queue: Niels Moller <nisse@webrtc.org>
Reviewed-by: Erik Språng <sprang@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#36882}
2022-05-13 13:40:14 +00:00
Danil Chapovalov
8f44ae4fa5 Remove dead code in cricket::FakeVideoRenderer
Remove unused accessors
move helper implementation into .cc file

Bug: None
Change-Id: Iccd877180901b278af4800f681669089b8a046ce
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/262254
Commit-Queue: Niels Moller <nisse@webrtc.org>
Auto-Submit: Danil Chapovalov <danilchap@webrtc.org>
Reviewed-by: Niels Moller <nisse@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#36881}
2022-05-13 13:36:35 +00:00
Tommi
cb7c7366d0 Separate reading remote_ssrc from using the rtp_config() getter.
`remote_ssrc` can be considered const while some other state represented
by rtp_config() can not and also is tied to a specific thread.
Separating access to these variables, makes moving things around easier.

Bug: webrtc:11993
Change-Id: I70aa000daab6174a401e01dca163213174e8f284
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/261316
Commit-Queue: Tomas Gunnarsson <tommi@webrtc.org>
Reviewed-by: Niels Moller <nisse@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#36818}
2022-05-09 14:55:00 +00:00
Erik Språng
536f587b98 Revert "Calculate video stream max bitrate using expression."
This reverts commit 45361f78ed.

Reason for revert: Perf alerts galore.

Original change's description:
> Calculate video stream max bitrate using expression.
>
> This replaces the ealier table-based caps.
> Apart from the VGA cap (now 1600kbps instead of 1700kbps), or if using
> "in between" resolutions, the caps are unchanged - but now cover high
> resolutions better.
>
> Bug: webrtc:14017
> Change-Id: I8649b528495d6c917e38ea8cb1a272df6c464c03
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/260940
> Commit-Queue: Erik Språng <sprang@webrtc.org>
> Reviewed-by: Per Kjellander <perkj@webrtc.org>
> Cr-Commit-Position: refs/heads/main@{#36776}

Bug: webrtc:14017
Change-Id: I18ebc81c6054713c58d49bd227e37090686958c9
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/261309
Reviewed-by: Per Kjellander <perkj@webrtc.org>
Auto-Submit: Erik Språng <sprang@webrtc.org>
Commit-Queue: Per Kjellander <perkj@webrtc.org>
Bot-Commit: rubber-stamper@appspot.gserviceaccount.com <rubber-stamper@appspot.gserviceaccount.com>
Cr-Commit-Position: refs/heads/main@{#36794}
2022-05-06 09:37:32 +00:00
Erik Språng
45361f78ed Calculate video stream max bitrate using expression.
This replaces the ealier table-based caps.
Apart from the VGA cap (now 1600kbps instead of 1700kbps), or if using
"in between" resolutions, the caps are unchanged - but now cover high
resolutions better.

Bug: webrtc:14017
Change-Id: I8649b528495d6c917e38ea8cb1a272df6c464c03
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/260940
Commit-Queue: Erik Språng <sprang@webrtc.org>
Reviewed-by: Per Kjellander <perkj@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#36776}
2022-05-05 10:10:20 +00:00
Niels Möller
ba2de58a22 Update audio/, media/, and video/ to not use implicit conversion
from scoped_refptr<T> to T*.

Bug: webrtc:13464
Change-Id: Ia14885f359fea2bdf08a41b3ded82532a9585d34
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/259503
Reviewed-by: Gustaf Ullberg <gustaf@webrtc.org>
Reviewed-by: Ilya Nikolaevskiy <ilnik@webrtc.org>
Commit-Queue: Niels Moller <nisse@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#36599}
2022-04-21 09:00:14 +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
Jonas Oreland
4476b82b35 WebRTC-DeprecateGlobalFieldTrialString/Enabled/ - part 3/inf
convert much of media/ (and the collateral)

Bug: webrtc:10335
Change-Id: I04489dfe9622efe7f89e04aba3be6b3f60e77c91
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/254520
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@{#36177}
2022-03-11 07:46:34 +00:00
Sergey Silkin
e1cd3ad4f5 Switch encoder on init failure
Currently if encoder initialization fails WebRTC doesn't send any video.
This CL adds functionality that changes encoder type in such case and
restores the video. If encoder selector is available we switch to
encoder it recommends. Otherwise, VP8 is used as the default fallback
encoder.

Bug: webrtc:13572
Change-Id: Ifcdf707a575711f5ff81f9451caf30140c9171dc
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/246960
Reviewed-by: Philip Eliasson <philipel@webrtc.org>
Reviewed-by: Erik Språng <sprang@webrtc.org>
Reviewed-by: Rasmus Brandt <brandtr@webrtc.org>
Commit-Queue: Sergey Silkin <ssilkin@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#35761}
2022-01-21 12:05:17 +00:00
Sergey Silkin
42bf2c670c Put current send codec to front of codecs list in RTP sender parameters
WebRTC can switch encoder on-fly when encoder fails or by request from
encoder selector. Putting the current send codec to the front of the
codecs list provides a simple way for apps to know what is actually
used without retrieving stats.

Bug: webrtc:13572
Change-Id: Iaaa5f7ad8667f59016dc92bff9e9a57a7425ef44
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/246500
Reviewed-by: Mirta Dvornicic <mirtad@webrtc.org>
Reviewed-by: Erik Språng <sprang@webrtc.org>
Commit-Queue: Sergey Silkin <ssilkin@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#35723}
2022-01-18 14:36:33 +00:00
Erik Språng
5065e5b922 Don't configure frame dropping externally for screenshare.
Legacy code depended of setting VideoCodecVP8::frameDroppingOn to false
for screensharing since the reference frame management handles frame
dropping in the VP8 wrapper instead.
Now the frame dropping is instead configured based on what the
Vp8FrameBufferController instance in use signals.

This change unblocks relanding
https://webrtc-review.googlesource.com/c/src/+/242366

This CL also turns frame dropping on for H264 screenshare, which
should be desirable as it allows for quicker recovery from rate control
overshoots.

Bug: webrtc:9734
Change-Id: I34a29edcd41bb5fd07f7f9bf68660472a1570533
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/242965
Reviewed-by: Markus Handell <handellm@webrtc.org>
Auto-Submit: Erik Språng <sprang@webrtc.org>
Commit-Queue: Erik Språng <sprang@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#35592}
2021-12-29 17:02:38 +00:00
Markus Handell
68f06af6f6 WebRtcVideoChannelBaseTest.InvalidRecvBufferSize: fix UAF.
The test could cause a UAF as the test exits while the lambda is
still running. Only seems to happen on Linux for some reason.

Bug: webrtc:12854
Change-Id: Ie0c0de09b675ef93dc195a6470752a772083029e
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/238425
Auto-Submit: Markus Handell <handellm@webrtc.org>
Commit-Queue: Tommi <tommi@webrtc.org>
Reviewed-by: Tommi <tommi@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#35389}
2021-11-19 12:53:33 +00:00
Niels Möller
13d163654a Delete support for has_internal_source
Bug: webrtc:12875
Change-Id: I9683e71e1fe5b24802033ffcb32a531ca685fc6f
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/179220
Commit-Queue: Niels Moller <nisse@webrtc.org>
Reviewed-by: Tommi <tommi@webrtc.org>
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Reviewed-by: Ilya Nikolaevskiy <ilnik@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#35353}
2021-11-16 11:29:40 +00:00
Byoungchan Lee
efe46b6bee Change the type of RTCVideoSourceStats.framesPerSecond
Spec: https://w3c.github.io/webrtc-stats/#dom-rtcvideosourcestats-framespersecond

Bug: webrtc:12905
Change-Id: If53e2e480e2d6f687c3f8bb95a9e1d1e386fe9c2
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/237420
Reviewed-by: Ilya Nikolaevskiy <ilnik@webrtc.org>
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Reviewed-by: Henrik Boström <hbos@webrtc.org>
Commit-Queue: Byoungchan Lee <daniel.l@hpcnt.com>
Cr-Commit-Position: refs/heads/main@{#35352}
2021-11-16 11:21:41 +00:00
Markus Handell
ee03431107 WebRtcVideoEngineTest: use simulated time.
Bug: chromium:1255737
Change-Id: I6036ae5af4b3f0e7bd04352b055935f501ecc52b
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/237341
Commit-Queue: Markus Handell <handellm@webrtc.org>
Reviewed-by: Niels Moller <nisse@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#35316}
2021-11-05 14:06:12 +00:00
philipel
83d667925f Removed unused WebRTC-SupportVP9SVC field trial.
Instead use `parameters_.config.rtp.ssrcs.size()` directly to make decisions about the number of temporal and spatial layer used.

Bug: none
Change-Id: Icba553178ae7fea281c2c67654c510228d9ab5b6
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/237080
Commit-Queue: Philip Eliasson <philipel@webrtc.org>
Reviewed-by: Niels Moller <nisse@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#35299}
2021-11-02 16:05:52 +00:00
Mirko Bonadei
e5e78c4521 Fix -Wunused-but-set-variable.
Bug: None
Change-Id: I8943227108e46c4c942895e4bd8fb276947502e0
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/236525
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Reviewed-by: Sergey Silkin <ssilkin@webrtc.org>
Reviewed-by: Alessio Bazzica <alessiob@webrtc.org>
Reviewed-by: Niels Moller <nisse@webrtc.org>
Reviewed-by: Björn Terelius <terelius@webrtc.org>
Reviewed-by: Henrik Lundin <henrik.lundin@webrtc.org>
Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#35272}
2021-10-28 12:53:49 +00:00
Taylor Brandstetter
b9b0890541 Fix error adding receive stream after packet received from non-primary SSRC.
The non-primary SSRC being RTX, for example. Normally a default stream
wouldn't be created from RTX packets, but there is a window of time
where packets can be received before the video engine has receive
parameters/payload type mappings, so it creates one anyway.

Then in AddRecvStream, normally the default stream would be destroyed
before creating a new one, but this only happens for sp.first_ssrc().
Resulting in the error "Receive stream with SSRC 'X' already exists".

Fixed by simply iterating over all SSRCs.

Bug: webrtc:13171
Change-Id: Iaf4e4a3ceafddee3d9b2d1e24af68be56f9695de
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/231633
Reviewed-by: Niels Moller <nisse@webrtc.org>
Reviewed-by: Taylor Brandstetter <deadbeef@webrtc.org>
Commit-Queue: Taylor Brandstetter <deadbeef@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#34971}
2021-09-10 21:28:23 +00:00
Tommi
1f38a38b6f Add ability to set rtp header extensions without recreating streams.
Setting the rtp header extensions on the packet delivery thread
(currently worker, soon to be network), is now possible without
taking the hit of deleting and recreating the receive stream (and
rtp receiver and related state).

Bug: webrtc:11993
Change-Id: I9bbe306844a25d85d79cd216092ead66eaf68960
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/223741
Reviewed-by: Niels Moller <nisse@webrtc.org>
Commit-Queue: Tommi <tommi@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#34953}
2021-09-08 13:39:36 +00:00
Åsa Persson
fb1959625d Allow setting different number of temporal layers per simulcast layer.
Setting different number of temporal layers is supported by SimulcastEncodeAdapter and LibvpxVp8Encoder will fallback to SimulcastEncoderAdapter if InitEncode fails.

Bug: none
Change-Id: I8a09ee1e6c70a0006317957c0802d019a0d28ca2
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/228642
Reviewed-by: Erik Språng <sprang@webrtc.org>
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Commit-Queue: Åsa Persson <asapersson@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#34785}
2021-08-17 13:33:55 +00:00
Artem Titov
37f664f6d5 Use backticks not vertical bars to denote variables in comments for /media
Bug: webrtc:12338
Change-Id: Ia800a4017ede1f647b36f809ef3c5b37a2616fdd
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/226949
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Commit-Queue: Artem Titov <titovartem@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#34567}
2021-07-27 17:11:33 +00:00
Danil Chapovalov
99a71f49c0 Move helpers to parse base rtp packet fields to rtp_rtcp module
rtp_rtcp_format is lighter build target than rtc_media_base and
a more natural place to keep rtp parsing functions.

Bug: None
Change-Id: Ibcb5661cc65edbdc89a63f3e411d7ad1218353cc
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/226330
Commit-Queue: Danil Chapovalov <danilchap@webrtc.org>
Reviewed-by: Niels Moller <nisse@webrtc.org>
Reviewed-by: Henrik Boström <hbos@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#34504}
2021-07-19 14:27:27 +00:00
Danil Chapovalov
fb1a0f0e1f Cleanup rtp utils in media/base
Remove unused functions GetRtpHeader/GetRtpHeaderLength
Replace usage of SetRtpHeader with webrtc::RtpPacket
Move SetRtpSsrc next to the only place it is used.

Bug: None
Change-Id: I3ecc244b1a2bdb2d68e0dbdb34dd60160a3101f8
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/225547
Reviewed-by: Erik Språng <sprang@webrtc.org>
Commit-Queue: Danil Chapovalov <danilchap@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#34447}
2021-07-09 17:48:26 +00:00
Jakob Ivarsson
e91c992fa1 Implement nack_count metric for outbound audio rtp streams.
Bug: webrtc:12510
Change-Id: Ia035885bced3c3d202bb9ffeb88c2556d4830e92
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/225021
Reviewed-by: Sam Zackrisson <saza@webrtc.org>
Reviewed-by: Erik Språng <sprang@webrtc.org>
Reviewed-by: Henrik Boström <hbos@webrtc.org>
Commit-Queue: Jakob Ivarsson <jakobi@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#34444}
2021-07-09 13:29:10 +00:00
Jakob Ivarsson
e54914a79e Implement nack_count metric for inbound audio rtp streams.
Bug: webrtc:12925
Change-Id: I4542ca0f14a7dd7485ad5a2b6f2bd7051076f71f
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/224085
Commit-Queue: Jakob Ivarsson <jakobi@webrtc.org>
Reviewed-by: Sam Zackrisson <saza@webrtc.org>
Reviewed-by: Henrik Boström <hbos@webrtc.org>
Reviewed-by: Björn Terelius <terelius@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#34401}
2021-07-01 10:38:44 +00:00
Tommi
d350006b70 Add rtp_config() accessor to ReceiveStream.
This is a consistent way to get to common config parameters for
all receive streams and avoids storing a copy of the extension
headers inside of Call. This is needed to get rid of the need of
keeping config and copies in sync, which currently is part of why
we repeatedly delete and recreate audio receive streams on config
changes.

Bug: webrtc:11993
Change-Id: Ia356b6cac1425c8c6766abd2e52fdeb73c4a4b4f
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/222040
Commit-Queue: Tommi <tommi@webrtc.org>
Reviewed-by: Niels Moller <nisse@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#34285}
2021-06-14 17:57:57 +00:00
Tommi
1c1f540487 Factor out common receive stream methods to a common interface.
Also including common Rtp config members.
Follow up changes will remove the ReceiveRtpConfig class in Call
and copy of extension headers, instead use the config directly
from the receive streams and not require stream recreation for changing
the headers.

Bug: webrtc:11993
Change-Id: I29ff3400d45d5bffddb3ad0a078403eb102afb65
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/221983
Reviewed-by: Niels Moller <nisse@webrtc.org>
Commit-Queue: Tommi <tommi@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#34283}
2021-06-14 16:54:07 +00:00
Henrik Boström
62ec0f6130 Add small cooldown to unsignalled ssrc stream creation.
This CL adds a cooldown of 0.5 seconds where if the WebRtcVideoChannel
created an unsignalled receive stream within that amount of time, if we
receive even more unknown ssrcs we simply drop those RTP packets.

This prevents getting into a state of spawning new decoders on every
single packet which could happen e.g. if PT based demuxing is enabled
and MIDs are missing from the packets.

Bug: webrtc:12815
Change-Id: Id7675fb0cbfbc72281dcfe030d1a35629df3eb9f
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/221520
Reviewed-by: Taylor Brandstetter <deadbeef@webrtc.org>
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Commit-Queue: Henrik Boström <hbos@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#34263}
2021-06-10 13:13:21 +00:00
Tommi
a334dc68f3 Make VideoSendStream::UpdateActiveSimulcastLayers not block.
UpdateActiveSimulcastLayers has been blocking
WebRtcVideoChannel::SetSend which may be called quite frequently during
negotiations. This CL changes UpdateActiveSimulcastLayers to not
synchronize with the transport's task queue to wait for the changes to
get applied.

This synchronization is quite costly, but so too are other remaining
things in VideoSendStream, so we should aim to get rid of the
`thread_sync_event_` in VideoSendStream.

Bug: webrtc:12840, webrtc:12854
Change-Id: Idb48d29b6b8382881c7c1e6f1d0f5e708dbca30f
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/221203
Commit-Queue: Tommi <tommi@webrtc.org>
Reviewed-by: Markus Handell <handellm@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#34228}
2021-06-04 12:32:24 +00:00
Danil Chapovalov
47f5f8c160 Reduce usage of RtpHeaderParser::CreateForTest in favor of RtpPacket
As a step to delete the legacy rtp packet parser.

Bug: None
Change-Id: I2aae86bc8847acd76cdd89007273a99f0298fdb9
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/221109
Commit-Queue: Danil Chapovalov <danilchap@webrtc.org>
Reviewed-by: Erik Språng <sprang@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#34219}
2021-06-03 12:29:09 +00:00
Danil Chapovalov
ea7474ee74 Remove redundant VideoSendStream::rtcp_stats field
its content is duplicated in the report_block_data member

Bug: webrtc:10678
Change-Id: I89421ae4ab5f727a233161924372105e222ed404
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/219080
Reviewed-by: Erik Språng <sprang@webrtc.org>
Commit-Queue: Danil Chapovalov <danilchap@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#34039}
2021-05-18 13:37:51 +00:00
Tomas Gunnarsson
02e079ff80 Update video tests to clear network interface pointer consistently.
This is related to upcoming changes whereby it will be enforced that
calls to SetInterface(<valid ptr>) and SetInterface(nullptr) be matched
up correctly.

Bug: webrtc:11993
Change-Id: Ic022f9487a7ab297adaced8e620e2384e055673b
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/217241
Commit-Queue: Tommi <tommi@webrtc.org>
Reviewed-by: Danil Chapovalov <danilchap@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#33903}
2021-05-03 15:45:35 +00:00
Johannes Kron
c3fcee7c3a Move h264_profile_level_id and vp9_profile to api/video_codecs
This is a refactor to simplify a follow-up CL of adding
SdpVideoFormat::IsSameCodec.

The original files media/base/h264_profile_level_id.* and
media/base/vp9_profile.h must be kept until downstream projects
stop using them.

Bug: chroimium:1187565
Change-Id: Ib39eca095a3d61939a914d9bffaf4b891ddd222f
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/215236
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Reviewed-by: Kári Helgason <kthelgason@webrtc.org>
Reviewed-by: Niels Moller <nisse@webrtc.org>
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Commit-Queue: Johannes Kron <kron@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#33782}
2021-04-20 09:42:05 +00:00
Henrik Boström
15e078c574 Fix unsignalled ssrc race in WebRtcVideoChannel.
BaseChannel adds and removes receive streams on the worker thread
(UpdateRemoteStreams_w) and then posts a task to the network thread to
update the demuxer criteria. Until this happens, OnRtpPacket() keeps
forwarding "recently removed" ssrc packets to the WebRtcVideoChannel.
Furthermore WebRtcVideoChannel::OnPacketReceived() posts task from the
network thread to the worker thread, so even if the demuxer criteria was
instantly updated we would still have an issue of in-flight packets for
old ssrcs arriving late on the worker thread inside WebRtcVideoChannel.

The wrong ssrc could also arrive when the demuxer goes from forwarding
all packets to a single m= section to forwarding to different m=
sections. In this case we get packets with an ssrc for a recently
created m= section and the ssrc was never intended for our channel.

This is a problem because when WebRtcVideoChannel sees an unknown ssrc
it treats it as an unsignalled stream, creating and destroying default
streams which can be very expensive and introduce large delays when lots
of packets are queued up.

This CL addresses the issue with callbacks for when a demuxer criteria
update is pending and when it has completed. During this window of time,
WebRtcVideoChannel will drop packets for unknown ssrcs.

This approach fixes the race without introducing any new locks and
packets belonging to ssrcs that were not removed continue to be
forwarded even if a demuxer criteria update is pending. This should make
a=inactive for 50p receive streams a glitch-free experience.

Bug: webrtc:12258, chromium:1069603
Change-Id: I30d85f53d84e7eddf7d21380fb608631863aad21
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/214964
Commit-Queue: Henrik Boström <hbos@webrtc.org>
Reviewed-by: Taylor <deadbeef@webrtc.org>
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#33757}
2021-04-16 09:33:42 +00:00
Markus Handell
588f9b3705 VideoReceiveStream2: AV1 encoded sink support.
This change adds support for emitting encoded frames
for recording when the decoder can't easily read out
encoded width and height as is the case for AV1 streams,
in which case the information is buried in OBUs. Downstream
project relies on resolution information being present for key
frames. With the change, VideoReceiveStream2 infers the
resolution from decoded frames, and supplies it in the
RecordableEncodedFrames.

Bug: chromium:1191972
Change-Id: I07beda6526206c80a732976e8e19d3581489b8fe
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/214126
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Reviewed-by: Philip Eliasson <philipel@webrtc.org>
Reviewed-by: Erik Språng <sprang@webrtc.org>
Commit-Queue: Markus Handell <handellm@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#33662}
2021-04-08 20:07:22 +00:00
Philipp Hancke
006206dda9 rtx-time implementation
provides an implementation of the rtx-time parameter from
  https://tools.ietf.org/html/rfc4588#section-8
that determines the maximum time a receiver waits for a frame
before sending a PLI.

BUG=webrtc:12420

Change-Id: Iff20d92c806989cd4d56fe330d105b3dd127ed24
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/201400
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Reviewed-by: Erik Språng <sprang@webrtc.org>
Commit-Queue: Erik Språng <sprang@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#33627}
2021-04-06 13:42:31 +00:00
Jeremy Leconte
b258c56267 Send and Receive VideoFrameTrackingid RTP header extension.
Bug: webrtc:12594
Change-Id: I2372a361e55d0fdadf9847081644b6a3359a2928
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/212283
Reviewed-by: Artem Titov <titovartem@webrtc.org>
Reviewed-by: Danil Chapovalov <danilchap@webrtc.org>
Reviewed-by: Christoffer Rodbro <crodbro@webrtc.org>
Reviewed-by: Erik Språng <sprang@webrtc.org>
Commit-Queue: Jeremy Leconte <jleconte@google.com>
Cr-Commit-Position: refs/heads/master@{#33570}
2021-03-25 21:57:29 +00:00
Sergey Silkin
d19e3b9676 Reland "Reland "Enable quality scaling when allowed""
This reverts commit 31c5c9da35.

Reason for revert: made QP parser thread-safe https://webrtc.googlesource.com/src/+/0e42cf703bd111fde235d06d08b02d3a7b02c727

Original change's description:
> Revert "Reland "Enable quality scaling when allowed""
>
> This reverts commit 0021fe7793.
>
> Reason for revert: Broken on linux_tsan bot: https://ci.chromium.org/ui/p/webrtc/builders/ci/Linux%20Tsan%20v2/25329/overview
>
> Original change's description:
> > Reland "Enable quality scaling when allowed"
> >
> > This reverts commit eb449a979b.
> >
> > Reason for revert: Added QP parsing in https://webrtc.googlesource.com/src/+/8639673f0c098efc294a7593fa3bd98e28ab7508
> >
> > Original change's description:
> > Before this CL quality scaling was conditioned on scaling settings
> > provided by encoder. That should not be a requirement since encoder
> > may not be aware of quality scaling which is a WebRTC feature. In M90
> > chromium HW encoders do not provide scaling settings (chromium:1179020).
> > The default scaling settings provided by these encoders are not correct
> > (b/181537172).
> >
> > This CL adds is_quality_scaling_allowed to VideoEncoderConfig. The flag
> > is set to true in singlecast with normal video feed (not screen sharing)
> > mode. If quality scaling is allowed it is enabled no matter whether
> > scaling settings are present in encoder info or not. Setting from
> > QualityScalingExperiment are used in case if not provided by encoder.
> >
> > Bug: chromium:1179020
> > Bug: webrtc:12511
> > Change-Id: I97911fde9005ec25028a640a3f007d12f2bbc2e5
> > Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/211349
> > Reviewed-by: Rasmus Brandt <brandtr@webrtc.org>
> > Reviewed-by: Ilya Nikolaevskiy <ilnik@webrtc.org>
> > Commit-Queue: Sergey Silkin <ssilkin@webrtc.org>
> > Cr-Commit-Position: refs/heads/master@{#33438}
>
> TBR=brandtr@webrtc.org,ilnik@webrtc.org,ssilkin@webrtc.org,rubber-stamper@appspot.gserviceaccount.com
>
> Change-Id: Id7633a1e98f95762e81487887f83a0c35f89195c
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Bug: chromium:1179020
> Bug: webrtc:12511
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/211352
> Reviewed-by: Ilya Nikolaevskiy <ilnik@webrtc.org>
> Commit-Queue: Ilya Nikolaevskiy <ilnik@webrtc.org>
> Cr-Commit-Position: refs/heads/master@{#33439}

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

Bug: chromium:1179020
Bug: webrtc:12511
Change-Id: I3a31e1c1fdf7da93226f8c1e0a96b43fe0b786df
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/212026
Reviewed-by: Sergey Silkin <ssilkin@webrtc.org>
Reviewed-by: Rasmus Brandt <brandtr@webrtc.org>
Reviewed-by: Ilya Nikolaevskiy <ilnik@webrtc.org>
Commit-Queue: Sergey Silkin <ssilkin@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#33481}
2021-03-16 15:13:52 +00:00
Ilya Nikolaevskiy
31c5c9da35 Revert "Reland "Enable quality scaling when allowed""
This reverts commit 0021fe7793.

Reason for revert: Broken on linux_tsan bot: https://ci.chromium.org/ui/p/webrtc/builders/ci/Linux%20Tsan%20v2/25329/overview

Original change's description:
> Reland "Enable quality scaling when allowed"
>
> This reverts commit eb449a979b.
>
> Reason for revert: Added QP parsing in https://webrtc.googlesource.com/src/+/8639673f0c098efc294a7593fa3bd98e28ab7508
>
> Original change's description:
> Before this CL quality scaling was conditioned on scaling settings
> provided by encoder. That should not be a requirement since encoder
> may not be aware of quality scaling which is a WebRTC feature. In M90
> chromium HW encoders do not provide scaling settings (chromium:1179020).
> The default scaling settings provided by these encoders are not correct
> (b/181537172).
>
> This CL adds is_quality_scaling_allowed to VideoEncoderConfig. The flag
> is set to true in singlecast with normal video feed (not screen sharing)
> mode. If quality scaling is allowed it is enabled no matter whether
> scaling settings are present in encoder info or not. Setting from
> QualityScalingExperiment are used in case if not provided by encoder.
>
> Bug: chromium:1179020
> Bug: webrtc:12511
> Change-Id: I97911fde9005ec25028a640a3f007d12f2bbc2e5
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/211349
> Reviewed-by: Rasmus Brandt <brandtr@webrtc.org>
> Reviewed-by: Ilya Nikolaevskiy <ilnik@webrtc.org>
> Commit-Queue: Sergey Silkin <ssilkin@webrtc.org>
> Cr-Commit-Position: refs/heads/master@{#33438}

TBR=brandtr@webrtc.org,ilnik@webrtc.org,ssilkin@webrtc.org,rubber-stamper@appspot.gserviceaccount.com

Change-Id: Id7633a1e98f95762e81487887f83a0c35f89195c
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: chromium:1179020
Bug: webrtc:12511
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/211352
Reviewed-by: Ilya Nikolaevskiy <ilnik@webrtc.org>
Commit-Queue: Ilya Nikolaevskiy <ilnik@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#33439}
2021-03-11 15:14:42 +00:00
Sergey Silkin
0021fe7793 Reland "Enable quality scaling when allowed"
This reverts commit eb449a979b.

Reason for revert: Added QP parsing in https://webrtc.googlesource.com/src/+/8639673f0c098efc294a7593fa3bd98e28ab7508

Original change's description:
Before this CL quality scaling was conditioned on scaling settings
provided by encoder. That should not be a requirement since encoder
may not be aware of quality scaling which is a WebRTC feature. In M90
chromium HW encoders do not provide scaling settings (chromium:1179020).
The default scaling settings provided by these encoders are not correct
(b/181537172).

This CL adds is_quality_scaling_allowed to VideoEncoderConfig. The flag
is set to true in singlecast with normal video feed (not screen sharing)
mode. If quality scaling is allowed it is enabled no matter whether
scaling settings are present in encoder info or not. Setting from
QualityScalingExperiment are used in case if not provided by encoder.

Bug: chromium:1179020
Bug: webrtc:12511
Change-Id: I97911fde9005ec25028a640a3f007d12f2bbc2e5
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/211349
Reviewed-by: Rasmus Brandt <brandtr@webrtc.org>
Reviewed-by: Ilya Nikolaevskiy <ilnik@webrtc.org>
Commit-Queue: Sergey Silkin <ssilkin@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#33438}
2021-03-11 13:43:11 +00:00
Guido Urdaneta
eb449a979b Revert "Reland "Enable quality scaling when allowed""
This reverts commit 83be84bb74.

Reason for revert: Suspect of crbug.com/1185276

Original change's description:
> Reland "Enable quality scaling when allowed"
>
> This reverts commit 609b524dd3.
>
> Reason for revert: Disable QualityScalingAllowed_QualityScalingEnabled on iOS.
>
> Original change's description:
> Before this CL quality scaling was conditioned on scaling settings
> provided by encoder. That should not be a requirement since encoder
> may not be aware of quality scaling which is a WebRTC feature. In M90
> chromium HW encoders do not provide scaling settings (chromium:1179020).
> The default scaling settings provided by these encoders are not correct
> (b/181537172).
>
> This CL adds is_quality_scaling_allowed to VideoEncoderConfig. The flag
> is set to true in singlecast with normal video feed (not screen sharing)
> mode. If quality scaling is allowed it is enabled no matter whether
> scaling settings are present in encoder info or not. Setting from
> QualityScalingExperiment are used in case if not provided by encoder.
>
> Bug: chromium:1179020
> Bug: webrtc:12511
> Change-Id: Ia0923e5a62acdfdeb06f9aad5d670be8a0f8d746
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/209643
> Reviewed-by: Rasmus Brandt <brandtr@webrtc.org>
> Reviewed-by: Ilya Nikolaevskiy <ilnik@webrtc.org>
> Reviewed-by: Åsa Persson <asapersson@webrtc.org>
> Commit-Queue: Sergey Silkin <ssilkin@webrtc.org>
> Cr-Commit-Position: refs/heads/master@{#33385}

Bug: chromium:1179020
Bug: webrtc:12511
Change-Id: I7004014c5936176f8c125aeb55da91ce095b266e
TBR: ssilkin@webrtc.org
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/209708
Reviewed-by: Guido Urdaneta <guidou@webrtc.org>
Commit-Queue: Guido Urdaneta <guidou@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#33393}
2021-03-06 09:40:50 +00:00
Sergey Silkin
83be84bb74 Reland "Enable quality scaling when allowed"
This reverts commit 609b524dd3.

Reason for revert: Disable QualityScalingAllowed_QualityScalingEnabled on iOS.

Original change's description:
Before this CL quality scaling was conditioned on scaling settings
provided by encoder. That should not be a requirement since encoder
may not be aware of quality scaling which is a WebRTC feature. In M90
chromium HW encoders do not provide scaling settings (chromium:1179020).
The default scaling settings provided by these encoders are not correct
(b/181537172).

This CL adds is_quality_scaling_allowed to VideoEncoderConfig. The flag
is set to true in singlecast with normal video feed (not screen sharing)
mode. If quality scaling is allowed it is enabled no matter whether
scaling settings are present in encoder info or not. Setting from
QualityScalingExperiment are used in case if not provided by encoder.

Bug: chromium:1179020
Bug: webrtc:12511
Change-Id: Ia0923e5a62acdfdeb06f9aad5d670be8a0f8d746
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/209643
Reviewed-by: Rasmus Brandt <brandtr@webrtc.org>
Reviewed-by: Ilya Nikolaevskiy <ilnik@webrtc.org>
Reviewed-by: Åsa Persson <asapersson@webrtc.org>
Commit-Queue: Sergey Silkin <ssilkin@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#33385}
2021-03-04 16:01:23 +00:00
Björn Terelius
609b524dd3 Revert "Enable quality scaling when allowed"
This reverts commit 752cbaba90.

Reason for revert: The test VideoStreamEncoderTest.QualityScalingAllowed_QualityScalingEnabled seems to fail on iOS.

Original change's description:
> Enable quality scaling when allowed
>
> Before this CL quality scaling was conditioned on scaling settings
> provided by encoder. That should not be a requirement since encoder
> may not be aware of quality scaling which is a WebRTC feature. In M90
> chromium HW encoders do not provide scaling settings (chromium:1179020).
> The default scaling settings provided by these encoders are not correct
> (b/181537172).
>
> This CL adds is_quality_scaling_allowed to VideoEncoderConfig. The flag
> is set to true in singlecast with normal video feed (not screen sharing)
> mode. If quality scaling is allowed it is enabled no matter whether
> scaling settings are present in encoder info or not. Setting from
> QualityScalingExperiment are used in case if not provided by encoder.
>
> Bug: chromium:1179020, webrtc:12511
> Change-Id: I83d55319ce4b9f4fb143187ced94a16a778b4de3
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/209184
> Reviewed-by: Rasmus Brandt <brandtr@webrtc.org>
> Reviewed-by: Ilya Nikolaevskiy <ilnik@webrtc.org>
> Reviewed-by: Åsa Persson <asapersson@webrtc.org>
> Commit-Queue: Sergey Silkin <ssilkin@webrtc.org>
> Cr-Commit-Position: refs/heads/master@{#33373}

Bug: chromium:1179020
Bug: webrtc:12511
Change-Id: Icabf2d9a034d359f79491f2c37f1044f17a7445d
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/209641
Reviewed-by: Sergey Silkin <ssilkin@webrtc.org>
Commit-Queue: Björn Terelius <terelius@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#33381}
2021-03-04 10:11:36 +00:00
Sergey Silkin
752cbaba90 Enable quality scaling when allowed
Before this CL quality scaling was conditioned on scaling settings
provided by encoder. That should not be a requirement since encoder
may not be aware of quality scaling which is a WebRTC feature. In M90
chromium HW encoders do not provide scaling settings (chromium:1179020).
The default scaling settings provided by these encoders are not correct
(b/181537172).

This CL adds is_quality_scaling_allowed to VideoEncoderConfig. The flag
is set to true in singlecast with normal video feed (not screen sharing)
mode. If quality scaling is allowed it is enabled no matter whether
scaling settings are present in encoder info or not. Setting from
QualityScalingExperiment are used in case if not provided by encoder.

Bug: chromium:1179020, webrtc:12511
Change-Id: I83d55319ce4b9f4fb143187ced94a16a778b4de3
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/209184
Reviewed-by: Rasmus Brandt <brandtr@webrtc.org>
Reviewed-by: Ilya Nikolaevskiy <ilnik@webrtc.org>
Reviewed-by: Åsa Persson <asapersson@webrtc.org>
Commit-Queue: Sergey Silkin <ssilkin@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#33373}
2021-03-03 13:57:22 +00:00
Tomas Gunnarsson
8408c9938c Remove 'secondary sink' concept from webrtc::VideoReceiveStream.
In practice, support for multiple sinks is not needed and supporting
the API that allows for dynamically adding/removing sinks at runtime,
adds to the complexity of the implementation.

This CL removes that Add/Remove methods for secondary sinks as well
as vectors of callback pointers (which were either of size 0 or 1).
Instead, an optional callback pointer is added to the config struct
for VideoReceiveStream, that an implementation can consider to be
const and there's not a need to do thread synchronization for that
pointer for every network packet.

As part of webrtc:11993, this simplifies the work towards keeping
the processing of network packets on the network thread. The secondary
sinks, currently operate on the worker thread.

Bug: webrtc:11993
Change-Id: I10c473e57d3809527a1b689f4352e903a4c78168
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/207421
Commit-Queue: Tommi <tommi@webrtc.org>
Reviewed-by: Rasmus Brandt <brandtr@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#33272}
2021-02-15 18:08:17 +00:00
Philipp Hancke
e71b55fb27 build: merge media_constants and engine_constants
no functional changes
BUG=None

Change-Id: I994cf7de6fdbf5505ed3359e08700cac5ea9fe3f
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/202022
Commit-Queue: Niels Moller <nisse@webrtc.org>
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Reviewed-by: Niels Moller <nisse@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#33246}
2021-02-12 11:20:45 +00:00
Tomas Gunnarsson
33c0ab4948 Call MediaChannel::OnPacketReceived on the network thread.
Functionality wise, there should be no change with this CL, aside
from updating tests to anticipate OnPacketReceived to handle the packet
asynchronously (as already was the case via BaseChannel).

This only removes the network->worker hop out of the BaseChannel
class into the WebRTC MediaChannel implementations. However, it updates
the interface contract between BaseChannel and MediaChannel to align
with how we want things to work down the line, i.e. avoid hopping to
the worker thread for every rtp packet.

The following steps will be to update the video and voice channel
classes to call Call::DeliverPacket on the network thread and only
handle unsignalled SSRCs on the worker (exception case).

Bug: webrtc:11993
Change-Id: If0540874444565dc93773aee89d862f3bfc9c502
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/202242
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Commit-Queue: Tommi <tommi@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#33040}
2021-01-19 20:55:14 +00:00
Danil Chapovalov
e15dc58f32 Use rtc::CopyOnWriteBuffer::MutableData through webrtc
where mutable access is required.

Bug: webrtc:12334
Change-Id: I4b2b74f836aaf7f12278c3569d0d49936297716b
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/198846
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Reviewed-by: Erik Språng <sprang@webrtc.org>
Commit-Queue: Danil Chapovalov <danilchap@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#32936}
2021-01-11 11:31:33 +00:00
Harsh Maniar
064be38380 Reland "Enable FlexFEC as a receiver video codec by default"
This is a reland of f08db1be94

Original change's description:
> Enable FlexFEC as a receiver video codec by default
>
> - Add Flex FEC format as default supported receive codec
> - Disallow advertising FlexFEC as video sender codec by default until implementation is complete
> - Toggle field trial "WebRTC-FlexFEC-03-Advertised"s behavior for receiver to use as kill-switch to prevent codec advertising
>
> Bug: webrtc:8151
> Change-Id: Iff367119263496fb335500e96641669654b45834
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/191947
> Commit-Queue: Christoffer Rodbro <crodbro@webrtc.org>
> Reviewed-by: Ying Wang <yinwa@webrtc.org>
> Reviewed-by: Christoffer Rodbro <crodbro@webrtc.org>
> Reviewed-by: Stefan Holmer <stefan@webrtc.org>
> Cr-Commit-Position: refs/heads/master@{#32639}

Bug: webrtc:8151
Change-Id: I36cbe833dc2131d72f1d7e8f96d058d0caa94ff9
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/195363
Reviewed-by: Christoffer Rodbro <crodbro@webrtc.org>
Reviewed-by: Stefan Holmer <stefan@webrtc.org>
Commit-Queue: Christoffer Rodbro <crodbro@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#32819}
2020-12-11 16:01:27 +00:00
Philipp Hancke
5c4c836ac4 use [35,65] rtp payload type range for new codecs
Changes the video payload type allocation to use the
lower dynamic payload type range [35,65] described in
  https://www.iana.org/assignments/rtp-parameters/rtp-parameters.xhtml#rtp-parameters-1
for new codecs such as FlexFEC.

BUG=webrtc:12194

Change-Id: I71782199074e0fc94fa6aa8c36afeb68221a2839
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/195822
Commit-Queue: Harald Alvestrand <hta@webrtc.org>
Reviewed-by: Ilya Nikolaevskiy <ilnik@webrtc.org>
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#32799}
2020-12-08 14:56:44 +00:00
Philipp Hancke
6562109fc9 test: do not consider flexfec-03 a normal codec
BUG=None

Change-Id: I5d3720202893d73d467aac0288bc5fdef52f79e8
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/194262
Reviewed-by: Christoffer Rodbro <crodbro@webrtc.org>
Reviewed-by: Erik Språng <sprang@webrtc.org>
Commit-Queue: Christoffer Rodbro <crodbro@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#32726}
2020-12-01 10:23:26 +00:00
Ilya Nikolaevskiy
d3811947e6 Adjust min bitrate for the first active stream
Without this change, if the user disables QVGA and VGA streams via |active|
flags in SetParamters, the resulting stream would have too high min bitrate.
This would lead to bad performance and low quality adaptation rate.

Bug: none
Change-Id: I919a30bfb248c06747c989afe6965b3afaef2260
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/195325
Reviewed-by: Åsa Persson <asapersson@webrtc.org>
Commit-Queue: Ilya Nikolaevskiy <ilnik@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#32706}
2020-11-26 17:36:45 +00:00
Mirko Bonadei
ce4be1e640 Revert "Enable FlexFEC as a receiver video codec by default"
This reverts commit f08db1be94.

Reason for revert: It looks like this breaks Chromium FYI Windows bots.

See https://ci.chromium.org/p/chromium/builders/webrtc.fyi/WebRTC%20Chromium%20FYI%20Win10%20Tester/6988.

If this is not the culprit I will reland.

Original change's description:
> Enable FlexFEC as a receiver video codec by default
>
> - Add Flex FEC format as default supported receive codec
> - Disallow advertising FlexFEC as video sender codec by default until implementation is complete
> - Toggle field trial "WebRTC-FlexFEC-03-Advertised"s behavior for receiver to use as kill-switch to prevent codec advertising
>
> Bug: webrtc:8151
> Change-Id: Iff367119263496fb335500e96641669654b45834
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/191947
> Commit-Queue: Christoffer Rodbro <crodbro@webrtc.org>
> Reviewed-by: Ying Wang <yinwa@webrtc.org>
> Reviewed-by: Christoffer Rodbro <crodbro@webrtc.org>
> Reviewed-by: Stefan Holmer <stefan@webrtc.org>
> Cr-Commit-Position: refs/heads/master@{#32639}

TBR=brandtr@webrtc.org,tommi@webrtc.org,stefan@webrtc.org,crodbro@webrtc.org,crodbro@google.com,yinwa@webrtc.org,philipp.hancke@googlemail.com,hmaniar@nvidia.com

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

Bug: webrtc:8151
Change-Id: Ia1788a1cf34e0fc9500a081552f6ed03d0995d5b
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/194334
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#32657}
2020-11-20 20:31:39 +00:00
Harsh Maniar
f08db1be94 Enable FlexFEC as a receiver video codec by default
- Add Flex FEC format as default supported receive codec
- Disallow advertising FlexFEC as video sender codec by default until implementation is complete
- Toggle field trial "WebRTC-FlexFEC-03-Advertised"s behavior for receiver to use as kill-switch to prevent codec advertising

Bug: webrtc:8151
Change-Id: Iff367119263496fb335500e96641669654b45834
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/191947
Commit-Queue: Christoffer Rodbro <crodbro@webrtc.org>
Reviewed-by: Ying Wang <yinwa@webrtc.org>
Reviewed-by: Christoffer Rodbro <crodbro@webrtc.org>
Reviewed-by: Stefan Holmer <stefan@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#32639}
2020-11-19 13:47:28 +00:00
Per Kjellander
70c8945c15 Offer VideoLayersAllocation if field trial enabled
Enable using the field trial WebRTC-VideoLayersAllocationAdvertised/Enabled/

Bug: webrtc:1200
Change-Id: I7c1d94c6051aace8d22c16e0f2e2256dd7ade7fd
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/189960
Commit-Queue: Per Kjellander <perkj@webrtc.org>
Reviewed-by: Erik Språng <sprang@webrtc.org>
Reviewed-by: Danil Chapovalov <danilchap@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#32465}
2020-10-21 15:40:09 +00:00
Danil Chapovalov
44f749dac6 Advertise dependency descriptor rtp header extension behind a field trial
Bug: webrtc:10342
Change-Id: I7020f9a56e09e90e78850935765da5e4dff8ff66
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/188382
Reviewed-by: Erik Språng <sprang@webrtc.org>
Commit-Queue: Danil Chapovalov <danilchap@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#32401}
2020-10-14 12:14:17 +00:00
Yun Zhang
c401923f3e Take max bitrate into account for target bitrate decision when min bitrate is empty
Currently, when only max bitrate available and min bitratea & target
bitrate are missing from encoding config, the target bitrate is decided
by the calculation from GetSimulcastConfig() according to width/height/qp.
The max bitrate doesn't play a role here other than ensure target < max.
This will make the target bitrate cap at some calculated number even
when control message gives much larger allocation through max bitrate.

In our cases, the L0 (at 180p) is capped at 80-90kbps even control
message gives L0's max bitrate over 300kbps. This under-use of bandwidth
happens to all layer other than top layer. Top layer will be compensated
with all the left bandwidth up to max at last.

Since in web api, we cannot pass down either min bitrate or target bitrate
(https://developer.mozilla.org/en-US/docs/Web/API/RTCRtpEncodingParameters).
We propose a new logic to take max bitrate into consideration in this case,
use 3/4 max bitrate or calculated target bitrate whichever is larger.

Bug: None
Change-Id: I2234b4636daa379fd47d4bbe764cf8307b9a1ea4
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/186161
Reviewed-by: Ilya Nikolaevskiy <ilnik@webrtc.org>
Reviewed-by: Rasmus Brandt <brandtr@webrtc.org>
Commit-Queue: Ilya Nikolaevskiy <ilnik@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#32308}
2020-10-05 11:11:51 +00:00
Erik Språng
ceb44959ca Reland: Wires up WebrtcKeyValueBasedConfig in media engines.
This is a reland of
https://webrtc-review.googlesource.com/c/src/+/174261

Patchset 1 contains the old cl (plus a merge conflict fix).
Later patchets are bufixes: A PeerConnection can be created without a
Call instance (in the case of DataChannel only), so we can't always
use that to fetch the current trials.

Old CL descritpion:

This replaces field_trial:: -based functions from system_wrappers.
Field trials are still used as fallback, but injectable trials are now
possible.

// Since re-land is otherwise unchanged, setting previous reviewers as TBR
TBR=kthelgason@webrtc.org,mbonadei@webrtc.org,stefan@webrtc.org,srte@webrtc.org

Bug: webrtc:11926
Change-Id: I57a9e8c3454f226f77fb93215bcac83da65034b0
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/185003
Commit-Queue: Erik Språng <sprang@webrtc.org>
Reviewed-by: Per Kjellander <perkj@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#32163}
2020-09-22 16:08:22 +00:00
Artem Titov
5956a17ed6 Revert "Wires up WebrtcKeyValueBasedConfig in media engines."
This reverts commit 591b2ab82e.

Reason for revert: Breaks downstream project

Original change's description:
> Wires up WebrtcKeyValueBasedConfig in media engines.
> 
> This replaces field_trial:: -based functions from system_wrappers.
> Field trials are still used as fallback, but injectable trials are now
> possible.
> 
> Bug: webrtc:11926
> Change-Id: I70f28c4fbabf6d9e55052342000e38612b46682c
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/174261
> Reviewed-by: Per Kjellander <perkj@webrtc.org>
> Reviewed-by: Kári Helgason <kthelgason@webrtc.org>
> Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
> Reviewed-by: Stefan Holmer <stefan@webrtc.org>
> Reviewed-by: Sebastian Jansson <srte@webrtc.org>
> Commit-Queue: Erik Språng <sprang@webrtc.org>
> Cr-Commit-Position: refs/heads/master@{#32129}

TBR=mbonadei@webrtc.org,kthelgason@webrtc.org,sprang@webrtc.org,stefan@webrtc.org,srte@webrtc.org,perkj@webrtc.org

Change-Id: I3e169149a8b787aa6366bb357abb71794534c63a
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: webrtc:11926
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/184507
Reviewed-by: Artem Titov <titovartem@webrtc.org>
Commit-Queue: Artem Titov <titovartem@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#32132}
2020-09-17 20:17:38 +00:00
Erik Språng
591b2ab82e Wires up WebrtcKeyValueBasedConfig in media engines.
This replaces field_trial:: -based functions from system_wrappers.
Field trials are still used as fallback, but injectable trials are now
possible.

Bug: webrtc:11926
Change-Id: I70f28c4fbabf6d9e55052342000e38612b46682c
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/174261
Reviewed-by: Per Kjellander <perkj@webrtc.org>
Reviewed-by: Kári Helgason <kthelgason@webrtc.org>
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Reviewed-by: Stefan Holmer <stefan@webrtc.org>
Reviewed-by: Sebastian Jansson <srte@webrtc.org>
Commit-Queue: Erik Språng <sprang@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#32129}
2020-09-17 16:24:10 +00:00
Byoungchan Lee
444c13c078 Fix tests in WebRtcVideoChannelBaseTest.
If rtc_libvpx_build_vp9=false, some tests fail because
BuiltinVideoEncoderFactory / DecoderFactory doesn't support VP9.

Bug: webrtc:11901
Change-Id: Iaa97950e70e1f70cdeb6ef677786e0fd115a75db
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/183220
Reviewed-by: Niels Moller <nisse@webrtc.org>
Commit-Queue: Niels Moller <nisse@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#32028}
2020-09-02 09:58:25 +00:00
Niels Möller
2b781bf908 Deprecate write-only member CodecInfo::is_hardware_accelerated
This member of the CodecInfo struct was set in several places, but not
used for anything. To aid deletion, this cl defines a default implementation
of VideoEncoderFactory::QueryVideoEncoder.

The next step is to delete almost all downstream implementations of that method,
since the only classes that have to implement it are the few factories that
produce "internal source" encoders, e.g., for Chromium remoting.

Bug: None
Change-Id: I1f0dbf0d302933004ebdc779460cb2cb3a894e02
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/179520
Reviewed-by: Kári Helgason <kthelgason@webrtc.org>
Reviewed-by: Sami Kalliomäki <sakal@webrtc.org>
Reviewed-by: Sebastian Jansson <srte@webrtc.org>
Commit-Queue: Niels Moller <nisse@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#31844}
2020-08-04 07:56:49 +00:00
Niels Möller
2a70703eb8 Delete MediaTransportInterface and DatagramTransportInterface
Bug: webrtc:9719
Change-Id: Ic9936a78ab42f4a9bb4cc3265f0a2cf36946558f
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/176500
Reviewed-by: Stefan Holmer <stefan@webrtc.org>
Reviewed-by: Taylor <deadbeef@webrtc.org>
Reviewed-by: Christoffer Rodbro <crodbro@webrtc.org>
Commit-Queue: Niels Moller <nisse@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#31536}
2020-06-17 08:41:14 +00:00
philipel
9465978a3b Remove framemarking RTP extension.
BUG=webrtc:11637

Change-Id: I47f8e22473429c9762956444e27cfbafb201b208
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/176442
Commit-Queue: Philip Eliasson <philipel@webrtc.org>
Reviewed-by: Tommi <tommi@webrtc.org>
Reviewed-by: Danil Chapovalov <danilchap@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#31522}
2020-06-15 11:18:00 +00:00
Henrik Boström
e917379c5b [Stats] Don't attempt to aggregate empty VideoSenderInfos.
This fixes a crash that could happen if substreams exist but there is
no kMedia substream yet. There was an assumption that we either had no
substreams or at least one kMedia substream, but this was not true.
The correct thing to do is to ignore substream stats that are not
associated with any kMedia substream, because we only produce
"outbound-rtp" stats objects for existing kMedia substreams.

A test is added to make sure no stats are returned. Prior to the fix,
this test would crash.

Bug: chromium:1090712
Change-Id: Ib1f8494a162542ae56bdd2df7618775a3473419b
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/176446
Commit-Queue: Henrik Boström <hbos@webrtc.org>
Reviewed-by: Erik Språng <sprang@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#31442}
2020-06-04 09:03:52 +00:00
Danil Chapovalov
f2c0f15282 In media/ and modules/video_coding replace mock macros with unified MOCK_METHOD macro
Bug: webrtc:11564
Change-Id: I5c7f5dc99e62619403ed726c23201ab4fbd37cbe
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/175647
Reviewed-by: Ilya Nikolaevskiy <ilnik@webrtc.org>
Commit-Queue: Danil Chapovalov <danilchap@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#31340}
2020-05-25 08:46:30 +00:00
Danil Chapovalov
fc11519c92 Cleanup mocks in api/test
Modernise functions to unified MOCK_METHOD macro,
delete few deprecated functions on the way.
add one missing function (in MockEncodedImageCallback)
Remove proxy mock function (in MockVideoBitrateAllocatorFactory)

Remove default constructors and destructors

Bug: None
Change-Id: Ibebb0d9e3c9be5877649af7bde8b87222ddf04fb
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/174751
Reviewed-by: Ilya Nikolaevskiy <ilnik@webrtc.org>
Reviewed-by: Sebastian Jansson <srte@webrtc.org>
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Commit-Queue: Danil Chapovalov <danilchap@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#31195}
2020-05-08 20:01:03 +00:00
Danil Chapovalov
b63331bb8f Cleanup mocks for Video (en|de)coder factories
In particular remove proxy mocks in favor of lambdas and Return(ByMove(...))

Bug: None
Change-Id: If6b79601437e82a7116479d128d538e965622fab
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/174701
Reviewed-by: Ilya Nikolaevskiy <ilnik@webrtc.org>
Reviewed-by: Sebastian Jansson <srte@webrtc.org>
Commit-Queue: Danil Chapovalov <danilchap@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#31179}
2020-05-07 11:58:50 +00:00
Henrik Boström
a0ff50c031 Reland "Improve outbound-rtp statistics for simulcast"
This reverts commit 9a925c9ce3.

Reason for revert: The original CL is updated in PS #2 to
fix the googRtt issue which was that when the legacy sender
stats were put in "aggregated_senders" we forgot to update
rtt_ms the same way that we do it for "senders".

Original change's description:
> Revert "Improve outbound-rtp statistics for simulcast"
>
> This reverts commit da6cda839d.
>
> Reason for revert: Breaks googRtt in legacy getStats API
>
> Original change's description:
> > Improve outbound-rtp statistics for simulcast
> >
> > Bug: webrtc:9547
> > Change-Id: Iec4eb976aa11ee743805425bedb77dcea7c2c9be
> > Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/168120
> > Reviewed-by: Sebastian Jansson <srte@webrtc.org>
> > Reviewed-by: Erik Språng <sprang@webrtc.org>
> > Reviewed-by: Henrik Boström <hbos@webrtc.org>
> > Reviewed-by: Harald Alvestrand <hta@webrtc.org>
> > Commit-Queue: Eldar Rello <elrello@microsoft.com>
> > Cr-Commit-Position: refs/heads/master@{#31097}
>
> TBR=hbos@webrtc.org,sprang@webrtc.org,stefan@webrtc.org,srte@webrtc.org,hta@webrtc.org,elrello@microsoft.com
>
> # Not skipping CQ checks because original CL landed > 1 day ago.
>
> Bug: webrtc:9547
> Change-Id: I06673328c2a5293a7eef03b3aaf2ded9d13df1b3
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/174443
> Reviewed-by: Henrik Boström <hbos@webrtc.org>
> Commit-Queue: Henrik Boström <hbos@webrtc.org>
> Cr-Commit-Position: refs/heads/master@{#31165}

TBR=hbos@webrtc.org,sprang@webrtc.org,stefan@webrtc.org,srte@webrtc.org,hta@webrtc.org,elrello@microsoft.com

# Not skipping CQ checks because this is a reland.

Bug: webrtc:9547
Change-Id: I723744c496c3c65f95ab6a8940862c8b9f544338
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/174480
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Reviewed-by: Henrik Boström <hbos@webrtc.org>
Commit-Queue: Henrik Boström <hbos@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#31169}
2020-05-05 20:22:19 +00:00
Henrik Boström
9a925c9ce3 Revert "Improve outbound-rtp statistics for simulcast"
This reverts commit da6cda839d.

Reason for revert: Breaks googRtt in legacy getStats API

Original change's description:
> Improve outbound-rtp statistics for simulcast
> 
> Bug: webrtc:9547
> Change-Id: Iec4eb976aa11ee743805425bedb77dcea7c2c9be
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/168120
> Reviewed-by: Sebastian Jansson <srte@webrtc.org>
> Reviewed-by: Erik Språng <sprang@webrtc.org>
> Reviewed-by: Henrik Boström <hbos@webrtc.org>
> Reviewed-by: Harald Alvestrand <hta@webrtc.org>
> Commit-Queue: Eldar Rello <elrello@microsoft.com>
> Cr-Commit-Position: refs/heads/master@{#31097}

TBR=hbos@webrtc.org,sprang@webrtc.org,stefan@webrtc.org,srte@webrtc.org,hta@webrtc.org,elrello@microsoft.com

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

Bug: webrtc:9547
Change-Id: I06673328c2a5293a7eef03b3aaf2ded9d13df1b3
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/174443
Reviewed-by: Henrik Boström <hbos@webrtc.org>
Commit-Queue: Henrik Boström <hbos@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#31165}
2020-05-05 13:38:51 +00:00
Eldar Rello
da6cda839d Improve outbound-rtp statistics for simulcast
Bug: webrtc:9547
Change-Id: Iec4eb976aa11ee743805425bedb77dcea7c2c9be
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/168120
Reviewed-by: Sebastian Jansson <srte@webrtc.org>
Reviewed-by: Erik Språng <sprang@webrtc.org>
Reviewed-by: Henrik Boström <hbos@webrtc.org>
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Commit-Queue: Eldar Rello <elrello@microsoft.com>
Cr-Commit-Position: refs/heads/master@{#31097}
2020-04-17 11:28:00 +00:00
Rasmus Brandt
de6fa1ef29 Reland "Let WebRtcVideoChannel::ResetUnsignaledRecvStream delete all default streams."
This is a reland of d335426a39.

The revert was premature: the failing tests were known to be flaky
(crbug.com/1066515, crbug.com/1066453, crbug.com/1066407, crbug.com/1066399)

Original change's description:
> Let WebRtcVideoChannel::ResetUnsignaledRecvStream delete all default streams.
>
> This CL changes WebRtcVideoChannel::ResetUnsignaledRecvStream so
> that it deletes all default streams created by
> WebRtcVideoChannel::AddRecvStream. This is needed for the case that
> there are lingering default streams, whose SSRCs are different
> from the SSRCs that were subsequently signaled. This can happen
> when there are multiple "m= sections" and the early media is
> sent to an "m= section" that is later not supposed to be the
> sink for that particular SSRC.
>
> Default streams whose SSRC match the subsequently signaled
> SSRC is already handled here: https://source.chromium.org/chromium/chromium/src/+/master:third_party/webrtc/media/engine/webrtc_video_engine.cc;l=1386;drc=22387b44ff173d263b434889d394cea90368ab06?originalUrl=https:%2F%2Fcs.chromium.org%2F
>
> Bug: webrtc:11477
> Change-Id: I96ed7e35b4904fb0757fe5824f8afa6f1b9a565e
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/172622
> Reviewed-by: Harald Alvestrand <hta@webrtc.org>
> Reviewed-by: Magnus Flodman <mflodman@webrtc.org>
> Commit-Queue: Rasmus Brandt <brandtr@webrtc.org>
> Cr-Commit-Position: refs/heads/master@{#30971}

TBR=mflodman@webrtc.org,hta@webrtc.org

Bug: webrtc:11477
Change-Id: I70b8fa47b4d1d0aa36fed4d8612e13fa7f992925
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/172782
Reviewed-by: Rasmus Brandt <brandtr@webrtc.org>
Commit-Queue: Rasmus Brandt <brandtr@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#30986}
2020-04-02 16:08:26 +00:00
Rasmus Brandt
c6b2f34f35 Revert "Let WebRtcVideoChannel::ResetUnsignaledRecvStream delete all default streams."
This reverts commit d335426a39.

Reason for revert: Breaking RTCPeerConnectionTest.GetTrackRemoveStreamAndGCAll.

Original change's description:
> Let WebRtcVideoChannel::ResetUnsignaledRecvStream delete all default streams.
> 
> This CL changes WebRtcVideoChannel::ResetUnsignaledRecvStream so
> that it deletes all default streams created by
> WebRtcVideoChannel::AddRecvStream. This is needed for the case that
> there are lingering default streams, whose SSRCs are different
> from the SSRCs that were subsequently signaled. This can happen
> when there are multiple "m= sections" and the early media is
> sent to an "m= section" that is later not supposed to be the
> sink for that particular SSRC.
> 
> Default streams whose SSRC match the subsequently signaled
> SSRC is already handled here: https://source.chromium.org/chromium/chromium/src/+/master:third_party/webrtc/media/engine/webrtc_video_engine.cc;l=1386;drc=22387b44ff173d263b434889d394cea90368ab06?originalUrl=https:%2F%2Fcs.chromium.org%2F
> 
> Bug: webrtc:11477
> Change-Id: I96ed7e35b4904fb0757fe5824f8afa6f1b9a565e
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/172622
> Reviewed-by: Harald Alvestrand <hta@webrtc.org>
> Reviewed-by: Magnus Flodman <mflodman@webrtc.org>
> Commit-Queue: Rasmus Brandt <brandtr@webrtc.org>
> Cr-Commit-Position: refs/heads/master@{#30971}

TBR=brandtr@webrtc.org,mflodman@webrtc.org,hta@webrtc.org

Change-Id: I41dc2ea2fc43bb3f7cca2fc5e946c58baa54e00a
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: webrtc:11477
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/172760
Reviewed-by: Rasmus Brandt <brandtr@webrtc.org>
Commit-Queue: Rasmus Brandt <brandtr@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#30979}
2020-04-02 12:26:19 +00:00
Rasmus Brandt
d335426a39 Let WebRtcVideoChannel::ResetUnsignaledRecvStream delete all default streams.
This CL changes WebRtcVideoChannel::ResetUnsignaledRecvStream so
that it deletes all default streams created by
WebRtcVideoChannel::AddRecvStream. This is needed for the case that
there are lingering default streams, whose SSRCs are different
from the SSRCs that were subsequently signaled. This can happen
when there are multiple "m= sections" and the early media is
sent to an "m= section" that is later not supposed to be the
sink for that particular SSRC.

Default streams whose SSRC match the subsequently signaled
SSRC is already handled here: https://source.chromium.org/chromium/chromium/src/+/master:third_party/webrtc/media/engine/webrtc_video_engine.cc;l=1386;drc=22387b44ff173d263b434889d394cea90368ab06?originalUrl=https:%2F%2Fcs.chromium.org%2F

Bug: webrtc:11477
Change-Id: I96ed7e35b4904fb0757fe5824f8afa6f1b9a565e
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/172622
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Reviewed-by: Magnus Flodman <mflodman@webrtc.org>
Commit-Queue: Rasmus Brandt <brandtr@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#30971}
2020-04-02 09:05:43 +00:00
Johannes Kron
3e98368ec5 Reland "Distinguish between send and receive codecs"
This reverts commit 8e8b36a94a.

Reason for revert: The CL has been improved with the following changes,
  - Fixed negotiation of send/receive only clients.
  - Handles the implicit assumption that any H264 decoder also can
    decode H264 constraint baseline.

Original change's description:
> Distinguish between send and receive codecs
>
> Even though send and receive codecs may be the same, they might have
> different support in HW. Distinguish between send and receive codecs
> to be able to keep track of which codecs have HW support.
>
> Bug: chromium:1029737
> Change-Id: Id119560becadfe0aaf861c892a6485f1c2eb378d
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/165763
> Commit-Queue: Johannes Kron <kron@webrtc.org>
> Reviewed-by: Steve Anton <steveanton@webrtc.org>
> Cr-Commit-Position: refs/heads/master@{#30284}

Change-Id: I834ed48ee78d04922c73e2836165e476925e1cc5
Bug: chromium:1029737
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/168605
Commit-Queue: Johannes Kron <kron@webrtc.org>
Reviewed-by: Ilya Nikolaevskiy <ilnik@webrtc.org>
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Reviewed-by: Johannes Kron <kron@webrtc.org>
Reviewed-by: Henrik Boström <hbos@webrtc.org>
Reviewed-by: Sergey Silkin <ssilkin@webrtc.org>
Reviewed-by: Steve Anton <steveanton@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#30932}
2020-03-29 21:03:27 +00:00
Henrik Boström
f45ca3787f [Stats] Explicit RTP-RTX and RTP-FEC mappings. Unblocks simulcast stats.
--- Background ---
The webrtc::VideoSendStream::StreamStats are converted into
VideoSenderInfo objects which turn into "outbound-rtp" stats objects in
getStats() (or "ssrc" objects in legacy getStats()).

StreamStats are created for each type of substream: RTP media streams,
RTX streams and FlexFEC streams - each with individual packet counters.

The RTX stream is responsible for retransmissions of a referenced media
stream and the FlexFEC stream is responsible for FEC of a referenced
media stream. RTX/FEC streams do not show up as separate objects in
getStats(). Only the media streams become "outbound-rtp" objects, but
their packet and byte counters have to include the RTX and FEC counters.

--- Overview of this CL ---
This CL adds MergeInfoAboutOutboundRtpSubstreams(). It takes
StreamStats of all kinds as input, and outputs media-only StreamStats
- incorporating the RTX and FEC counters into the relevant media
StreamStats.

The merged StreamStats objects is a smaller set of objects than the
non-merged counterparts, but when aggregating all packet counters
together we end up with exact same packet and count as before.

Because WebRtcVideoSendStream::GetVideoSenderInfo() currently aggregates
the StreamStats into a single VideoSenderInfo (single "outbound-rtp"),
this CL should not have any observable side-effects. Prior to this CL:
aggregate StreamStats. After this CL: merge StreamStats and then
aggregate them.

However, when simulcast stats are implemented (WIP CL:
https://webrtc-review.googlesource.com/c/src/+/168120) each RTP media
stream should turn into an individual "outbound-rtp" object. We will
then no longer aggregate all StreamStats into a single "info". This CL
unblocks simulcast stats by providing StreamStats objects that could be
turned into individual VideoSenderInfos.

--- The Changes ---
1. Methods added to RtpConfig to be able to easily tell the relationship
   between RTP, RTX and FEC ssrcs.
2. StreamStats gets a StreamType (kMedia, kRtx or kFlexfec) that
   replaces the booleans (is_rtx, is_flexfec).
3. "referenced_media_ssrc" is added to StreamStats, making it possible
   to tell which kRtx/kFlexFec stream stats need to be merged with which
   kMedia StreamStats.
4. MergeInfoAboutOutboundRtpSubstreams() added and used.

Bug: webrtc:11439
Change-Id: Iaf9002041169a054ddfd32c7ea06bd1dc36c6bca
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/170826
Commit-Queue: Henrik Boström <hbos@webrtc.org>
Reviewed-by: Ilya Nikolaevskiy <ilnik@webrtc.org>
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Reviewed-by: Stefan Holmer <stefan@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#30869}
2020-03-24 13:31:54 +00:00
Henrik Boström
fc29b0ad46 [Stats] Include RTX retransmissions in the VideoSenderInfo.
Ignoring retransmissions carried over the RTX stream was a bug. This CL
fixes the bug, so that all retransmissions are accounted for. It also
adds test coverage for this.

This resolves https://crbug.com/webrtc/11440 but does not resolve
https://crbug.com/webrtc/11439.

Bug: webrtc:11440, webrtc:11439
Change-Id: Ifb10aa60a0f453738aaa30de90eaa5b31f9ec265
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/170639
Reviewed-by: Ilya Nikolaevskiy <ilnik@webrtc.org>
Commit-Queue: Henrik Boström <hbos@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#30822}
2020-03-18 17:25:16 +00:00
Markus Handell
8bc8834029 webrtc_video_engine_unittest.cc: fix using directives.
There was quite a lot of excessive qualification in the test code.
Cleaned up by adding a few using directives.

BUG=None

Change-Id: I03487f457f15f663acf276ce2a4a9cbbc9804101
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/170467
Commit-Queue: Markus Handell <handellm@webrtc.org>
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#30806}
2020-03-16 21:08:11 +00:00