mirror of
https://github.com/brunoherbelin/vimix.git
synced 2025-12-16 12:49:59 +01:00
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:
@@ -36,6 +36,7 @@ MediaPlayer::MediaPlayer()
|
||||
seeking_ = false;
|
||||
enabled_ = true;
|
||||
force_software_decoding_ = false;
|
||||
hardware_decoder_ = "";
|
||||
rate_ = 1.0;
|
||||
position_ = GST_CLOCK_TIME_NONE;
|
||||
desired_state_ = GST_STATE_PAUSED;
|
||||
@@ -473,6 +474,10 @@ bool MediaPlayer::isImage() const
|
||||
return media_.isimage;
|
||||
}
|
||||
|
||||
std::string MediaPlayer::hardwareDecoderName()
|
||||
{
|
||||
return hardware_decoder_;
|
||||
}
|
||||
|
||||
bool MediaPlayer::softwareDecodingForced()
|
||||
{
|
||||
@@ -708,6 +713,11 @@ void MediaPlayer::fill_texture(guint index)
|
||||
// initialize texture
|
||||
init_texture(index);
|
||||
|
||||
// now that a frame is ready, and once only, browse into the decoder of the pipeline
|
||||
// for possible hadrware decoding plugins used. Empty string means none.
|
||||
GstElement *dec = GST_ELEMENT(gst_bin_get_by_name (GST_BIN (pipeline_), "decoder") );
|
||||
hardware_decoder_ = GstToolkit::used_gpu_decoding_plugins(dec);
|
||||
|
||||
}
|
||||
else {
|
||||
glBindTexture(GL_TEXTURE_2D, textureindex_);
|
||||
|
||||
Reference in New Issue
Block a user