Skip to content

Conversation

cadubentzen
Copy link

@cadubentzen cadubentzen commented Aug 20, 2025

- libva 1.10 has no support for AV1.
- Some h265 fields are missing in libva 1.10, plus there's no VAAPI
  H.265 encoder in cros-codecs yet anyways.
- This project actually uses minigbm, and we don't use it, so we can
  just disable it.
- c2-wrapper is only useful for Android
Frame skipping may be useful for real-time, and bit stuffing messes with
rate control.
Currently, only handle those for the h264 encoder
This way we can avoid extra complications with using the constructor with VideoFrame and use plain VAAPI surfaces borrowed as input.
Pushing new SPS/PPS on P-frames might confuse some decoders.
Our main use-case is importing dmabufs into surfaces for encoding.
@cadubentzen cadubentzen changed the title Add Discord patches - part 1 Add Discord patches Aug 21, 2025
Copy link

@mikepavone mikepavone left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some of this is a bit deep in the weeds for me to do a good job of review without reading up a bit more on va-api and h264, but the parts I follow look reasonable to me

self.resolution().height,
// TODO: Should we add USAGE_HINT_ENCODER support?
Some(UsageHint::USAGE_HINT_DECODER),
Some(UsageHint::USAGE_HINT_ENCODER),

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess this is fine for us since we're only using this for encoding, but looks like this code is used for both encode and decode generally. Seems like it would be better to pass in a parameter for this

@mikepavone mikepavone merged commit 4dfe86c into discord:discord-0.0.5 Aug 27, 2025
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.

2 participants