BugFix Stream sources change input

This commit is contained in:
Bruno Herbelin
2023-09-17 12:17:41 +02:00
parent 33c222555f
commit a430d39849
4 changed files with 17 additions and 5 deletions

View File

@@ -106,7 +106,7 @@ std::string Stream::decoderName()
guint Stream::texture() const
{
if (!textureindex_)
if (!textureindex_ || !textureinitialized_)
return Resource::getTextureBlack();
return textureindex_;
@@ -202,9 +202,6 @@ StreamInfo StreamDiscoverer(const std::string &description, guint w, guint h)
void Stream::open(const std::string &gstreamer_description, guint w, guint h)
{
if ( w != width_ || h != height_ )
textureinitialized_ = false;
// set gstreamer pipeline source
description_ = gstreamer_description;
@@ -238,6 +235,7 @@ void Stream::execute_open()
{
// reset
opened_ = false;
textureinitialized_ = false;
// Add custom app sink to the gstreamer pipeline
std::string description = description_;
@@ -369,7 +367,6 @@ void Stream::close()
// un-ready
opened_ = false;
textureinitialized_ = false;
// clean up GST
if (pipeline_ != nullptr) {