After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 781119 - v4l2: No timestamp set when importing dma buffer on V4L2_OUTPUT interface
v4l2: No timestamp set when importing dma buffer on V4L2_OUTPUT interface
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gst-plugins-good
1.x
Other Linux
: Normal normal
: 1.11.91
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2017-04-10 08:56 UTC by Todor Tomov
Modified: 2017-04-11 07:17 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Copy the timestamp from the exported buffer to the imported one (948 bytes, patch)
2017-04-10 08:56 UTC, Todor Tomov
committed Details | Review
Output log (226.52 KB, text/plain)
2017-04-10 08:57 UTC, Todor Tomov
  Details
Kernel log with v4l2 debug enabled (95.77 KB, text/plain)
2017-04-10 08:57 UTC, Todor Tomov
  Details
Copy the timestamp in usrptr case (913 bytes, patch)
2017-04-10 14:37 UTC, Todor Tomov
committed Details | Review

Description Todor Tomov 2017-04-10 08:56:44 UTC
Created attachment 349588 [details] [review]
Copy the timestamp from the exported buffer to the imported one

When dma buffer import is done the timestamp of the imported buffer is not set. I have hit this problem when using v4l2src and video encoder plugin on DB410c. When dma buffers are exported from v4l2src and imported in encoder, the missing timestamp leads to no processing in encoder.

I have made a simple fix to copy the timestamp from the exported buffer to the imported one - attached in copy_timestamp.patch.

I also attach gst output log and kernel log with v4l2 debug enabled.

I use gstreamer version 1.10.4.
Comment 1 Todor Tomov 2017-04-10 08:57:27 UTC
Created attachment 349589 [details]
Output log
Comment 2 Todor Tomov 2017-04-10 08:57:55 UTC
Created attachment 349590 [details]
Kernel log with v4l2 debug enabled
Comment 3 Nicolas Dufresne (ndufresne) 2017-04-10 14:14:31 UTC
Review of attachment 349588 [details] [review]:

This is correct indeed. It does not matter for sinkpad (capture interfaces), but it does matter for srcpad (V4L2_OUTPUT). Can you also add those two lines in gst_v4l2_buffer_pool_import_userptr() ? If you don't have time let me know, I'll do that later today.
Comment 4 Todor Tomov 2017-04-10 14:37:44 UTC
Created attachment 349613 [details] [review]
Copy the timestamp in usrptr case

This is the diff for the usrptr case however I don't have a system to test this - it is build-tested only.
Comment 5 Nicolas Dufresne (ndufresne) 2017-04-10 15:06:32 UTC
(In reply to Todor Tomov from comment #4)
> Created attachment 349613 [details] [review] [review]
> Copy the timestamp in usrptr case
> 
> This is the diff for the usrptr case however I don't have a system to test
> this - it is build-tested only.

I'm no worried, thanks. For your interest, the UVC driver supports it.
Comment 6 Nicolas Dufresne (ndufresne) 2017-04-10 16:07:54 UTC
Hmm, UVC driver is a capture driver, so other then going through the new code it wouldn't be testing anything, since the TS will be replaced when the buffer is dequeued (captured). Still not worried.
Comment 7 Nicolas Dufresne (ndufresne) 2017-04-10 18:14:20 UTC
I've squashed and wrote a commit message for both.

See 081bae28499612734b8e5c66ed2088b286315811
Comment 8 Nicolas Dufresne (ndufresne) 2017-04-10 18:14:57 UTC
Thanks for you contribution.
Comment 9 Todor Tomov 2017-04-11 07:17:58 UTC
Thank you Nicolas for your fast response.