8#include <QtCore/QByteArray>
10#include <QtCore/QList>
11#include <QtCore/QMutex>
12#include <QtCore/QString>
59 std::optional<VideoDecoderOption>
applied()
const {
return _applied; }
62 bool setRank(GstRegistry* registry,
const char* featureName, uint16_t rank);
72 static GstRegistry* _registry();
74 bool _setRank(GstRegistry* registry,
const char* featureName, uint16_t rank);
76 void _restore(GstRegistry* registry);
80 QHash<QByteArray, guint> _originalRanks;
81 std::optional<VideoDecoderOption> _applied;
97 const std::optional<VideoDecoderOption> _previous;
101bool changeFeatureRank(GstRegistry* registry,
const char* featureName, uint16_t rank);
VideoDecoderOption
The decoders VideoSettings' forceVideoDecoder can force. The values are persisted.
void apply(VideoDecoderOption option)
Restores the original ranks, then applies option's plan for the installed decoders on this platform.
bool setRank(GstRegistry *registry, const char *featureName, uint16_t rank)
Sets featureName's rank in registry. False when the registry or name is null or the feature is absent...
DecoderRankApplier(const DecoderRankApplier &)=delete
std::optional< VideoDecoderOption > applied() const
The option apply() last applied; nullopt before the first and after restore().
bool demoteFailedDecoder(const char *featureName, const GstCaps *caps)
void restore()
Restores the original ranks.
void reapply()
apply() for the option applied last, when the platform's RankTraits changed since: Qt's device became...
static DecoderRankApplier & instance()
DecoderRankApplier & operator=(const DecoderRankApplier &)=delete
ScopedDecoderOption(const ScopedDecoderOption &)=delete
ScopedDecoderOption & operator=(const ScopedDecoderOption &)=delete
ScopedDecoderOption(VideoDecoderOption option)
QList< VideoDecoderOption > availableDecoderFamilies()
bool changeFeatureRank(GstRegistry *registry, const char *featureName, uint16_t rank)
DecoderRankApplier::setRank() on the process's applier, so setCodecPriorities() restores the rank too...
void setCodecPriorities(VideoDecoderOption option)
DecoderRankApplier::apply() on the process's applier. GUI thread.
bool demoteFailedDecoder(const char *factoryName, const GstCaps *caps)
DecoderRankApplier::demoteFailedDecoder() on the process's applier. Any thread.
bool isHardwareDecoderFactory(GstElementFactory *factory)
VideoDecoderOption decoderFamilyForFactory(const char *factoryName)
QString describeDecoderFactory(GstElementFactory *factory)
"[HW|SW] <plugin>/<factory> rank=<rank> (<klass>)" for decoder logs.
void forEachVideoDecoderFactory(GstRank minRank, const std::function< void(GstElementFactory *)> &visitor)
The platform rules planRanks() adds to an option.