Change READY state of source

a source is ready after rendering one frame (which is after being initialized)
This commit is contained in:
Bruno
2021-05-01 00:34:58 +02:00
parent 058fde19ce
commit 381f68aaae
10 changed files with 42 additions and 21 deletions

View File

@@ -342,7 +342,7 @@ DeviceSource::~DeviceSource()
}
void DeviceSource::setDevice(const std::string &devicename)
{
{
device_ = devicename;
Log::Notify("Creating Source with device '%s'", device_.c_str());
@@ -384,8 +384,12 @@ void DeviceSource::setDevice(const std::string &devicename)
pipeline << " ! videoconvert";
// open gstreamer
stream_->open( pipeline.str(), best.width, best.height);
stream_->play(true);
// will be ready after init and one frame rendered
ready_ = false;
}
else
Log::Warning("No such device '%s'", device_.c_str());