LoadSiteItem blocks the SDK

Hi Support,

I use the MIPSDK (.NET) to connect many Milestone servers at the same time.

I display many videos of many servers.

then I try to connect another server that is unavailable, so the connection is blokced at LoadSiteItem, and all the displayed videos are paused until the LoadSiteItem returns NULL.

Is that a problem in the SDK, or am I missing something?

How can I avoid video blocking?

Thanks.

What you describe seems to me to be the functionality of the MultiSiteViewer sample. Now, with the MultiSiteViewer sample I cannot reproduce your observations.

My suggestionis that you try the sample, if it works for you then compare the implementation in the sample with your code.

If the MultiSiteViewer sample shows the same issue for you please let me know the version of the MIP SDK you use and add some information about your XProtect test setup..

I cannot reproduce the same issue in MultiSiteViewer sample.

But the deference between my code and the MultiSiteViewer sample is the implementation of the Live display:

- The MultiSiteViewer sample uses the graphic component ImageViewerControl.

- I use the JPEGLiveSource class like in MediaLiveViewer sample.

I think, that is what makes the Live blocks (no more buffers returned by JpegLiveSource1LiveNotificationEvent) in my application.

I cannot use ImageViewerControl because I need buffers to be sent to a server for display.

I did the experiment. I made a “merger” of MultiSiteViewer sample and MediaLiveViewer sample. I can reproduce the issue. I will ask Milestone Development for guidance, maybe we both do it wrong, but I suspect there is more to it.

We both did this wrong.

LoadSiteItem takes time, most significantly if it will return empty after a network time out, not being able to reach a Milestone XProtect site.

This is know behavior.

So what is wrong is that if you do the LoadSiteItem in the UI thread everything will freeze.

What you must do is to switch to another thread when you call the LoadSiteItem function so that the UI is not frozen, and after the methods return you must again switch thread to the UI thread to update the UI.

I mentioned above that ‘I need buffers to be sent to a server for display.’

So I don’t have a UI. My application communicates with a server by messages.

The server asks to connect to a specific Milestone Server, then I connect and return a message.

The server asks to receive Live, so I start the live like in MediaLiveViewer and return, and for each callback to “JpegLiveSource1LiveNotificationEvent” I send the buffer of the picture to the server.

So we are not in the same case.

Did you try this correction? Does it work?

I made the LoadSiteItem in another thread, then there was no issue, it was tried and succesfully so..

I still think you should try to switch thread even if it is not the UI thread you are working with.

That we both did the same was not a valid assumption on my part, but I still hope that the core of the solution, making sure to not block the thread, is valid for you also.