return TRUE;
}
+static void
+gst_x264_enc_set_latency (GstX264Enc * encoder)
+{
+ GstVideoInfo *info = &encoder->input_state->info;
+ GstClockTime latency = gst_util_uint64_scale (GST_SECOND * info->fps_d,
+ x264_encoder_maximum_delayed_frames (encoder->x264enc), info->fps_n);
+ gst_video_encoder_set_latency (GST_VIDEO_ENCODER (encoder), latency, latency);
+}
+
static gboolean
gst_x264_enc_set_format (GstVideoEncoder * video_enc,
GstVideoCodecState * state)
return FALSE;
}
+ gst_x264_enc_set_latency (encoder);
+
return TRUE;
}
encoder->reconfig = FALSE;
if (x264_encoder_reconfig (encoder->x264enc, &encoder->x264param) < 0)
GST_WARNING_OBJECT (encoder, "Could not reconfigure");
+ gst_x264_enc_set_latency (encoder);
}
if (pic_in && input_frame) {