[gst-devel] How to set window ID on Mac OSX
Andreas Schuler
andreas at neokast.com
Thu Jun 26 00:16:07 CEST 2008
Hi all,
I am trying to get an application to run on a Max OSX 10.5.2. I have
downloaded and built the latest tar balls and everything seems to be running
fine when I use gst-launch.
>From within my app, which also runs on Windows, I am doing the following to
set the id of the window I want the video to be rendered on:
- get_bus_set_sync_handler to setup my callback
- The callback function looks as follows:
GstBusSyncReply DefaultVideoRenderer::PrepareWindowCallback(
GstBus* bus,
GstMessage* message,
gpointer * data)
{
// ignore anything but 'prepare-xwindow-id' element messages
if (GST_MESSAGE_TYPE (message) != GST_MESSAGE_ELEMENT)
{
return GST_BUS_PASS;
}
if (!gst_structure_has_name (message->structure, "prepare-xwindow-id"))
{
return GST_BUS_PASS;
}
DefaultVideoRenderer* renderer = (DefaultVideoRenderer*)data;
if (renderer->m_windowHandle.GetHandle() != 0)
{
MEDIA_LOG_INFO("Attaching window handle: ", renderer->m_windowHandle
);
gst_x_overlay_set_xwindow_id (GST_X_OVERLAY (GST_MESSAGE_SRC (
message)),
(gulong)renderer->m_windowHandle.GetHandle());
}
else
{
MEDIA_LOG_INFO("Cannot attach window handle because it is null");
}
gst_message_unref (message);
return GST_BUS_DROP;
}
This code seems to be working fine on Windows but not on the Mac. I have
found that it never gets to the "GetHandle" line, which leads me to believe
that the XOverlay interface does not exist on the Mac.
The video does play back just fine in its own window by the way.
I am using the "autovideosink" for video in my pipeline.
So the question is: How would one go about setting the render window on a
Mac? Since I am also working on a Linux version I would also be interested
in a solution for that platform.
Thank you,
Andreas
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/gstreamer-devel/attachments/20080625/f220f56a/attachment.htm>
More information about the gstreamer-devel
mailing list