UsbCamera: Allow silencing of Connecting message (#1231)

This commit is contained in:
Peter Johnson
2018-07-28 14:57:41 -07:00
committed by GitHub
parent 0614913f1a
commit 6b37ca9f9a
7 changed files with 49 additions and 5 deletions

View File

@@ -268,6 +268,10 @@ class UsbCamera : public VideoCamera {
/// Get the path to the device.
std::string GetPath() const;
/// Set how verbose the camera connection messages are.
/// @param level 0=don't display Connecting message, 1=do display message
void SetConnectVerbose(int level);
};
/// A source that represents a MJPEG-over-HTTP (IP) camera.

View File

@@ -233,6 +233,12 @@ inline std::string UsbCamera::GetPath() const {
return ::cs::GetUsbCameraPath(m_handle, &m_status);
}
inline void UsbCamera::SetConnectVerbose(int level) {
m_status = 0;
SetProperty(GetSourceProperty(m_handle, "connect_verbose", &m_status), level,
&m_status);
}
inline HttpCamera::HttpCamera(wpi::StringRef name, wpi::StringRef url,
HttpCameraKind kind) {
m_handle = CreateHttpCamera(