[PATCH] Change Encoder::applyEncodingPreference() to buildEncodingOptions()
authorArjen Hiemstra <ahiemstra@heimr.nl>
Thu, 20 Mar 2025 13:26:36 +0000 (14:26 +0100)
committerAurélien COUDERC <coucouf@debian.org>
Tue, 15 Jul 2025 14:45:40 +0000 (16:45 +0200)
commit32254294a92c9060073779e0ff55f71d4815d143
tree7625d1a0c1d86a7b6645868328e687baca225a37
parent0234c0eff451d5ee8b4d9b4dff816a1c5cc8c06e
[PATCH] Change Encoder::applyEncodingPreference() to buildEncodingOptions()

As it turns out, FFmpeg does something to the pointers here that causes
the dictionary to never be properly used. This means we were never
applying the encoding options, as avcodec_open() was passed a nullptr
for options.

Fix this by changing the function to return an AVDictionary* instead of
trying to modify a passed-in pointer. This results in a proper dict
being returned, that can then be passed to avcodec_open().

The main result of this is that we now properly apply the encoding
options for VP9 encoding, which means we can now encode VP9 at realtime
speeds instead of it massively lagging behind.

BUG: 488896

Gbp-Pq: Name upstream_52911b70_Change-Encoder-applyEncodingPreference-to-buildEncodingOptions-.patch
15 files changed:
src/encoder.cpp
src/encoder_p.h
src/gifencoder.cpp
src/gifencoder_p.h
src/h264vaapiencoder.cpp
src/h264vaapiencoder_p.h
src/libopenh264encoder.cpp
src/libopenh264encoder_p.h
src/libvpxencoder.cpp
src/libvpxencoder_p.h
src/libvpxvp9encoder.cpp
src/libvpxvp9encoder_p.h
src/libwebpencoder_p.h
src/libx264encoder.cpp
src/libx264encoder_p.h