Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TWCC manager relies on buffers meta for recovery percentage #13

Open
wants to merge 391 commits into
base: main
Choose a base branch
from

Conversation

MishaBaranov
Copy link
Contributor

This introduces Buffers Meta API for attaching info of which ssrc and seqnums any particular buffer cares redundant content about.
So far it just substitutes present mechanism for recovery percentage computation for RTX only.

Mikhail Fludkov and others added 30 commits September 27, 2023 17:46
Multiple SIMD-ified vpx plugins will be built if available. These
plugins will be put in a separate plugin directory which can be
linked to if configuring with --enable-simd-symlink=avx etc.
Hard code limit to 1500 ms between each generated key frame. This
should ideally be a property and set to a value derived from RTT.

This avoids generating bursts of keyframes when receiving many
PLIs/NACKs in close succession.

1500ms is quite large, but with 500ms and lots of packetloss, the
frequent keyframe generation will more then double the bitrate from
the libvpx encoder (configured at 1mbps, producing over 2mbps),
potentially making an already bad situation much worse. By adding
another second we only see about 1,4mbps, which is more acceptable.
Adds property that can be used to disable direct rendering.
When buffer is pushed downstream, we should not hold the buffer mapped
with write access. Doing so would often lead to unneccesary memcpy
later.

For instance, gst_buffer_make_writable() in
gst_video_decoder_finish_frame() will cause a memcpy because of
_memory_get_exclusive_reference().
Change so that if the intersection of upstream and template caps does
not contain a specific annex it will be not added to the caps. Previous
behavior was that it was set explictily to false.

This fixes an issue if an encoder (avenc_h263p) is linked late with the
payloader it could end up as not negotiated.
These can spam a lot if it actually happens.
The caps for Opus is generated via a utility function that creates a new
GstCaps instance after validating the codec arguments. There are possible ways
to solve this, we chose the one requiring the least number of modifications.

It would be also possible to simply set the caps with the
specified arguments; however, this will required to move all the validation
to qtdemux or require a change to gstreamer codec-utils.
Basically, all frames are "i-frames" here.
Can't have a mix of GstValueArray and GValueArray here.
tbeloqui added 2 commits May 16, 2024 11:11
As this could end up blocking the audio listener thread
(gst_osx_audio_device_change_cb) when probing devices caps in
gst_core_audio_open() and gst_core_audio_probe_caps()
This way we avoid having potential races between querying "is-default" on
devices and changing the system defaults.

We now update the system default on every device change to get new connected
devices added with the correct default state.
@MishaBaranov MishaBaranov force-pushed the misha/twcc_protection branch from 137c427 to 8bf0b24 Compare May 16, 2024 14:06
tbeloqui and others added 4 commits May 17, 2024 11:31
This condition is more common than I expected, for example, in the case
we disconnect a bluetooth headset set as system-default.

The AudioDeviceID is allowed to be different each time you re-plug the
same device, so we might not have it in the internal list by the time
it was removed and reported as changed as system-default.
This is basically to ensure better testability and reduce racyness
by ensuring each operation completes for each input buffer.

Also add some more logging and refactor a bit around locking.
If VTDecompressionSessionDecodeFrame returns kVTInvalidSessionErr or
kVTVideoEncoderMalfunctionErr we need to reset the decoder session and
request an intra frame.

This change allows the decoder to continue decoding after the
application switches between foreground and background modes.
@MishaBaranov MishaBaranov force-pushed the misha/twcc_protection branch from 8bf0b24 to 766fb6e Compare May 29, 2024 16:23
@MishaBaranov MishaBaranov force-pushed the misha/twcc_protection branch 3 times, most recently from 9a21777 to 633ffe8 Compare July 8, 2024 12:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.