Launchpad Entry: https://launchpad.net/distros/ubuntu/+spec/gnome-app-install-codecs
Packages affected: gnome-app-install
gnome-app-install needs to be modified to install codecs. The reasons are:
- we should have a separate database for codecs/other plugins than we have for the mime types
- we need to be able to install multiple things at once (several --codec parameters)
- we need to be able to give an XID to become modal for
The following options should be added:
--transient-for: this option will cause the gnome-app-install window to be declared as a transient for the window with the given XID. this can be done using gdk_window_set_transient_for (with gdk_window_foreign_new).
--codec: perform lookup of a given codec.
Multiple --codec options should be accepted.
The install should only be attempted if all of the codecs can be found.
An example invocation will look like:
gnome-app-install --transient-for=12345 --codec=vorbis --codec=theora
where "vorbis" and "theora" are strings of a special format that will be decided later.
The idea is that the codec packages will include a gst-inspect type of thing during their build processes which creates a metadata file inside the package (similar to the current .desktop files) from which the database can be generated.
When --codec is specified, gnome-app-install will:
- Search for the codec(s) specified in the database of suitable and available apps
- If at least one application is found for each specified codec string, provide the user with a UI for selecting application(s) to install, and install those applications if the user selects. Any errors from the application installation will be reported to the user by gnome-app-install.
Exit status and error handling
mvo: this section is obsoleted by: http://gstreamer.freedesktop.org/data/doc/gstreamer/head/gst-plugins-base-libs/html/gst-plugins-base-libs-gstbaseutilsinstallplugins.html
- 0: g-a-i has installed at least one application. Nothing has been be printed to g-a-i's stderr. If there are still missing codecs, the application should rerun gnome-app-install specifying exactly the now-missing codecs. This exit status of 0 is the only situation where the application should rerun g-a-i if it finds that codecs are still missing after g-a-i finishes.
- 2: g-a-i has attempted some installations but there were installation problems. The problems with installation have been reported to the user already. A message similar to "additional codec installation failed" has been printed to g-a-i's stderr.
- 3: The user has declined to install any applications. A message similar to "additional codec installation declined" has been printed to g-a-i's stderr.
- 4-7: There has been some problem. (Details: reserved for future use.) The cause of the problem has already been reported to the user. A brief message summarising the problem has been printed to g-a-i's stderr.
8: For at least one codec, no application(s) suitable for automatic installation can be found (see SuggestPackagesForFiletypesSpec). No new codec installation has been attempted. This has not yet been reported to the user. "No application suitable for automatic installation could be found for the codec(s) <codec>" has been printed to g-a-i's stderr.
9: for at least one codec, no application(s) can be found. No new codec installation has been attempted. This has not yet been reported to the user. "No application could be found for the codec(s) <codec>" has been printed to g-a-i's stderr.
- 10-15: There has been some problem. (Details: reserved for future use.) The cause of the problem has not already been reported to the user. A brief message summarising the problem has been printed to g-a-i's stderr.
In all of the above cases g-a-i has printed a message to stderr summarising the problem, as noted. These message to stderr has been been translated into an appropriate language already, if necessary. The caller should capture stderr from g-a-i for use in error reporting. A naive program could just capture g-a-i's stderr and use the string provided and could treat all of the above exit statuses identically.
1,16-255: gnome-app-install has crashed, malfunctioned, or there is some serious installation problem. Some message has been written to stderr useful for debugging but not necessarily suitable for direct presentation to the user - when the caller presents this message to the user, there should be some "framing" text. For example: "The search for a suitable codec could not be conducted. The attempt produced the following diagnostic message: <python stacktrace or whatever came from g-a-i's stderr>".
- SIGTERM: gnome-app-install has been terminated deliberately by something. This hasn't been reported to the user (obviously).
- Other fatal signal: gnome-app-install has crashed. This hasn't been reported to the user (obviously).
In all of those crash cases it would be a mistake to rerun g-a-i.
Note that the above interface specification deliberately leaves unspecified whether g-a-i will prefer to return an error, or claim success, if some installations succeeded and some failed or were declined. The specification above allows g-a-i to control whether it will be reinvoked if the application finds that the codecs are still insufficient: if it exits 0, the application should rerun g-a-i in that case, otherwise it must not.
We will have g-a-i exit 0 if any package installations succeeded, preferring to rerun it. But if this turns out to be annoying for the user we will change g-a-i to prefer to report error returns (or perhaps augment its own error dialogues).
- straight-up modification to the gnome-app-install
- modification to the build process for codecs to create the metadata file
- modification to the cron job that runs to generate the gnome-app-install database
Codec specifier strings are as described in s4 of http://webcvs.freedesktop.org/gstreamer/gstreamer/docs/random/draft-missing-plugins.txt?revision=1.3&view=markup; the string passed to g-a-i as the "codec" is the final entry from the string ID, ie only the "identifier string for the required component"
To be decided during implementation
The following questions remain:
- location in .deb and format for codec metadata file
- format and location for g-a-i database (app-install-data package)
The exact details here will be done however is convenient and this wiki page updated with the actual details from the implementation.