Bug 327211 - RFE: Totem should build both the xine and gstreamer backends
Summary: RFE: Totem should build both the xine and gstreamer backends
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Fedora
Classification: Fedora
Component: totem
Version: rawhide
Hardware: All
OS: Linux
low
low
Target Milestone: ---
Assignee: Bastien Nocera
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2007-10-11 04:21 UTC by Stewart Adam
Modified: 2008-05-19 09:32 UTC (History)
3 users (show)

Fixed In Version: 2.23.2-2.fc9
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2008-05-19 09:32:25 UTC
Type: ---
Embargoed:
bnocera: fedora_requires_release_note+


Attachments (Terms of Use)
New totem spec file (10.72 KB, text/plain)
2007-10-11 04:21 UTC, Stewart Adam
no flags Details
Patch to add the new gconf option (613 bytes, patch)
2007-10-11 04:22 UTC, Stewart Adam
no flags Details | Diff
Script to retrieve and run the correct backend based on gconf values (378 bytes, text/plain)
2007-10-11 04:23 UTC, Stewart Adam
no flags Details
totem.spec patch (10.46 KB, patch)
2007-10-13 01:04 UTC, Stewart Adam
no flags Details | Diff
Script used to start backend-specific binaries (1.75 KB, text/plain)
2007-10-13 01:04 UTC, Stewart Adam
no flags Details
Schema patch to support "backend" key/value pair (603 bytes, patch)
2007-10-13 01:05 UTC, Stewart Adam
no flags Details | Diff
Script used to start backend-specific binaries (1.75 KB, text/plain)
2007-10-13 02:10 UTC, Stewart Adam
no flags Details
Script used to start backend-specific binaries (1.75 KB, text/plain)
2007-10-20 15:57 UTC, Stewart Adam
no flags Details
totem.spec patch for 2.21.1 (11.60 KB, patch)
2007-11-03 05:49 UTC, Stewart Adam
no flags Details | Diff
Script used to start backend-specific binaries (1.75 KB, application/x-sh)
2007-11-03 05:54 UTC, Stewart Adam
no flags Details
New patch for 2.21.95 (14.09 KB, patch)
2008-03-03 18:12 UTC, Stewart Adam
no flags Details | Diff
Don't build help files (258 bytes, patch)
2008-03-03 18:12 UTC, Stewart Adam
no flags Details | Diff
Fixes some translation problems, patches 2.21.95 to svn head as of 20080303 (962.58 KB, patch)
2008-03-03 18:13 UTC, Stewart Adam
no flags Details | Diff
Script used to start backend-specific binaries (1.30 KB, text/plain)
2008-03-03 19:14 UTC, Stewart Adam
no flags Details
The scriptlets and code needed to switch backends (1.30 KB, text/plain)
2008-03-05 20:29 UTC, Stewart Adam
no flags Details
This patch adds the required 'alternatives' commands (3.02 KB, patch)
2008-03-06 16:14 UTC, Stewart Adam
no flags Details | Diff
Adds the required 'alternatives' commands (3.07 KB, patch)
2008-03-06 16:51 UTC, Stewart Adam
no flags Details | Diff
Adds the required 'alternatives' commands (3.87 KB, patch)
2008-03-06 20:57 UTC, Stewart Adam
no flags Details | Diff
Adds the required 'alternatives' commands (revised) (3.13 KB, patch)
2008-03-14 01:52 UTC, Stewart Adam
no flags Details | Diff
totem.spec "Requires" patch (493 bytes, patch)
2008-03-20 15:26 UTC, Arkady L. Shane
no flags Details | Diff

Description Stewart Adam 2007-10-11 04:21:46 UTC
This is just the result of the totem-xine review request.

Changes:
* Goes through the build twice so that both backends can be built
* Uses --program-suffix "-$BACKEND" to handle the binary files from the
different backends (Backends are placed in subpackages)
* Uses gconf to determine the backend to use at runtime

I've attached the working spec file and patches, I'll upload an SRPM tomorrow.

Comment 1 Stewart Adam 2007-10-11 04:21:46 UTC
Created attachment 223871 [details]
New totem spec file

Comment 2 Stewart Adam 2007-10-11 04:22:37 UTC
Created attachment 223881 [details]
Patch to add the new gconf option

Comment 3 Stewart Adam 2007-10-11 04:23:23 UTC
Created attachment 223891 [details]
Script to retrieve and run the correct backend based on gconf values

Comment 4 Stewart Adam 2007-10-11 04:25:34 UTC
Oh, the final recompile finished sooner than I thought. Here's the SRPM:
http://www.diffingo.com/downloads/diffingo-repo/review/totem-2.20.0-3.fc8.src.rpm

Comment 5 Bastien Nocera 2007-10-11 09:46:15 UTC
Little problem. The nautilus extension is another program that depends on a
specific backend:
%{_libdir}/nautilus/extensions-1.0/*.so*

There should only be one in there, at any one time. This is probably a good use
of alternatives. Could you please add a "--set [backend name]" to the shell
script that would set the alternatives properly (if root), and modify the gconf
value in all cases?

The Mozilla plugin doesn't seem to be switchable either:
%{_libexecdir}/totem-plugin-viewer-gstreamer
%{_libexecdir}/totem-plugin-viewer-xine

You can leave the backends in the main backend packages, and have the actual
mozilla plugins in that package.

Comment 6 Bastien Nocera 2007-10-11 09:50:26 UTC
Comment on attachment 223881 [details]
Patch to add the new gconf option

Please follow the existing code style and identation in the patch.

Comment 7 Bastien Nocera 2007-10-11 09:53:24 UTC
In the .spec:
Requires:           %{name}-gstreamer = %{version}-%{release}
Requires:           %{name}-xine = %{version}-%{release}

Add virtual Provides: in the backends, and add a Requires: totem-backend in the
main package, so people can choose to install only one backend.

Finally, please mark your text attachments as "text/plain", and attach your
.spec file changes as patches (generated with "cvs diff -up", the CVS can be
checked out as an anonymous user).

Comment 8 Stewart Adam 2007-10-12 22:43:12 UTC
Where do you suggest I store actual .so's for the nautilus plugin? (I'm assuming
that nautilus will load and .so in that directory so we can't have both .so
original folder)

Comment 9 Stewart Adam 2007-10-13 01:04:21 UTC
Created attachment 226231 [details]
totem.spec patch

Here is the new spec file

Comment 10 Stewart Adam 2007-10-13 01:04:46 UTC
Created attachment 226241 [details]
Script used to start backend-specific binaries

Comment 11 Stewart Adam 2007-10-13 01:05:16 UTC
Created attachment 226251 [details]
Schema patch to support "backend" key/value pair

Comment 12 Stewart Adam 2007-10-13 02:10:58 UTC
Created attachment 226281 [details]
Script used to start backend-specific binaries

Fixed a glitch with the totem script when using it to open files in Nautilus

Comment 13 Stewart Adam 2007-10-20 15:57:29 UTC
Created attachment 233441 [details]
Script used to start backend-specific binaries

Fixed another bug where indexing videos would make the script switch to
gstreamer. (-s is a valid switch for totem-video-thumbnailer. The wrapper
script now uses -b to switch backends)

Comment 14 Stewart Adam 2007-10-24 22:12:38 UTC
Just noticed there's missing quotes in attachment 233441 [details] around the $*, second
to last line.

Comment 15 Stewart Adam 2007-11-03 05:49:11 UTC
Created attachment 247201 [details]
totem.spec patch for 2.21.1

Updated for 2.21.1

Comment 16 Stewart Adam 2007-11-03 05:54:36 UTC
Created attachment 247211 [details]
Script used to start backend-specific binaries

New script which uses $@ rather than $* to workaround a bug, as well as
includes quotes to function properly with files including spaces.

Comment 17 Stewart Adam 2008-02-08 23:33:56 UTC
Any updates on the upstream effort?

Comment 18 Stewart Adam 2008-03-03 18:12:25 UTC
Created attachment 296650 [details]
New patch for 2.21.95

Comment 19 Stewart Adam 2008-03-03 18:12:56 UTC
Created attachment 296651 [details]
Don't build help files

Comment 20 Stewart Adam 2008-03-03 18:13:43 UTC
Created attachment 296652 [details]
Fixes some translation problems, patches 2.21.95 to svn head as of 20080303

Comment 21 Stewart Adam 2008-03-03 19:14:57 UTC
Created attachment 296663 [details]
Script used to start backend-specific binaries

Now passes arguments onto totem-$backend binary

Comment 22 Bastien Nocera 2008-03-03 19:40:08 UTC
Committed with 2.21.96-1

Comment 23 Hans de Goede 2008-03-04 13:11:15 UTC
Good work, but those nautilus plugins really should go in a subdir of
%{_libdir}not in libdir itself, libdir itself is only for libraries.


Comment 24 Bastien Nocera 2008-03-05 00:07:45 UTC
It was completely broken, package upgrade-wise, so I went a different way. Totem
now installs the backend as a shared library, instead of having it statically
linked in all the binaries.

There's a totem-backend shell script to launch totem and other binaries with a
specific backend. Eg:
totem-backend -b xine totem dvd://

If run as root, it will switch the backend for the whole system, eg.:
totem-backend -b xine
although, that's not implemented right now... Anybody willing to write the crazy
update-alternatives line?

Comment 25 Stewart Adam 2008-03-05 16:44:58 UTC
Sure - So it's the same as what the script did before but I'm using alternatives
to switch the symlinks?

Comment 26 Bastien Nocera 2008-03-05 16:49:55 UTC
Implementation is completely different though...

The only symlink you can switch is whether:
$(libdir)/libbaconvideowidget.so.0.0.0 points to
$(libdir)/libbaconvideowidget-gstreamer.so.0.0.0 or
$(libdir)/libbaconvideowidget-xine.so.0.0.0

Comment 27 Stewart Adam 2008-03-05 20:27:26 UTC
Reopening, alternatives code attached

Comment 28 Stewart Adam 2008-03-05 20:29:22 UTC
Created attachment 296927 [details]
The scriptlets and code needed to switch backends

Comment 29 Stewart Adam 2008-03-06 16:14:58 UTC
Created attachment 297066 [details]
This patch adds the required 'alternatives' commands

Comment 30 Stewart Adam 2008-03-06 16:51:53 UTC
Created attachment 297070 [details]
Adds the required 'alternatives' commands

Fixed a stupid typo...

Comment 31 Stewart Adam 2008-03-06 20:57:40 UTC
Created attachment 297102 [details]
Adds the required 'alternatives' commands

Removed a few lines from %files and calls ldconfig in the main package's post
scriptlet (until we call ldconfig after installation, libbaconvideowidget.so.0
always point to xine).

Tested this a few times, works after every installation and the script switches
as it should.

Comment 32 Bastien Nocera 2008-03-14 00:06:19 UTC
Could you split that on multiple lines, and say something like "the xine backend
is not available":
+    echo -e 'Error: One or both of the libbaconvideowidget files not
found!\nPlease check your totem installation.'

I don't understand that:
+# works around %{_libdir}/libbaconvideowidget.so.0.0.0 pointing to xine (and
+# therefore alternatives setup is ignored)
+/sbin/ldconfig

Otherwise looks good to commit.

Comment 33 Stewart Adam 2008-03-14 01:35:36 UTC
I'm xine is build after gstreamer, so %{_libdir}/libbaconvideowidget.so.0.0.0
ends up pointing to the xine backend: at that point in time, the alternatives
don't exist so the xine library is selected by ld[config].

Once a backend has been installed and the wrapper symlink (the one we use with
alternatives) is in place, ldconfig uses that instead. So after all backends
install, we need to call a final ldconfig.

I just checked and realized the true problem - ldconfig is called before the
alternatives command in the %post and %postun scriptlets... Fixing+testing now,
if it works I'll attach a new patch.

Comment 34 Stewart Adam 2008-03-14 01:52:09 UTC
Created attachment 298004 [details]
Adds the required 'alternatives' commands (revised)

Yup, that did it. Patches backend script and spec at once, obsoleting those
patches

Comment 35 Bastien Nocera 2008-03-19 12:41:52 UTC
Looks good, please commit and kick a build.

Comment 36 Bastien Nocera 2008-03-19 13:17:46 UTC
Release notes:
---8<---
Totem, the default movie player, now has the ability to switch playback backends
without recompilation, or replacing the default package.

To change the backend system-wide:
yum install totem-xine
totem-backend -b xine

To run totem with the xine-lib backend:
yum install totem-xine
totem-backend -b xine totem
---8<---

I'm sure somebody can come up with a slightly better wording...

Comment 37 Stewart Adam 2008-03-19 15:37:03 UTC
How does this sound?
Release notes:
---8<---
Totem, the default movie player for Gnome, now has the ability to switch
playback backends without recompilation or switching packages!
To install the xine backend, run:
  yum install totem-xine

To run totem with the xine backend once, execute:
  totem-backend -b xine totem

If you'd like to change the default backend to xine for the entire system,
execute as root:
  totem-backend -b xine

Once using the xine backend, you can temporarily use the gstreamer backend in
the same manner:
  totem-backend -b gstreamer totem

Or to change the default backend back to gstreamer:
  totem-backend -b gstreamer
---8<---

Comment 38 Bastien Nocera 2008-03-19 16:52:10 UTC
Without the exclamation mark, and once you've actually committed your patch :)

Comment 39 Stewart Adam 2008-03-19 18:11:30 UTC
Done - I also changed Source0 from 2.21 to 2.23 which wasn't in the patch
original because "spectool -g" was returning 404...

Comment 40 Arkady L. Shane 2008-03-20 15:26:29 UTC
Created attachment 298705 [details]
totem.spec "Requires" patch

I think it is better to require %{name}-backend, not %{name}-gstreamer. In this
case we can remove totem-gstreamer and leave only totem-xine.

Comment 41 Bastien Nocera 2008-03-20 15:54:17 UTC
(In reply to comment #40)
> Created an attachment (id=298705) [edit]
> totem.spec "Requires" patch
> 
> I think it is better to require %{name}-backend, not %{name}-gstreamer. In this
> case we can remove totem-gstreamer and leave only totem-xine.

Not a typo. Otherwise doing a "yum install totem" will install "totem-xine"
instead of "totem-gstreamer" as its name is shorter. I blame yum...

Comment 42 Jon Stanley 2008-04-23 20:30:08 UTC
Adding FutureFeature keyword to RFE's.

Comment 43 Bastien Nocera 2008-04-23 21:54:40 UTC
(In reply to comment #42)
> Adding FutureFeature keyword to RFE's.

Did you even read the bug? It's already implemented.

Comment 44 Rahul Sundaram 2008-04-28 10:52:39 UTC
Totem in rawhide defaults to xine instead of gstreamer. We need to fix that if
we want to codeina to work. 

Comment 45 Bastien Nocera 2008-04-28 11:07:29 UTC
(In reply to comment #44)
> Totem in rawhide defaults to xine instead of gstreamer. We need to fix that if
> we want to codeina to work. 

No it doesn't. Read the scripts in the totem.spec, the GStreamer backend has a
higher priority than the xine-lib one. Must be a side-effect of upgrading from
an old version.


Note You need to log in before you can comment on or make changes to this bug.