|
QGroundControl
Ground Control Station for MAVLink Drones
|
#include "gstqt6elements.h"#include "gstqml6glsink.h"#include <QtGui/QGuiApplication>#include <gst/gl/gstglfuncs.h>
Include dependency graph for gstqml6glsink.cc:Go to the source code of this file.
Macros | |
| #define | GST_CAT_DEFAULT gst_debug_qml6_gl_sink |
| #define | DEFAULT_FORCE_ASPECT_RATIO TRUE |
| #define | DEFAULT_PAR_N 0 |
| #define | DEFAULT_PAR_D 1 |
| #define | gst_qml6_gl_sink_parent_class parent_class |
Enumerations | |
| enum | { ARG_0 , PROP_WIDGET , PROP_FORCE_ASPECT_RATIO , PROP_PIXEL_ASPECT_RATIO } |
| enum | { SIGNAL_0 , LAST_SIGNAL } |
Functions | |
| GST_DEBUG_CATEGORY (gst_debug_qml6_gl_sink) | |
| static void | gst_qml6_gl_sink_navigation_interface_init (GstNavigationInterface *iface) |
| static void | gst_qml6_gl_sink_finalize (GObject *object) |
| static void | gst_qml6_gl_sink_set_property (GObject *object, guint prop_id, const GValue *value, GParamSpec *param_spec) |
| static void | gst_qml6_gl_sink_get_property (GObject *object, guint prop_id, GValue *value, GParamSpec *param_spec) |
| static gboolean | gst_qml6_gl_sink_stop (GstBaseSink *bsink) |
| static gboolean | gst_qml6_gl_sink_query (GstBaseSink *bsink, GstQuery *query) |
| static GstStateChangeReturn | gst_qml6_gl_sink_change_state (GstElement *element, GstStateChange transition) |
| static void | gst_qml6_gl_sink_get_times (GstBaseSink *bsink, GstBuffer *buf, GstClockTime *start, GstClockTime *end) |
| static gboolean | gst_qml6_gl_sink_set_caps (GstBaseSink *bsink, GstCaps *caps) |
| static GstFlowReturn | gst_qml6_gl_sink_show_frame (GstVideoSink *bsink, GstBuffer *buf) |
| static gboolean | gst_qml6_gl_sink_propose_allocation (GstBaseSink *bsink, GstQuery *query) |
| G_DEFINE_TYPE_WITH_CODE (GstQml6GLSink, gst_qml6_gl_sink, GST_TYPE_VIDEO_SINK, GST_DEBUG_CATEGORY_INIT(gst_debug_qml6_gl_sink, "qtsink", 0, "Qt Video Sink");G_IMPLEMENT_INTERFACE(GST_TYPE_NAVIGATION, gst_qml6_gl_sink_navigation_interface_init)) | |
| G_BEGIN_DECLS gboolean | G_PASTE (gst_element_register_, qml6glsink)(GstPlugin *plugin) |
| static void | gst_qml6_gl_sink_class_init (GstQml6GLSinkClass *klass) |
| static void | gst_qml6_gl_sink_init (GstQml6GLSink *qt_sink) |
| static void | _reset (GstQml6GLSink *qt_sink) |
| static void | gst_qml6_gl_sink_navigation_send_event (GstNavigation *navigation, GstStructure *structure) |
Variables | |
| static GstStaticPadTemplate | gst_qt_sink_template |
| G_END_DECLS | |
| #define DEFAULT_FORCE_ASPECT_RATIO TRUE |
Definition at line 117 of file gstqml6glsink.cc.
| #define DEFAULT_PAR_D 1 |
Definition at line 119 of file gstqml6glsink.cc.
| #define DEFAULT_PAR_N 0 |
Definition at line 118 of file gstqml6glsink.cc.
| #define GST_CAT_DEFAULT gst_debug_qml6_gl_sink |
SECTION:gstqml6glsink
qml6glsink provides a way to render a video stream as a Qml object inside the Qml scene graph. This is achieved by providing the incoming OpenGL textures to Qt as a scene graph object.
qml6glsink will attempt to retrieve the windowing system display connection that Qt is using (#GstGLDisplay). This may be different to any already existing window system display connection already in use in the pipeline for a number of reasons. A couple of examples of this are:
If one of these scenarios occurs, then there will be multiple OpenGL contexts in use in the pipeline. This means that either the pipeline will fail to start up correctly, a downstream element may reject buffers, or a complete GPU->System memory->GPU transfer is performed for every buffer.
The requirement to avoid this is that all elements share the same #GstGLDisplay object and as Qt cannot currently share an existing window system display connection, GStreamer must use the window system display connection provided by Qt. This window system display connection can be retrieved by either a qmlglsink element or a qmlgloverlay element. The recommended usage is to have either element (qmlglsink or qmlgloverlay) be the first to propagate the #GstGLDisplay for the entire pipeline to use by setting either element to the READY element state before any other OpenGL element in the pipeline.
In a dynamically adding qmlglsink (or qmlgloverlay) to a pipeline case, there are some considerations for ensuring that the window system display and OpenGL contexts are compatible with Qt. When the qmlgloverlay (or qmlglsink) element is added and brought up to READY, it will propagate it's own #GstGLDisplay using the #GstContext mechanism regardless of any existing #GstGLDisplay used by the pipeline previously. In order for the new #GstGLDisplay to be used, the application must then set the provided #GstGLDisplay containing #GstContext on the pipeline. This may effectively cause each OpenGL element to replace the window system display and also the OpenGL context it is using. As such this process may take a significant amount of time and resources as objects are recreated in the new OpenGL context.
All instances of qmlglsink and qmlgloverlay will return the exact same #GstGLDisplay object while the pipeline is running regardless of whether any qmlglsink or qmlgloverlay elements are added or removed from the pipeline.
Definition at line 81 of file gstqml6glsink.cc.
| #define gst_qml6_gl_sink_parent_class parent_class |
Definition at line 135 of file gstqml6glsink.cc.
| anonymous enum |
| Enumerator | |
|---|---|
| ARG_0 | |
| PROP_WIDGET | |
| PROP_FORCE_ASPECT_RATIO | |
| PROP_PIXEL_ASPECT_RATIO | |
Definition at line 121 of file gstqml6glsink.cc.
| anonymous enum |
| Enumerator | |
|---|---|
| SIGNAL_0 | |
| LAST_SIGNAL | |
Definition at line 129 of file gstqml6glsink.cc.
|
static |
Definition at line 247 of file gstqml6glsink.cc.
Referenced by gst_qml6_gl_sink_finalize().
| G_DEFINE_TYPE_WITH_CODE | ( | GstQml6GLSink | , |
| gst_qml6_gl_sink | , | ||
| GST_TYPE_VIDEO_SINK | , | ||
| GST_DEBUG_CATEGORY_INIT(gst_debug_qml6_gl_sink, "qtsink", 0, "Qt Video Sink");G_IMPLEMENT_INTERFACE(GST_TYPE_NAVIGATION, gst_qml6_gl_sink_navigation_interface_init) | |||
| ) |
| G_BEGIN_DECLS gboolean G_PASTE | ( | gst_element_register_ | , |
| qml6glsink | |||
| ) |
Definition at line 141 of file gstqml6glsink.cc.
References qt6_element_init().
| GST_DEBUG_CATEGORY | ( | gst_debug_qml6_gl_sink | ) |
|
static |
Definition at line 344 of file gstqml6glsink.cc.
Referenced by gst_qml6_gl_sink_class_init().
|
static |
Definition at line 153 of file gstqml6glsink.cc.
References DEFAULT_FORCE_ASPECT_RATIO, DEFAULT_PAR_D, DEFAULT_PAR_N, gst_qml6_gl_sink_change_state(), gst_qml6_gl_sink_finalize(), gst_qml6_gl_sink_get_property(), gst_qml6_gl_sink_get_times(), gst_qml6_gl_sink_propose_allocation(), gst_qml6_gl_sink_query(), gst_qml6_gl_sink_set_caps(), gst_qml6_gl_sink_set_property(), gst_qml6_gl_sink_show_frame(), gst_qml6_gl_sink_stop(), gst_qt_sink_template, PROP_FORCE_ASPECT_RATIO, PROP_PIXEL_ASPECT_RATIO, and PROP_WIDGET.
|
static |
Definition at line 266 of file gstqml6glsink.cc.
References _reset().
Referenced by gst_qml6_gl_sink_class_init().
|
static |
Definition at line 278 of file gstqml6glsink.cc.
References DEFAULT_FORCE_ASPECT_RATIO, DEFAULT_PAR_D, DEFAULT_PAR_N, PROP_FORCE_ASPECT_RATIO, PROP_PIXEL_ASPECT_RATIO, and PROP_WIDGET.
Referenced by gst_qml6_gl_sink_class_init().
|
static |
Definition at line 425 of file gstqml6glsink.cc.
Referenced by gst_qml6_gl_sink_class_init().
|
static |
Definition at line 205 of file gstqml6glsink.cc.
|
static |
Definition at line 573 of file gstqml6glsink.cc.
References gst_qml6_gl_sink_navigation_send_event().
|
static |
Definition at line 564 of file gstqml6glsink.cc.
Referenced by gst_qml6_gl_sink_navigation_interface_init().
|
static |
Definition at line 475 of file gstqml6glsink.cc.
Referenced by gst_qml6_gl_sink_class_init().
|
static |
Definition at line 315 of file gstqml6glsink.cc.
Referenced by gst_qml6_gl_sink_class_init().
|
static |
Definition at line 446 of file gstqml6glsink.cc.
Referenced by gst_qml6_gl_sink_class_init().
|
static |
Definition at line 213 of file gstqml6glsink.cc.
References PROP_FORCE_ASPECT_RATIO, PROP_PIXEL_ASPECT_RATIO, and PROP_WIDGET.
Referenced by gst_qml6_gl_sink_class_init().
|
static |
Definition at line 462 of file gstqml6glsink.cc.
Referenced by gst_qml6_gl_sink_class_init().
|
static |
Definition at line 338 of file gstqml6glsink.cc.
Referenced by gst_qml6_gl_sink_class_init().
| G_END_DECLS |
Definition at line 150 of file gstqml6glsink.cc.
|
static |
Definition at line 106 of file gstqml6glsink.cc.
Referenced by gst_qml6_gl_sink_class_init().