getting the output on the windows ui using xoverlay

classic Classic list List threaded Threaded
12 messages Options
Reply | Threaded
Open this post in threaded view
|

getting the output on the windows ui using xoverlay

vivekr
How to get the output of video sink on XOverlay on the Standard windows.
When we use autovideosink or directshowsink the overlay structure is coming to be 0.
I am also not able use ximagesink or xvimage sink what could be the reason for the same.
Kindly throw some light.
Thanks
Reply | Threaded
Open this post in threaded view
|

Re: getting the output on the windows ui using xoverlay

Stefan Sauer
On 04/27/2012 08:40 AM, vivekr wrote:
> How to get the output of video sink on XOverlay on the Standard windows.
> When we use autovideosink or directshowsink the overlay structure is coming
> to be 0.
Where is your code, you are doing it wrong. This has been discussed at
length on this list a zillion times before. People get it working if the
follow the docs. Unfortunately no one cared to contribute an example for
gst-pluginsbase/tests/example/overlay back :/

> I am also not able use ximagesink or xvimage sink what could be the reason
> for the same.
you don't have X11 on windows.

> Kindly throw some light.
> Thanks
>
> --
> View this message in context: http://gstreamer-devel.966125.n4.nabble.com/getting-the-output-on-the-windows-ui-using-xoverlay-tp4591879p4591879.html
> Sent from the GStreamer-devel mailing list archive at Nabble.com.
> _______________________________________________
> gstreamer-devel mailing list
> [hidden email]
> http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel

_______________________________________________
gstreamer-devel mailing list
[hidden email]
http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: getting the output on the windows ui using xoverlay

vivekr
Hi Stephen,

Thanks for your reply.

I am attaching the files that I am using also parallely the problem part.

in the bus sync handler this is the code

xoverlay_bus_sync_handler(GstBus *bus, GstMessage *message, gpointer data)
{
HWND hWnd = (HWND)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;

if (hWnd != 0) {
GstXOverlay *xoverlay;

// GST_MESSAGE_SRC (message) will be the video sink element
xoverlay = GST_X_OVERLAY (GST_MESSAGE_SRC (message));

//xoverlay = GST_X_OVERLAY (videosink);

//GstXOverlay *xoverlay;
GstXOverlay* ov = (GstXOverlay*)videosink;

//gst_x_overlay_set_xwindow_id(ov, 0);
gst_x_overlay_set_xwindow_id (ov, (gulong)hWnd);
//gst_x_overlay_set_xwindow_id (ov,(guintptr)s_app.hWndMain);//Vivek Ramakrishnan


//gst_x_overlay_set_window_handle(ov,(guintptr)s_app.hWndMain);

} else {
g_warning ("Should have obtained hWnd by now!");
}

gst_message_unref (message);
return GST_BUS_DROP;
}


There are some warnings as to invalid cast from GSTDDrrawsink and some comments G_TYPE_IS_INTERFACE failed GST_ELEMENT (from) iface_type failed. I have read the entire blog in the series on this topic. And also implemented the said corrections. Please throw some light on the problem and the solution. Then once solved we can upload the solution as these files.
Please find the attachment.

Thanks and Regards,
Vivek Ramakrishnan





source.cppccc.cppxoverlay.h
Reply | Threaded
Open this post in threaded view
|

Re: getting the output on the windows ui using xoverlay

padam
I used:
gst_x_overlay_set_xwindow_id(GST_X_OVERLAY (video-sink), HANDLE);

where HANDLE is guint64
Reply | Threaded
Open this post in threaded view
|

Re: getting the output on the windows ui using xoverlay

vivekr
for me GST_X_OVERLAY (video-sink),  is some how coming to be zero, and the code is also crashing.
i am using ddrawimagesink, element as the video sink gstelement.
Reply | Threaded
Open this post in threaded view
|

Re: getting the output on the windows ui using xoverlay

vivekr
In reply to this post by padam
Hi PADAM,

Even after putting the handle as guint64 the problem is still not yet solved.
I am also attaching the screen shot of the XOverlay_Window for reference with this post.XoVERLAYWINDOWSCREEN_SHOT.JPG

Thanks and Regards,
Vivek Ramakrishnan
Reply | Threaded
Open this post in threaded view
|

Re: getting the output on the windows ui using xoverlay

vivekr
In reply to this post by padam
I am using the following libraries and the following version of gstreamer
kindly get back to me if these are to be specific for solving the problem

gstreamer-0.10.lib
gobject-2.0.lib
User32.lib
kernel32.lib
gstinterfaces-0.10.lib
user32.lib
gdi32.lib
comdlg32.lib
advapi32.lib
shell32.lib
ole32.lib
oleaut32.lib
uuid.lib
Advapi32.lib
glib-2.0.lib

GSTREAMER WIN BUILDS 0.10.6 (GPL)

WINBUILDS SDK 0.10.6 (GPL)

Please get back.

Thanks and Regards,
Vivek Ramakrishnan
Reply | Threaded
Open this post in threaded view
|

Re: getting the output on the windows ui using xoverlay

padam
This post was updated on .
I use dshowvideosink

static GstBusSyncReply create_window (GstBus * bus, GstMessage * message, void *user_data)
{
        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;

        if(Player.HANDLE != -1)
                gst_x_overlay_set_xwindow_id(GST_X_OVERLAY (Player.sink), Player.HANDLE);
 gst_message_unref (message);

 return GST_BUS_DROP;
}

You don't need to create GstXOverlay *xoverlay as you can see.
Reply | Threaded
Open this post in threaded view
|

Re: getting the output on the windows ui using xoverlay

vivekr
thats right!!!!
even if you use dshowvideosink, the problem is
GST_X_OVERLAY(player.sink) produces a pointer to GSTXoverlay that is not getting generated in my case, is it due to libs or sdk?
Your method is simplegreat!!

But what to do with this pointer issue in my place?

Pl. throw some light.....


Thanks and Regards,
Vivek Ramakrishnan
Reply | Threaded
Open this post in threaded view
|

Re: getting the output on the windows ui using xoverlay

padam
I really don't know... I also use gstinterfaces-0.10.lib and #include <xoverlay.c> and that's all.
Can you paste the code where you are creating pipeline?
Reply | Threaded
Open this post in threaded view
|

Re: getting the output on the windows ui using xoverlay

vivekr
Hi Padam,

Please refer the posts above where I have attached the files that I have used please let me know if these work at your end..

:-)

Thanks and Regards,
Vivek Ramakrishnan
Reply | Threaded
Open this post in threaded view
|

Re: getting the output on the windows ui using xoverlay

vivekr
Finally the issue is solved
I am able to play the video on the
Win32 window.
Please find the attached code.
Now evry thing works fine.....WindowsApplication.cppWindowsApplication.hstdafx.cpp

I hope this benefits every one..

Thanks and Regards.
Vivek Ramakrishnan