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 741427 - RFC: gst-launch/gst-inspect support for presets
RFC: gst-launch/gst-inspect support for presets
Status: RESOLVED OBSOLETE
Product: GStreamer
Classification: Platform
Component: gstreamer (core)
1.x
Other Linux
: Normal enhancement
: git master
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2014-12-12 08:45 UTC by Stefan Sauer (gstreamer, gtkdoc dev)
Modified: 2018-11-03 12:24 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
gst-inspect: print preset names (1.33 KB, patch)
2014-12-15 13:06 UTC, Stefan Sauer (gstreamer, gtkdoc dev)
committed Details | Review
parse: add support for presets (3.04 KB, patch)
2014-12-30 10:52 UTC, Stefan Sauer (gstreamer, gtkdoc dev)
none Details | Review

Description Stefan Sauer (gstreamer, gtkdoc dev) 2014-12-12 08:45:58 UTC
Hi,

gst-inspect could list the preset names if an element implements the preset iface.

gst-launch could support a 'special' property called "@preset" to load a preset. e.g.
gst-launch uridecodebin uri="..." ! equalizer @preset="disco" ! ...

The rational for "@preset" is that it would not clash with other properties. Better ideas are welcome. if it sounds like a plan, I have a xmas vacation project :)
Comment 1 Tim-Philipp Müller 2014-12-15 11:42:01 UTC
+1 for gst-inspect showing the names.

Not a fan of that special @preset thing. I don't see why we need to hack around the lack of interfaces support in gst-launch for this particular interface. You could add a "preset" property to GstPreset and all GstPreset-using elements, although that would probably not be 100% backwards-compatible. But then, is anyone using the interface outside of our trees?
Comment 2 Stefan Sauer (gstreamer, gtkdoc dev) 2014-12-15 13:06:31 UTC
Created attachment 292748 [details] [review]
gst-inspect: print preset names
Comment 3 Stefan Sauer (gstreamer, gtkdoc dev) 2014-12-15 13:44:34 UTC
Tim, if we'd add a 'preset' property, every element would need to implement it. And that just in order to support gst-launch. Apps would use the preset iface. Secondly, there is some risk that an element already has a property called 'preset' :/

To my knowledge we just have the equalizer and freeverb supporting presets. Right now I am proposing in #611689 to also implement the preset iface.

For freeverb I never submitted them (will do that right away). Lots of encoders have the preset iface added, but no one added a preset file so far.

Please also note that my proposal of @preset was not meant to hack around the lack of interfaces support in gst-launch, quite the contrary. If we want to support e.g. the preset iface in gst-launch, we need a syntax for it, so that the parser can match on it. Better ideas for the syntax are welcome. I proposed @preset as some command-line tools use this notation for commandline parameter files and I thought this metaphor matches quite nicely to what presets are for element-properties.
Comment 4 Stefan Sauer (gstreamer, gtkdoc dev) 2014-12-21 13:35:38 UTC
http://cgit.freedesktop.org/gstreamer/gstreamer/tree/gst/parse/parse.l#n65

properties are set as

_identifier [[:alnum:]_][[:alnum:]\-_%:]*
_char ("\\".)|([^[:space:]])
_string {_char}+|("\""([^\"]|"\\\"")*"\"")|("'"([^']|"\\\'")*"'")
_assign [[:space:]]*"="[[:space:]]*
_assignment {_identifier}{_assign}{_string}

for presets I'd add:

_preset @preset
_preset @preset{_assign}{_string}

+ the code to handle handle it. Any better ideas?
Comment 5 Stefan Sauer (gstreamer, gtkdoc dev) 2014-12-30 10:52:15 UTC
Created attachment 293471 [details] [review]
parse: add support for presets

Can be tested as:
gst-launch-1.0 audiotestsrc wave=ticks ! freeverb @preset="cathedral" ! pulsesink
gst-launch-1.0 audiotestsrc wave=ticks ! freeverb @preset="engine room" ! pulsesink

We could simplify the syntax:
... ! freeverb @"cathedral" ! ...

If we have consensus on the syntax, I'll update the man-page for gst-launch and add tests.
Comment 6 Yann Dirson 2015-12-01 14:16:57 UTC
The x264enc element has some presets now, allowing to select a H.264 profile.
Commandline support to help testing those would be welcome!
Comment 7 Yann Dirson 2015-12-01 14:25:06 UTC
For the gst-inspect aspect: getting the list of presets, as is the case with 1.6.1,
is nice, but would be much more useful if it printed the property values with them.

That would even provide an interim solution to the use of presets in gst-launch until
an interface is agreed upon, by allowing to cut'n'paste the preset contents into the
gst-launch CLI :)
Comment 8 GStreamer system administrator 2018-11-03 12:24:45 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/86.