On Wed Apr 23 03:51:34 2025 +0000, Brendan McGrath wrote:
I'll add one more thing. In all three cases, the `GST_EVENT_CAPS` event is still being sent downstream and in-band, but its only in the case that `decodebin` is still using the `memory:CUDAMemory` feature that we get the `not-negotiated` error (this is the log from one of my earlier comments, which shows the error scenario):
0:00:01.367038957 209283 0x7020700013a0 WARN basetransform gstbasetransform.c:1371:gst_base_transform_setcaps:<videoconvert0> transform could not transform video/x-raw(memory:CUDAMemory), format=(string)NV12, width=(int)1920, height=(int)1080, interlace-mode=(string)progressive, multiview-mode=(string)mono, multiview-flags=(GstVideoMultiviewFlagsSet)0:ffffffff:/right-view-first/left-flipped/left-flopped/right-flipped/right-flopped/half-aspect/mixed-mono, pixel-aspect-ratio=(fraction)1/1, colorimetry=(string)bt709, framerate=(fraction)30/1 in anything we support 0:00:01.367052022 209283 0x7020700013a0 DEBUG GST_PADS gstpad.c:5986:gst_pad_send_event_unchecked:<videoconvert0:sink> sent event, ret not-negotiated 0:00:01.373114496 209283 0x7020700013a0 DEBUG GST_SCHEDULING gstpad.c:4496:gst_pad_chain_data_unchecked:<deinterlace0:sink> called chainfunction &gst_deinterlace_chain with buffer 0x70205c012fd0, returned not-negotiated
The three cases I'm referring to being:
- The buffer arrives before the RECONFIGURE event (hence we're still
using the `memory:CUDAMemory` feature and we get the error); 2. The RECONFIGURE event occurs prior to the buffer (in which case we've negotiated away the the `memory:CUDAMemory` feature and the new caps is accepted); and 3. The `memory:CUDAMemory` feature is rejected before linking by `autoplug_query_cb`; added in this MR (hence the caps sent either side of the RECONFIGURE event is accepted)
Sorry about the delay, and thank you for the investigation. I wanted to get a clearer picture of the GStreamer bug, but I think it's clear that it is one, and this seems like a reasonable way to work around it regardless of where the fault ultimately lies.
There is a very long line introduced by the patch; please break it before the "||".
Please also adjust the commit message to read:
"nvh264dec fixates a caps using CUDAMemory, which is not accepted by deinterlace. Linking triggers a reconfigure, but due to a GStreamer bug some buffers are sent with the CUDAMemory caps, triggering a streaming error. Work around this by forcing all buffers to use system memory."
On investigation I don't think I see how pipeline creation is going to be sped up, since we always trigger a reconfigure anyway?