From 88586b4149038ddae066ff48394fb58c7365b995 Mon Sep 17 00:00:00 2001 From: Haihao Xiang Date: Wed, 12 Dec 2018 15:24:18 +0800 Subject: [PATCH] msdk: change the wait time for encoder and vpp In MSDK samples, the wait time for encoder, decoder and vpp is 300000. Let's set the wait time to the same value in msdk plugin --- sys/msdk/gstmsdkenc.c | 7 +++++-- sys/msdk/gstmsdkvpp.c | 6 +++++- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/sys/msdk/gstmsdkenc.c b/sys/msdk/gstmsdkenc.c index 6a0db481db..bc9d4d36e8 100644 --- a/sys/msdk/gstmsdkenc.c +++ b/sys/msdk/gstmsdkenc.c @@ -685,9 +685,12 @@ gst_msdkenc_finish_frame (GstMsdkEnc * thiz, MsdkEncTask * task, return GST_FLOW_ERROR; } - /* Wait for encoding operation to complete */ + /* Wait for encoding operation to complete, the magic number 300000 below + * is used in MSDK samples + * #define MSDK_ENC_WAIT_INTERVAL 300000 + */ MFXVideoCORE_SyncOperation (gst_msdk_context_get_session (thiz->context), - task->sync_point, 10000); + task->sync_point, 300000); if (!discard && task->output_bitstream.DataLength) { GstBuffer *out_buf = NULL; guint8 *data = diff --git a/sys/msdk/gstmsdkvpp.c b/sys/msdk/gstmsdkvpp.c index 5917590020..d6fe05610d 100644 --- a/sys/msdk/gstmsdkvpp.c +++ b/sys/msdk/gstmsdkvpp.c @@ -699,8 +699,12 @@ gst_msdkvpp_transform (GstBaseTransform * trans, GstBuffer * inbuf, if (status == MFX_ERR_MORE_DATA) goto error_more_data; + /* Wait for vpp operation to complete, the magic number 300000 below + * is used in MSDK samples + * #define MSDK_VPP_WAIT_INTERVAL 300000 + */ if (sync_point) - MFXVideoCORE_SyncOperation (session, sync_point, 10000); + MFXVideoCORE_SyncOperation (session, sync_point, 300000); /* More than one output buffers are generated */ if (status == MFX_ERR_MORE_SURFACE) {