mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-23 00:36:51 +00:00
svtav1enc: Drain and completely reallocate the encoder instance on caps changes
The encoder does not support reconfiguration, and only deinitializing it and then initializing it again causes deadlocks. Also only reconfigure and drain the encoder if the video info has actually changed. Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3957>
This commit is contained in:
parent
a14f8008fb
commit
cfb14c4b5d
1 changed files with 7 additions and 3 deletions
|
@ -988,9 +988,13 @@ gst_svtav1enc_set_format (GstVideoEncoder * encoder, GstVideoCodecState * state)
|
|||
GstVideoCodecState *output_state;
|
||||
GST_DEBUG_OBJECT (svtav1enc, "set_format");
|
||||
|
||||
if (svtav1enc->state) {
|
||||
gst_video_codec_state_unref (svtav1enc->state);
|
||||
svt_av1_enc_deinit (svtav1enc->svt_encoder);
|
||||
if (svtav1enc->state
|
||||
&& !gst_video_info_is_equal (&svtav1enc->state->info, &state->info)) {
|
||||
gst_svtav1enc_finish (encoder);
|
||||
gst_svtav1enc_stop (encoder);
|
||||
gst_svtav1enc_close (encoder);
|
||||
gst_svtav1enc_open (encoder);
|
||||
gst_svtav1enc_start (encoder);
|
||||
}
|
||||
svtav1enc->state = gst_video_codec_state_ref (state);
|
||||
|
||||
|
|
Loading…
Reference in a new issue