Serious developer questions regarding VLC code tree on Win32

Microsoft Windows specific usage questions
Forum rules
Please post only Windows specific questions in this forum category. If you don't know where to post, please read the different forums' rules. Thanks.
mtortolano
New Cone
New Cone
Posts: 3
Joined: 28 May 2007 17:32

Serious developer questions regarding VLC code tree on Win32

Postby mtortolano » 28 May 2007 17:54

I'm a developer seeking some definitive answers on the VLC code tree + VC compilers...

Before you reply:

1. Yes, I know it's best to compile VLC under Cygwin or MingW (I have done so many times), that isn't my question
2. Yes, I know not all of the libraries can be compiled under MSVC
3. Yes, I know you probably don't like the MS tools, I don't either particularly so you don't need to convince me otherwise
4. Yes, I have searched the forum for this info to no avail

So the context of my question is this:

We *need* to compile a minimal build of VLC with either VC6, 7 or 8 (VS2005). I don't care which.

We need to build it that way so we can use MS debugging tools. The DLL's we have to use are compiled under MSVC and they simply can't be ported to cygwin (they use hardware). Therefore GDB/Insight doesn't cut it, it won't step into our code and hosting a cygwin compiled VLC under MSVC debugger causes all sorts of problems (it bombs out randomly, locks up randomly, and not least the debug symbols from GCC can't be exported to MS debuggers).

We don't need a full build of VLC, we only need whatever it takes to decode an AVI, or MP4 file. We don't need decoder support, we'll be providing that, so lack of the FFMPEG library isn't the end of the world. This is simply to allow a workable development process for the rather cool project our team are working on.

So this leads onto my questions:

1. Which is the best version of the tree to use to try and do this?

2. Which is the easiest compiler to do it with, VC6, VS.Net or VS2005?

3. I've figured out how to build the .dsp's or .vcproj's with toolbox but they don't compile, I get this error plus many more...

..\include\vlc_symbols.h(482) : error C2061: syntax error : identifier 'lldiv_t'

(this was on the 0.8.6b tree with VC6)

Do I need to move files around, set special #defines or pass special options to ./bootstrap to make this work?

4. Any tips on which modules do and don't compile easily.

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:

Postby Jean-Baptiste Kempf » 28 May 2007 18:12

Fine DISCLAIMER.
2. You should build in VC6 or VS2005. VC6 may be easier
1. You should start to build vlc 0.8.6b for the tar.gz.
Decoding AVI and MP4 does not mean anything. Sorry. To demux them you just need VLC. To decode most of the codecs inside AVI and MP4, you need ffmpeg.
3. This is the main problem. MSVC does not understand all the C/C++ specifications and is not able to compile it correctly. And here seems to be a struct unrecognized by MSVC. You may be alone on that fight. sorry.
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.

mtortolano
New Cone
New Cone
Posts: 3
Joined: 28 May 2007 17:32

Postby mtortolano » 28 May 2007 18:45

Many thanks.
Decoding AVI and MP4 does not mean anything. Sorry. To demux them you just need VLC. To decode most of the codecs inside AVI and MP4, you need ffmpeg.
Yes apologies slipped into non-programmer speak for a second, I meant demux of course (getting a field called PTS from an AVI made me chuckle though). I will be providing the Decoders (although I may use liba52 or libmad to decode the audio initially).
3. This is the main problem. MSVC does not understand all the C/C++ specifications and is not able to compile it correctly. And here seems to be a struct unrecognized by MSVC. You may be alone on that fight. sorry.
Ok, no one else come across this issue?
Last edited by mtortolano on 28 May 2007 18:53, edited 1 time in total.

mtortolano
New Cone
New Cone
Posts: 3
Joined: 28 May 2007 17:32

Postby mtortolano » 28 May 2007 18:52

I don't suppose anyone has tried it with the Intel compilers either?

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:

Postby Jean-Baptiste Kempf » 28 May 2007 19:28

I did compile VLC under Linux with icc. It worked fine. But I never did under Windows, and I don't know anyone who has tried...
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.

Rockthesmurf
New Cone
New Cone
Posts: 1
Joined: 03 Jun 2007 12:27

Postby Rockthesmurf » 03 Jun 2007 12:28

How about dropping this somewhere near the top of vlc_common.h:

Code: Select all

#if defined(_MSC_VER) && !defined(__MWERKS__) && \ !defined(__ICL) && !defined(__COMO__) && \ !defined(__BORLANDC__) #define MSVC # endif #ifdef MSVC typedef struct { long long quot; /* Quotient. */ long long rem; /* Remainder. */ } lldiv_t; inline lldiv_t lldiv(long long __n, long long __d) { lldiv_t __q; __q.quot = __n / __d; __q.rem = __n % __d; return __q; } #endif
Steve

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:

Postby Jean-Baptiste Kempf » 03 Jun 2007 13:08

What for ?
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.

loic69
Blank Cone
Blank Cone
Posts: 37
Joined: 31 Jan 2007 18:10
Location: France

Postby loic69 » 04 Jun 2007 11:18

Hi

I'v'e got the same problem to compile just a 0.8.6b plugin with VS6.
I try to replace lldiv_t type.
I compile and link the plugin sucessfully but VLC crash at launch.
The entry point of DLL if been called sucessfully but Create function is never called because VLC.exe crash...

Maybe there is a problem on libvlc.dll dependency...

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:

Postby Jean-Baptiste Kempf » 04 Jun 2007 13:11

When (if you are ever able to) you are able to make it work, provide a HOWTO and patches to the current trunk. We will then include those in the SVN.
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.

loic69
Blank Cone
Blank Cone
Posts: 37
Joined: 31 Jan 2007 18:10
Location: France

Postby loic69 » 04 Jun 2007 13:49

I successfully compile, link and use plugin compiled with VS6 :D

There is some modifications to do :
- replace in vlc_symbols.h :
lldiv_t (*vlc_lldiv_inner) (long long numer, long long denom);
by
lldiv_t (*vlc_lldiv_inner) (int64_t numer, int64_t denom);
It will be better to use (if it will be inserted in VLC SVN trunk) the use of conditionnal compilation :
# if defined( _MSC_VER ) \
|| defined( UNDER_CE ) \
|| ( defined( WIN32 ) && !defined( __MINGW32__ ) )
lldiv_t (*vlc_lldiv_inner) (int64_t numer, int64_t denom);
#else
lldiv_t (*vlc_lldiv_inner) (long long numer, long long denom);
#endif
- replace in vlc_common.h :
# if defined( _MSC_VER ) \
|| defined( UNDER_CE ) \
|| ( defined( WIN32 ) && !defined( __MINGW32__ ) )

typedef unsigned __int64 uint64_t;
typedef signed __int64 int64_t;
...
by
# if defined( _MSC_VER ) \
|| defined( UNDER_CE ) \
|| ( defined( WIN32 ) && !defined( __MINGW32__ ) )

typedef unsigned __int64 uint64_t;
typedef signed __int64 int64_t;

typedef struct {
int64_t quot; /* Quotient. */
int64_t rem; /* Remainder. */
} lldiv_t;

inline lldiv_t lldiv(int64_t __n, int64_t __d)
{
lldiv_t __q;
__q.quot = __n / __d;
__q.rem = __n % __d;
return __q;
}
...
VC6 option proprocessor to add :
__VLC__, __PLUGIN__, HAVE_SHARED_LIBVLC
To link the pluging and resolve dependancy on libvlc.dll :
Use tools in VC6 binaries dir :
dumpbin /EXPORTS libvlc.dll >libvlc.txt
to get all exported symbols in the libvlc.dll
then create a text file named libvlc.def and create entry for all missing link in VC6 plugin project. For example; I compiled and link transform video filter with VS6, here's the needed symbol to link :
; libvlc.def : Declares the module parameters for the DLL.
LIBRARY "libvlc"
DESCRIPTION 'libvlc Windows Dynamic Link Library'


EXPORTS

__config_GetPsz
config_Duplicate
config_GetPsz
__var_AddCallback
__vout_AllocatePicture
__vout_Create
vout_Destroy
__vlc_object_detach
__var_DelCallback
vout_DisplayPicture
vout_UnlinkPicture
vout_LinkPicture
vout_DatePicture
msleep
vout_CreatePicture
__msg_GenericVa
__var_Set
__var_Change
Then create the imported lib to add in the plugin project :
lib /DEF:libvlc.def
Enjoy...

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:

Postby Jean-Baptiste Kempf » 04 Jun 2007 14:52

First does it work without a crash ?
THen if VLC works, can you detail how in the wiki ?

And if that works, please provide SVN patches.
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.

loic69
Blank Cone
Blank Cone
Posts: 37
Joined: 31 Jan 2007 18:10
Location: France

Postby loic69 » 04 Jun 2007 15:19

First does it work without a crash ?
THen if VLC works, can you detail how in the wiki ?

And if that works, please provide SVN patches.
Of course, it works fine without crash.
At my first try, VLC crash because I didn't link my Visual Studio plugin with exported function of libvlc so the pointer function of the plugin wasn't register...
No all is register successfully.

I never provide SVN patch.
Can you tell me a little more.
(I worked on my local disk with the SVN 0.8.6b tags).
I think I will commit modification on the trunk ?
Have I can access to comit on the trunk ?
regards

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:

Postby Jean-Baptiste Kempf » 04 Jun 2007 15:27

Well, you can't commit directly. :D

To provide patches, use the SVN trunk, (checkout it under Windows with TortoiseSVN) and check your compilation.
Then provide a diff (SVN diff) of your modification and send it to vlc-devel@
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.

loic69
Blank Cone
Blank Cone
Posts: 37
Joined: 31 Jan 2007 18:10
Location: France

Postby loic69 » 04 Jun 2007 15:39

Well, you can't commit directly. :D

To provide patches, use the SVN trunk, (checkout it under Windows with TortoiseSVN) and check your compilation.
Then provide a diff (SVN diff) of your modification and send it to vlc-devel@
Ok thanks
No problem for SVN and tortoise SVN (I'm using it all the day at work !)
I will commit modification in the week.

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:

Postby Jean-Baptiste Kempf » 04 Jun 2007 16:14

Thanks. Does it work with VC6 or VS2005.Net ?

Do you rebuild the contribs or do you use the common ones ?
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.

loic69
Blank Cone
Blank Cone
Posts: 37
Joined: 31 Jan 2007 18:10
Location: France

Postby loic69 » 04 Jun 2007 16:18

Thanks. Does it work with VC6 or VS2005.Net ?

Do you rebuild the contribs or do you use the common ones ?
just compile with VC6 only for the moment.
It's another story with VS2005 because the use of specific MS libc...

I didn't compile all VLC, just one plugin (transform filter for example) !
I just need to compile a specific plugin for the moment not all VLC...
Entiere VLC seams a task more and more harder
It's a mandatory first step because lldiv is not supported on MS compilers


Return to “VLC media player for Windows Troubleshooting”

Who is online

Users browsing this forum: No registered users and 25 guests