VideoBackend on GStreamer: the only place the app reaches GStreamer's lifecycle from, in the only order it can run: prepareEnvironment() on the GUI thread, before gst_init() reads the environment; initialize() once, on any thread; then selfTest(), once initialized. More...
#include <GStreamerVideoBackend.h>
Public Types | |
| enum class | State : uint8_t { Unprepared , Prepared , Initialized , Failed } |
Public Member Functions | |
| State | state () const |
| Capabilities | capabilities () const override |
| VideoReceiver * | createReceiver (QObject *parent) override |
| A receiver that can play: once initialize() has failed, one that needs no initialization. | |
| void | configureQtGraphics (bool softwareRendering) override |
| EnvPrepResult | prepareEnvironment () override |
| Points GStreamer at its plugins, scanner and registry (GStreamer::Environment::prepareEnvironment()). | |
| bool | initialize (const InitParams ¶ms) override |
| GStreamer::initialize() the first time; afterwards that call's outcome. | |
| QString | initFailureMessage () const override |
| What to tell the user once initialize() has failed: what failed, and what plays the streams instead. | |
| bool | selfTest () override |
| GStreamer::SelfTest::run() once initialized; false, logged, otherwise. | |
| void | applyDecoderPriorities (VideoDecoderOption option) override |
| QList< VideoDecoderOption > | availableDecoderFamilies () override |
| The hardware decoder families present, as forceVideoDecoder values (never Default or Software). | |
| void | setDebugLevel (int level) override |
| void | onMainWindowReady (QQuickWindow *window) override |
| void | setAndroidJniState (void *javaVm, void *appContext, void *classLoader) override |
| Public Member Functions inherited from VideoBackend | |
| virtual | ~VideoBackend ()=default |
| VideoBackend (const VideoBackend &)=delete | |
| VideoBackend & | operator= (const VideoBackend &)=delete |
Additional Inherited Members | |
| Static Public Member Functions inherited from VideoBackend | |
| static VideoBackend & | instance () |
| static bool | disabledForUnitTests () |
| True when the backend is skipped under unit tests (opt back in with QGC_TEST_ENABLE_GSTREAMER). | |
| static std::optional< int > | persistedDebugLevel () |
| The persisted gstDebugLevel setting, read before the settings system exists; nullopt when it was never set. | |
| Protected Member Functions inherited from VideoBackend | |
| VideoBackend ()=default | |
VideoBackend on GStreamer: the only place the app reaches GStreamer's lifecycle from, in the only order it can run: prepareEnvironment() on the GUI thread, before gst_init() reads the environment; initialize() once, on any thread; then selfTest(), once initialized.
gst_init() can't be undone, so initialize() runs GStreamer's setup once: a later call returns the first one's outcome, and a failed setup isn't retried. The receivers are then Qt Multimedia's. The free functions in GStreamer.h, GStreamerEnvironment.h and GStreamerSelfTest.h do the work.
Definition at line 15 of file GStreamerVideoBackend.h.
|
strong |
| Enumerator | |
|---|---|
| Unprepared | |
| Prepared | The environment is set up for gst_init(). |
| Initialized | GStreamer runs, with the plugins video needs. |
| Failed | initialize() failed; Qt Multimedia plays the streams. |
Definition at line 18 of file GStreamerVideoBackend.h.
|
overridevirtual |
Reimplemented from VideoBackend.
Definition at line 93 of file GStreamerVideoBackend.cc.
References GStreamer::setCodecPriorities().
|
overridevirtual |
The hardware decoder families present, as forceVideoDecoder values (never Default or Software).
Reimplemented from VideoBackend.
Definition at line 98 of file GStreamerVideoBackend.cc.
References GStreamer::availableDecoderFamilies().
|
overridevirtual |
Implements VideoBackend.
Definition at line 29 of file GStreamerVideoBackend.cc.
|
overridevirtual |
Qt graphics setup the backend's GPU video paths need; call it before the QGuiApplication exists, as Qt reads it at startup. softwareRendering: the user asked for software rendering (–swrast), which it must keep.
Reimplemented from VideoBackend.
Definition at line 24 of file GStreamerVideoBackend.cc.
References HwBuffers::configureQtGraphics().
|
overridevirtual |
A receiver that can play: once initialize() has failed, one that needs no initialization.
Implements VideoBackend.
Definition at line 39 of file GStreamerVideoBackend.cc.
|
overridevirtual |
What to tell the user once initialize() has failed: what failed, and what plays the streams instead.
Reimplemented from VideoBackend.
Definition at line 77 of file GStreamerVideoBackend.cc.
|
overridevirtual |
GStreamer::initialize() the first time; afterwards that call's outcome.
Reimplemented from VideoBackend.
Definition at line 59 of file GStreamerVideoBackend.cc.
References Failed, GStreamer::initialize(), Initialized, Prepared, state(), and Unprepared.
|
overridevirtual |
Reimplemented from VideoBackend.
Definition at line 108 of file GStreamerVideoBackend.cc.
References GStreamer::onMainWindowReady().
|
overridevirtual |
Points GStreamer at its plugins, scanner and registry (GStreamer::Environment::prepareEnvironment()).
Reimplemented from VideoBackend.
Definition at line 48 of file GStreamerVideoBackend.cc.
References Prepared, GStreamer::Environment::prepareEnvironment(), state(), and Unprepared.
|
overridevirtual |
GStreamer::SelfTest::run() once initialized; false, logged, otherwise.
Reimplemented from VideoBackend.
Definition at line 84 of file GStreamerVideoBackend.cc.
References GStreamer::Environment::bundledRuntime(), Initialized, GStreamer::SelfTest::run(), and state().
|
overridevirtual |
Android: hands the backend the JavaVM, application context and class loader (jobject, or null) its plugins look up through JNI.
Reimplemented from VideoBackend.
Definition at line 113 of file GStreamerVideoBackend.cc.
|
overridevirtual |
Reimplemented from VideoBackend.
Definition at line 103 of file GStreamerVideoBackend.cc.
References GStreamer::setDebugLevel().
|
inline |
Definition at line 26 of file GStreamerVideoBackend.h.
Referenced by createReceiver(), initialize(), prepareEnvironment(), and selfTest().