I am attempting to dispose of an ImageViewerControl and it appears you guys are not checking for disposed/disconnected in the camera reconnect timer. I have tried a few variants of the calls but i still get an unhandled exception bubbling up from your library.
After calling the following methods:
_imageViewerControl.Disconnect();
_imageViewerControl.Close();
_imageViewerControl.Dispose();
I get a NullReferenceException and here is a partial stack trace (I have attached the full one)
at VideoOS.UI.Common.WPF.VideoPlayer.Toolkit.ToolkitVideoSource.Connect(XmlDocument configurationXml, XmlDocument digitalZoomConfigurationXml, List`1 renderingParameters, Boolean multicast)
at VideoOS.UI.Common.WPF.VideoPlayer.VideoPlayer.Connect(XmlDocument configurationXml, XmlDocument digitalZoomConfigurationXml, List`1 renderingParameters, String cameraName, String cameraAddress, Boolean multicast)
at VideoOS.Platform.SDK.UI.PlatformImageViewerWpfControl.ConnectUsingCameraConfigurationXml(String bstrUsername, String bstrPassword, String bstrCameraConfigurationXml)
at VideoOS.Platform.SDK.UI.PlatformImageViewerWpfControl.ConnectToServer()
at System.Windows.Threading.DispatcherTimer.FireTick(Object unused)
I have reproduced the error using your PlaybackWpfUser sample project by adding the following to the MainWindow constructor:
Task.Delay(20000).ContinueWith(_ =>
{
Dispatcher.Invoke(() =>
{
_imageViewerControl.Disconnect();
_imageViewerControl.Close();
_imageViewerControl.Dispose();
});
});
The documentation you have on the control contains the following instructions:
A simple implementation just need these lines for initialization:
imageViewerControl.CameraFQID = _selectedCameraItem.FQID;
imageViewerControl.Initialize();
imageViewerControl.Connect();
When the session is to be terminated, issue the following statement:
imageViewerControl.Disconnect();
After this you can connect again to the same or another camera. Once you are completely done with the image viewer call this:
imageViewerControl.Close();
imageViewerControl.Dispose();
Any help is appreciated