Build TCP server client program into vlc problem.

*nix specific usage questions
wssoh85
Blank Cone
Blank Cone
Posts: 20
Joined: 20 Dec 2008 10:52

Build TCP server client program into vlc problem.

Postby wssoh85 » 23 Dec 2008 18:35

Hi, everyone. i try to build small function for vlc. I'm using ubuntu 7.10 and VLC 0.8.6f

However, now I face a big problem to compile the code.
My project is to adding small tcp server function to vlc.c file. A client program will send an IPv6 address to the server and the server need to get the streaming video from that address. I study the code for 2 days and I found out that I need to call function that able to start the streaming from that address. The 2 functions are:

playlist_AddItem()
playlist_Control()

Is it correct?
Can anyone tell me how to initiate both the function? For example, client just want tell VLC to start stream from address: ff4f::11
then how can this to be archieved?

Is my initialized got problem? my code is here

Code: Select all

vlc_t * p_vlc = NULL; playlist_item_t* p_item; playlist_t *p_playlist; p_playlist = playlist_Create( p_vlc ); char *try; try = "[ff4f::11]"; /*playlist_t *p_playlist = (playlist_t *)vlc_object_find( p_intf, VLC_OBJECT_PLAYLIST, FIND_ANYWHERE );*/ p_item = playlist_ItemNew(p_playlist, try, NULL ); playlist_AddItem( p_playlist, p_item, PLAYLIST_APPEND, PLAYLIST_END ); playlist_Control( p_playlist, PLAYLIST_ITEMPLAY, p_item );
Is there are other method?

Please Help me. It's urgent for me. I'm lost now....

wssoh85
Blank Cone
Blank Cone
Posts: 20
Joined: 20 Dec 2008 10:52

Re: Build TCP server client program into vlc problem.

Postby wssoh85 » 24 Dec 2008 08:36

Regarding to the previous problem, I found that the problem maybe is due to the libvlc.h and vlc_playlist.h file is not in the same folder with vlc.c file. Hence it have error as shown at previous post.

therefore, i change to add in my program in "libvlc.c" file in function "int VLC_Create( void )". I put my program at there because I found out that
while VLC initialize, It will execute that function. In the libvlc.c file, the libvlc.h and vlc_playlist is define in default. However I found that there are new error while complie.

Code: Select all

make[4]: Entering directory `/home/ims/Desktop/vlc-0.8.6f/src' if gcc -DHAVE_CONFIG_H -I. -I. -I.. -DSYS_LINUX -I../include `top_builddir=".." ../vlc-config --cflags vlc pic` -Wsign-compare -Wall -pipe -MT libvlc_a-libvlc.o -MD -MP -MF ".deps/libvlc_a-libvlc.Tpo" -c -o libvlc_a-libvlc.o `test -f 'libvlc.c' || echo './'`libvlc.c; \ then mv -f ".deps/libvlc_a-libvlc.Tpo" ".deps/libvlc_a-libvlc.Po"; else rm -f ".deps/libvlc_a-libvlc.Tpo"; exit 1; fi libvlc.c: In function ‘sthr_do’: libvlc.c:340: warning: pointer targets in passing argument 3 of ‘accept’ differ in signedness libvlc.c:388: warning: passing argument 1 of ‘__playlist_Create’ from incompatible pointer type libvlc.c:439:7: warning: "/*" within comment libvlc.c:455:11: warning: "/*" within comment libvlc.c:465:5: warning: "/*" within comment libvlc.c:480:4: warning: "/*" within comment libvlc.c:514:11: warning: "/*" within comment libvlc.c:2165: error: invalid storage class for function ‘AddIntfInternal’ libvlc.c:2225: error: invalid storage class for function ‘SetLanguage’ libvlc.c:2292: error: invalid storage class for function ‘GetFilenames’ libvlc.c:2342: error: invalid storage class for function ‘Help’ libvlc.c:2374: error: invalid storage class for function ‘Usage’ libvlc.c:2658: error: invalid storage class for function ‘ListModules’ libvlc.c:2705: error: invalid storage class for function ‘Version’ libvlc.c:2784: error: invalid storage class for function ‘ConsoleWidth’ libvlc.c:2819: error: invalid storage class for function ‘VerboseCallback’ libvlc.c:2835: error: invalid storage class for function ‘InitDeviceValues’ libvlc.c:2921: error: expected declaration or statement at end of input make[4]: *** [libvlc_a-libvlc.o] Error 1 make[4]: Leaving directory `/home/ims/Desktop/vlc-0.8.6f/src' make[3]: *** [all-recursive] Error 1 make[3]: Leaving directory `/home/ims/Desktop/vlc-0.8.6f/src' make[2]: *** [all] Error 2 make[2]: Leaving directory `/home/ims/Desktop/vlc-0.8.6f/src' make[1]: *** [all-recursive] Error 1 make[1]: Leaving directory `/home/ims/Desktop/vlc-0.8.6f' make: *** [all] Error 2 ims@ims-laptop:~/Desktop/vlc-0.8.6f$
The portion of my code is :

Code: Select all

char recv_data[1024]; int bytes_received; vlc_t * p_vlc = NULL; playlist_item_t * p_item; playlist_t *p_playlist; p_playlist = __playlist_Create (p_vlc); char *try; try = "[ff3e::33]"; p_item = playlist_ItemNew(p_playlist, try, NULL ); playlist_AddItem( p_playlist, p_item, PLAYLIST_APPEND, PLAYLIST_END ); playlist_Control( p_playlist, PLAYLIST_ITEMPLAY, p_item );
can anyone please help me? I'm urgently to solve for this problem.
pr is there are other way to do this?

Sincerely,
wssoh

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

Re: Build TCP server client program into vlc problem.

Postby Rémi Denis-Courmont » 26 Dec 2008 19:50

Your C code is syntaxically incorrect. Fix it.
Rémi Denis-Courmont
https://www.remlab.net/
Private messages soliciting support will be systematically discarded

wssoh85
Blank Cone
Blank Cone
Posts: 20
Joined: 20 Dec 2008 10:52

[solve]Re: Build TCP server client program into vlc problem.

Postby wssoh85 » 27 Dec 2008 07:09

Hi, Rémi Denis-Courmont

Thanks for your remind and I found out the reason for the error. The error is cause by the missing bracket in my code.

and for the use of that 2 function, currently I declare that as following and it works.

Code: Select all

playlist_item_t * p_item; playlist_t *p_playlist =(playlist_t *)vlc_object_find((vlc_object_t *)p_vlc, VLC_OBJECT_PLAYLIST, FIND_ANYWHERE ); p_item = playlist_ItemNew(p_playlist, recv_data, NULL );//so far p_item is consider no problem playlist_AddItem( p_playlist, p_item, PLAYLIST_APPEND, PLAYLIST_END );//PLAYLIST_APPEND is how the item being added, playlist_Control( p_playlist, PLAYLIST_ITEMPLAY, p_item );//PLAYLIST_ITEMPLAY is the action to do


Return to “VLC media player for Linux and friends Troubleshooting”

Who is online

Users browsing this forum: Google [Bot] and 15 guests