Re: Embed movie player using mplayer - How to execute mplayer (fork?)



Hi again,

I put the function spawn in my program but he gives me a "No such file or directory" error. I check the file and the path is right.

The code:

void Player::play(int wid)
{
    int in_fd, out_fd;

    sprintf(command, "mplayer -quiet -slave -idle -wid %d /home/test.avi", wid);
  
    std::vector<std::string> argv;
    argv.push_back(command);
   
    Glib::spawn_async_with_pipes("/usr/bin", argv, Glib::SpawnFlags(0), sigc::slot<void>(), NULL, &in_fd, &out_fd, NULL);
}

The error:

(test:8804): glibmm-CRITICAL **:
unhandled exception (type Glib::Error) in signal handler:
domain: g-exec-error-quark
code  : 8
what  : Failed to execute child process "mplayer -quiet -slave -idle -wid 60817444 /home/test.avi" (No such file or directory)

Anybody know what I'm doing wrong?

Thanks in advance...
P.F.Smorigo



On Mon, Aug 18, 2008 at 10:56, Paulo Flabiano Smorigo <pfsmorigo gmail com> wrote:
Hi Jens,

I saw this method but I couldn't found any example of use... I'm trying to implement using the api but it's hard to do so...

Anyone here have and example of  a "Spawning Processes" use?

Thanks!
P.F.Smorigo



On Mon, Aug 18, 2008 at 10:47, Jens Georg <mail jensge org> wrote:

> How can I execute mplayer in my program? I tried using fork but didn't
> work...
> When I create a graphic app I need a different aproach?
> And to be more complicated I need a solution that works on linux and
> windows... :'(

Glib provides an abstraction layer above the various OS process spawning
methods, have a look at

http://www.gtkmm.org/docs/glibmm-2.4/docs/reference/html/group__Spawn.html


_______________________________________________
gtkmm-list mailing list
gtkmm-list gnome org
http://mail.gnome.org/mailman/listinfo/gtkmm-list




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]