Skip to content
Snippets Groups Projects
Commit 32c0c8d7 authored by Adrien Béraud's avatar Adrien Béraud Committed by Philippe Gorley
Browse files

video_rtp_session: don't start sender if unable to open camera


Change-Id: Ib25362e474af6cecee59c4d3738473bfafcd766f
Reviewed-by: default avatarPhilippe Gorley <philippe.gorley@savoirfairelinux.com>
parent be8c5391
No related branches found
No related tags found
No related merge requests found
...@@ -98,14 +98,18 @@ void VideoRtpSession::startSender() ...@@ -98,14 +98,18 @@ void VideoRtpSession::startSender()
if (newParams.valid() && if (newParams.valid() &&
newParams.wait_for(NEWPARAMS_TIMEOUT) == std::future_status::ready) newParams.wait_for(NEWPARAMS_TIMEOUT) == std::future_status::ready)
localVideoParams_ = newParams.get(); localVideoParams_ = newParams.get();
else else {
RING_ERR("No valid new video parameters."); RING_ERR("No valid new video parameters.");
return;
}
} catch (const std::exception& e) { } catch (const std::exception& e) {
RING_ERR("Exception during retrieving video parameters: %s", RING_ERR("Exception during retrieving video parameters: %s",
e.what()); e.what());
return;
} }
} else { } else {
RING_WARN("Can't lock video input"); RING_WARN("Can't lock video input");
return;
} }
} }
...@@ -124,10 +128,10 @@ void VideoRtpSession::startSender() ...@@ -124,10 +128,10 @@ void VideoRtpSession::startSender()
send_.enabled = false; send_.enabled = false;
} }
auto codecVideo = std::static_pointer_cast<ring::AccountVideoCodecInfo>(send_.codec); auto codecVideo = std::static_pointer_cast<ring::AccountVideoCodecInfo>(send_.codec);
auto isAutoQualityEnabledStr = codecVideo->getCodecSpecifications()[DRing::Account::ConfProperties::CodecInfo::AUTO_QUALITY_ENABLED]; auto autoQuality = codecVideo->isAutoQualityEnabled;
if ((not rtcpCheckerThread_.isRunning()) && (isAutoQualityEnabledStr.compare(TRUE_STR) == 0)) if (autoQuality and not rtcpCheckerThread_.isRunning())
rtcpCheckerThread_.start(); rtcpCheckerThread_.start();
else if ((rtcpCheckerThread_.isRunning()) && (isAutoQualityEnabledStr.compare(FALSE_STR) == 0)) else if (not autoQuality and rtcpCheckerThread_.isRunning())
rtcpCheckerThread_.join(); rtcpCheckerThread_.join();
} }
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment