GNOME Bugzilla – Bug 786800
harness: add support for pushing BufferList
Last modified: 2018-11-03 12:42:15 UTC
Created attachment 358399 [details] [review] harness: add support for pushing BufferList Providing support for pushing BufferList in Harness is quite useful to test elements being able to handle it. In this way we could easily test that the behavior is the expected, that there is not memory leaks, etc.
Created attachment 358594 [details] [review] harness: add support for pushing BufferList Fix getting the PTS of the last buffer in the list to assign last_push_ts.
> Fix getting the PTS of the last buffer in the list to assign last_push_ts. This is not really right. Typically a buffer list will have one timestamp, and that's on the first buffer. Of course it might contain buffers with multiple timestamps, so you could do your check but there should always be a fallback to the first buffer imho.
Hello @tim!! Thanks for the feedback, but unfortunately I cannot agree because it depends on the use case, specifically on the point where the BufferList is created or modified, so it can contain Buffers with different timestamps. From my point of view the meaning of pushing a BufferList with N buffers is the same that independently pushing each Buffer in the BufferList in the same order: { GstHarness *h = ...; int i; for (i = 0; i < gst_buffer_list_length (list); i++) { GstBuffer *buffer; buffer = gst_buffer_list_get (list, len - 1); gst_harness_push (h, buffer); } } Hence, the last_push_ts is the timestamp of the last Buffer in the BufferList. What do you think?
Sorry, change buffer = gst_buffer_list_get (list, len - 1); to buffer = gst_buffer_list_get (list, i);
(In reply to Miguel París Díaz from comment #3) > Hence, the last_push_ts is the timestamp of the last Buffer in the > BufferList. > > What do you think? I disagree. The purpose of the timestamp on the bufferlist is for synchronization purpose. If it's set to the last timestamp in the list, all buffers will be late. For anything else then passing the entire list, one should look at each buffer timestamp (if set).
There is an existing convention / usage definition, and that's to put "the timestamp for the bufferlist" on the first buffer. You are free to look at the last buffer(s) as well, but if you don't handle the case where only the first buffer has a timestamp and the other buffers don't, then you're simply not handling things properly. That's what I was trying to get at.
OK, I see. So, what do you think about iterating the buffers in the list in reverse order and get the timestamp from the first one which has a valid PTS?
-- GitLab Migration Automatic Message -- This bug has been migrated to freedesktop.org's GitLab instance and has been closed from further activity. You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.freedesktop.org/gstreamer/gstreamer/issues/247.