in reply to Re: wxMediaCtrl running under Kubuntu 9.10
in thread wxMediaCtrl running under Kubuntu 9.10

Hi Zentara

I got the same hit. But I don't know that I'm really up to doing a build yet. I've posted this question on the GStreamer mailing list and the wxPerl Mailing list, but no response yet. I'm just not sure that a lot of people use wxMediaCtrl on Linux. Instead I found a peice of code which runs GStreamer directly:

#!/usr/bin/perl -w -- use strict; use warnings; use GStreamer -init; my $loop = Glib::MainLoop -> new(); # set up my file = "/tmp/foo.avi"; my $play = GStreamer::ElementFactory -> make("playbin", "play"); $play -> set(uri => Glib::filename_to_uri $file, "localhost"); $play -> get_bus() -> add_watch(\&my_bus_callback, $loop); $play -> set_state("playing"); # run $loop -> run(); # clean up $play -> set_state("null"); sub my_bus_callback { my ($bus, $message, $loop) = @_; if ($message -> type & "error") { warn $message -> error; $loop -> quit(); } elsif ($message -> type & "eos") { $loop -> quit(); } # remove message from the queue return 1; }

I thought maybe I could use something like this in the Linux code. Not very Cross Platform, I know. But I don't know how to embed it in wxPerl. Anyhow both options would give me a working system.

Update Ah, I've just realised what you mean. Use the compiler to find out which package is missing! Good idea, I'll do that.

Thanks

Steve

Replies are listed 'Best First'.
Re^3: wxMediaCtrl running under Kubuntu 9.10
by zentara (Cardinal) on Nov 09, 2009 at 11:43 UTC
    ... hi, ...yeah, i was going to make a little ps to my post to try to find an alternate method to your wxMediaCtl dilemma.... usually on linux, you run things directly... and i see you found some good code.

    But I don't know how to embed it in wxPerl.

    ...possibly use Kbuntu's media controller?

    ....i havn't used Wx...i stick with plain Gtk2..... but there should be a way in the Wx design gui to do what is called an Glib idle_add or a timer to launch the code. ....i would launch it in a separate thread, or fork-and-exec the code, get the pid to kill it ... the thread is simpler, but fork-and-exec cleaner memory wise

    on linux, you probably can embed the gstreamer object in one of your current windows, or just pop open a new toplevel window and display the imagery there

    but this is something you should ask on the Wx maillist..... i'm just saying that gstreamer is a big lib, and interfacing is complex

    here is some code that i used to use for experimentation..... it may be outdated as gstreamer is evolving fast

    gst-launch -v ximagesrc ! video/x-raw-rgb,framerate=5/1 ! ffmpegcolors +pace ! mux. avimux name=mux ! filesink location=ztest.avi mencoder -vf scale=640:480 ztest.avi -ovc lavc -o ztest.mpg rm ztest.avi
    something like that can be run in a thread or piped-open....OR... you can try to use the Perl module interface to GStreamer.... but i would stick with the c program run thru ipc, so that memory cleanup is better

    i mean, i have no idea of what your code actually does...these are just general design musings regarding linux guis


    I'm not really a human, but I play one on earth.
    Old Perl Programmer Haiku