Page 1 of 1

VLC 0.8.6i plays in new window

Posted: 14 Jul 2008 22:59
by (*)
Hi,

I get the picture in external window with title "VLC (hardware YUV DirectX output)". This is in a custom program which worked fine with previous versions.
Is this some bug in version 8.6i or maybe some option is necessary to play in the correct window (specified with VLC_VariableSet ... "drawable")?

Re: VLC 0.8.6i plays in new window

Posted: 15 Jul 2008 22:46
by VLC_help
Maybe Direct3D output works better? Some files also spawn multiple outputs, like some MOV and VCD files (BIN images mostly).

Re: VLC 0.8.6i plays in new window

Posted: 16 Jul 2008 19:56
by (*)
No difference. Only the title is "VLC (Direct3D output)" and the output is in a new window again. All this happen in version 8.6i and not in previous versions (8.6h, 8.6d and earlier). I think that some option is not correctly read from config file or something of this kind. This is exactly like "--no-wx-embed" option but "wx-embed" is interpreted by VLC user interface program and don't work for external programs using libvlc.dll

Re: VLC 0.8.6i plays in new window

Posted: 17 Jul 2008 12:33
by (*)
The problem is in "VLC_VariableSet" function. In version 8.6i it cannot be used to assign the hWnd to "drawable" variable and I am not sure is there an alternative way to do this?

Re: VLC 0.8.6i plays in new window

Posted: 17 Jul 2008 18:02
by basos
Seems like libvlc is going heavy changes.... FOR the thing you are asking

Code: Select all

/** * Embedding support: Set/change the default parent drawable for video outputs * \param p_instance libvlc instance * \param drawable the new parent window (Drawable on X11, CGrafPort on MacOSX, HWND on Win32) * \param p_exception an initialized exception */ void libvlc_video_set_parent( libvlc_instance_t *, libvlc_drawable_t, libvlc_exception_t * );
(libvlc.h is your only friend)

And 2 questions i have :
- I;m trying to get libvlc play something these days and i cant. it blows up a command window telling that "the command line options could not be loaded"...
Can you post the initialization commands you are using at your externat program?
- Also please post the way you imported the lib into the program. I used the RunTime dynamic loading capability (which has ALOT of redeclerations of library prototypes). Is there a way to link against a lib file to account for the dlib linking stuff?


thanks
basos

Re: VLC 0.8.6i plays in new window

Posted: 18 Jul 2008 12:24
by (*)
Hello,

Thanks for your help. It seems this new API (libvlc_*) is exactly I was trying to find.

See the samples in this thread - currently I use libvlc in the same way:
viewtopic.php?t=27112

You need only one command line option with the pathname to VLC directory + additional "\vlc" at the end. I am not sure why is necessary the extra "\vlc" but without it the function fails.

You can generate .lib file from the .dll and use static linking but I do not recommend it for 2 reasons: 1) You will need to put your program in VLC directory or include VLC dir to PATH environment var - otherwise the OS can't find it; 2) If there is no VLC installation or the path is not set your program will not start and the user will not know what is the reason. With dynamic linking you can show error message "Cannot find or load libvlc.dll"...

Re: VLC 0.8.6i plays in new window

Posted: 19 Jul 2008 14:42
by basos
I managed to play something..
The trick? No need for something usefull as a first parameter to libvlc_new(). Just use the usefull parameters.
e.g.

Code: Select all

char * const vlc_args[] = { "-I", "dummy", // Don't use any interface "--no-dummy-quiet", // do not use a dos box //"--module-path=/set/your/path/to/libvlc/module/if/you/are/on/windows/or/macosx" };
The important thing is to copy libvlc.dll AS WELL AS the plugins directory in the new application directory.

As for the library issues you have a point on the error handling. But there are a lot of declarations. And the library API is not so stable yet. Anyway if i manage sthing with static link i will post.

Thanks

Re: VLC 0.8.6i plays in new window

Posted: 19 Jul 2008 15:30
by (*)
Hi,

I am not sure for the first param of "libvlc_new()". If you ask for the "old api" function VLC_Init() you can use ""c:\\Program Files\\VideoLAN\\VLC\\vlc" and it has to work. It is better to get the real vlc location from the registry and add "\vlc" to the end instead of this constant path. I agree that declarations for dynamic link are long list but you can find all necessary in this example: http://wiki.videolan.org/LibVLC_Visual_C