kulakov.ilya at gmail.com
Tue Jul 2 07:47:47 PDT 2013
It's not the only solution.
gstreamer could spawn another process and share framebuffer (e.g. by using IOSurface).
On 26.06.2013, at 16:17, Andoni Morales <ylatuya at gmail.com> wrote:
> 2013/6/26 Ilya Kulakov <kulakov.ilya at gmail.com>
> > So this new thread with the run loop is only
> > started when the sink needs to create its own window and the application
> > didn't start any run loop.
> > This hack we made to make osxvideosink work with gst-launch, but in a
> > normal scenario, the application should have started a run loop and this
> > internal thread will not be created.
> This does not explain why new thread is created for each instance. It to should be created once for the whole class and reused.
> Used hack does not support scenario with multiple osxvideosink instances which is pretty possible even with get-launch.
> Also the hack itself is very very unstable. One should not mangle with mainThread like this and just let the main thread to be what AppKit decides.
> Since, as you pointed, the only real use case when osxvideosink has to create new thread is with gst-launch, wouldn't it be simpler to update it in the same manner
> as other cross platform UI frameworks work (like Qt or wxWidgets)?
> I wish it was that easy :) It's something we have been discussing several times and we haven't found a better solution. Like I commented before, if this thread is started more than once it's a bug and it shouldn't happen at all. This scenario doesn't not only happens with gst-launch, it could also happen with any small application that doesn't start a run loop in the main thread and instead blocks it with its own polling using gst_bus_timed_pop_filtered. What happens than? The sink can very likely be started on a completely different and with the main thread blocked, how do you run any Cocoa stuff with the main thread blocked? So the only solution in this case is to start a dedicated thread for it and make it believe it's the main thread. For UI frameworks like QT or GTK it's completely different because they start a main loop in in the main thread, and in this main loop they integrate the run loop. We can ask to do that for every simple app because it's platform specific and because it's only required for osxvideosink and when no window handle is provided to the sink.
> > Could to please open a new bug and attach a test case?
> Andoni Morales Alastruey
> LongoMatch:The Digital Coach
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the gstreamer-devel