mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-01-22 23:28:16 +00:00
msdkenc: renegotiate when video info changes
Renegotiation was implemented for bitrate change. We can re-use the same sequence when video info changes except that this can be executed right away when receiving the new input format. I.e. no need to wait for the next call to handle_frame.
This commit is contained in:
parent
9f1fbd3649
commit
f578eab6fd
1 changed files with 7 additions and 1 deletions
|
@ -1097,8 +1097,14 @@ gst_msdkenc_set_format (GstVideoEncoder * encoder, GstVideoCodecState * state)
|
|||
GstMsdkEncClass *klass = GST_MSDKENC_GET_CLASS (thiz);
|
||||
|
||||
if (state) {
|
||||
if (thiz->input_state)
|
||||
if (thiz->input_state) {
|
||||
if (!gst_video_info_is_equal (&thiz->input_state->info, &state->info)) {
|
||||
GST_INFO_OBJECT (thiz, "Re-init the encoder as info changed");
|
||||
gst_msdkenc_flush_frames (thiz, FALSE);
|
||||
gst_msdkenc_close_encoder (thiz);
|
||||
}
|
||||
gst_video_codec_state_unref (thiz->input_state);
|
||||
}
|
||||
thiz->input_state = gst_video_codec_state_ref (state);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue