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 634687 - RFC: operation hints for GstElement
RFC: operation hints for GstElement
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: 532307 564749
 
 
Reported: 2010-11-12 15:49 UTC by Stefan Sauer (gstreamer, gtkdoc dev)
Modified: 2018-11-03 12:14 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
element: implement hint flags (4.61 KB, patch)
2011-04-11 10:52 UTC, Mark Nauwelaerts
none Details | Review
element: implement hint flags (8.41 KB, patch)
2011-04-12 13:38 UTC, Mark Nauwelaerts
needs-work Details | Review

Description Stefan Sauer (gstreamer, gtkdoc dev) 2010-11-12 15:49:12 UTC
Bug #564749 mostly blocks on the GstTagReaderIface. An alternative would be to have a set of hint-flags on GstElement. Those flags can be set on the pipeline, individual bins and even elements. Bins could propagate the hints to new children and hint-changes to existing children.

The purpose of the hints is to specify the intended use case a bit more to give elements a chances for optimization. Right now gstreamer elements prepare to support everything.

Some use cases
1) quickly play something from start to end
- no need for metadata
- no seeking/no playback rate changes
- no  mucking with the pipeline at all until eos

2) quick metadata reading
- no prerolling
- no seektable building

3) no caps changes (video in fullscreen)
- quicker pad_alloc or even no need to check for caps changes in basetransform

No proposal for a set of hints yet :/
Comment 1 Stefan Sauer (gstreamer, gtkdoc dev) 2010-11-15 19:49:33 UTC
An alternative to use-case flags would be a means of telling that the app is not interested in certain message and not going to send certain events and queries.

At least that could cover 1) & 2)
Comment 2 Stefan Sauer (gstreamer, gtkdoc dev) 2011-02-09 11:22:07 UTC
One more item for the initial comment category 1) is avoid building the GstIndex (like it is done in QtDemux now).
Comment 3 Tim-Philipp Müller 2011-02-09 11:29:49 UTC
> avoid building the GstIndex (like it is done in QtDemux now)

This is usually achieved by not setting one in the first place.
Comment 4 Mark Nauwelaerts 2011-04-11 10:52:26 UTC
Created attachment 185691 [details] [review]
element: implement hint flags

Straightforward approach to implementing suggested hint flags.

Obviously one can up with all sorts of if'ing examples/applications of demuxers skipping some index or metadata parsing steps depending on configured hint flags, but not that much point until API to do so is agreed upon and stabilizes.
Comment 5 Stefan Sauer (gstreamer, gtkdoc dev) 2011-04-11 13:33:58 UTC
Review of attachment 185691 [details] [review]:

Looks good. Few small comments below. I wonder if we want to make this an element property (then we can test this on gst-launch). The we could also use the property-flags to document that e.g. it cannot be changed in state >=PAUSED (imho a sensible restriction).

::: gst/gstelement.c
@@ +550,3 @@
+ * @hints: the hints to set.
+ *
+ * Sets the hints of an element. See gst_element_get_base_time().

copy'n'paste mistake here in the reference.

@@ +566,3 @@
+  GST_OBJECT_UNLOCK (element);
+
+  GST_DEBUG_OBJECT (element, "set hints=%08x, old %08x", hints, old);

This will yield a compiler warning about unused var 'old' when logging is off.

::: gst/gstelement.h
@@ +61,3 @@
+ * it to optimize for that purpose and possibly discard unneccesary actions
+ * and steps.
+ */

Maybe mention, that by default elements will prepare for all features to be used.
Comment 6 Mark Nauwelaerts 2011-04-12 13:38:00 UTC
Created attachment 185791 [details] [review]
element: implement hint flags

Next version with some adjustments as suggested.

Maybe the hint type flag registering belongs elsewhere, but for now it is "tucked in there".
Comment 7 Sebastian Dröge (slomo) 2011-05-26 11:20:19 UTC
Comment on attachment 185791 [details] [review]
element: implement hint flags

Looks good to me, what shall we do about this?

Apart from that you can let the GType of the flags get generated by glib-mkenums somehow
Comment 8 Tim-Philipp Müller 2016-11-12 13:42:56 UTC
Comment on attachment 185791 [details] [review]
element: implement hint flags

This should be implemented with GstContext, and perhaps it should just be part of a bigger GstPipelineContext or GstBinContext or whatnot.
Comment 9 Stefan Sauer (gstreamer, gtkdoc dev) 2016-11-12 19:44:24 UTC
IMHO GstPipelineContext/GstBinContext would not be a good name. A GstContext implies some shared state. But indeed we could implement a GstUsageHintContext.
Comment 10 Tim-Philipp Müller 2016-11-12 20:12:58 UTC
Whatever the name, it would be shared state that's propagated through the pipeline hierarchy. The point of the suggestion was to have a more general context struct which can be used for this but also other things.
Comment 11 GStreamer system administrator 2018-11-03 12:14:18 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/17.