OpenGL renderer window..

Hans Hony hanshony at gmail.com
Wed Feb 7 19:49:54 UTC 2018


I have a question about launching a simple video pipeline using
'glimagesink' with the python3 gi.repository.Gst.ElementFactory..

On Mac OSX I can launch my pipeline with custom plugin:
gst-launch-1.0 filesrc <avi> ! decodebin ! queue ! my_custom_plugin <props>
! autovideosink

The output a default window titled 'OpenGL renderer'.. which I assume is
gstglwindow_cocoa.m
<https://github.com/GStreamer/gst-plugins-bad/blob/1.12/gst-libs/gst/gl/cocoa/gstglwindow_cocoa.m#L466>
from
gst-plugins-bad.. ?

Likewise, 'glimagesink' will also open the 'OpenGL renderer' window when
used in a bash gst-launch-1.0 command in the same way as 'autovideosink'. Also
I notice when I launch the pipeline under bash, I can see:

    Setting pipeline to PAUSED ...

    Pipeline is PREROLLING ...

    Got context from element 'sink': gst.gl.GLDisplay=context,
gst.gl.GLDisplay=(GstGLDisplay)"\(GstGLDisplayCocoa\)\ gldisplaycocoa0";


However, when I launch the pipeline for gi.repository.Gst.ElementFactory
(in python3) I have issues:

   1. It fails horribly for ElementFactory.make('autovideosink') with *Illegal
   instruction: 4* when NULL to READY is propagated.. so to fix that I just
   didn't use 'autovideosink'..

   2. It will propagate PLAY for ElementFactory.make('glimagesink').. but
   nothing actually plays.. probably because the chain isn't correct

   3. I cannot figure out how to hook the 'sync_message' to an OSX window
   object with glimagesink from python?!? I see information in gst-inspect-1.0
   glimagesink.. but I can't find any examples to do this specifically.

   4. Secondarily, I see that I can use
   gi.repository.GstGL.GLDisplay().new() to create:
       <__gi__.GstGLDisplayCocoa object at 0x10e05eb88 (GstGLDisplayCocoa
   at 0x7fc7ba9439c0)>
   .. which is seemingly what I want!

   5. How to do hook this object up to 'glimagesink' ??


   6. Finally, do I need to add:
     pipeline.get_bus().connect('sync-message::element', on_sync_message) with
   a function on_sync_message(bus, msg) ?

>From the Gtk examples I found there was a function which would update the
GUI.. I assume that I would need to do this as well.. but the syntax is not
clear immediately.
More specifically:
def on_sync_message(bus, msg): if msg.get_structure().get_name() == '
prepare-window-handle':
sink = msg.src
sink.set_window_handle(<window_handle>)
sink.set_render_rectangle(0, 0, <window.width>, <window.height>)


Overall, I want to know:

   1. How is it that gst-launch-1.0 works so well?
   2. How can I use that functionality in my python3 gi code?
   3. How can I add another element to trigger that force-aspect-ratio
   window magic?


$ brew list --versions | grep gst

gst-plugins-bad 1.12.3

gst-plugins-base 1.12.3

gst-plugins-good 1.12.3

gst-plugins-ugly 1.12.3

gst-python 1.12.3

gst-rtsp-server 1.12.3

gstreamer 1.12.3


Thanks,
Hans
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/gstreamer-devel/attachments/20180207/82ad419b/attachment-0001.html>


More information about the gstreamer-devel mailing list