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

Re: [pygame] Communicating with an event queue



Well, the movie module will use different back ends. One back end is nearing alpha testing, the wrapper around ffmpeg. If that back end fails to load, then we want to load in a wrapper around a video player that will be distributed with pygame, and I'm trying to figure what needs to be done to get that working, and whether or not I'll need to customize its code myself. The wrapper would create a sub-process of the movie player, playing the video file given. When I communicate with the subprocess via a pipe through STDIN, it should theoretically be controllable.  I'm just wondering if there's a way, from string input to stdin, to cause SDL to fire a keyboard event? I don't think there is, but I thought I'd double-check that. Its better to take the simple and robust way, if it exists, rather than customizing a program for the needs of the movie module, which it looks like I'll have to do.

-Tyler

On Thu, Jun 18, 2009 at 10:19 AM, NBarnes <nbarnes@xxxxxxxxx> wrote:
Tyler Laing<trinioler@xxxxxxxxx> wrote:

> For the movie module, I need to be able to communicate with a process
> programmatically.
>
> The video player in discussion is ffplay(because its the smallest), and it
> has an internal event loop around the SDL event loop. When I use
> subprocess.Popen to open up the video player running a file, with the PIPE
> arguments to all std*'s, only the window spawned responds to commands from
> the keyboard, indicating that the event loop doesn't listen on stdin.
>
> Is there a way to cause events to be pushed onto the process's internal
> event loop?

I'm not sure what the question is?  I may just be missing data due to
unfamiliarity with the structure in question.  Shouldn't you, as the
developer, be able to insert a method into the movie subsystem wrapper
object that takes a command and places it in queue to be processed by
the subprocess' loop?



--
Visit my blog at http://oddco.ca/zeroth/zblog