gstreamer: Allocate output buffers via the encoder

This makes sure the correct allocator and configuration is used.
This commit is contained in:
Sebastian Dröge 2023-01-11 15:21:26 +02:00 committed by Hassene Tmar
parent 30e0c1e4fd
commit 85b9c8e103

View file

@ -656,8 +656,11 @@ gst_svtav1enc_dequeue_encoded_frames (GstSvtAv1Enc * svtav1enc,
GST_VIDEO_CODEC_FRAME_SET_SYNC_POINT (frame); GST_VIDEO_CODEC_FRAME_SET_SYNC_POINT (frame);
} }
frame->output_buffer = if ((ret = gst_video_encoder_allocate_output_frame(GST_VIDEO_ENCODER (svtav1enc), frame, output_buf->n_filled_len)) != GST_FLOW_OK) {
gst_buffer_new_allocate (NULL, output_buf->n_filled_len, NULL); svt_av1_enc_release_out_buffer(&output_buf);
gst_video_codec_frame_unref (frame);
return ret;
}
GST_BUFFER_FLAG_SET(frame->output_buffer, GST_BUFFER_FLAG_LIVE); GST_BUFFER_FLAG_SET(frame->output_buffer, GST_BUFFER_FLAG_LIVE);
gst_buffer_fill (frame->output_buffer, 0, gst_buffer_fill (frame->output_buffer, 0,
output_buf->p_buffer, output_buf->n_filled_len); output_buf->p_buffer, output_buf->n_filled_len);