[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>
Sun, 18 May 2025 22:58:37 +0000 (00:58 +0200)
commitc3b54edda4b41be3628bc686fe06e179caea3936
tree6100a7ad45648d1c2fddbc3b51f3a04dd3f316cc
parent5d93d153d92c30a9c0c2089bcc185ee41b34a8fe
[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