Posts

New Qt6 QML (OpenGL) elements

Image
Recently, I was tasked with porting some of the existing Qt5-based QML GStreamer elements for use with Qt6. Throughout this process, the only major architectural change in Qt that affected these GStreamer elements was the Qt6 rendering overhaul for supporting multiple graphics APIs (OpenGL, Vulkan, Direct3D, Metal, etc). The process overall was relatively painless however still required understanding the new Qt6 rendering model. The result is a set of elements that mirror functionality of the existing Qt5 GStreamer elements (`qmlglsink`, `qmlglsrc`, `qmlgloverlay`). The new elements are named `qml6glsink`, `qml6glsrc`, and `qml6gloverlay`. There is also a new element called `qml6glmixer`. qml6glsink The Qt6 variant of qmlglsink operates the exact same as its Qt5 counterpart. There is a QML Item that needs to be retrieved from the QML scene and a GStreamer sink component that needs the QML item set as a property. Once that is achieved, the video stream is viewable in the QML sc

GStreamer WebRTC in 2020

A little while ago, we at Centricular developed a plugin for easier WebRTC with GStreamer . For the details on the initial release, see Nirbheek 's blogpost about the new GStreamer WebRTC implementation. The initial release gathered a lot of interest and sparked a fair bit of activity around some of the needed features. This is a birds eye view of the new features since Nirbheek's blog post. New features RTP Bundling In a WebRTC connection there may be multiple streams that need to be sent and received. Without bundling, they would require opening a connection for each stream to be sent (and another for some control packets if not muxing RTCP with the RTP stream). This may consume precious ports and TURN resources if relaying is in use with the network topology. A WebRTC stream with bundling will instead send all of the streams over a single connection. GStreamer already supported bundling of streams as required by the WebRTC and related specifications and an im

qmlglsink - GStreamer and Qt's QML

Windows Support - NEW!! Just recently, I added the missing piece for adding Windows support for qmlglsink for QtQuick 2 applications (tracked by this bug ) with this commit which means that qmlglsink is now usable on all major platforms 1 . With the list of supported platforms (Android, iOS, OS X, Windows, Linux) for qmlglsink growing, I thought I'd write a little bit about it and why you should use it. qmlglsink is a GStreamer element that will render a video stream into a QtQuick QML scene. As you can see from this example , qmlglsink does this by providing a GstGLVideoItem QML item that can be placed anywhere in the scene. The GstGLVideoItem is given a unique name to be able to link the element and the QML item. Without this link, the element cannot render the stream anywhere and will fail changing state. In the C++ code, we then retrieve the GstGLVideoItem by name like so . Then we set the pipeline to playing, start Qt's mainloop and watch the show. Why Use qml

Vulkan in GStreamer

Image
Today, Vulkan 1.0 as released . For those of you that don't what Vulkan is, the TL;DR is essentially that it's cross-platform/device lower level 3D API than OpenGL (both the desktop and the ES variants) of a similar scope to DX12, Metal or Mantle. As a result, the driver does less work and the application/engine takes over some of the management of resources which hopefully leads to a smaller driver divergence and therefore bugs while at the same time providing increased access to the capabilities of the GPU. Centricular graciously sponsored some of my time to have a look at Vulkan and implement a basic working prototype of a GStreamer sink element that would display video frames onto the screen. I hereby present to you, vulkansink, the result of that labour. gst-launch-1.0 videotestsrc ! vulkanupload ! vulkansink Disclaimer: this is still alpha-quality code and it hasn't had the same extensive testing as the OpenGL elements and there are a number of short fall

GStreamer 1.6 and OpenGL contexts

With the imminent release of GStreamer 1.6 there has been a change in the mechanism by which OpenGL contexts and Window System (X11, Wayland, Win32, OS X's Cocoa) specific resources are shared with a GStreamer pipeline for elements that need that information. Elements like sinks or any of the GL elements or any global application provided information that is shared between elements. Previously, in 1.4, there was a property, 'external-opengl-context' available on some(!) elements that one could set on the current set of filter and mixer elements (not sink or source elements though!). While it mostly worked well enough, it was a behaviour difference to how window system handles are shared between the application and the GStreamer pipeline. Internal GL context sharing between elements was occurring in the ALLOCATION query as a value in a GstStructure of the meta:GstVideoGLTextureUploadMeta parameters. The main problem with this is 1. the ALLOCATION query is handled diffe

GNOME Asia 2015

Image
I've just arrived back from GNOME Asia and it's time to blog about the experience there. The trip to Jakarta was relatively uneventful. An early train to Sydney started the day followed by the trip to Singapore. A tight connection (1 hour) combined with switching terminals made life a little interesting. The fact that one of the Changi terminal connection AirTrain's was out of service meant we were bussed across the tarmac. Then to find the gate and the aeroplane, and the short trip to Jakarta. After landing in Jakarta, I was meant to meet up with a local Indonesian, however different terminal exit points meant that we missed each other and a phone call was necessary on another local's mobile phone. After meeting there was a bus trip followed by a KRL (train) trip followed by a ride on a Ojek (motorcycle) which made for an interesting trip to my sleeping quarters. A local meal was followed swiftly by some horizontal time. Some early breakfast consisting of

Forwarding GObject properties

First blog post! Let's get straight into it. While developing some cool new features for the GStreamer GL stack, I found the need to have GstBin contain the properties of a containing GstElement. Extra points if we can change the containing element and the GstBin properties react accordingly. Option 1 - manual forwarding The simplest and most boring solution, create subclasses with the necessary properties and forward to the relevant containing element. We should be able to do better than this. Option 2 - GParamSpecOverride The next option is to use g_param_spec_override which points the property to a property within another object. This comes with the advantage and pitfall that it's kinda supported by GLib directly but not thoroughly tested. /* should only called from an object's class_init function */ void install_properties_into_class_from_gtype (GObjectClass * self, GType type) { GObjectClass *class; GParamSpec ** props; GParamSpec **