libvlc_vlm_set_output() doesn't work after play

This forum is about all development around libVLC.
jlz
Blank Cone
Blank Cone
Posts: 11
Joined: 13 Jul 2009 12:09

libvlc_vlm_set_output() doesn't work after play

Postby jlz » 22 May 2010 06:20

Hello everyone

I try vlc-1.2.0-git-20100508-0002-win32-debug.zip nightly build and If I call to libvlc_vlm_set_output() after play but doesn't run. On the example code the event type VlmMediaChanged tell me that the "command" is executed but rtp stream output only run if libvlc_vlm_set_output() is executed before play.

Is this a bug or a feature?

Thanks in avance

Code: Select all

#include <iostream> #include <stdlib.h> #include <vlc/vlc.h> void event_man(const struct libvlc_event_t * event, void *data) { std::cout << " type " << libvlc_event_type_name (event->type)<<std::endl; } int main(int argc, char *argv[]) { libvlc_instance_t * _vlcinstance; const char * const vlc_args[]={ "-I", "dummy", /* Don't use any interface */ "--ignore-config", /* Don't use VLC's config */ "--plugin-path=c:\\vlc\\plugins" }; _vlcinstance=libvlc_new( sizeof(vlc_args) / sizeof(vlc_args[0]), (const char *const*)vlc_args); if(_vlcinstance==NULL) exit(1); libvlc_event_manager_t *man= libvlc_vlm_get_event_manager( _vlcinstance ); if(man==NULL) exit(1); libvlc_event_attach(man,libvlc_VlmMediaAdded ,event_man,NULL); libvlc_event_attach(man,libvlc_VlmMediaRemoved ,event_man,NULL); libvlc_event_attach(man,libvlc_VlmMediaChanged ,event_man,NULL); libvlc_event_attach(man,libvlc_VlmMediaInstanceStarted ,event_man,NULL); libvlc_event_attach(man,libvlc_VlmMediaInstanceStopped ,event_man,NULL); libvlc_event_attach(man,libvlc_VlmMediaInstanceStatusInit ,event_man,NULL); libvlc_event_attach(man,libvlc_VlmMediaInstanceStatusOpening ,event_man,NULL); libvlc_event_attach(man,libvlc_VlmMediaInstanceStatusPlaying ,event_man,NULL); libvlc_event_attach(man,libvlc_VlmMediaInstanceStatusPause ,event_man,NULL); libvlc_event_attach(man,libvlc_VlmMediaInstanceStatusEnd ,event_man,NULL); libvlc_event_attach(man,libvlc_VlmMediaInstanceStatusError ,event_man,NULL); if(0!=libvlc_vlm_add_broadcast( _vlcinstance, "broad1", "..\\..\\videos\\presto.avi", "#display", 0,NULL, true,true)) exit(2); if(0==strcmp(argv[1],"yes")) { if(0!=libvlc_vlm_set_output( _vlcinstance, "broad1", "#duplicate{dst=display,dst=rtp{mux=ts,dst=239.255.12.41,port=1234}}")) exit(4); } if(0!=libvlc_vlm_play_media ( _vlcinstance,"broad1")) exit(3); if(0==strcmp(argv[1],"no")) { if(0!=libvlc_vlm_set_output( _vlcinstance, "broad1", "#duplicate{dst=display,dst=rtp{mux=ts,dst=239.255.12.41,port=1234}}")) exit(4); } getchar(); libvlc_vlm_del_media( _vlcinstance,"broad1"); libvlc_vlm_release( _vlcinstance ); libvlc_release (_vlcinstance); }

Output with arg "unknow"

Code: Select all

type VlmMediaAdded type VlmMediaChanged Warning: input_item_SetURI("..\..\videos\presto.avi"): file path instead of URL. type VlmMediaInstanceStatusOpening input_SplitMRL("..\..\videos\presto.avi"): not a valid URI! type VlmMediaInstanceStarted type Unknown Event
Output with arg "yes"

Code: Select all

type VlmMediaAdded type VlmMediaChanged type VlmMediaChanged Warning: input_item_SetURI("..\..\videos\presto.avi"): file path instead of URL. type VlmMediaInstanceStarted type VlmMediaInstanceStatusOpening input_SplitMRL("..\..\videos\presto.avi"): not a valid URI! type Unknown Event

output with arg "no"

Code: Select all

type VlmMediaAdded type VlmMediaChanged Warning: input_item_SetURI("..\..\videos\presto.avi"): file path instead of URL. type VlmMediaInstanceStatusOpening input_SplitMRL("..\..\videos\presto.avi"): not a valid URI! type VlmMediaInstanceStarted type VlmMediaChanged type Unknown Event

Jean-Baptiste Kempf
Site Administrator
Site Administrator
Posts: 37523
Joined: 22 Jul 2005 15:29
VLC version: 4.0.0-git
Operating System: Linux, Windows, Mac
Location: Cone, France
Contact:

Re: libvlc_vlm_set_output() doesn't work after play

Postby Jean-Baptiste Kempf » 25 May 2010 12:12

Shouldn't libvlc_vlm_set_output() be called before playing?
Jean-Baptiste Kempf
http://www.jbkempf.com/ - http://www.jbkempf.com/blog/category/Videolan
VLC media player developer, VideoLAN President and Sites administrator
If you want an answer to your question, just be specific and precise. Don't use Private Messages.

Rémi Denis-Courmont
Developer
Developer
Posts: 15228
Joined: 07 Jun 2004 16:01
VLC version: master
Operating System: Linux
Contact:

Re: libvlc_vlm_set_output() doesn't work after play

Postby Rémi Denis-Courmont » 25 May 2010 19:02

Yes. You can't change outputs dynamically.
Rémi Denis-Courmont
https://www.remlab.net/
Private messages soliciting support will be systematically discarded

jlz
Blank Cone
Blank Cone
Posts: 11
Joined: 13 Jul 2009 12:09

Re: libvlc_vlm_set_output() doesn't work after play

Postby jlz » 28 May 2010 06:49

OK, but :
- where is documented this feature?
- why libvlc_vlm_set_output() doesn't return error when is called on playing ?
- why this
libvlc_vlm_play_media ( ...)
libvlc_vlm_set_output(...)
libvlc_vlm_stop_media (...)
libvlc_vlm_play_media (...)

set the new output succesfully


thanks


Return to “Development around libVLC”

Who is online

Users browsing this forum: No registered users and 35 guests