mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-01-20 06:08:14 +00:00
va: baseenc: Add is_live field to check the live stream
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4359>
This commit is contained in:
parent
556a254e59
commit
a73474827b
2 changed files with 10 additions and 0 deletions
|
@ -778,6 +778,7 @@ static gboolean
|
|||
gst_va_base_enc_set_format (GstVideoEncoder * venc, GstVideoCodecState * state)
|
||||
{
|
||||
GstVaBaseEnc *base = GST_VA_BASE_ENC (venc);
|
||||
GstQuery *query;
|
||||
|
||||
g_return_val_if_fail (state->caps != NULL, FALSE);
|
||||
|
||||
|
@ -798,6 +799,13 @@ gst_va_base_enc_set_format (GstVideoEncoder * venc, GstVideoCodecState * state)
|
|||
gst_video_codec_state_unref (base->input_state);
|
||||
base->input_state = gst_video_codec_state_ref (state);
|
||||
|
||||
/* in case live streaming, we should run on low-latency mode */
|
||||
base->is_live = FALSE;
|
||||
query = gst_query_new_latency ();
|
||||
if (gst_pad_peer_query (GST_VIDEO_ENCODER_SINK_PAD (venc), query))
|
||||
gst_query_parse_latency (query, &base->is_live, NULL, NULL);
|
||||
gst_query_unref (query);
|
||||
|
||||
if (!gst_va_base_enc_reset (base))
|
||||
return FALSE;
|
||||
|
||||
|
|
|
@ -54,6 +54,8 @@ struct _GstVaBaseEnc
|
|||
|
||||
gboolean reconf;
|
||||
|
||||
gboolean is_live;
|
||||
|
||||
VAProfile profile;
|
||||
gint width;
|
||||
gint height;
|
||||
|
|
Loading…
Reference in a new issue