libVLC VLM example
Posted: 01 Aug 2012 10:51
Hi there,
i am using 2.x libvlc version and want to use vlm functionality to stream "sheduled" streams (udp, rtp protocols). But i end up with strange problems such a blocking in libvlc_vlm_stop_media or in some more certain libvlc_vlm_* functions in my own libvlc_VlmMediaInstanceStatusEnd event callback. What i want is actually just to stop current streaming in any time, or continue streaming another file when current one is finished. I need some decent libvlc_vlm_* usage examples or just advices to find out what i am doing wrong. To clear out my actual problem i provide some code examples:
Registering event handler:
My event callback
Streaming (playing)
After *_play_media() call i use
Thanks!
i am using 2.x libvlc version and want to use vlm functionality to stream "sheduled" streams (udp, rtp protocols). But i end up with strange problems such a blocking in libvlc_vlm_stop_media or in some more certain libvlc_vlm_* functions in my own libvlc_VlmMediaInstanceStatusEnd event callback. What i want is actually just to stop current streaming in any time, or continue streaming another file when current one is finished. I need some decent libvlc_vlm_* usage examples or just advices to find out what i am doing wrong. To clear out my actual problem i provide some code examples:
Registering event handler:
Code: Select all
eventManager = libvlc_vlm_get_event_manager(vlc);
libvlc_event_attach(eventManager, libvlc_VlmMediaInstanceStatusEnd, vlcEventHandler, NULL);
Code: Select all
void vlcEventHandler(const struct libvlc_event_t * evt, void * data)
{
printf("stream end?\n");
int ret = libvlc_vlm_stop_media(vlc, "media_name");
PINFO("Returned: %d", ret); // it does not print, prints -1 when media_name is faked one
//int ret = libvlc_vlm_set_input(vlc, "media_name", "/home/algirdas/dev/live555/adstreamer/big_buck_bunny_1080p_surround.ts"); blocks here again
//PINFO("Return value: %d", ret);
//ret = libvlc_vlm_play_media(vlc, "media_name"); blocks here too
//PINFO("Return value: %d", ret);
}
Code: Select all
libvlc_vlm_play_media(vlc, "media_name");
Code: Select all
while (1) {
sleep(1);
}