QGroundControl
Ground Control Station for MAVLink Drones
Loading...
Searching...
No Matches
GStreamer Namespace Reference

Namespaces

namespace  Environment
 
namespace  SourceFactory
 

Classes

struct  GstObjectDeleter
 
struct  GstQueryDeleter
 
struct  VideoSinkConfig
 

Typedefs

using GstObjectPtr = std::unique_ptr< GstObject, GstObjectDeleter >
 
using GstFactoryPtr = std::unique_ptr< GstElementFactory, GstObjectDeleter >
 
using GstFeaturePtr = std::unique_ptr< GstPluginFeature, GstObjectDeleter >
 
using GstQueryPtr = std::unique_ptr< GstQuery, GstQueryDeleter >
 

Enumerations

enum  VideoDecoderOptions : int {
  ForceVideoDecoderDefault = 0 , ForceVideoDecoderSoftware , ForceVideoDecoderNVIDIA , ForceVideoDecoderVAAPI ,
  ForceVideoDecoderDirectX3D , ForceVideoDecoderVideoToolbox , ForceVideoDecoderIntel , ForceVideoDecoderVulkan ,
  ForceVideoDecoderHardware
}
 

Functions

Environment::ValidationResult prepareEnvironment ()
 
bool completeInit ()
 
bool initialize (const QStringList &arguments, const Environment::ValidationResult &envResult)
 
void * createVideoSink (const VideoSinkConfig &config)
 
void releaseVideoSink (void *sink)
 
VideoReceivercreateVideoReceiver (QObject *parent)
 
bool setupQVideoSinkElement (void *sinkBin, QVideoSink *videoSink, QObject *controllerParent)
 
void attachAppSink (QObject *receiver, void *sink, QQuickItem *widget)
 
void bindDebugLevelFact (Fact *fact, QObject *context)
 
static const char * graphicsApiName (QSGRendererInterface::GraphicsApi api)
 
static const char * zeroCopyFamilyForApi (QSGRendererInterface::GraphicsApi api)
 
void onMainWindowReady (QQuickWindow *window)
 
QList< VideoDecoderOptionsavailableDecoderFamilies ()
 
void setDebugLevel (int level)
 
bool isValidRtspUri (const gchar *uri_str)
 
QString writePipelineDot (GstElement *pipeline, const char *tag)
 
void forEachPlugin (GstRegistry *registry, const std::function< void(GstPlugin *)> &visitor)
 
bool isHardwareDecoderFactory (GstElementFactory *factory)
 
bool changeFeatureRank (GstRegistry *registry, const char *featureName, uint16_t rank)
 
void setCodecPriorities (int rawOption)
 Overload taking the raw forceVideoDecoder setting value; the cast/range-check lives in the impl.
 
void setCodecPriorities (VideoDecoderOptions option)
 
void resetExternalPluginLoaderFailure ()
 
bool didExternalPluginLoaderFail ()
 
void redirectGLibLogging ()
 
void qtGstLog (GstDebugCategory *category, GstDebugLevel level, const gchar *file, const gchar *function, gint line, GObject *object, GstDebugMessage *message, gpointer data)
 
void configureDebugLogging ()
 
void logDecoderRanks ()
 
GstFactoryPtr adoptFactory (GstElementFactory *factory) noexcept
 
GstFeaturePtr adoptFeature (GstPluginFeature *feature) noexcept
 
GstQueryPtr adoptQuery (GstQuery *query) noexcept
 

Detailed Description

Scoped owners for transfer-full GStreamer returns so refs can't leak on early return. Use the adopt* helpers at the transfer-full call boundary; .get() yields a non-owning view.

Typedef Documentation

◆ GstFactoryPtr

using GStreamer::GstFactoryPtr = typedef std::unique_ptr<GstElementFactory, GstObjectDeleter>

Definition at line 22 of file GstScoped.h.

◆ GstFeaturePtr

using GStreamer::GstFeaturePtr = typedef std::unique_ptr<GstPluginFeature, GstObjectDeleter>

Definition at line 23 of file GstScoped.h.

◆ GstObjectPtr

using GStreamer::GstObjectPtr = typedef std::unique_ptr<GstObject, GstObjectDeleter>

Definition at line 21 of file GstScoped.h.

◆ GstQueryPtr

using GStreamer::GstQueryPtr = typedef std::unique_ptr<GstQuery, GstQueryDeleter>

Definition at line 24 of file GstScoped.h.

Enumeration Type Documentation

◆ VideoDecoderOptions

Enumerator
ForceVideoDecoderDefault 
ForceVideoDecoderSoftware 
ForceVideoDecoderNVIDIA 
ForceVideoDecoderVAAPI 
ForceVideoDecoderDirectX3D 
ForceVideoDecoderVideoToolbox 
ForceVideoDecoderIntel 
ForceVideoDecoderVulkan 
ForceVideoDecoderHardware 

Definition at line 17 of file GStreamer.h.

Function Documentation

◆ adoptFactory()

GstFactoryPtr GStreamer::adoptFactory ( GstElementFactory *  factory)
inlinenoexcept

Definition at line 26 of file GstScoped.h.

Referenced by createVideoSink().

◆ adoptFeature()

GstFeaturePtr GStreamer::adoptFeature ( GstPluginFeature *  feature)
inlinenoexcept

Definition at line 31 of file GstScoped.h.

Referenced by changeFeatureRank().

◆ adoptQuery()

GstQueryPtr GStreamer::adoptQuery ( GstQuery *  query)
inlinenoexcept

Definition at line 36 of file GstScoped.h.

Referenced by QGCQVideoSinkController::refreshLatency().

◆ attachAppSink()

void GStreamer::attachAppSink ( QObject *  receiver,
void *  sink,
QQuickItem *  widget 
)

◆ availableDecoderFamilies()

QList< VideoDecoderOptions > GStreamer::availableDecoderFamilies ( )

Hardware decoder families currently present in the GStreamer registry, as VideoDecoderOptions values (always omits ForceVideoDecoderDefault/Software). Lets the settings layer validate a persisted ForceVideoDecoder* choice against what the running build can actually provide.

Definition at line 471 of file GStreamer.cc.

References ForceVideoDecoderDirectX3D, ForceVideoDecoderIntel, ForceVideoDecoderNVIDIA, ForceVideoDecoderVAAPI, ForceVideoDecoderVideoToolbox, and ForceVideoDecoderVulkan.

Referenced by VideoSettings::pruneUnavailableDecoders().

◆ bindDebugLevelFact()

void GStreamer::bindDebugLevelFact ( Fact fact,
QObject *  context 
)

Definition at line 387 of file GStreamer.cc.

References Fact::rawValueChanged(), and setDebugLevel().

Referenced by VideoBackend::bindDebugLevelFact().

◆ changeFeatureRank()

bool GStreamer::changeFeatureRank ( GstRegistry *  registry,
const char *  featureName,
uint16_t  rank 
)

Look up featureName in registry and set its autoplug rank to rank, releasing the transfer-full feature ref. Returns false when the registry/name is null or the feature is absent.

Definition at line 173 of file GStreamerHelpers.cc.

References adoptFeature(), and changeFeatureRank().

Referenced by changeFeatureRank(), and completeInit().

◆ completeInit()

bool GStreamer::completeInit ( )

◆ configureDebugLogging()

void GStreamer::configureDebugLogging ( )

Definition at line 131 of file GStreamerLogging.cc.

References qtGstLog().

Referenced by completeInit().

◆ createVideoReceiver()

VideoReceiver * GStreamer::createVideoReceiver ( QObject *  parent)

Definition at line 312 of file GStreamer.cc.

Referenced by VideoBackend::createReceiver().

◆ createVideoSink()

void * GStreamer::createVideoSink ( const VideoSinkConfig config)

Definition at line 276 of file GStreamer.cc.

References adoptFactory(), and config.

Referenced by VideoBackend::createSink().

◆ didExternalPluginLoaderFail()

bool GStreamer::didExternalPluginLoaderFail ( )

Definition at line 75 of file GStreamerLogging.cc.

Referenced by completeInit().

◆ forEachPlugin()

void GStreamer::forEachPlugin ( GstRegistry *  registry,
const std::function< void(GstPlugin *)> &  visitor 
)

Walk every plugin in the GStreamer registry, invoking visitor for each; frees the GList internally. The plugin pointer is valid only for the duration of the call (don't ref it).

Definition at line 109 of file GStreamerHelpers.cc.

References forEachPlugin().

Referenced by forEachPlugin().

◆ graphicsApiName()

static const char * GStreamer::graphicsApiName ( QSGRendererInterface::GraphicsApi  api)
static

Definition at line 395 of file GStreamer.cc.

Referenced by onMainWindowReady().

◆ initialize()

bool GStreamer::initialize ( const QStringList &  arguments,
const Environment::ValidationResult envResult 
)

◆ isHardwareDecoderFactory()

bool GStreamer::isHardwareDecoderFactory ( GstElementFactory *  factory)

Definition at line 122 of file GStreamerHelpers.cc.

References isHardwareDecoderFactory().

Referenced by isHardwareDecoderFactory(), and logDecoderRanks().

◆ isValidRtspUri()

bool GStreamer::isValidRtspUri ( const gchar *  uri_str)

Definition at line 35 of file GStreamerHelpers.cc.

References isValidRtspUri().

Referenced by isValidRtspUri().

◆ logDecoderRanks()

void GStreamer::logDecoderRanks ( )

Definition at line 159 of file GStreamerLogging.cc.

References isHardwareDecoderFactory().

Referenced by completeInit().

◆ onMainWindowReady()

void GStreamer::onMainWindowReady ( QQuickWindow *  window)

◆ prepareEnvironment()

Environment::ValidationResult GStreamer::prepareEnvironment ( )

◆ qtGstLog()

void GStreamer::qtGstLog ( GstDebugCategory *  category,
GstDebugLevel  level,
const gchar *  file,
const gchar *  function,
gint  line,
GObject *  object,
GstDebugMessage *  message,
gpointer  data 
)

Definition at line 87 of file GStreamerLogging.cc.

Referenced by configureDebugLogging().

◆ redirectGLibLogging()

void GStreamer::redirectGLibLogging ( )

Definition at line 80 of file GStreamerLogging.cc.

Referenced by initialize().

◆ releaseVideoSink()

void GStreamer::releaseVideoSink ( void *  sink)

Definition at line 304 of file GStreamer.cc.

Referenced by VideoBackend::releaseSink().

◆ resetExternalPluginLoaderFailure()

void GStreamer::resetExternalPluginLoaderFailure ( )

Definition at line 70 of file GStreamerLogging.cc.

Referenced by initialize().

◆ setCodecPriorities() [1/2]

void GStreamer::setCodecPriorities ( int  rawOption)

Overload taking the raw forceVideoDecoder setting value; the cast/range-check lives in the impl.

Definition at line 376 of file GStreamerHelpers.cc.

References ForceVideoDecoderDefault, ForceVideoDecoderHardware, and setCodecPriorities().

Referenced by VideoBackend::applyDecoderPriorities(), setCodecPriorities(), and setCodecPriorities().

◆ setCodecPriorities() [2/2]

void GStreamer::setCodecPriorities ( VideoDecoderOptions  option)

Apply decoder rank overrides for option to the global GStreamer registry. Defined here alongside the decoder-rank table it drives; re-exported through the GStreamer facade.

Definition at line 386 of file GStreamerHelpers.cc.

References ForceVideoDecoderDefault, ForceVideoDecoderDirectX3D, ForceVideoDecoderHardware, ForceVideoDecoderIntel, ForceVideoDecoderNVIDIA, ForceVideoDecoderSoftware, ForceVideoDecoderVAAPI, ForceVideoDecoderVideoToolbox, ForceVideoDecoderVulkan, and setCodecPriorities().

◆ setDebugLevel()

void GStreamer::setDebugLevel ( int  level)

Definition at line 149 of file GStreamerLogging.cc.

Referenced by bindDebugLevelFact().

◆ setupQVideoSinkElement()

bool GStreamer::setupQVideoSinkElement ( void *  sinkBin,
QVideoSink *  videoSink,
QObject *  controllerParent 
)

Wire videoSink into the qgcqvideosink element inside sinkBin and create a QGCQVideoSinkController child of controllerParent. Idempotent: prior controllers under the same parent are torn down first. Returns true on success.

Definition at line 317 of file GStreamer.cc.

References QGCQVideoSinkController::controllersOf(), gst_qgc_q_video_sink_set_hw_context(), gst_qgc_video_sink_bin_get_gpu_zerocopy(), gst_qgc_video_sink_bin_get_qvideosink(), and HwBuffers::onPipelineRestart().

Referenced by attachAppSink().

◆ writePipelineDot()

QString GStreamer::writePipelineDot ( GstElement pipeline,
const char *  tag 
)

Dump pipeline's graph as a rotating .dot under CacheLocation/qgc-pipeline-dot/ for field reports. Returns empty (no-op) when GST_DEBUG_DUMP_DOT_DIR is set or on I/O failure.

Definition at line 59 of file GStreamerHelpers.cc.

References writePipelineDot().

Referenced by GstVideoReceiver::dumpPipelineGraph(), and writePipelineDot().

◆ zeroCopyFamilyForApi()

static const char * GStreamer::zeroCopyFamilyForApi ( QSGRendererInterface::GraphicsApi  api)
static

Definition at line 416 of file GStreamer.cc.

Referenced by onMainWindowReady().