mirror of
https://github.com/brunoherbelin/vimix.git
synced 2025-12-11 10:19:59 +01:00
BugFix Stream sources change input
This commit is contained in:
@@ -157,6 +157,11 @@ void PatternSource::setPattern(uint type, glm::ivec2 resolution)
|
||||
// play gstreamer
|
||||
stream_->play(true);
|
||||
|
||||
// delete and reset render buffer to enforce re-init of StreamSource
|
||||
if (renderbuffer_)
|
||||
delete renderbuffer_;
|
||||
renderbuffer_ = nullptr;
|
||||
|
||||
// will be ready after init and one frame rendered
|
||||
ready_ = false;
|
||||
}
|
||||
|
||||
@@ -43,6 +43,11 @@ void SrtReceiverSource::setConnection(const std::string &ip, const std::string &
|
||||
stream_->open(description);
|
||||
stream_->play(true);
|
||||
|
||||
// delete and reset render buffer to enforce re-init of StreamSource
|
||||
if (renderbuffer_)
|
||||
delete renderbuffer_;
|
||||
renderbuffer_ = nullptr;
|
||||
|
||||
// will be ready after init and one frame rendered
|
||||
ready_ = false;
|
||||
}
|
||||
|
||||
@@ -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) {
|
||||
|
||||
@@ -51,6 +51,11 @@ void GenericStreamSource::setDescription(const std::string &desc)
|
||||
stream_->open(gst_description_ + " ! queue max-size-buffers=10 ! videoconvert" );
|
||||
stream_->play(true);
|
||||
|
||||
// delete and reset render buffer to enforce re-init of StreamSource
|
||||
if (renderbuffer_)
|
||||
delete renderbuffer_;
|
||||
renderbuffer_ = nullptr;
|
||||
|
||||
// will be ready after init and one frame rendered
|
||||
ready_ = false;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user