Make glimagesink fullscreen again
Change-Id: Ib53d4a0b0fa8f6b90aabbfd8527655cb8cf6a4ad
diff --git a/edgetpuvision/gstreamer.py b/edgetpuvision/gstreamer.py
index 16dbdab..8c651e1 100644
--- a/edgetpuvision/gstreamer.py
+++ b/edgetpuvision/gstreamer.py
@@ -211,11 +211,6 @@
sys.stderr.write('Error: %s: %s\n' % (err, debug))
Gtk.main_quit()
-def on_sink_eos(sink, pipeline):
- overlay = pipeline.get_by_name('overlay')
- if overlay:
- overlay.set_eos()
-
def on_new_sample(sink, pipeline, render_overlay, layout, images, get_command, preroll):
with pull_sample(sink, preroll) as (sample, data, meta, pts):
custom_command = None
@@ -320,52 +315,9 @@
bus.connect('message', on_bus_message, pipeline, loop)
if display is not Display.NONE:
- # Needed to commit the wayland sub-surface.
- def on_gl_draw(sink, widget):
- widget.queue_draw()
-
- # Needed to account for window chrome etc.
- def on_widget_configure(widget, event, glsink):
- allocation = widget.get_allocation()
- glsink.set_render_rectangle(allocation.x, allocation.y,
- allocation.width, allocation.height)
- return False
-
- # TODO: re-enable this when we have proper GL support.
- # window = Gtk.Window(Gtk.WindowType.TOPLEVEL)
- # window.set_title(WINDOW_TITLE)
- # window.set_default_size(layout.render_size.width, layout.render_size.height)
- # if display is Display.FULLSCREEN:
- # window.fullscreen()
-
- # drawing_area = Gtk.DrawingArea()
- # window.add(drawing_area)
- # drawing_area.realize()
-
glsink = pipeline.get_by_name('glsink')
- #if display is Display.FULLSCREEN:
- # glsink.set_property('fullscreen', True)
-
- # window.connect('delete-event', Gtk.main_quit)
- # window.show_all()
-
- # The appsink pipeline branch must use the same GL display as the screen
- # rendering so they get the same GL context. This isn't automatically handled
- # by GStreamer as we're the ones setting an external display handle.
- def on_bus_message_sync(bus, message, glsink):
- if message.type == Gst.MessageType.NEED_CONTEXT:
- _, context_type = message.parse_context_type()
- # if context_type == 'gst.gl.GLDisplay':
- # sinkelement = glsink.get_by_interface(GstVideo.VideoOverlay)
- # gl_context = sinkelement.get_property('context')
- # if gl_context:
- # display_context = Gst.Context.new('gst.gl.GLDisplay', True)
- # display_structure = display_context.writable_structure()
- # display_structure.set_value('gst.gl.GLDisplay', gl_context.get_display())
- # message.src.set_context(display_context)
- return Gst.BusSyncReply.PASS
-
- bus.set_sync_handler(on_bus_message_sync, glsink)
+ if display is Display.FULLSCREEN:
+ glsink.set_property('fullscreen', True)
with Worker(save_frame) as images, Commands() as get_command:
signals = {'appsink':
@@ -380,8 +332,7 @@
layout=layout,
images=images,
get_command=get_command,
- preroll=True),
- 'eos' : on_sink_eos},
+ preroll=True)},
**(signals or {})
}