mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-06-05 06:58:56 +00:00
msdk: enc: Support force-key-unit events
https://bugzilla.gnome.org/show_bug.cgi?id=791479
This commit is contained in:
parent
4300611082
commit
3cc61f98b1
2 changed files with 13 additions and 1 deletions
|
@ -727,7 +727,15 @@ gst_msdkenc_encode_frame (GstMsdkEnc * thiz, mfxFrameSurface1 * surface,
|
||||||
task = gst_msdkenc_get_free_task (thiz);
|
task = gst_msdkenc_get_free_task (thiz);
|
||||||
|
|
||||||
for (;;) {
|
for (;;) {
|
||||||
status = MFXVideoENCODE_EncodeFrameAsync (session, NULL, surface,
|
/* Force key-frame if needed */
|
||||||
|
if (GST_VIDEO_CODEC_FRAME_IS_FORCE_KEYFRAME (input_frame))
|
||||||
|
thiz->enc_cntrl.FrameType =
|
||||||
|
MFX_FRAMETYPE_I | MFX_FRAMETYPE_IDR | MFX_FRAMETYPE_REF;
|
||||||
|
else
|
||||||
|
thiz->enc_cntrl.FrameType = MFX_FRAMETYPE_UNKNOWN;
|
||||||
|
|
||||||
|
status =
|
||||||
|
MFXVideoENCODE_EncodeFrameAsync (session, &thiz->enc_cntrl, surface,
|
||||||
&task->output_bitstream, &task->sync_point);
|
&task->output_bitstream, &task->sync_point);
|
||||||
if (status != MFX_WRN_DEVICE_BUSY)
|
if (status != MFX_WRN_DEVICE_BUSY)
|
||||||
break;
|
break;
|
||||||
|
@ -1384,6 +1392,7 @@ gst_msdkenc_init (GstMsdkEnc * thiz)
|
||||||
thiz->enable_extopt3 = FALSE;
|
thiz->enable_extopt3 = FALSE;
|
||||||
memset (&thiz->option2, 0, sizeof (thiz->option2));
|
memset (&thiz->option2, 0, sizeof (thiz->option2));
|
||||||
memset (&thiz->option3, 0, sizeof (thiz->option3));
|
memset (&thiz->option3, 0, sizeof (thiz->option3));
|
||||||
|
memset (&thiz->enc_cntrl, 0, sizeof (thiz->enc_cntrl));
|
||||||
}
|
}
|
||||||
|
|
||||||
/* gst_msdkenc_set_common_property:
|
/* gst_msdkenc_set_common_property:
|
||||||
|
|
|
@ -120,6 +120,9 @@ struct _GstMsdkEnc
|
||||||
mfxExtCodingOption3 option3;
|
mfxExtCodingOption3 option3;
|
||||||
gboolean enable_extopt3;
|
gboolean enable_extopt3;
|
||||||
|
|
||||||
|
/* parameters for per-frame based encoding control */
|
||||||
|
mfxEncodeCtrl enc_cntrl;
|
||||||
|
|
||||||
GstBufferPool *msdk_pool;
|
GstBufferPool *msdk_pool;
|
||||||
GstBufferPool *msdk_converted_pool;
|
GstBufferPool *msdk_converted_pool;
|
||||||
GstVideoInfo aligned_info;
|
GstVideoInfo aligned_info;
|
||||||
|
|
Loading…
Reference in a new issue