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 401072 - Move libgimme-codec helper functions to GStreamer
Move libgimme-codec helper functions to GStreamer
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gst-plugins-base
git master
Other Linux
: Normal enhancement
: 0.10.12
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks: 401074
 
 
Reported: 2007-01-26 17:12 UTC by Bastien Nocera
Modified: 2007-02-02 20:45 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
patch adding plugin install API and unit tests (20.22 KB, patch)
2007-01-28 12:32 UTC, Tim-Philipp Müller
none Details | Review
updated patch (48.58 KB, patch)
2007-01-29 14:07 UTC, Tim-Philipp Müller
none Details | Review
updated patch, take #3 (27.86 KB, patch)
2007-01-31 19:22 UTC, Tim-Philipp Müller
none Details | Review

Description Bastien Nocera 2007-01-26 17:12:45 UTC
libgimme-codec is far too small to be packaged by itself.

I would be good to have libgimme-codec "integrated" in GStreamer (probably using the same helper application if possible), so that all GStreamer apps could get advantage of the automated plugins installation.
Comment 1 Tim-Philipp Müller 2007-01-28 12:32:47 UTC
Created attachment 81366 [details] [review]
patch adding plugin install API and unit tests

Patch adds gst_install_plugins_*() API and some basic unit tests.

Shame we can't keep the old naming (or can we?) - gst_gimme_codec or / gst_gimme_plugin is much snazzier IMHO.
Comment 2 Tim-Philipp Müller 2007-01-29 14:07:29 UTC
Created attachment 81433 [details] [review]
updated patch

New patch, addressing some of the issues raised on IRC:

The main issue is the XID argument to gst_plugin_install_{sync|async}. We should replace this with something that's not platform-specific. or get rid of it completely. IMHO the latter is not a good idea, because it's something distros seem to want (to make it transient to the application window while the plugin installation is in progress) and they'll do it one way or another, so let's just make it part of the API instead of forcing them to patch stuff all over the place to make this work.

So instead of an xid we now pass a GstPluginInstallContext argument, and apps can set their XID on the context before passing it in. This allows us to add variants that make sense on win32/OSX/BeOS/whatever later. Also, it allows us to easily add other useful things later on.

Also improved the docs a bit:
 - mention that gst_install_plugins_sync() should usually not be used
 - some additinos to gst_install_plugins_async()
 - for both mention where the installer detail strings come from

Also added a function:
 - gst_install_plugins_installation_in_progress()
Comment 3 Bastien Nocera 2007-01-29 14:22:49 UTC
(In reply to comment #2)
> Created an attachment (id=81433) [edit]
> updated patch
> 
> New patch, addressing some of the issues raised on IRC:
> 
> The main issue is the XID argument to gst_plugin_install_{sync|async}. We
> should replace this with something that's not platform-specific. or get rid of
> it completely. IMHO the latter is not a good idea, because it's something
> distros seem to want (to make it transient to the application window while the
> plugin installation is in progress) and they'll do it one way or another, so
> let's just make it part of the API instead of forcing them to patch stuff all
> over the place to make this work.

"
GdkNativeWindow
Used to represent native windows (Windows for the X11 backend, HWNDs for Win32). 
"

Can't use Gdk in GStreamer?
Comment 4 Tim-Philipp Müller 2007-01-30 10:43:42 UTC
> "GdkNativeWindow: Used to represent native windows (Windows for the
> X11 backend, HWNDs for Win32)."
>
> Can't use Gdk in GStreamer?

In GStreamer as such yes, but not really in this utility lib. Seems a bit heavy-handed to link to or header-wise depend on Gdk plus the entire dependency chain just to get something that basically amounts to a pointer typedef (?). Also, I am not sure it actually helps us get the information we need (something to pass on to another process so it knows which window to make itself transient to).

IMHO it's best (easiest) to punt the implementation details for OSX/WIN32 for now and know it can easily be added in future if/when the need arises.

As an alternative to the context stuff we could just turn _install_*sync() into a vararg function with documented key/type/value triplets, but that's not very bindings friendly as far as I am aware.
Comment 5 Tim-Philipp Müller 2007-01-31 19:22:10 UTC
Created attachment 81622 [details] [review]
updated patch, take #3

Updated again. Changes to previous version:

 - add --with-install-plugins-helper option to configure so
   distros can easily set the install helper to use (defaults
   to something based on prefix otherwise - which makes sense
   since a helper in a non-prefix would typically install
   plugins in that other prefix and not in ours).

 - some small docs fixes/additions; add bits to generate API docs.

 - attach diffs for each file only once and not twice
Comment 6 Tim-Philipp Müller 2007-02-02 20:45:22 UTC
Committed, with a few more small changes (add 'Since' to docs; document return enums better, shuffle a few of the return enums around a bit):

2007-02-02  Tim-Philipp Müller  <tim at centricular dot net>

	* gst-libs/gst/utils/Makefile.am:
	* gst-libs/gst/utils/base-utils.h:
	* gst-libs/gst/utils/install-plugins.c:
	(gst_install_plugins_context_set_xid),
	(gst_install_plugins_context_new),
	(gst_install_plugins_context_free),
	(gst_install_plugins_get_helper),
	(gst_install_plugins_spawn_child),
	(gst_install_plugins_return_from_status),
	(gst_install_plugins_installer_exited),
	(gst_install_plugins_async), (gst_install_plugins_sync),
	(gst_install_plugins_return_get_name),
	(gst_install_plugins_installation_in_progress):
	* gst-libs/gst/utils/install-plugins.h:
	  API: add API for applications to initiate installation of missing
	  plugins, ie. gst_install_plugins_async() primarily.
	  Based on libgimme-codec by Ryan Lortie.

	* configure.ac:
	  Add --with-install-plugins-helper configure option so distros can specify
	  the path of the helper script or program to call when plugin installation
	  is requested (distros: please do any argument munging in this helper
	  script instead of patching GStreamer to pass arguments differently
	  to another program directly).

	* docs/libs/gst-plugins-base-libs-docs.sgml:
	* docs/libs/gst-plugins-base-libs-sections.txt:
	  Build and document new API.

	* tests/check/libs/utils.c: (result_cb),
	(test_base_utils_install_plugins_do_callout), (GST_START_TEST),
	(libgstbaseutils_suite):
	  Some simple checks for the new API.