same as they attached to other packets.
Otherwise there is risk that ssrc will be acked after few initial pure padding packets are sent, before remote endpoint seen any mid or rid attached.
Bug: b/361257385
Change-Id: I695b379221debe2518ad33d13d65620877f0b2a7
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/360660
Reviewed-by: Per Kjellander <perkj@webrtc.org>
Commit-Queue: Danil Chapovalov <danilchap@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#42851}
by encryption a packet with sequence number 65535 followed
by a packet with sequence number 1. The second packet is encrypted
with a SRTP ROC of 1 as described in
https://datatracker.ietf.org/doc/html/rfc3711#section-3.3.1
The packets are (received and) decrypted in a different order,
the packet with sequence number 1 (and ROC=1) is decrypted first.
Since the ROC is maintained locally the decrypting session assumes
it to be 0.
Why is that a problem? The RFC recommends estimating the ROC with +-1 which, as demonstrated by the test, libSRTP does not.
But this is a rare problem that requires a random in a high range combined with packet loss/reordering which turns into no-a-problem if you choose carefully as done by packet_sequencer.cc which restricts the initial sequence number in the range 0..32767 which means you do not run into this issue in production.
See also Q6 in libsrtp's historical documentation at
https://srtp.sourceforge.net/historical/faq.html
BUG=webrtc:353565743
Change-Id: I9bd72b198c946937aeb25c229005a0c682447f53
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/358360
Reviewed-by: Erik Språng <sprang@webrtc.org>
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Commit-Queue: Philipp Hancke <phancke@meta.com>
Cr-Commit-Position: refs/heads/main@{#42798}
This can happen when VP8 simulcast is negotiated while two-byte header
extensions are not negotiated via extmap-allow-mixed. For VP8 the
DD extension would be 23 bytes long which exceeds the maximum size
of 15 bytes for a one-byte header extension.
To test, revert
f04b52b4a7
and test using VP8.
Note that this works for VP9, AV1, H264 out of the box.
BUG=webrtc:40191093
Change-Id: I2f5d04d8b58b71d32547b06fab6b9a9006df9f1a
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/359623
Commit-Queue: Philipp Hancke <phancke@meta.com>
Reviewed-by: Danil Chapovalov <danilchap@webrtc.org>
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#42786}
To make it available for FEC to use field trials in follow ups
Bug: webrtc:355577231
Change-Id: I4a6260a38e50a70dae27db28401b08bf0160aaec
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/358680
Reviewed-by: Danil Chapovalov <danilchap@webrtc.org>
Reviewed-by: Åsa Persson <asapersson@webrtc.org>
Commit-Queue: Danil Chapovalov <danilchap@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#42740}
To make it available for FEC to use field trials in follow ups
Bug: webrtc:355577231
Change-Id: Ie0b7761915696e6ee7453df3d0531b0f7ad30ee1
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/358240
Reviewed-by: Danil Chapovalov <danilchap@webrtc.org>
Commit-Queue: Danil Chapovalov <danilchap@webrtc.org>
Reviewed-by: Åsa Persson <asapersson@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#42732}
Old copy of the header and some previous usage is kept around
for compatibility with downstream projects for now.
Bug: chromium:345101934
Change-Id: Icbe42fb8450d3a4115799438d209da4eda127bab
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/357441
Commit-Queue: Florent Castelli <orphis@webrtc.org>
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#42681}
a frame must be (or should be) first when it contains either SPS (but not just PPS),
is an IDR or is a slice with first_mb_in_slice == 0.
Fixes an edge case where a STAP-A with SPS, PPS and multiple slices of an IDR fit
into a single RTP packet which can happen with small 320x196 frames
BUG=webrtc:352379280,webrtc:346608838
Change-Id: Ic6dea6c81db759d0d7ddd4054407103fd791f6c5
No-Try: true
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/357121
Reviewed-by: Danil Chapovalov <danilchap@webrtc.org>
Commit-Queue: Sergey Silkin <ssilkin@webrtc.org>
Reviewed-by: Sergey Silkin <ssilkin@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#42652}
All known users are updated to use ntp_time_util.h directly
Bug: webrtc:343076000
Change-Id: I7229b9e5dd72d83bfd98ba4050ae7583d792575b
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/357300
Commit-Queue: Danil Chapovalov <danilchap@webrtc.org>
Reviewed-by: Sergey Silkin <ssilkin@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#42645}
This is cherry-picked from WebKit's patch for fixing a fuzzer failure.
The original patch: https://github.com/WebKit/WebKit/pull/30438
Bug: chromium:41480904
Change-Id: Ic8eddb9de816c4c8d720dac6d4c55d1db3f0596e
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/356361
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Reviewed-by: Philip Eliasson <philipel@webrtc.org>
Commit-Queue: Jianlin Qiu <jianlin.qiu@intel.com>
Cr-Commit-Position: refs/heads/main@{#42598}
This is a forward fix for https://webrtc-review.googlesource.com/c/src/+/354622 that breaks client code using nalus_length.
No-Try: true
Change-Id: Ic0fc41696e408adefe4eb8792150a64b1eab49da
Bug: None
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/354840
Reviewed-by: Danil Chapovalov <danilchap@webrtc.org>
Commit-Queue: Jeremy Leconte <jleconte@google.com>
Owners-Override: Jeremy Leconte <jleconte@google.com>
Cr-Commit-Position: refs/heads/main@{#42493}
and files that broke when I fixed the first set.
Bug: webrtc:42226242
Change-Id: I321cd63537ab3002098c7bdecd889a6fc5a1eb25
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/353421
Commit-Queue: Harald Alvestrand <hta@webrtc.org>
Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org>
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Auto-Submit: Harald Alvestrand <hta@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#42429}
Split out time_util.h and cc from target rtp_rtcp to its own target.
This is to avoid possible circular dependencies and not having all targets using them to depend on the full RtpRcp module.
Bug: webrtc:343076000
Change-Id: I7b3c84456b17f1920f71afdd5a644d27e28caed2
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/352480
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Auto-Submit: Per Kjellander <perkj@webrtc.org>
Commit-Queue: Per Kjellander <perkj@webrtc.org>
Reviewed-by: Danil Chapovalov <danilchap@webrtc.org>
Reviewed-by: Jakob Ivarsson <jakobi@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#42392}
This depenency is not needed and may lead to a circular dependency. The cl removes old unused functionaliy to log BWE related statistics using compile time flags.
Bug: webrtc:42225697
Change-Id: I6cc01b367c0c48ab30f34c12a10afc58d1e7822f
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/352142
Commit-Queue: Per Kjellander <perkj@webrtc.org>
Reviewed-by: Danil Chapovalov <danilchap@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#42386}
This makes the downcasts currently used in eg
modules/rtp_rtcp/source/rtp_sender_video_frame_transformer_delegate.cc
safer.
Bug: webrtc:339815768
Change-Id: Ie6c7ab84666d399dbca4c95846b850aac5327f1a
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/350361
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Commit-Queue: Tony Herre <herre@google.com>
Reviewed-by: Danil Chapovalov <danilchap@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#42325}
This reverts commit e1607ed3a6.
Reason for revert: downstream project adjusted
Original change's description:
> Revert "h264: bail out early when failing to parse SPS/PPS ids"
>
> This reverts commit 4344eb713b.
>
> Reason for revert: Breaks downstream project.
>
> Original change's description:
> > h264: bail out early when failing to parse SPS/PPS ids
> >
> > This currently gets caught later in the process by the H264 SPS/PPS
> > tracker but can be rejected explicitly here. The network observable
> > behavior should be similar and request a key frame after a 200ms delay, at least for entities that send such bad bitstreams
> >
> > BUG=webrtc:337076010
> >
> > Change-Id: I239c64efa7db631460ef9e9986d283335303df5f
> > Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/349060
> > Reviewed-by: Danil Chapovalov <danilchap@webrtc.org>
> > Reviewed-by: Harald Alvestrand <hta@webrtc.org>
> > Commit-Queue: Philipp Hancke <phancke@meta.com>
> > Cr-Commit-Position: refs/heads/main@{#42211}
>
> Bug: webrtc:337076010
> Change-Id: I15b815c69f1d25e41fb222d46359655242589fba
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/349661
> Bot-Commit: rubber-stamper@appspot.gserviceaccount.com <rubber-stamper@appspot.gserviceaccount.com>
> Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org>
> Owners-Override: Mirko Bonadei <mbonadei@webrtc.org>
> Cr-Commit-Position: refs/heads/main@{#42217}
Bug: webrtc:337076010
Change-Id: Ibe5a960b9b5fdf9a35e5dfffb47b78ade36b0cec
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/349700
Bot-Commit: rubber-stamper@appspot.gserviceaccount.com <rubber-stamper@appspot.gserviceaccount.com>
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Commit-Queue: Danil Chapovalov <danilchap@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#42223}
This reverts commit 4344eb713b.
Reason for revert: Breaks downstream project.
Original change's description:
> h264: bail out early when failing to parse SPS/PPS ids
>
> This currently gets caught later in the process by the H264 SPS/PPS
> tracker but can be rejected explicitly here. The network observable
> behavior should be similar and request a key frame after a 200ms delay, at least for entities that send such bad bitstreams
>
> BUG=webrtc:337076010
>
> Change-Id: I239c64efa7db631460ef9e9986d283335303df5f
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/349060
> Reviewed-by: Danil Chapovalov <danilchap@webrtc.org>
> Reviewed-by: Harald Alvestrand <hta@webrtc.org>
> Commit-Queue: Philipp Hancke <phancke@meta.com>
> Cr-Commit-Position: refs/heads/main@{#42211}
Bug: webrtc:337076010
Change-Id: I15b815c69f1d25e41fb222d46359655242589fba
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/349661
Bot-Commit: rubber-stamper@appspot.gserviceaccount.com <rubber-stamper@appspot.gserviceaccount.com>
Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org>
Owners-Override: Mirko Bonadei <mbonadei@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#42217}
Support for parsing the packet is gated behind field trial
WebRTC-RFC8888CongestionControlFeedback/Enabled/.
Bug: webrtc:15368
Change-Id: Ib4478e821fe5a43510af5131543e7861cf54d901
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/348664
Reviewed-by: Danil Chapovalov <danilchap@webrtc.org>
Commit-Queue: Per Kjellander <perkj@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#42215}
This currently gets caught later in the process by the H264 SPS/PPS
tracker but can be rejected explicitly here. The network observable
behavior should be similar and request a key frame after a 200ms delay, at least for entities that send such bad bitstreams
BUG=webrtc:337076010
Change-Id: I239c64efa7db631460ef9e9986d283335303df5f
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/349060
Reviewed-by: Danil Chapovalov <danilchap@webrtc.org>
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Commit-Queue: Philipp Hancke <phancke@meta.com>
Cr-Commit-Position: refs/heads/main@{#42211}
Implements a two-pass approach to packetization which creates
packets of an even size similar to RtpPacketizer::SplitAboutEqually.
This improves the bandwidth estimation.
The algorithm does a first pass with the existing packetizer, then
iterates through the resulting packet sizes and sums up the bytes left unused in each packet.
It then calculates a new maximum packet length as
configured_max_packet_len - ((unused_bytes - packets + 1) / packets)
adjusts for the overhead and re-runs the packetization algorithm.
For example, a list of OBUs with sizes
{1206, 1476, 1431}
currently gets packetized greedily as payload sizes
{1200, 1200, 1200, 523}
With this change, it gets packetized as
{1032, 1032, 1032, 1028}
This change is guarded by the field trial
WebRTC-Video-AV1EvenPayloadSizes
which is acting as a rollout flag.
BUG=webrtc:15927
Co-authored-by: Shyam Sadhwani <shyamsadhwani@meta.com>
Change-Id: I4f0b3c27de6f06104908dd769c4dd1f34115712c
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/348100
Commit-Queue: Philipp Hancke <phancke@meta.com>
Reviewed-by: Danil Chapovalov <danilchap@webrtc.org>
Reviewed-by: Per Kjellander <perkj@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#42203}
This cl adds an implementation of the RTCP feedback packet as specified in https://www.rfc-editor.org/rfc/rfc8888.html
Bug: webrtc:15368
Change-Id: I0b9a7fb15512ff9f9e721efd8e03ebe981a8d9bd
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/347901
Reviewed-by: Danil Chapovalov <danilchap@webrtc.org>
Commit-Queue: Per Kjellander <perkj@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#42140}
When an IRAP frame was present in the Aggregation Packet,
the control flow was incorrectly transferred to SPS parsing
due to ABSL_FALLTHROUGH_INTENDED within the IRAP case statement,
resulting in a parsing error and generating a warning log.
A break statement has been introduced to prevent this fallthrough.
Bug: webrtc:13485
Change-Id: I523fbf548f14b31eae7c41f607fe33572f094aac
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/346381
Reviewed-by: Danil Chapovalov <danilchap@webrtc.org>
Reviewed-by: Daniel.L (Byoungchan) Lee <daniel.l@hpcnt.com>
Commit-Queue: Daniel.L (Byoungchan) Lee <daniel.l@hpcnt.com>
Cr-Commit-Position: refs/heads/main@{#42132}
This is a reland of commit 7ae48c452a with updated RtpVp9RefFinder
RtpVp9RefFinder relied on the fact that frames with (inter_pic_predicted=true && inter_layer_predicted=true) were marked as keyframes. Since this is not the case anymore, the related code paths in RtpVp9RefFinder have been deleted.
Calculation of gof_info_[] index for non-keyframes has been updated to account for that fact it is now possible to received multiple T0 frames belonging to the same temporal unit (we don't need to do "unwrapped_tl0 - 1" in this case).
Original change's description:
> Mark frames with inter_layer_predicted=true as delta frames
>
> As it is currently implemented, the VP9 depacketizer decides packet's frame type based on p_bit ("Inter-picture predicted layer frame"). p_bit is set to 0 for upper spatial layer frames of keyframe since they do not have temporal refs. This results in marking packets of upper spatial layer frames, and, eventually these frames, of SVC keyframes as "keyframe" while they are in fact delta frames.
>
> Normally spatial layer frames are merged into a superframe and the superframe is passed to decoder. But passing individual layers to a single decoder instance is a valid scenario too and is used in downstream projects. In this case, an upper layer frame marked as keyframe may cause decoder reset [2] and break decoding.
>
> This CL changes frame type decision logic in the VP9 depacketizer such that only packets with both P and D (inter-layer predicted) bits unset are considered as keyframe packets.
>
> When spatial layer frames are merged into a superframe in CombineAndDeleteFrames [1], frame type of the superframe is inferred from the lowest spatial layer frame.
>
> [1] https://source.chromium.org/chromium/chromium/src/+/main:third_party/webrtc/modules/video_coding/frame_helpers.cc;l=53
>
> [2] https://source.corp.google.com/piper///depot/google3/third_party/webrtc/files/stable/webrtc/modules/video_coding/codecs/vp9/libvpx_vp9_decoder.cc;l=209
>
> Bug: webrtc:15827
> Change-Id: Idc3445636f0eae0192dac998876fedec48628560
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/343342
> Reviewed-by: Danil Chapovalov <danilchap@webrtc.org>
> Commit-Queue: Sergey Silkin <ssilkin@webrtc.org>
> Cr-Commit-Position: refs/heads/main@{#41939}
Bug: webrtc:15827
Change-Id: Ic69b94989919cf6d353bceea85d0eba63bc500ee
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/344144
Reviewed-by: Philip Eliasson <philipel@webrtc.org>
Commit-Queue: Sergey Silkin <ssilkin@webrtc.org>
Reviewed-by: Danil Chapovalov <danilchap@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#41985}
The purpose is to be able to create a RtpPacketSendInfo from Pacing and RtpPacketSendInfo only.
This allow further refactoring where we directly in PacketRouter can notify BWE and early loss detection that a packet will be sent.
RtpPacketSendInfo::From is mostly added to be able to test conversion.
Bug: webrtc:15368
Change-Id: I5ebe2dc91d2eedf2c86e62c3f9738437082a49e4
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/343766
Reviewed-by: Danil Chapovalov <danilchap@webrtc.org>
Commit-Queue: Per Kjellander <perkj@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#41961}
This reverts commit 7ae48c452a.
Reason for revert: breaks RtpVp9RefFinder
Original change's description:
> Mark frames with inter_layer_predicted=true as delta frames
>
> As it is currently implemented, the VP9 depacketizer decides packet's frame type based on p_bit ("Inter-picture predicted layer frame"). p_bit is set to 0 for upper spatial layer frames of keyframe since they do not have temporal refs. This results in marking packets of upper spatial layer frames, and, eventually these frames, of SVC keyframes as "keyframe" while they are in fact delta frames.
>
> Normally spatial layer frames are merged into a superframe and the superframe is passed to decoder. But passing individual layers to a single decoder instance is a valid scenario too and is used in downstream projects. In this case, an upper layer frame marked as keyframe may cause decoder reset [2] and break decoding.
>
> This CL changes frame type decision logic in the VP9 depacketizer such that only packets with both P and D (inter-layer predicted) bits unset are considered as keyframe packets.
>
> When spatial layer frames are merged into a superframe in CombineAndDeleteFrames [1], frame type of the superframe is inferred from the lowest spatial layer frame.
>
> [1] https://source.chromium.org/chromium/chromium/src/+/main:third_party/webrtc/modules/video_coding/frame_helpers.cc;l=53
>
> [2] https://source.corp.google.com/piper///depot/google3/third_party/webrtc/files/stable/webrtc/modules/video_coding/codecs/vp9/libvpx_vp9_decoder.cc;l=209
>
> Bug: webrtc:15827
> Change-Id: Idc3445636f0eae0192dac998876fedec48628560
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/343342
> Reviewed-by: Danil Chapovalov <danilchap@webrtc.org>
> Commit-Queue: Sergey Silkin <ssilkin@webrtc.org>
> Cr-Commit-Position: refs/heads/main@{#41939}
Bug: webrtc:15827
Change-Id: I697a057b8b3e88c07499f77c42f014da43cf1dc1
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/343763
Reviewed-by: Danil Chapovalov <danilchap@webrtc.org>
Commit-Queue: Sergey Silkin <ssilkin@webrtc.org>
Bot-Commit: rubber-stamper@appspot.gserviceaccount.com <rubber-stamper@appspot.gserviceaccount.com>
Cr-Commit-Position: refs/heads/main@{#41953}
The purpose of these new methods are to allow creating a RTP packet with
sequence numbers that
can be inspected and is ensured to be sent if SendPacket is invoked.
virtual bool CanSendPacket(const RtpPacketToSend& packet) const = 0;
virtual void AssignSequenceNumber(RtpPacketToSend& packet) = 0;
virtual void SendPacket(std::unique_ptr<RtpPacketToSend> packet,
const PacedPacketInfo& pacing_info) = 0;
Bug: webrtc:15368
Change-Id: I671e737575e15328e796aa98761a4d540c5812d6
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/343785
Reviewed-by: Danil Chapovalov <danilchap@webrtc.org>
Commit-Queue: Per Kjellander <perkj@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#41951}
RtpPacketToSend::transport_sequence_number
packed_id is set to be 64 bit to align with rtc::PacketOptions.
packet_id is only set to RtpPacketToSend::transport_sequence_number if
TransportSequenceNumber header extension is not used in order to not
change current behaviour.
Bug: webrtc:15368
Change-Id: Ia532714226421422bdb292f8dd34b175560e9dc6
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/344160
Reviewed-by: Danil Chapovalov <danilchap@webrtc.org>
Commit-Queue: Per Kjellander <perkj@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#41950}
And move writing of the header extension from PacketRouter to
RtpSenderEgress::SendPacket.
Bug: webrtc:15368
Change-Id: Ieb18af4bc20115bf02d37e1f9a815a5c120975a9
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/343786
Reviewed-by: Danil Chapovalov <danilchap@webrtc.org>
Commit-Queue: Per Kjellander <perkj@webrtc.org>
Auto-Submit: Per Kjellander <perkj@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#41949}
Start migrating away from `hasAudioLevel`, `voiceActivity`, `audioLevel` fields in RTPHeaderExtension and switch usages to a more modern absl::optional<AudioLevel> accessor instead.
The old fields are preserved for compatibility with downstream projects, but will be removed in the future.
Bug: webrtc:15788
Change-Id: I76599124fd68dd4d449f850df3b9814d6a002f5d
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/336303
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Reviewed-by: Danil Chapovalov <danilchap@webrtc.org>
Commit-Queue: Danil Chapovalov <danilchap@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#41947}
As it is currently implemented, the VP9 depacketizer decides packet's frame type based on p_bit ("Inter-picture predicted layer frame"). p_bit is set to 0 for upper spatial layer frames of keyframe since they do not have temporal refs. This results in marking packets of upper spatial layer frames, and, eventually these frames, of SVC keyframes as "keyframe" while they are in fact delta frames.
Normally spatial layer frames are merged into a superframe and the superframe is passed to decoder. But passing individual layers to a single decoder instance is a valid scenario too and is used in downstream projects. In this case, an upper layer frame marked as keyframe may cause decoder reset [2] and break decoding.
This CL changes frame type decision logic in the VP9 depacketizer such that only packets with both P and D (inter-layer predicted) bits unset are considered as keyframe packets.
When spatial layer frames are merged into a superframe in CombineAndDeleteFrames [1], frame type of the superframe is inferred from the lowest spatial layer frame.
[1] https://source.chromium.org/chromium/chromium/src/+/main:third_party/webrtc/modules/video_coding/frame_helpers.cc;l=53
[2] https://source.corp.google.com/piper///depot/google3/third_party/webrtc/files/stable/webrtc/modules/video_coding/codecs/vp9/libvpx_vp9_decoder.cc;l=209
Bug: webrtc:15827
Change-Id: Idc3445636f0eae0192dac998876fedec48628560
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/343342
Reviewed-by: Danil Chapovalov <danilchap@webrtc.org>
Commit-Queue: Sergey Silkin <ssilkin@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#41939}
This seems to confuse perfetto, and the data ends up on its own track
and the end event is just ignored. As it was invalid, I am assuming it
is not used, and can be simply removed.
#rtc_fixit
Bug: webrtc:15867
Change-Id: I31a814f6c2147c3ce534726bf9046a79369b9eb3
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/342761
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Reviewed-by: Danil Chapovalov <danilchap@webrtc.org>
Commit-Queue: Evan Shrubsole <eshr@google.com>
Cr-Commit-Position: refs/heads/main@{#41896}
This seems to confuse perfetto, and the data ends up on its own track
and the end event is just ignored. As it was invalid, I am assuming it
is not used, and can be simply removed.
#rtc_fixit
Bug: webrtc:15867
Change-Id: I77e59adcd35c51911474446a5f92505bf6b860f4
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/342780
Reviewed-by: Danil Chapovalov <danilchap@webrtc.org>
Commit-Queue: Evan Shrubsole <eshr@google.com>
Cr-Commit-Position: refs/heads/main@{#41892}