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

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

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

Stuart Axon
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


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.

S++

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

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

Sebastian Dröge-3
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
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel

signature.asc (949 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

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

munezbn.dev
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 & Regards
Munez


On Mon, Oct 24, 2016 at 12:44 PM, Sebastian Dröge <[hidden email]> 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
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel



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

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

Stuart Axon
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


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 <[hidden email]> 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 & Regards
Munez


On Mon, Oct 24, 2016 at 12:44 PM, Sebastian Dröge <[hidden email]> 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
[hidden email]
https://lists.freedesktop.org/ mailman/listinfo/gstreamer- devel



_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel




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

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

Stuart Axon
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

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 <[hidden email]> 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


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 <[hidden email]> 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 & Regards
Munez


On Mon, Oct 24, 2016 at 12:44 PM, Sebastian Dröge <[hidden email]> 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
[hidden email]
https://lists.freedesktop.org/ mailman/listinfo/gstreamer- devel



_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel






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

Segfault in set_window_handle on rpi (was gst_video_overlay_set_window_handle() example ...)

Stuart Axon
I've been poking this a bit more in gdb ..

Whenever I try and access any of the fields on "foreign_window" I get 'Cannot access memory'

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

(gdb) print foreign_window.element
Cannot access memory at address 0x213e3c01
 
S++


On Friday, October 28, 2016 12:54 PM, Stuart Axon <[hidden email]> 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

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 <[hidden email]> 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


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 <[hidden email]> 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 & Regards
Munez


On Mon, Oct 24, 2016 at 12:44 PM, Sebastian Dröge <[hidden email]> 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
[hidden email]
https://lists.freedesktop.org/ mailman/listinfo/gstreamer- devel



_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel








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

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

Stuart Axon
In reply to this post by Stuart Axon
In case anyone needs to use set_window_handle on python I've updated the above example so that it works.
On Friday, October 28, 2016 12:54 PM, Stuart Axon <[hidden email]> 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

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 <[hidden email]> 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


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 <[hidden email]> 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 & Regards
Munez


On Mon, Oct 24, 2016 at 12:44 PM, Sebastian Dröge <[hidden email]> 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
[hidden email]
https://lists.freedesktop.org/ mailman/listinfo/gstreamer- devel



_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel








_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel