I am trying to use GStreamer in an existing perl application that uses AnyEvent with an EV event loop. This is not a Glib application. I downloaded EV :: Glib to get the main Glib loop to use EV. I freely admit that with regard to Glib, I am rather ignorant. I think I have all the bits that I need, but I struggle (can't) get them to work together.
If I use the standalone perl program to build the GStreamer pipeline and then put it in the PLAYING state, it all just works. I don't need to do anything with Glib mainloop or tickle the GStreamer bus otherwise.
Building the same pipeline in my existing application in the context of an AnyEvent event handler, then it will not be able to execute the pipeline. I played with various ways trying to use it, including calling $pipeline->get_bus->poll() . If I repeat ...->poll() in the original event handler (i.e. the handler does not return), then it works, but this is clearly an invalid solution. Calling ...->poll() in the AnyEvent timer callback does not start the pipeline.
My best guess at the moment is that EV :: Glib provides some level of integration, but does not actually run the necessary bits of the main loop. What am I missing?
source share