Commit graph

265 commits

Author SHA1 Message Date
Jim Gustafson
1357e97179
Fix some comment blocks for easier merging 2024-06-21 13:52:48 -07:00
Per K
9c166e064f Remove VideoSendStream::StartPerRtpStream
Instead, always use VideoSendStream::Start.

VideoSendStream::StartPerRtpStream was used for controlling if
individual rtp stream for a RtpEncodingParameter should be able to send RTP packets. It was not used for controlling the actual encoder layers.

With this change RtpEncodingParameter.active still controls actual encoder layers but it does not control if RTP packets can be sent or not.

The cleanup is done to simplify code and in the future allow sending
probe packet on a RtpTransceiver that allows sending, regardless of the
RtpEncodingParameter.active flag.

Bug: webrtc:14928
Change-Id: I896c055ed4de76db58d76f452147c29783f77ae1
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/335042
Reviewed-by: Henrik Boström <hbos@webrtc.org>
Reviewed-by: Erik Språng <sprang@webrtc.org>
Commit-Queue: Per Kjellander <perkj@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#41619}
2024-01-26 09:19:50 +00:00
Philipp Hancke
de17252e8e Reland "Unify access to SDP codec parameters"
This is a reland of commit 63d03f586b

Original change's description:
> Unify access to SDP codec parameters
>
> which come from the a=fmtp:<pt> lines in the SDP and were used as either
>   std::map<std::string, std:string>
> with three aliases,
>   cricket::CodecParameterMap
>   SdpAudioFormat::Parameters
>   SdpVideoFormat::Parameters
>
> Use webrtc::CodecParameterMap in all places.
>
> BUG=None
>
> Change-Id: If47692bde7347834c349c6539b43309d8770e67b
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/330420
> Reviewed-by: Florent Castelli <orphis@webrtc.org>
> Reviewed-by: Harald Alvestrand <hta@webrtc.org>
> Commit-Queue: Philipp Hancke <phancke@microsoft.com>
> Cr-Commit-Position: refs/heads/main@{#41375}

Bug: None
Change-Id: I5f8f45688df232eb37b12fa3e56a893a1c754e17
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/331402
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Reviewed-by: Florent Castelli <orphis@webrtc.org>
Commit-Queue: Philipp Hancke <phancke@microsoft.com>
Cr-Commit-Position: refs/heads/main@{#41467}
2024-01-03 12:03:11 +00:00
Mirko Bonadei
6c9c958c69 Revert "Unify access to SDP codec parameters"
This reverts commit 63d03f586b.

Reason for revert: Breaks downstream project (not backwards compatible API change)

Original change's description:
> Unify access to SDP codec parameters
>
> which come from the a=fmtp:<pt> lines in the SDP and were used as either
>   std::map<std::string, std:string>
> with three aliases,
>   cricket::CodecParameterMap
>   SdpAudioFormat::Parameters
>   SdpVideoFormat::Parameters
>
> Use webrtc::CodecParameterMap in all places.
>
> BUG=None
>
> Change-Id: If47692bde7347834c349c6539b43309d8770e67b
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/330420
> Reviewed-by: Florent Castelli <orphis@webrtc.org>
> Reviewed-by: Harald Alvestrand <hta@webrtc.org>
> Commit-Queue: Philipp Hancke <phancke@microsoft.com>
> Cr-Commit-Position: refs/heads/main@{#41375}

Bug: None
Change-Id: I841735d98533d3b66850b9cfcf7ee0a99ddde078
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/331400
Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org>
Auto-Submit: Mirko Bonadei <mbonadei@webrtc.org>
Owners-Override: Mirko Bonadei <mbonadei@webrtc.org>
Bot-Commit: rubber-stamper@appspot.gserviceaccount.com <rubber-stamper@appspot.gserviceaccount.com>
Cr-Commit-Position: refs/heads/main@{#41377}
2023-12-13 16:28:44 +00:00
Philipp Hancke
63d03f586b Unify access to SDP codec parameters
which come from the a=fmtp:<pt> lines in the SDP and were used as either
  std::map<std::string, std:string>
with three aliases,
  cricket::CodecParameterMap
  SdpAudioFormat::Parameters
  SdpVideoFormat::Parameters

Use webrtc::CodecParameterMap in all places.

BUG=None

Change-Id: If47692bde7347834c349c6539b43309d8770e67b
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/330420
Reviewed-by: Florent Castelli <orphis@webrtc.org>
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Commit-Queue: Philipp Hancke <phancke@microsoft.com>
Cr-Commit-Position: refs/heads/main@{#41375}
2023-12-13 14:22:15 +00:00
Danil Chapovalov
75aa7e94dd Update MediaEngine unittests to create Call using Environment
Bug: webrtc:15656
Change-Id: I8016f03fd0640d218344f5a6ab53c4b0663690c0
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/329081
Reviewed-by: Ilya Nikolaevskiy <ilnik@webrtc.org>
Commit-Queue: Danil Chapovalov <danilchap@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#41260}
2023-11-28 18:42:37 +00:00
Emil Lundmark
f268afd791 Remove unused propagation of field trials in Codec::Matches
Bug: None
Change-Id: I7e56bae37a7fd9f8ca9c3bb8c8f55631a19a1a00
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/326521
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#41152}
2023-11-14 08:14:14 +00:00
Sergey Silkin
b6ef1a736e Define default max Qp in media/base/media_constants
kDefaultQpMax=56 was defined in multiple places. Move it to media_constants and split it into two: VPx/AV1 and H26x values. H26x value is set to 51 which is the max bitstream QP value for H264/5.

This CL is expected to be a no-op because:
1. VideoCodec::qpMax value has not changed for VP8/9 and AV1.
2. VideoCodec::qpMax is currently not used by OpenH264 wrapper (wiring it up is out-of-scope of this CL).
3. Previous default qpMax=56 exceeded the max value for H26x (=51). External HW H26x encoders likely clamped it and used 51.

Bug: webrtc:14852
Change-Id: I1d795e695dac5c78e86ed829b24281e61066f668
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/324282
Reviewed-by: Erik Språng <sprang@webrtc.org>
Commit-Queue: Sergey Silkin <ssilkin@webrtc.org>
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#40997}
2023-10-24 06:43:50 +00:00
Tommi
5b186e98bc Remove effectively dead code for allow_codec_switching
Bug: webrtc:11341
Change-Id: I88e3c1059f5ebcc9d693c0719534aaacd4b9199b
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/324283
Reviewed-by: Philip Eliasson <philipel@webrtc.org>
Commit-Queue: Tomas Gunnarsson <tommi@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#40990}
2023-10-23 14:08:11 +00:00
Erik Språng
665e6817d1 Add field trial to control network socket receive buffer size.
In some very high-bandwidth application there have been observations of
packet loss in the socket implementation (not on the network itself) due
to large bursts of packets arriving. Allocating too big buffers can of
course lead to issue as well, so this flag is intended to find a good
tradeoff.

Bug: webrtc:15585
Change-Id: I63eccb1a9f34d852d80c286fc27bffd17818f0ef
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/324021
Auto-Submit: Erik Språng <sprang@webrtc.org>
Reviewed-by: Per Kjellander <perkj@webrtc.org>
Commit-Queue: Per Kjellander <perkj@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#40963}
2023-10-18 14:32:38 +00:00
Danil Chapovalov
a3ce407023 Cleanup Call construction
Return unique_ptr to clearly communicate ownership is transfered.
Remove Call::Config alias

Bug: None
Change-Id: Ie3aa1da383ad65fae490d218fced443d44961eab
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/323160
Reviewed-by: Rasmus Brandt <brandtr@webrtc.org>
Auto-Submit: Danil Chapovalov <danilchap@webrtc.org>
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Commit-Queue: Danil Chapovalov <danilchap@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#40934}
2023-10-16 06:34:26 +00:00
Philipp Hancke
bfc2a3553d Remove more codec-related templating
BUG=webrtc:15214

Change-Id: I719de4ef2b9c98a01b14f8f292098f19baa0d925
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/321341
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Commit-Queue: Philipp Hancke <phancke@microsoft.com>
Reviewed-by: Florent Castelli <orphis@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#40809}
2023-09-26 06:55:24 +00:00
philipel
31718d7ce2 Reland "Add option to disable quality scaling for AV1."
This reverts commit 83102d3907.

Reason for revert: reland with fix

Original change's description:
> Revert "Add option to disable quality scaling for AV1."
>
> This reverts commit 446dbc66fd.
>
> Reason for revert: downstream break
>
> Original change's description:
> > Add option to disable quality scaling for AV1.
> >
> > The main goal of this change is to disable the quality scaler when multiple spatial layers are used.
> >
> > Bug: b/295129711
> > Change-Id: I25e0b7440a8c2adee3e97720a1e0ee5e0a914334
> > Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/319181
> > Reviewed-by: Sergey Silkin <ssilkin@webrtc.org>
> > Reviewed-by: Erik Språng <sprang@webrtc.org>
> > Commit-Queue: Philip Eliasson <philipel@webrtc.org>
> > Cr-Commit-Position: refs/heads/main@{#40709}
>
> Bug: b/295129711
> Change-Id: Iaeb13951d1b839bc0426120436035843bb3ee98f
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/320081
> Reviewed-by: Sergey Silkin <ssilkin@webrtc.org>
> Bot-Commit: rubber-stamper@appspot.gserviceaccount.com <rubber-stamper@appspot.gserviceaccount.com>
> Commit-Queue: Philip Eliasson <philipel@webrtc.org>
> Owners-Override: Philip Eliasson <philipel@webrtc.org>
> Cr-Commit-Position: refs/heads/main@{#40742}

Bug: b/295129711
Change-Id: Iab4846c2cd6074f50a3ebe9551432d449243b5d7
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/320120
Reviewed-by: Erik Språng <sprang@webrtc.org>
Commit-Queue: Philip Eliasson <philipel@webrtc.org>
Reviewed-by: Sergey Silkin <ssilkin@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#40743}
2023-09-13 15:19:36 +00:00
Philip Eliasson
83102d3907 Revert "Add option to disable quality scaling for AV1."
This reverts commit 446dbc66fd.

Reason for revert: downstream break

Original change's description:
> Add option to disable quality scaling for AV1.
>
> The main goal of this change is to disable the quality scaler when multiple spatial layers are used.
>
> Bug: b/295129711
> Change-Id: I25e0b7440a8c2adee3e97720a1e0ee5e0a914334
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/319181
> Reviewed-by: Sergey Silkin <ssilkin@webrtc.org>
> Reviewed-by: Erik Språng <sprang@webrtc.org>
> Commit-Queue: Philip Eliasson <philipel@webrtc.org>
> Cr-Commit-Position: refs/heads/main@{#40709}

Bug: b/295129711
Change-Id: Iaeb13951d1b839bc0426120436035843bb3ee98f
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/320081
Reviewed-by: Sergey Silkin <ssilkin@webrtc.org>
Bot-Commit: rubber-stamper@appspot.gserviceaccount.com <rubber-stamper@appspot.gserviceaccount.com>
Commit-Queue: Philip Eliasson <philipel@webrtc.org>
Owners-Override: Philip Eliasson <philipel@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#40742}
2023-09-13 12:21:31 +00:00
philipel
446dbc66fd Add option to disable quality scaling for AV1.
The main goal of this change is to disable the quality scaler when multiple spatial layers are used.

Bug: b/295129711
Change-Id: I25e0b7440a8c2adee3e97720a1e0ee5e0a914334
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/319181
Reviewed-by: Sergey Silkin <ssilkin@webrtc.org>
Reviewed-by: Erik Språng <sprang@webrtc.org>
Commit-Queue: Philip Eliasson <philipel@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#40709}
2023-09-06 12:37:22 +00:00
Philipp Hancke
5866e1a0ed Rename Set(Send|Recv)Parameters Set(Sender|Receiver)Parameters
following the previous change to rename the classes derived from
  cricket::RtpParameters

Also rename ChangedRecvParameters to ChangedReceiveParameters.

BUG=webrtc:13931

Change-Id: Ia51dd39905a5cbb98162c3948930e43ccaf3786d
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/314500
Reviewed-by: Florent Castelli <orphis@webrtc.org>
Commit-Queue: Philipp Hancke <phancke@microsoft.com>
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#40677}
2023-09-01 08:12:55 +00:00
Philipp Hancke
82c56ca794 Request keyframe via setParameters
after the W3C changes in approach documented here:
  https://github.com/w3c/webrtc-extensions/pull/167

chromium CL: https://chromium-review.googlesource.com/c/chromium/src/+/4643591

Note that this does not follow the route taken by the W3C API but
still considers this flag a part of the encodingParameters.

BUG=chromium:1354101

Change-Id: If0f0ec09bebddea1f01dd8afbe4747c21afe6793
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/286741
Reviewed-by: Ilya Nikolaevskiy <ilnik@webrtc.org>
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Commit-Queue: Philipp Hancke <phancke@microsoft.com>
Cr-Commit-Position: refs/heads/main@{#40656}
2023-08-29 13:53:33 +00:00
Danil Chapovalov
f53597140f In RtpSource represent time with Timestamp type instead of int64_t
Bug: webrtc:13757
Change-Id: I5d7da9c9aee489e4b57d361de174c59713cb2b14
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/317780
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Commit-Queue: Danil Chapovalov <danilchap@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#40650}
2023-08-29 10:05:03 +00:00
Florent Castelli
43a5dd86c2 Implement codec selection api
The implementation covers the latest specification, but does not
support mixed-codec simulcast at the moment.
Changing codec for audio and video is supported.

Bug: webrtc:15064
Change-Id: I09082f39e2a7d54dd4a663a8a57bf9df5a851690
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/311663
Reviewed-by: Henrik Boström <hbos@webrtc.org>
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Commit-Queue: Florent Castelli <orphis@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#40616}
2023-08-24 13:18:04 +00:00
Harald Alvestrand
d43af9172b Remove internal overrides using old SendRtp and SendRtcp interfaces.
This CL takes away all usages except for Android code.

Low-Coverage-Reason: Refactoring old code
Bug: webrtc:15410
Change-Id: I66bed6a4a2787b4177a82e599b48623ca67cd235
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/315940
Commit-Queue: Harald Alvestrand <hta@webrtc.org>
Reviewed-by: Danil Chapovalov <danilchap@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#40554}
2023-08-15 13:20:21 +00:00
Harald Alvestrand
34d82df2ba Use ArrayView versions of SendRtp and SendRtcp
This CL adds [[deprecated]] to the old signatures, and uses the new
signatures throughout.

Bug: webrtc:14870
Change-Id: Ic9a8198ac0a2f954e1b2e7d05a55dbe04342f958
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/314962
Reviewed-by: Danil Chapovalov <danilchap@webrtc.org>
Commit-Queue: Harald Alvestrand <hta@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#40517}
2023-08-07 08:28:48 +00:00
Philipp Hancke
a9d5141367 Rename cricket::RtpParameters and derived classes
Renames
  cricket::RtpParameters
to
  cricket::MediaChannelParameters
in order to distinguish it better from webrtc::RtpParameters.
This involves renaming
  RtpSendParameters -> SenderParameters
  AudioSendParameters -> AudioSenderParameters
  AudioRecvParameters -> AudioReceiverParameters
  VideoSendParameters -> VideoSenderParameters
  VideoRecvParameters -> VideoReceiverParameters

BUG=webrtc:13931

Change-Id: I664595ee3863418c0c6ca092ca77127be0f9498f
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/314360
Reviewed-by: Florent Castelli <orphis@webrtc.org>
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Commit-Queue: Philipp Hancke <phancke@microsoft.com>
Cr-Commit-Position: refs/heads/main@{#40497}
2023-08-01 08:55:02 +00:00
Mirko Bonadei
e2dff95ac6 Revert "Clean up WebRTC-FilterAbsSendTimeExtension field trial"
This reverts commit ebf71114a3.

Reason for revert: Breaks downstream project.

Original change's description:
> Clean up WebRTC-FilterAbsSendTimeExtension field trial
>
> which has been enabled by default for a while. Also document the
> expected behavior, see
>   https://groups.google.com/g/discuss-webrtc/c/vfrnxWBVcdA/m/ASf7dBJOGAAJ
> for more details.
>
> BUG=webrtc:10234
>
> Change-Id: If793e2b4b6cebb07371bfdf1f94ed8d49bf2bb34
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/311281
> Commit-Queue: Philipp Hancke <phancke@microsoft.com>
> Reviewed-by: Konrad Hofbauer <hofbauer@webrtc.org>
> Reviewed-by: Erik Språng <sprang@webrtc.org>
> Cr-Commit-Position: refs/heads/main@{#40417}

BUG=webrtc:10234

Change-Id: I856991260ff40a24f03f6054a5c2a9e6f37f47da
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/311803
Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org>
Owners-Override: Mirko Bonadei <mbonadei@webrtc.org>
Reviewed-by: Danil Chapovalov <danilchap@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#40438}
2023-07-17 10:17:49 +00:00
Philipp Hancke
ebf71114a3 Clean up WebRTC-FilterAbsSendTimeExtension field trial
which has been enabled by default for a while. Also document the
expected behavior, see
  https://groups.google.com/g/discuss-webrtc/c/vfrnxWBVcdA/m/ASf7dBJOGAAJ
for more details.

BUG=webrtc:10234

Change-Id: If793e2b4b6cebb07371bfdf1f94ed8d49bf2bb34
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/311281
Commit-Queue: Philipp Hancke <phancke@microsoft.com>
Reviewed-by: Konrad Hofbauer <hofbauer@webrtc.org>
Reviewed-by: Erik Språng <sprang@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#40417}
2023-07-11 15:45:16 +00:00
Philipp Hancke
cabd77a5c7 Remove flexfec-03 killswitch guarding receiving FlexFEC
since this has been shipping receive-only enabled by default since M92.
Sending remains behind a field trial.

BUG=webrtc:8151

Change-Id: Ia44f8b9cf89ee4878074d1469413d847621ce5ae
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/310040
Reviewed-by: Henrik Boström <hbos@webrtc.org>
Commit-Queue: Philipp Hancke <phancke@microsoft.com>
Reviewed-by: Florent Castelli <orphis@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#40377}
2023-06-29 10:45:30 +00:00
Harald Alvestrand
84fdf990e8 Convert Media*Channel to contain a webrtc::Transport
Media*Channel objects used to subclass webrtc::Transport.
This was not an optimal design. This CL makes the transport
a member variable of MediaChannelUtil.

Bug: None
Change-Id: I85d33cc1b32b931e563b7bb2d277f1c512600831
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/309800
Commit-Queue: Harald Alvestrand <hta@webrtc.org>
Reviewed-by: Florent Castelli <orphis@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#40328}
2023-06-21 16:13:55 +00:00
Florent Castelli
d20bbc4a15 Remove CreateMediaChannel calls from webrtc_video_engine_unittest
Bug: webrtc:13931
Change-Id: I3d54741dffb337de9db80efa81b24396b96245f1
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/309621
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Commit-Queue: Florent Castelli <orphis@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#40326}
2023-06-21 13:21:16 +00:00
Florent Castelli
4e434c313e Remove MediaChannel usage from webrtc_video_engine_unittest
Bug: webrtc:13931
Change-Id: Ie45a25c6b204b38b749381ef5e9403cf036b8126
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/309660
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Commit-Queue: Florent Castelli <orphis@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#40323}
2023-06-21 10:10:56 +00:00
Florent Castelli
ee97e6ad88 Move GetSendCodec() to MediaSendChannelInterface
This allows the voice send channels to share the method definition.

Bug: webrtc:15214
Change-Id: Ie0cc23f3694eeb8322a9ea7328a8d56fa7571c95
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/309600
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Commit-Queue: Florent Castelli <orphis@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#40322}
2023-06-21 10:00:56 +00:00
Harald Alvestrand
847208e9d6 Remove transitional shim classes
Bug: webrtc:13931
Change-Id: Iaeb0b892aca4b4d64d13a025adc7564e572e0f26
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/307940
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Commit-Queue: Harald Alvestrand <hta@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#40232}
2023-06-06 11:58:29 +00:00
Florent Castelli
8c4b9ea535 Remove references to AudioCodec and VideoCodec constructors
The preferred method to create codecs is to use the function
cricket::CreateAudioCodec or cricketCreateVideoCodec.
Empty codec objects are deprecated and should be replaced
with alternatives such as methods returning an
absl::optional object instead.

Bug: webrtc:15214
Change-Id: I7fe40f64673cd407830dbbb0e541b85a3aee93aa
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/307521
Commit-Queue: Florent Castelli <orphis@webrtc.org>
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#40226}
2023-06-05 23:23:40 +00:00
Florent Castelli
811e24a117 Move functionality from AudioCodec and VideoCodec into cricket::Codec
Part 1 of the migration towards merging the types.
Any method that could belong to the Codec type was moved, the others
are deprecated.
Alternatives to the AudioCodec and VideoCodec constructors are introduced
to allow creating objects of an indefinite type without having to
reference the old classes.

Bug: webrtc:15214
Change-Id: I20e1aa32962821cad98e9a92c2ec86f8f75e5dd8
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/307220
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Commit-Queue: Florent Castelli <orphis@webrtc.org>
Reviewed-by: Philipp Hancke <phancke@microsoft.com>
Cr-Commit-Position: refs/heads/main@{#40213}
2023-06-02 15:26:46 +00:00
Harald Alvestrand
f785bd46e8 Split WebRtcVideoMediaChannel into Send and Receive
This completes the split-channel work for the Video side.
Note: For ease of review, the implementations in the .cc
file have not been sorted between sender and receiver. This
can be done in a later purely-editorial CL.

Bug: webrtc:13931
Change-Id: I36cf015d5facb1eed368070cb204a8763ac19a9c
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/307180
Reviewed-by: Henrik Boström <hbos@webrtc.org>
Commit-Queue: Harald Alvestrand <hta@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#40207}
2023-06-02 12:16:56 +00:00
Harald Alvestrand
97c9623839 Make a shim object implementing the VideoMediaChannel interface
The intent is that this object can be used instead of VideoMediaChannel,
clearing the way for decomposing VideoMediaChannel into send and
receive classes.

This CL uses it for the "both" role of WebRtcVideoEngine::CreateMediaChannel; a later CL will use it for all roles on all engines.

Bug: webrtc:13931
Change-Id: Ibd0ca2c3c45b5e3bfcced8f7e30a1edd63cf7654
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/306720
Commit-Queue: Harald Alvestrand <hta@webrtc.org>
Reviewed-by: Henrik Boström <hbos@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#40173}
2023-05-30 08:44:27 +00:00
Rasmus Brandt
f0820ffd88 Implement video versions of RTCInboundRtpStreamStats.jitterBuffer{Target,Minimum}Delay
* https://www.w3.org/TR/webrtc-stats/#dom-rtcinboundrtpstreamstats-jitterbuffertargetdelay
* https://www.w3.org/TR/webrtc-stats/#dom-rtcinboundrtpstreamstats-jitterbufferminimumdelay

Tested: https://jsfiddle.net/pfgzj0yo/17/

Bug: webrtc:14244
Change-Id: I3d949ba63c8339b3881f5d00356559d5789d283d
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/304404
Commit-Queue: Henrik Boström <hbos@webrtc.org>
Reviewed-by: Henrik Boström <hbos@webrtc.org>
Reviewed-by: Åsa Persson <asapersson@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#40157}
2023-05-26 13:34:09 +00:00
Harald Alvestrand
5f32fa47a7 Delete MediaBaseChannel class
There are no common functions between MediaSendChannelInterface
and MediaReceiveChannelInterface except media_type().
This allows us to remove the common superclass for the two interfaces,
making for a simpler class structure.

Bug: webrtc:13931
Change-Id: I82a12ca31f0dc62d7bd97bdda34ca37e59a5fd55
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/306660
Reviewed-by: Henrik Boström <hbos@webrtc.org>
Commit-Queue: Harald Alvestrand <hta@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#40154}
2023-05-26 10:43:06 +00:00
Harald Alvestrand
cfd4cd0703 Introduce AddDefaultRecvStreamForTesting to VideoReceiveChannel API
This change allows us to remove one static_cast from tests that
was problematic for another refactoring.

Bug: webrtc:13931
Change-Id: I8e1b5cecadd806b266b6c115b56b18b9613cbe82
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/306500
Reviewed-by: Henrik Boström <hbos@webrtc.org>
Commit-Queue: Harald Alvestrand <hta@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#40144}
2023-05-25 12:59:53 +00:00
Rasmus Brandt
621cb2943d Fix video version of RTCInboundRtpStreamStats.jitterBufferDelay to obey spec.
Prior to this CL, the video `jitterBufferDelay` stat was the accumulated current delay, which is a smoothened version of the target delay. This is not correct according to the spec [1]. Rather, the stat should be the accumulated time spent in the jitter buffer, for all emitted frames. This CL fixes this spec compliance problem.

Expect changes to test metrics and product monitoring as this CL rolls out.

[1]: https://www.w3.org/TR/webrtc-stats/#dom-rtcinboundrtpstreamstats-jitterbufferdelay

Tested:
1. Go to https://jsfiddle.net/jib1/0L6duga2/show
2. Apply 2.0 seconds of video delay.
3. Notice that "Video jitter buffer delay" is slightly less than 1990ms. (2000ms playoutdelayhint - 10ms render delay - Xms decode delay).

Bug: webrtc:15085
Change-Id: I42805faafd7dd3bcdcf3ad08e751e08d6de38906
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/304521
Reviewed-by: Åsa Persson <asapersson@webrtc.org>
Commit-Queue: Rasmus Brandt <brandtr@webrtc.org>
Reviewed-by: Henrik Boström <hbos@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#40138}
2023-05-25 07:33:39 +00:00
Philipp Hancke
79249155c3 Stop decoding video for m-lines which are sendonly or inactive
by not starting the receive stream whenever it is creating.
Instead, this is controlled by the direction of the media content.

BUG=webrtc:11013

Change-Id: Iaaa0ac0aa9f90a4be776a1348f53a0f9c2b84d99
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/304661
Reviewed-by: Ilya Nikolaevskiy <ilnik@webrtc.org>
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Commit-Queue: Philipp Hancke <phancke@microsoft.com>
Cr-Commit-Position: refs/heads/main@{#40064}
2023-05-15 10:54:16 +00:00
Henrik Boström
e90d9344b8 Delete the WebRTC-H264Simulcast/Disabled/ field trial.
The field trial has been enabled-by-default for several years, I
suspect it was needed during its development but there doesn't seem to
be any reason to maintain it going forward.

Its very existence blocks our long term objective to have our APIs
behave according to the W3C standards and any apps still depending on
it, if there are any, should make sure to use the APIs correctly
instead. I assume they already do any any references to this is us
forgetting to clean things up.

Bug: webrtc:15161
Change-Id: I4a6a44a15219d2e045f3d8d857b5197a064f049c
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/304660
Commit-Queue: Ilya Nikolaevskiy <ilnik@webrtc.org>
Reviewed-by: Philip Eliasson <philipel@webrtc.org>
Reviewed-by: Ilya Nikolaevskiy <ilnik@webrtc.org>
Reviewed-by: Sergey Silkin <ssilkin@webrtc.org>
Auto-Submit: Henrik Boström <hbos@webrtc.org>
Reviewed-by: Erik Språng <sprang@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#40025}
2023-05-09 11:58:35 +00:00
Danil Chapovalov
ea33f7f6a3 Cleanup usasge of ReportBlockData::report_block accessor
This reduces dependency on the struct RTCPReportBlock and would allow to
delete it in favor of class ReportBlockData

Bug: None
Change-Id: Ia46a2516e26453724eed2e499f475f65df6cd3fa
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/304163
Reviewed-by: Erik Språng <sprang@webrtc.org>
Commit-Queue: Danil Chapovalov <danilchap@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#39990}
2023-05-05 09:56:30 +00:00
Philipp Hancke
f78d1f211a stats: Implement receive RTX stats
* retransmittedBytesReceived
* retransmittedPacketsReceived
added to the specification in
  https://github.com/w3c/webrtc-stats/pull/735

BUG=webrtc:15096

Change-Id: I6770e5d8d09ac1c2693c918fd943b0ab257ec7ba
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/295260
Reviewed-by: Henrik Boström <hbos@webrtc.org>
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Commit-Queue: Philipp Hancke <phancke@microsoft.com>
Cr-Commit-Position: refs/heads/main@{#39959}
2023-04-27 09:53:00 +00:00
Philipp Hancke
6a7bf10d60 Replace "rcvd" with "received" for readability
following guidance in
  https://google.github.io/styleguide/cppguide.html#General_Naming_Rules

BUG=None

Change-Id: I105591a7f709d65a3d3320f7f44137d432cf7ce0
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/302282
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Reviewed-by: Danil Chapovalov <danilchap@webrtc.org>
Commit-Queue: Philipp Hancke <phancke@microsoft.com>
Cr-Commit-Position: refs/heads/main@{#39937}
2023-04-24 15:30:07 +00:00
Tommi
51c632c13b Use GlobalSimulatedTimeController in more webrtc video engine unittests
This removes all "_WAIT" operations in the tests and all uses
of kTimeout for loop+poll check for values.

On my linux box, this also reduces the time it takes to run all
./rtc_media_unittests (in parallel) from about 3500ms, to ~50ms.
(longest running test was WebRtcVideoChannelBaseTest.GetStats)

Bug: none
Change-Id: If544aa10cb0281cb5e5e51fb654db5f45de871da
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/302343
Reviewed-by: Danil Chapovalov <danilchap@webrtc.org>
Commit-Queue: Tomas Gunnarsson <tommi@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#39918}
2023-04-21 14:41:27 +00:00
Danil Chapovalov
ec2670e631 Cleanup ReportBlockData class: use Timestamp and TimeDelta
Bug: webrtc:13757
Change-Id: Ic3ddb05413f58cedd12bf0f32c852befb9bd40f4
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/300940
Reviewed-by: Erik Språng <sprang@webrtc.org>
Reviewed-by: Henrik Boström <hbos@webrtc.org>
Commit-Queue: Danil Chapovalov <danilchap@webrtc.org>
Reviewed-by: Alessio Bazzica <alessiob@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#39841}
2023-04-13 08:51:12 +00:00
philipel
40cb0091a1 Unnest VideoEncoderFactoryTemplate in webrtc_video_engine_unittest.cc
Bug: webrtc:13573
Change-Id: I43517b6b7a130704803ff149b8a738ed4713d88a
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/300361
Commit-Queue: Philip Eliasson <philipel@webrtc.org>
Reviewed-by: Erik Språng <sprang@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#39767}
2023-04-05 15:13:36 +00:00
philipel
44437d35cd Replace BuiltinVideo{Encoder,Decoder}Factory with Video{Encoder,Decoder}FactoryTemplate.
Bug: webrtc:13573
Change-Id: I4eb5bb99bfde9c38c1d4072b933ef11a9ca32f53
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/299703
Reviewed-by: Ilya Nikolaevskiy <ilnik@webrtc.org>
Commit-Queue: Philip Eliasson <philipel@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#39743}
2023-04-03 09:39:08 +00:00
Henrik Boström
75ea06f0fa Revert "Ship ability to opt-in to VP9/AV1 simulcast."
This reverts commit 75990b9a8f.

Reason for revert: Breaks downstream, a use case of having three VP9
encodings, scalability mode only specified on the first layer
(L2T2_KEY) and the other two layers not having a scalability mode but
also being active=false appears to trigger a DCHECK in
call/rtp_video_sender.cc:501. More investigation needed

Original change's description:
> Ship ability to opt-in to VP9/AV1 simulcast.
>
> With this unflagging, an app can opt-in to simulcast when using multiple
> encodings by specifying RTCRtpEncodingParameters.scalabilityMode. This
> ensures backwards-compat with apps relying on 3 encodings to mean SVC
> who traditionally have not specified scalabilityMode.
>
> It fixes the spec/API bug of asking for simulcast and not getting
> simulcast. The field trial exists only as a kill-switch with a TODO to
> remove it.
>
> This ships initial support, however note that the VP9/AV1 simulcast uses
> SimulcastRateAllocator (just like VP8/H264 simulcast). This rate
> allocator uses more kbps than SvcRateAllocator. This should be revisited
> to avoid significant higher bitrates, for example when comparing VP9
> simulcast to VP9 SVC.
>
> Shipping the ability for apps to opt-in makes it easier to exercise
> these new code paths and allows initial feedback from developers, but
> due to the high bitrate (= same bitrate as VP8/H264 simulcast today)
> many apps may find that VP9 SVC is still more beneficial for BW reasons.
>
> Bug: webrtc:14884, webrtc:15005
> Change-Id: I748aae1adb47acc8a6b79b5852cff6aa47a46f5d
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/298046
> Commit-Queue: Henrik Boström <hbos@webrtc.org>
> Reviewed-by: Erik Språng <sprang@webrtc.org>
> Reviewed-by: Evan Shrubsole <eshr@google.com>
> Reviewed-by: Ilya Nikolaevskiy <ilnik@webrtc.org>
> Cr-Commit-Position: refs/heads/main@{#39601}

Bug: webrtc:14884, webrtc:15005
Change-Id: Ic8f77e6a2971f493d6cd8c23faecd435058a8847
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/298440
Bot-Commit: rubber-stamper@appspot.gserviceaccount.com <rubber-stamper@appspot.gserviceaccount.com>
Reviewed-by: Ilya Nikolaevskiy <ilnik@webrtc.org>
Commit-Queue: Henrik Boström <hbos@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#39605}
2023-03-20 12:47:21 +00:00
Henrik Boström
75990b9a8f Ship ability to opt-in to VP9/AV1 simulcast.
With this unflagging, an app can opt-in to simulcast when using multiple
encodings by specifying RTCRtpEncodingParameters.scalabilityMode. This
ensures backwards-compat with apps relying on 3 encodings to mean SVC
who traditionally have not specified scalabilityMode.

It fixes the spec/API bug of asking for simulcast and not getting
simulcast. The field trial exists only as a kill-switch with a TODO to
remove it.

This ships initial support, however note that the VP9/AV1 simulcast uses
SimulcastRateAllocator (just like VP8/H264 simulcast). This rate
allocator uses more kbps than SvcRateAllocator. This should be revisited
to avoid significant higher bitrates, for example when comparing VP9
simulcast to VP9 SVC.

Shipping the ability for apps to opt-in makes it easier to exercise
these new code paths and allows initial feedback from developers, but
due to the high bitrate (= same bitrate as VP8/H264 simulcast today)
many apps may find that VP9 SVC is still more beneficial for BW reasons.

Bug: webrtc:14884, webrtc:15005
Change-Id: I748aae1adb47acc8a6b79b5852cff6aa47a46f5d
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/298046
Commit-Queue: Henrik Boström <hbos@webrtc.org>
Reviewed-by: Erik Språng <sprang@webrtc.org>
Reviewed-by: Evan Shrubsole <eshr@google.com>
Reviewed-by: Ilya Nikolaevskiy <ilnik@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#39601}
2023-03-20 10:41:15 +00:00
Markus Handell
28c4986e1b WebRTCVideoChannel::OnPacketReceived: avoid PostTasks.
Under the combined network/worker thread project, tasks
are unnecessarily posted to the same thread. Avoid this
by posting only if invoked on a diffferent sequence.

TESTED=presubmit + local Meet calls.

Bug: webrtc:137439
Change-Id: Ic5dd99e5fbb843ad4c54d4466138135ae81596cf
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/295867
Commit-Queue: Markus Handell <handellm@webrtc.org>
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#39471}
2023-03-03 15:27:45 +00:00