![]() |
Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
|
Provides GStreamer-specific integration points for Qt Multimedia. More...
#include <qgstreamerinterface.h>
Public Member Functions | |
| virtual | ~QGStreamerInterface () |
| Destroys the interface. | |
| virtual QCamera * | makeCustomGStreamerCamera (const QByteArray &gstBinDescription, QObject *parent)=0 |
| virtual QCamera * | makeCustomGStreamerCamera (GstElement *element, QObject *parent)=0 |
| virtual QAudioDevice | makeCustomGStreamerAudioInput (const QByteArray &gstreamerPipeline)=0 |
| Creates a custom audio input device from a GStreamer pipeline description. | |
| virtual QAudioDevice | makeCustomGStreamerAudioOutput (const QByteArray &gstreamerPipeline)=0 |
| Creates a custom audio output device from a GStreamer pipeline description. | |
| virtual GstPipeline * | gstPipeline (QMediaPlayer *)=0 |
Returns the underlying GStreamer pipeline for player, or nullptr if player is not backed by the GStreamer media backend. | |
| virtual GstPipeline * | gstPipeline (QMediaCaptureSession *)=0 |
Returns the underlying GStreamer pipeline for session, or nullptr if session is not backed by the GStreamer media backend. | |
| virtual GstBuffer * | gstBuffer (const QVideoFrame &frame)=0 |
Returns the GStreamer buffer backing frame, or nullptr if frame does not hold GStreamer-backed video memory. | |
| virtual QVideoFrame | createFrameFromGstBuffer (GstBuffer *buffer, const GstVideoInfo &videoInfo)=0 |
| Creates a \l QVideoFrame that wraps buffer using the format described by videoInfo. | |
| virtual QVideoFrame | createFrameFromGstBuffer (GstBuffer *buffer, const GstVideoInfoDmaDrm &videoInfo)=0 |
| Creates a \l QVideoFrame that wraps a DMA-BUF-backed buffer using the format described by videoInfo. | |
Static Public Member Functions | |
| static QGStreamerInterface * | instance () |
Returns the GStreamer interface for the active Qt Multimedia backend, or nullptr if the GStreamer backend is not in use. | |
Provides GStreamer-specific integration points for Qt Multimedia.
\inmodule QtMultimedia
To use this class in an application, link to Qt::MultimediaPrivate (if using CMake), and include the header {#include <QtMultimedia/spi/qgstreamerinterface.h>}.
QGStreamerInterface is the entry point for customizing the GStreamer backend: wrapping custom pipeline elements as Qt audio and video devices, accessing the underlying GstPipeline of high-level Qt objects, and converting between \l QVideoFrame and GStreamer buffers.
By default, the class is available in meta-qt6 builds. In custom builds with GStreamer support, the gstreamer_qt_api feature can enable it.
QtMultimedia must be run with the gstreamer media backend to get a valid instance of the class.
Definition at line 29 of file qgstreamerinterface.h.
|
virtualdefault |
Destroys the interface.
|
pure virtual |
Creates a \l QVideoFrame that wraps buffer using the format described by videoInfo.
The created frame shares ownership of the specified GstBuffer with the caller.
|
pure virtual |
Creates a \l QVideoFrame that wraps a DMA-BUF-backed buffer using the format described by videoInfo.
Requires GStreamer 1.24 or later with DMA-BUF video format support. If unsupported, returns an invalid \l QVideoFrame and logs a warning.
The created frame shares ownership of the specified GstBuffer with the caller.
|
pure virtual |
Returns the GStreamer buffer backing frame, or nullptr if frame does not hold GStreamer-backed video memory.
Ownership of the returned buffer is not transferred.
|
pure virtual |
Returns the underlying GStreamer pipeline for session, or nullptr if session is not backed by the GStreamer media backend.
|
pure virtual |
Returns the underlying GStreamer pipeline for player, or nullptr if player is not backed by the GStreamer media backend.
|
static |
Returns the GStreamer interface for the active Qt Multimedia backend, or nullptr if the GStreamer backend is not in use.
Definition at line 46 of file qgstreamerinterface.cpp.
|
pure virtual |
Creates a custom audio input device from a GStreamer pipeline description.
The gstreamerPipeline string is parsed as a GStreamer bin description. The resulting elements are connected as the audio source of a \l QMediaCaptureSession when the returned \l QAudioDevice is passed to \l QAudioInput and assigned with \l{QMediaCaptureSession::setAudioInput()}.
Element names in the description can be used to locate nodes in the session pipeline via gst_bin_get_by_name() after the capture session is active.
|
pure virtual |
Creates a custom audio output device from a GStreamer pipeline description.
The gstreamerPipeline string is parsed as a GStreamer bin description. The resulting elements are connected as the audio sink of a \l QMediaCaptureSession when the returned \l QAudioDevice is passed to \l QAudioOutput and assigned with \l{QMediaCaptureSession::setAudioOutput()}.
|
pure virtual |
|
pure virtual |