Implemented a detection of hardware decoding used in pipeline

Simple check for names of decoder inside uridecodebin and cross check
with the list of known hardware Decoder Names
This commit is contained in:
brunoherbelin
2021-04-01 00:11:05 +02:00
parent 649d2b7ef7
commit c59994b7e5
6 changed files with 92 additions and 35 deletions

View File

@@ -169,10 +169,6 @@ public:
* Set the loop mode
* */
void setLoop(LoopMode mode);
bool softwareDecodingForced();
void setSoftwareDecodingForced(bool on);
/**
* Seek to next frame when paused
* (aka next frame)
@@ -242,6 +238,17 @@ public:
* Must be called in OpenGL context
* */
guint texture() const;
/**
* Get the name of the hardware decoder used
* Empty string if none (i.e. software decoding)
* */
std::string hardwareDecoderName();
/**
* Forces open using software decoding
* (i.e. without hadrware decoding)
* */
void setSoftwareDecodingForced(bool on);
bool softwareDecodingForced();
/**
* Accept visitors
* Used for saving session file
@@ -279,6 +286,7 @@ private:
bool seeking_;
bool enabled_;
bool force_software_decoding_;
std::string hardware_decoder_;
// fps counter
struct TimeCounter {