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 583187 - [API] add gst_adapter_masked_scan_uint32() and gst_adapter_get_buffer()
[API] add gst_adapter_masked_scan_uint32() and gst_adapter_get_buffer()
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gstreamer (core)
git master
Other Linux
: Normal enhancement
: 0.10.24
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2009-05-19 10:14 UTC by Tim-Philipp Müller
Modified: 2009-05-19 22:41 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
proposed new API - needs more work (4.19 KB, patch)
2009-05-19 10:14 UTC, Tim-Philipp Müller
none Details | Review

Description Tim-Philipp Müller 2009-05-19 10:14:00 UTC
Found those in the new video base classes in libgstvideo in -base. We should move them to GstAdapter though IMHO.

Attached a half-finished patch.
Comment 1 Tim-Philipp Müller 2009-05-19 10:14:42 UTC
Created attachment 134922 [details] [review]
proposed new API - needs more work
Comment 2 Wim Taymans 2009-05-19 11:09:37 UTC
Ah cool, scan functions for adapter are something I wanted too. 
Comment 3 David Schleef 2009-05-19 16:27:17 UTC
gst_adapter_get_buffer() is a hack to get some sort of timestamps out of an adapter in BaseVideoDecoder.  The BVD code doesn't work correctly, and a proper implementation won't use gst_adapter_get_buffer().

It would be nice to have some method of getting timestamps and buffer metadata for certain bytes in the adapter, but I don't think get_buffer() is the right API for that.
Comment 4 Wim Taymans 2009-05-19 16:33:55 UTC
there is code in adapter right now to get the last known timestamp for the current adapter byte and the offset since that timestamp. I don't know your use case but I found that to be a good way to get timestamps for libvisual and ffmpeg.
Comment 5 Wim Taymans 2009-05-19 17:59:18 UTC
The get_buffer() call is not so nice and could not return anything useful when buffers were merged.

<random idea>I was thinking of gst_adapter_push_meta(GQuark) that would track a generic metadata struct that can be retrieved with the quark again</random idea>
Comment 6 Wim Taymans 2009-05-19 22:41:08 UTC
commit 270723c85c66c5232c45e0a8fa15f4a4630813c0
Author: Wim Taymans <wim.taymans@collabora.co.uk>
Date:   Wed May 20 00:37:53 2009 +0200

    adapter: add _masked_scan_uint32
    
    Add a reasonably optimized new gst_adapter_masked_scan_uint32() function
    to scan the adapter for a pattern after applying a mask.
    
    Add some unit tests.
    
    API: GstAdapter::gst_adapter_masked_scan_uint32()
    
    Fixes #583187