mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-20 07:16:55 +00:00
[MOVED FROM BAD 070/134] basevideoencoder: provide proper upstream flow return handling
This commit is contained in:
parent
ddd32f1b05
commit
1d8a499ceb
1 changed files with 8 additions and 7 deletions
|
@ -149,7 +149,7 @@ static gboolean gst_vp8_enc_stop (GstBaseVideoEncoder * encoder);
|
||||||
static gboolean gst_vp8_enc_set_format (GstBaseVideoEncoder *
|
static gboolean gst_vp8_enc_set_format (GstBaseVideoEncoder *
|
||||||
base_video_encoder, GstVideoState * state);
|
base_video_encoder, GstVideoState * state);
|
||||||
static gboolean gst_vp8_enc_finish (GstBaseVideoEncoder * base_video_encoder);
|
static gboolean gst_vp8_enc_finish (GstBaseVideoEncoder * base_video_encoder);
|
||||||
static gboolean gst_vp8_enc_handle_frame (GstBaseVideoEncoder *
|
static GstFlowReturn gst_vp8_enc_handle_frame (GstBaseVideoEncoder *
|
||||||
base_video_encoder, GstVideoFrame * frame);
|
base_video_encoder, GstVideoFrame * frame);
|
||||||
static GstFlowReturn gst_vp8_enc_shape_output (GstBaseVideoEncoder * encoder,
|
static GstFlowReturn gst_vp8_enc_shape_output (GstBaseVideoEncoder * encoder,
|
||||||
GstVideoFrame * frame);
|
GstVideoFrame * frame);
|
||||||
|
@ -672,7 +672,7 @@ gst_vp8_enc_get_caps (GstBaseVideoEncoder * base_video_encoder)
|
||||||
return caps;
|
return caps;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static GstFlowReturn
|
||||||
gst_vp8_enc_process (GstVP8Enc * encoder)
|
gst_vp8_enc_process (GstVP8Enc * encoder)
|
||||||
{
|
{
|
||||||
vpx_codec_iter_t iter = NULL;
|
vpx_codec_iter_t iter = NULL;
|
||||||
|
@ -680,6 +680,7 @@ gst_vp8_enc_process (GstVP8Enc * encoder)
|
||||||
GstBaseVideoEncoder *base_video_encoder;
|
GstBaseVideoEncoder *base_video_encoder;
|
||||||
GstVP8EncCoderHook *hook;
|
GstVP8EncCoderHook *hook;
|
||||||
GstVideoFrame *frame;
|
GstVideoFrame *frame;
|
||||||
|
GstFlowReturn ret = GST_FLOW_OK;
|
||||||
|
|
||||||
base_video_encoder = GST_BASE_VIDEO_ENCODER (encoder);
|
base_video_encoder = GST_BASE_VIDEO_ENCODER (encoder);
|
||||||
|
|
||||||
|
@ -732,11 +733,13 @@ gst_vp8_enc_process (GstVP8Enc * encoder)
|
||||||
hook->invisible = g_list_append (hook->invisible, buffer);
|
hook->invisible = g_list_append (hook->invisible, buffer);
|
||||||
} else {
|
} else {
|
||||||
frame->src_buffer = buffer;
|
frame->src_buffer = buffer;
|
||||||
gst_base_video_encoder_finish_frame (base_video_encoder, frame);
|
ret = gst_base_video_encoder_finish_frame (base_video_encoder, frame);
|
||||||
}
|
}
|
||||||
|
|
||||||
pkt = vpx_codec_get_cx_data (&encoder->encoder, &iter);
|
pkt = vpx_codec_get_cx_data (&encoder->encoder, &iter);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
static gboolean
|
static gboolean
|
||||||
|
@ -803,7 +806,7 @@ static const int speed_table[] = {
|
||||||
VPX_DL_REALTIME,
|
VPX_DL_REALTIME,
|
||||||
};
|
};
|
||||||
|
|
||||||
static gboolean
|
static GstFlowReturn
|
||||||
gst_vp8_enc_handle_frame (GstBaseVideoEncoder * base_video_encoder,
|
gst_vp8_enc_handle_frame (GstBaseVideoEncoder * base_video_encoder,
|
||||||
GstVideoFrame * frame)
|
GstVideoFrame * frame)
|
||||||
{
|
{
|
||||||
|
@ -845,9 +848,7 @@ gst_vp8_enc_handle_frame (GstBaseVideoEncoder * base_video_encoder,
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
gst_vp8_enc_process (encoder);
|
return gst_vp8_enc_process (encoder);
|
||||||
|
|
||||||
return TRUE;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static guint64
|
static guint64
|
||||||
|
|
Loading…
Reference in a new issue