Hi,
I'm using the ducati plugin in gstreamer to create an H.264 stream. This basically works, but I see a problem where two consecutive encoder calls occasionally return the same buffer id for freeing.
This causes warnings, which don't stop operation, but the plugin uses the IDs to get the presentation time for the output frame from the input buffer.
It then goes on to 'unref' the buffer, causing more warnings.
I modded the code to assert that the buffer id is valid and print out its address:
if (!GST_IS_BUFFER(self->outArgs->freeBufID[0])) printf("not a buffer: %p\n", (void *)self->outArgs->freeBufID[0]); g_assert(GST_IS_BUFFER(self->outArgs->freeBufID[0]));
This causes it to bomb out when the problem occurs. With debug on, this causes the following output:
0:00:03.854569336 3998 0x94380 DEBUG ducati gstducatividenc.c:679:gst_ducati_videnc_handle_frame: Calling VIDENC2_process 0:00:03.864315918 3998 0x94380 DEBUG ducati gstducatividenc.c:685:gst_ducati_videnc_handle_frame:<ducatih264enc0> VIDENC2_process took 9566569ns (9 ms) 0:00:03.864632975 3998 0x94380 LOG ducati gstducatividenc.c:747:gst_ducati_videnc_handle_frame:<ducatih264enc0> free buffer: 0xb5704100 0:00:03.865297852 3998 0x94380 DEBUG ducati gstducatividenc.c:679:gst_ducati_videnc_handle_frame: Calling VIDENC2_process 0:00:03.875443522 3998 0x94380 DEBUG ducati gstducatividenc.c:685:gst_ducati_videnc_handle_frame:<ducatih264enc0> VIDENC2_process took 10017578ns (10 ms) 0:00:03.875767416 3998 0x94380 LOG ducati gstducatividenc.c:747:gst_ducati_videnc_handle_frame:<ducatih264enc0> free buffer: 0xb5704090 0:00:03.876374837 3998 0x94380 DEBUG ducati gstducatividenc.c:679:gst_ducati_videnc_handle_frame: Calling VIDENC2_process 0:00:03.886103028 3998 0x94380 DEBUG ducati gstducatividenc.c:685:gst_ducati_videnc_handle_frame:<ducatih264enc0> VIDENC2_process took 9562988ns (9 ms) (gst-launch-0.10:3998): GLib-GObject-WARNING **: invalid unclassed pointer in cast to 'GstBuffer' not a buffer: 0xb5704090 ** ERROR:gstducatividenc.c:735:gst_ducati_videnc_handle_frame: assertion failed: (GST_IS_BUFFER(self->outArgs->freeBufID[0])) Aborted
You can see that the buffer that is not a GST_BUFFER (not a buffer) has the same address as the one free'd in the previous encode cycle.
I changed the plugin code to zero out the ID passed back in each frame after freeing it, so this value does appear to be coming from the encoder process, or maybe copied from unflushed cached memory?
I'm using:
ipc_3_21_00_07, ipumm_3_00_03_04, libdce2-06793e9 and gst-plugin-ducati-6ca21aa3 (last two from git).
Thanks,
Nick.