GNOME Bugzilla – Bug 793236
test:msdkh264enc: get a fail by using attach unit test patch.
Last modified: 2018-03-09 19:44:00 UTC
Created attachment 367976 [details] [review] unit test patch for msdkh264enc. 1. apply the attach patch to gst-plugins-bad master branch. 2. ./autogen 3. make check Fail log: FAIL: elements/msdkh264enc ========================== Running suite(s): msdkh264enc 0:00:00.143456364 ^[[334m12537^[[00m 0x1f15270 ^[[36mINFO ^[[00m ^[[00m msdkenc msdk.c:344:msdk_open_session:^[[00m MSDK implementation: 0x0001 (SOFTWARE) 0:00:00.143490253 ^[[334m12537^[[00m 0x1f15270 ^[[36mINFO ^[[00m ^[[00m msdkenc msdk.c:345:msdk_open_session:^[[00m MSDK version: 1.23 0%: Checks: 1, Failures: 1, Errors: 0 elements/msdkh264enc.c:104:F:general:msdk_h264enc:0: Assertion 'gst_pad_push (srcpad, gst_buffer_ref (buffer)) == GST_FLOW_OK' failed Check suite msdkh264enc ran in 0.056s (tests failed: 1)
Hi Fei, I don't follow the purpose of this bug 1. To merge this unit test? 2. To fix the test? 3. Or to fix the encoder?
(In reply to Víctor Manuel Jáquez Leal from comment #1) > Hi Fei, > > I don't follow the purpose of this bug > > 1. To merge this unit test? > 2. To fix the test? > 3. Or to fix the encoder? @Victor, I wish this unit test could be merged first. And also, we need this bug to track the fail of encoder by this unit test.
Created attachment 368172 [details] [review] fix msdkh264enc gst push pad fail.
With this patch, gst push pad success. But another fail: elements/msdkh264enc.c:112:F:general:msdk_h264enc:0: 'g_list_length (buffers)' (9) is not equal to '10' (10)
Confirmed, Fei. Found a cause and preparing a patch but I need to wait until patches on #bug 790752 is fished.
Created attachment 368738 [details] [review] msdk: enc: fix missing some frames to be encoded There was not handling the end of encoding sequence in encoder. This patch does drain any remaining internal streams while decoder already does this. Document says: "To mark the end of the encoding sequence, call this function with a NULL surface pointer. Repeat the call to drain any remaining internally cached bitstreams—one frame at a time—until MFX_ERR_MORE_DATA is returned."
Note that this patch is based on patches in bug #793413
Review of attachment 368738 [details] [review]: ::: sys/msdk/gstmsdkenc.c @@ +793,3 @@ + for (;;) { + task = thiz->tasks + thiz->next_task; + gst_msdkenc_finish_frame (thiz, task, FALSE); what if gst_msdkenc_finish_frame() fails?
(In reply to Víctor Manuel Jáquez Leal from comment #8) > Review of attachment 368738 [details] [review] [review]: > > ::: sys/msdk/gstmsdkenc.c > @@ +793,3 @@ > + for (;;) { > + task = thiz->tasks + thiz->next_task; > + gst_msdkenc_finish_frame (thiz, task, FALSE); > > what if gst_msdkenc_finish_frame() fails? That is like gst_msdkdec_drain in decoder. There is a message saying "failed to finish the task %p, but keep draining for the remaining frames". Do you want to put this message also here?
Created attachment 369405 [details] [review] enc: fix missing some frames to be encoded There was not handling the end of encoding sequence in encoder. This patch does drain any remaining internal streams while decoder already does this. Document says: "To mark the end of the encoding sequence, call this function with a NULL surface pointer. Repeat the call to drain any remaining internally cached bitstreams—one frame at a time—until MFX_ERR_MORE_DATA is returned." ------------------- rebased.
@Fei: Please squash the patches. Also, add the support in meson.build
Review of attachment 369405 [details] [review]: Pushed as commit 491843085817ba9c5bc98f8d4087a1cc7ab4fad6
Created attachment 369478 [details] [review] msdkh264 encode unit test. @Sree, squashed, and added the test unit to meson.build. Please have a review.
Review of attachment 369478 [details] [review]: Pushed as commit 1192a598eee41395f632cfebd2d8fb4bec08af7f