Improved detection of unplugged device

This commit is contained in:
brunoherbelin
2020-09-25 21:44:38 +02:00
parent 7109b94484
commit a4ff2a325f
5 changed files with 22 additions and 10 deletions

View File

@@ -31,8 +31,8 @@ Stream::Stream()
description_ = "undefined";
pipeline_ = nullptr;
width_ = 800;
height_ = 600;
width_ = -1;
height_ = -1;
single_frame_ = false;
live_ = false;
ready_ = false;
@@ -76,9 +76,8 @@ void Stream::open(const std::string &gstreamer_description, int w, int h)
{
// set gstreamer pipeline source
description_ = gstreamer_description;
if (w>0) width_ = w;
if (h>0) height_ = h;
width_ = w;
height_ = h;
// close before re-openning
if (isOpen())