On Mon, 2008-07-14 at 10:19 -0700, Chandan Pitta wrote:
> This is interesting. I have a high end nVidia graphics card (8800 GT)
> and yet when using gl my cpu hovers around 75% (on a 2.4 GHz AMD X2)
> when playing 1080i, so chances of being able to play blu-ray are
> pretty slim. Jason can you send me the command-line you are using. I
> have been searching forums for a long time to understand the problem.

It's not really comparable to using the player's gl vo.  It uses a very
different pipeline, which works like this:

     1. kaa.candy maps a new window and then redirects it using
        XComposite (via clutter).
     2. We spawn the media player (MPlayer, Xine, etc.) and have it draw
        to the wid from step 1, which is redirected.  The player uses
        Xv, and so it follows the Xv path to get the frame into video
        memory, which typically means hardware colorspace conversion.
     3. Clutter handles Damage events for the redirected video window,
        and uses GLX_EXT_texture_from_pixmap to take the redirected
        window and put into a ClutterTexture.

If GLX_EXT_texture_from_pixmap isn't available (or isn't working [huzzah
Intel!]) there is a slower X11 fallback, which should work with 720p if
the CPU is fast enough.  Dischi and I are expecting that Intel can't
suck forever, so eventually the GLX approach will work with it.  I have
no idea how it works with ATI, but I fully expect it's even more broken
than Intel.  (Anyone who uses an ATI card for their HTPC deserves what
they get anyway.)

For systems whose Xv uses video texture (instead of video overlay), step
3 should be extremely fast.  (Because the work is basically already
done.)

Now Nvidia uses video textures and has a working
GLX_EXT_texture_from_pixmap.  This means that the above pipeline is very
close in performance to using unredirected Xv.  On both of my systems
(E6600 with Nvidia 7100GS, and E6750 with Nvidia 8600GT), for a
1920x1080 video there is 2-4% overhead in cpu (primarily the Xorg
process).

If you'd like to test this out, try the attached file, clutter-test.c.
Compile it using:

  gcc clutter-test.c `pkg-config clutter-0.7 --cflags --libs` -o clutter-test

It requires clutter 0.7 or 0.8 (change pkg-config above accordingly).

Make sure you do not have a compositing manager running.  If you do,
stop it.  In fact, you should probably restart X if you were running a
compmgr.  (I had some issues even after switching from compiz to
metacity until I restarted X.)  Start up an mplayer:

  mplayer video.avi

Find out its window id using xwininfo.  Let's say it's 0xa00001.  Then
run:

   ./clutter-test 0xa00001

It will open a 640x480 window and begin redirecting MPlayer onto a
rotated texture on the clutter stage.  (Note that it uses the
antialiasing settings on your card, so if it looks a bit ugly, increase
the AA with nvidia-settings.  With an 8800GT you should have no trouble
with 8x or better.)

With nvidia, you should find it performs quite well.  With Intel, it
almost certainly won't work, but you can edit clutter-test.c and replace
clutter_glx_texture_pixmap_new_with_window() with
clutter_x11_texture_pixmap_new_with_window() to use the slower X11
fallback.

Cheers,
Jason.

// gcc clutter-test.c `pkg-config clutter-0.7 --cflags --libs` -o clutter-test

#include <stdlib.h>
#include <string.h>
#include <signal.h>
#include <sys/types.h>
#include <sys/sem.h>

#include <clutter/clutter.h>
#include <clutter/x11/clutter-x11.h>
#include <clutter/x11/clutter-x11-texture-pixmap.h>

#include <clutter/glx/clutter-glx.h>
#include <clutter/glx/clutter-glx-texture-pixmap.h>


int
main (int argc, char **argv)
{
    ClutterActor         *stage, *tex;
    Pixmap                pixmap;
    const ClutterColor    gry = { 0x00, 0x00, 0x00, 0x00 };
    Window                win_remote;

    clutter_init (&argc, &argv);

    if (argc < 2)
      g_error ("usage: %s <window id>", argv[0]);

    win_remote = strtol(argv[1], NULL, 0);

    stage = clutter_stage_get_default ();
    clutter_stage_set_color (CLUTTER_STAGE (stage), &gry);
    clutter_actor_set_size(stage, 640, 480);

    //tex = clutter_x11_texture_pixmap_new_with_window (win_remote);
    tex = clutter_glx_texture_pixmap_new_with_window (win_remote);
    g_object_set(tex, "window-redirect-automatic", FALSE, NULL);

    clutter_texture_set_filter_quality(CLUTTER_TEXTURE(tex), CLUTTER_TEXTURE_QUALITY_MEDIUM);

    guint w, h;
    clutter_actor_get_size(tex, &w, &h);
    h = 640.0 / ((float)w/h);
    clutter_actor_set_size(tex, 640, h);

    //clutter_actor_set_opacity(tex, 220);
    clutter_actor_set_rotation(tex, CLUTTER_Y_AXIS, 25, 0, 0, 0);

    clutter_x11_texture_pixmap_set_automatic(CLUTTER_X11_TEXTURE_PIXMAP (tex), TRUE);
    clutter_container_add_actor(CLUTTER_CONTAINER (stage), tex);

    clutter_actor_show_all(stage);
    clutter_main ();

    return EXIT_SUCCESS;
}
-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Freevo-devel mailing list
Freevo-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/freevo-devel

Reply via email to