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 786800 - harness: add support for pushing BufferList
harness: add support for pushing BufferList
Status: RESOLVED OBSOLETE
Product: GStreamer
Classification: Platform
Component: gstreamer (core)
git master
Other Linux
: Normal enhancement
: git master
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2017-08-25 12:44 UTC by Miguel París Díaz
Modified: 2018-11-03 12:42 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
harness: add support for pushing BufferList (2.30 KB, patch)
2017-08-25 12:44 UTC, Miguel París Díaz
none Details | Review
harness: add support for pushing BufferList (2.34 KB, patch)
2017-08-28 14:38 UTC, Miguel París Díaz
none Details | Review

Description Miguel París Díaz 2017-08-25 12:44:13 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.
Comment 1 Miguel París Díaz 2017-08-28 14:38:58 UTC
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.
Comment 2 Tim-Philipp Müller 2017-08-28 20:52:08 UTC
> 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.
Comment 3 Miguel París Díaz 2017-08-29 10:13:29 UTC
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?
Comment 4 Miguel París Díaz 2017-08-29 10:14:38 UTC
Sorry,
change
  buffer = gst_buffer_list_get (list, len - 1);
to
  buffer = gst_buffer_list_get (list, i);
Comment 5 Nicolas Dufresne (ndufresne) 2017-08-29 14:58:38 UTC
(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).
Comment 6 Tim-Philipp Müller 2017-08-29 16:24:59 UTC
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.
Comment 7 Miguel París Díaz 2017-09-04 10:24:43 UTC
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?
Comment 8 GStreamer system administrator 2018-11-03 12:42:15 UTC
-- 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.