I am coding in C++, Visual Studio, for a program which will be running on embedded windows.
Edit: I see that there are a few other posts here that ask similar questions, how to tell if a stream is dead. But that is only half my issue, I could come up with a couple of ways the see if the stream has died, but I am really not sure of a better way to see when the stream is back up, aside from writing code that constantly checks the packets being sent out. I figure there must be a reason why the feed can not recover on its own, and am curious as to what that reason is.
Code: Select all
/*
* Initialise libVLC
*/
sprintf(clock, "%lld", (long long int)(intptr_t)lock);
sprintf(cunlock, "%lld", (long long int)(intptr_t)unlock);
sprintf(cdata, "%lld", (long long int)(intptr_t)this);
sprintf(width, "%i", VIDEO_WIDTH);
sprintf(height, "%i", VIDEO_HEIGHT);
sprintf(pitch, "%i", VIDEO_WIDTH * 4);
char const *vlc_argv[] =
{
//"-q",
"-vvvvv",
"--plugin-path", "plugins",
"--ignore-config",
"--noaudio",
"--no-overlay",
"--no-video-title-show",
"--no-osd",
"--vout", "vmem",
"--vmem-width", width,
"--vmem-height", height,
"--vmem-pitch", pitch,
"--vmem-chroma", "RV32",
"--vmem-lock", clock,
"--vmem-unlock", cunlock,
"--vmem-data", cdata,
};
int vlc_argc = sizeof (vlc_argv) / sizeof (*vlc_argv);
libvlc_exception_init_dll (&ex);
m_libvlc = libvlc_new_dll (vlc_argc, vlc_argv, &ex);
catchException (&ex);
char ipString[50];
strcpy (ipString, "rtsp://");
strcat (ipString, "192.168.1.200");
strcat (ipString, "/Live");
m_media = libvlc_media_new_dll (m_libvlc, ipString, &ex);
catchException (&ex);
libvlc_media_add_option_dll (m_media, "rtsp-caching=200", &ex);
catchException (&ex);
m_media_player = libvlc_media_player_new_from_media_dll (m_media, &ex);
catchException (&ex);
libvlc_media_player_play_dll (m_media_player, &ex);
catchException (&ex);