gst_video_overlay_set_window_handle() example for raspberry pi (or appsink)?

Stuart Axon stuaxo2 at yahoo.com
Mon Oct 31 11:56:56 UTC 2016


In case anyone needs to use set_window_handle on python I've updated the above example so that it works.        
https://gist.github.com/stuaxo/3009b761cba1085ac5730c7485506ee4

 S++ 

    On Friday, October 28, 2016 12:54 PM, Stuart Axon <stuaxo2 at yahoo.com> wrote:
 
 

 I'm getting a SIGSEGV trying to use set_window_handle with a dispmanx element -

Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 0x728ff460 (LWP 2084)]
0x75f873dc in gst_gl_window_dispmanx_egl_set_window_handle (window=0x551080, handle=555404289)
    at gstglwindow_dispmanx_egl.c:193
193      window_egl->native.element = window_egl->foreign.element = foreign_window->element;
(gdb) 


Minimal code to reproduce
https://gist.github.com/stuaxo/3009b761cba1085ac5730c7485506ee4

I'm new to a lot of these things, so highly likely I'm passing in something wrong.

I call set_window_handle before starting the pipeline, should this mater (code was adapted from an example for set_window_handle + Gtk)
 S++ 

    On Thursday, October 27, 2016 4:07 PM, Stuart Axon <stuaxo2 at yahoo.com> wrote:
 
 

 Cheers for the info, I'm having a play now.


To get it to play on raspbian I had to make a couple of changes to configure.ac [see below "Edit configure.ac"]

For me or anyone else in the future, here is what I did to get it working with gst-uninstalled on Raspbian -


Raspbian jessie was missing "bcm_host.pc" and "egl.pc" so grab those

$ git clone https://stuaxo/raspberrypi-pkgconfig
Install .pc files
$ sudo cp raspberrypi-pkgconfig/pkgconfig/*.pc /usr/local/lib/pkgconfig

- install "gst-uninstalled"- activate gst-uninstalled (everything from here will run under it)


- download and extract player_test from the bugzilla repo: https://bugzilla.gnome.org/show_bug.cgi?id=772608


Edit configure.ac:
Change this line:
OSS_GTK_REQUIRED=2.24.27
to:
OSS_GTK_REQUIRED=2.24.25    

Change these lines:AM_INIT_AUTOMAKE([foreign])
AM_SILENT_RULES([yes])

to:m4_ifdef([AM_INIT_AUTOMAKE], [AM_INIT_AUTOMAKE([foreign])])
m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])

Add gst-uninstalled .pc files to pkg-configs path:
$ export PKG_CONFIG_PATH=~/gst/master/gstreamer/pkgconfig

I had quite a bit of trouble working out the right incantation for autoconf, libtool etc - this seemed to work:
$ autoreconf -fiv

Only managed to get it compiling setting these environment variables:

$ export CFLAGS=`~/gst/gst-master pkg-config --cflags gstreamer-plugins-base-1.0-uninstalled egl`
$ export OSS_GSTREAMER_BASE_CFLAGS=$CFLAGS

~/gst/gst-master ./configure
~/gst/gst-master make    


 S++ 

   

 On Monday, October 24, 2016 8:35 AM, munez bn <munezbn.dev at gmail.com> wrote:
 
 

 The Native scaling function using set_render_rectangle didnt work for me. It was not playing smoothly for some reason. So this is what I did
1] Create a dismpanx window based on video resolution. ( This part may be missing in example code. I had hard-coded to  my test video resolution)2] Set this window using set_window_hanlde ( refer to example code in the bug)3] Once this happens you have complete control over the window, you can scale it, move it using dispmanx API  vc_dispmanx_element_change_attributes()
The attached example is not optimized but enough for you to understand how to scale and move(change dest rect  x, y value)..
Thanks & RegardsMunez


On Mon, Oct 24, 2016 at 12:44 PM, Sebastian Dröge <sebastian at centricular.com> wrote:

On Thu, 2016-10-20 at 10:56 +0000, Stuart Axon wrote:
> Hi,
>    I'm building a player on raspberry pi, but want to be able to move
> / scale the window.
> Is there an example somewhere to do this ?
>
> I saw the patch here
> https://bugzilla.gnome.org/ show_bug.cgi?id=772608
>
>
> But I'm pretty new to coding opengl es, so not sure how to create the
> window to pass into this API.
>
> My app is in python, but this part doesn't necessarily need do be in
> python.

That bug also contains a test application as an attachment. Please take
a look at that.

It's nothing GL specific in this case, but RPi specific. You pass a
dispmanx element there.

--
Sebastian Dröge, Centricular Ltd · http://www.centricular.com
______________________________ _________________
gstreamer-devel mailing list
gstreamer-devel at lists. freedesktop.org
https://lists.freedesktop.org/ mailman/listinfo/gstreamer- devel




_______________________________________________
gstreamer-devel mailing list
gstreamer-devel at lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel


 
   

 
   

 
   
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/gstreamer-devel/attachments/20161031/90d51a2e/attachment-0001.html>


More information about the gstreamer-devel mailing list