mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-30 02:31:44 +00:00
Fix video mode notifications.
This commit is contained in:
@@ -232,7 +232,7 @@ CS_Source CreateCvSource(llvm::StringRef name, const VideoMode& mode,
|
||||
source->Start(); // causes a property event
|
||||
notifier.NotifySource(name, handle, CS_SOURCE_CONNECTED);
|
||||
notifier.NotifySource(name, handle, CS_SOURCE_VIDEOMODES_UPDATED);
|
||||
notifier.NotifySource(name, handle, CS_SOURCE_VIDEOMODE_CHANGED);
|
||||
notifier.NotifySourceVideoMode(*source, mode);
|
||||
return handle;
|
||||
}
|
||||
|
||||
|
||||
@@ -628,8 +628,7 @@ CS_StatusValue UsbCameraImpl::DeviceCmdSetMode(
|
||||
DeviceConnect();
|
||||
}
|
||||
if (wasStreaming) DeviceStreamOn();
|
||||
Notifier::GetInstance().NotifySource(*this,
|
||||
CS_SOURCE_VIDEOMODE_CHANGED);
|
||||
Notifier::GetInstance().NotifySourceVideoMode(*this, newMode);
|
||||
lock.lock();
|
||||
} else if (newMode.fps != m_mode.fps) {
|
||||
m_mode = newMode;
|
||||
@@ -639,8 +638,7 @@ CS_StatusValue UsbCameraImpl::DeviceCmdSetMode(
|
||||
if (wasStreaming) DeviceStreamOff();
|
||||
DeviceSetFPS();
|
||||
if (wasStreaming) DeviceStreamOn();
|
||||
Notifier::GetInstance().NotifySource(*this,
|
||||
CS_SOURCE_VIDEOMODE_CHANGED);
|
||||
Notifier::GetInstance().NotifySourceVideoMode(*this, newMode);
|
||||
lock.lock();
|
||||
}
|
||||
|
||||
@@ -873,7 +871,7 @@ void UsbCameraImpl::DeviceCacheMode() {
|
||||
if (formatChanged) DeviceSetMode();
|
||||
if (fpsChanged) DeviceSetFPS();
|
||||
|
||||
Notifier::GetInstance().NotifySource(*this, CS_SOURCE_VIDEOMODE_CHANGED);
|
||||
Notifier::GetInstance().NotifySourceVideoMode(*this, m_mode);
|
||||
}
|
||||
|
||||
void UsbCameraImpl::DeviceCacheProperty(
|
||||
|
||||
Reference in New Issue
Block a user