mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-04-26 06:54:49 +00:00
videoencoder: Don't require an output state to be set before allocating output buffers
This commit is contained in:
parent
92af499eb7
commit
c5e9df4b51
1 changed files with 4 additions and 4 deletions
|
@ -1600,14 +1600,14 @@ gst_video_encoder_allocate_output_buffer (GstVideoEncoder * encoder, gsize size)
|
||||||
{
|
{
|
||||||
GstBuffer *buffer;
|
GstBuffer *buffer;
|
||||||
|
|
||||||
g_return_val_if_fail (encoder->priv->output_state, NULL);
|
|
||||||
g_return_val_if_fail (size > 0, NULL);
|
g_return_val_if_fail (size > 0, NULL);
|
||||||
|
|
||||||
GST_DEBUG ("alloc src buffer");
|
GST_DEBUG ("alloc src buffer");
|
||||||
|
|
||||||
GST_VIDEO_ENCODER_STREAM_LOCK (encoder);
|
GST_VIDEO_ENCODER_STREAM_LOCK (encoder);
|
||||||
if (G_UNLIKELY (encoder->priv->output_state_changed
|
if (G_UNLIKELY (encoder->priv->output_state_changed
|
||||||
|| gst_pad_check_reconfigure (encoder->srcpad))) {
|
|| (encoder->priv->output_state
|
||||||
|
&& gst_pad_check_reconfigure (encoder->srcpad)))) {
|
||||||
if (!gst_video_encoder_negotiate (encoder)) {
|
if (!gst_video_encoder_negotiate (encoder)) {
|
||||||
GST_DEBUG_OBJECT (encoder, "Failed to negotiate, fallback allocation");
|
GST_DEBUG_OBJECT (encoder, "Failed to negotiate, fallback allocation");
|
||||||
goto fallback;
|
goto fallback;
|
||||||
|
@ -1654,11 +1654,11 @@ gst_video_encoder_allocate_output_frame (GstVideoEncoder *
|
||||||
encoder, GstVideoCodecFrame * frame, gsize size)
|
encoder, GstVideoCodecFrame * frame, gsize size)
|
||||||
{
|
{
|
||||||
g_return_val_if_fail (frame->output_buffer == NULL, GST_FLOW_ERROR);
|
g_return_val_if_fail (frame->output_buffer == NULL, GST_FLOW_ERROR);
|
||||||
g_return_val_if_fail (encoder->priv->output_state, GST_FLOW_NOT_NEGOTIATED);
|
|
||||||
|
|
||||||
GST_VIDEO_ENCODER_STREAM_LOCK (encoder);
|
GST_VIDEO_ENCODER_STREAM_LOCK (encoder);
|
||||||
if (G_UNLIKELY (encoder->priv->output_state_changed
|
if (G_UNLIKELY (encoder->priv->output_state_changed
|
||||||
|| gst_pad_check_reconfigure (encoder->srcpad)))
|
|| (encoder->priv->output_state
|
||||||
|
&& gst_pad_check_reconfigure (encoder->srcpad))))
|
||||||
gst_video_encoder_negotiate (encoder);
|
gst_video_encoder_negotiate (encoder);
|
||||||
|
|
||||||
GST_LOG_OBJECT (encoder, "alloc buffer size %" G_GSIZE_FORMAT, size);
|
GST_LOG_OBJECT (encoder, "alloc buffer size %" G_GSIZE_FORMAT, size);
|
||||||
|
|
Loading…
Reference in a new issue