[MPlayer-users] embedding MPlayer into a window in MacOS

Adrian Stutz adrian at sttz.ch
Tue Jun 23 14:09:03 CEST 2009


On Tue, Jun 23, 2009 at 12:57 PM, Reimar
Döffinger<Reimar.Doeffinger at gmx.de> wrote:
> It isn't done one like that on Windows either, because the NVidia driver
> is buggy and can not handle drawing into a window that belongs into a
> different process (at least IMO that clearly is a video driver bug).
> All you need to be able is:
> 1) Getting size and position of another processes' windows
> 2) Create and draw your own Window and keep it on top of that
>
> 2) is simplified on Windows by creating our own Window as a child window
> of the -wid one, thus we do not need to handle position changes but only
> resizes.

Ah, ok.

There are some new Quatz functions in Leopard that enable getting the
bounds of any window:
http://developer.apple.com/documentation/Carbon/Reference/CGWindow_Reference/Reference/Functions.html

Though the problem remains: There's no public way on OSX to get a
reference to a window object from another process. One process has a
list of it's own windows but there's no way to pass windows between
processes to attach something to it.

Though looking at what I can gather, there seems to be some
functionality (including the one above) in Leopard that hints for
better window/view sharing support between applications:
http://stackoverflow.com/questions/583202/mac-os-x-can-one-process-render-to-another-processs-window

There's a NSWindowSharingType that you can set to
NSWindowSharingReadWrite but there doesn't seem to be anything you can
do with that right now besides preventing your application from
appearing on screenshots. Maybe there's more to come in Snow Leopard?

Greetings
Adrian


More information about the MPlayer-users mailing list