"libvlc_vlm_add_vod" blocks the thread
Posted: 01 Sep 2011 17:05
Hello Everyone,
I want to embed the libvlc into my VC++6.0 program to make it a simple RTSP server. The stream is "pushed" from another computer using RTP (also by VLC player), then the program publish the stream using RTSP.
The code is:
I am not sure if I've done the above correctly. But if the other computer is not "pushing" the stream through rtp to port 5004, The program freezes at libvlc_vlm_add_vod() function call. When the other computer starts pushing, program is un-blocked. And I have verified then the stream may be played at "rtsp://192.168.55.102/PUB0".
From this link: http://wiki.videolan.org/Documentation: ... _Internals, last paragraph <Thread Creation>, VLM should create a new thread after "libvlc_vlm_add_vod" being called. So I don't know why it is blocked?
Can someone help me? Many thanks in advance
I want to embed the libvlc into my VC++6.0 program to make it a simple RTSP server. The stream is "pushed" from another computer using RTP (also by VLC player), then the program publish the stream using RTSP.
The code is:
Code: Select all
void test ()
{
const char * const vlc_args[] = {
"--plugin-path=D:\\VideoLAN\\VLC",
"--sout-udp-caching=100",
"--udp-caching=100",
"--rtsp-caching=100",
"--sout-rtp-caching=100"};
const char * const vlm_args[] = {
"--no-sout-rtp-sap",
"--no-sout-standard-sap",
"--ttl=1",
"--sout-keep",
"--rtsp-session-timeout=20"};
libvlc_instance_t* m_pLibvlcInst=NULL;
m_pLibvlcInst = libvlc_new(sizeof(vlc_args)/ sizeof(vlc_args[0]),vlc_args); // init
n = libvlc_vlm_add_vod(m_pLibvlcInst, "PUB0", "rtp://@:5004/",
sizeof(vlm_args)/ sizeof(vlm_args[0]), vlm_args, true, NULL); // VOD source is rtp @ 5004, publishing point "PUB0"
}
From this link: http://wiki.videolan.org/Documentation: ... _Internals, last paragraph <Thread Creation>, VLM should create a new thread after "libvlc_vlm_add_vod" being called. So I don't know why it is blocked?
Can someone help me? Many thanks in advance