[vlc-devel] Re: problem with libmkv when compiling VLC.exe on WIN32
Damien Fouilleul
damien.fouilleul at laposte.net
Tue Sep 28 09:55:11 CEST 2004
Sigmund,
I understand your need, but I just want to point out that your are
creating unecessary software bloat (duplicate code), as shown in the
output of nm for both vlc.exe and libmp4_plugin.dll. Ideally, you should
rather load libmp4_plugin.dll before using the APIs, or make libmp4.c a
static library (or archive) before using it so that the duplication is
limited to the APIs you are actually using.
I understand that I may be a bit fussy, but if vlc is to be used for
embedded use (where code size matters), then this could be an issue
Damien
--------------------------------------------------------------
Extract of output of nm for vlc.exe:
00460350 T _MP4_BoxCount
00460740 T _MP4_BoxDumpStructure
00460040 T _MP4_BoxFree
00460320 T _MP4_BoxGet
00460110 T _MP4_BoxGetRoot
008b7b70 d _MP4_Box_Function
00469c00 t _MP4_FreeBox_0xa9xxx
004609e0 t _MP4_FreeBox_Common
004653e0 t _MP4_FreeBox_avcC
004686d0 t _MP4_FreeBox_cmvd
00468200 t _MP4_FreeBox_cprt
004647b0 t _MP4_FreeBox_ctts
00467e20 t _MP4_FreeBox_elst
00464ea0 t _MP4_FreeBox_esds
00460e10 t _MP4_FreeBox_ftyp
00462e80 t _MP4_FreeBox_hdlr
004678d0 t _MP4_FreeBox_padb
00469030 t _MP4_FreeBox_rdrf
00465c80 t _MP4_FreeBox_sample_soun
00460700 T _MP4_FreeBox_sample_vide
00466b90 t _MP4_FreeBox_stco_co64
004674f0 t _MP4_FreeBox_stdp
00466790 t _MP4_FreeBox_stsc
004671d0 t _MP4_FreeBox_stsh
00466e90 t _MP4_FreeBox_stss
00466400 t _MP4_FreeBox_stsz
00464460 t _MP4_FreeBox_stts
00463950 t _MP4_FreeBox_url
00463db0 t _MP4_FreeBox_urn
004603b0 T _MP4_InputStream
00460400 T _MP4_MemoryStream
004607f0 t _MP4_NextBox
00460520 T _MP4_PeekStream
0045ff70 t _MP4_ReadBox
0045f6d0 T _MP4_ReadBoxCommon
004608e0 t _MP4_ReadBoxContainer
0046a0c0 t _MP4_ReadBoxContainerRaw
004609f0 t _MP4_ReadBoxSkip
00469990 t _MP4_ReadBox_0xa9xxx
00464f20 t _MP4_ReadBox_avcC
00468710 t _MP4_ReadBox_cmov
00468450 t _MP4_ReadBox_cmvd
00467eb0 t _MP4_ReadBox_cprt
004644b0 t _MP4_ReadBox_ctts
00468240 t _MP4_ReadBox_dcom
00469c40 t _MP4_ReadBox_default
00463e00 t _MP4_ReadBox_dref
00469750 t _MP4_ReadBox_drms
00467960 t _MP4_ReadBox_elst
00464800 t _MP4_ReadBox_esds
00460b50 t _MP4_ReadBox_ftyp
00462b60 t _MP4_ReadBox_hdlr
00463380 t _MP4_ReadBox_hmhd
004622f0 t _MP4_ReadBox_mdhd
00460e50 t _MP4_ReadBox_mvhd
00467530 t _MP4_ReadBox_padb
00468c80 t _MP4_ReadBox_rdrf
00469070 t _MP4_ReadBox_rmdr
004692a0 t _MP4_ReadBox_rmqu
004694b0 t _MP4_ReadBox_rmvc
00465ce0 t _MP4_ReadBox_sample_mp4s
004654d0 t _MP4_ReadBox_sample_soun
0046a180 t _MP4_ReadBox_sample_text
0045f9e0 T _MP4_ReadBox_sample_vide
00463130 t _MP4_ReadBox_smhd
00466810 t _MP4_ReadBox_stco_co64
00467220 t _MP4_ReadBox_stdp
00466440 t _MP4_ReadBox_stsc
00465d90 t _MP4_ReadBox_stsd
00466ed0 t _MP4_ReadBox_stsh
00466bd0 t _MP4_ReadBox_stss
004660f0 t _MP4_ReadBox_stsz
00464160 t _MP4_ReadBox_stts
004618d0 t _MP4_ReadBox_tkhd
00463640 t _MP4_ReadBox_url
00463990 t _MP4_ReadBox_urn
00462ec0 t _MP4_ReadBox_vmhd
00460480 T _MP4_ReadStream
00460690 T _MP4_SeekStream
00460640 T _MP4_TellStream
00469d60 t ___MP4_BoxDumpStructure
00469ec0 t ___MP4_BoxGet
Extract of output of nm for libmp4_plugin.dll:
10006140 T _MP4_BoxCount
10006530 T _MP4_BoxDumpStructure
10005e30 T _MP4_BoxFree
10006110 T _MP4_BoxGet
10005f00 T _MP4_BoxGetRoot
10019080 d _MP4_Box_Function
1000fc50 t _MP4_FreeBox_0xa9xxx
100067d0 t _MP4_FreeBox_Common
1000b2b0 t _MP4_FreeBox_avcC
1000e6b0 t _MP4_FreeBox_cmvd
1000e1d0 t _MP4_FreeBox_cprt
1000a650 t _MP4_FreeBox_ctts
1000dde0 t _MP4_FreeBox_elst
1000ad60 t _MP4_FreeBox_esds
10006c10 t _MP4_FreeBox_ftyp
10008cb0 t _MP4_FreeBox_hdlr
1000d870 t _MP4_FreeBox_padb
1000f040 t _MP4_FreeBox_rdrf
1000bb70 t _MP4_FreeBox_sample_soun
100064f0 T _MP4_FreeBox_sample_vide
1000cae0 t _MP4_FreeBox_stco_co64
1000d470 t _MP4_FreeBox_stdp
1000c6c0 t _MP4_FreeBox_stsc
1000d140 t _MP4_FreeBox_stsh
1000cdf0 t _MP4_FreeBox_stss
1000c320 t _MP4_FreeBox_stsz
1000a2f0 t _MP4_FreeBox_stts
100097b0 t _MP4_FreeBox_url
10009c20 t _MP4_FreeBox_urn
100061a0 T _MP4_InputStream
100061f0 T _MP4_MemoryStream
100065e0 t _MP4_NextBox
10006310 T _MP4_PeekStream
10005d50 t _MP4_ReadBox
10005490 T _MP4_ReadBoxCommon
100066d0 t _MP4_ReadBoxContainer
10010140 t _MP4_ReadBoxContainerRaw
100067e0 t _MP4_ReadBoxSkip
1000f9d0 t _MP4_ReadBox_0xa9xxx
1000ade0 t _MP4_ReadBox_avcC
1000e6f0 t _MP4_ReadBox_cmov
1000e430 t _MP4_ReadBox_cmvd
1000de70 t _MP4_ReadBox_cprt
1000a340 t _MP4_ReadBox_ctts
1000e210 t _MP4_ReadBox_dcom
1000fc90 t _MP4_ReadBox_default
10009c70 t _MP4_ReadBox_dref
1000f780 t _MP4_ReadBox_drms
1000d900 t _MP4_ReadBox_elst
1000a6a0 t _MP4_ReadBox_esds
10006950 t _MP4_ReadBox_ftyp
10008990 t _MP4_ReadBox_hdlr
100091d0 t _MP4_ReadBox_hmhd
10008110 t _MP4_ReadBox_mdhd
10006c50 t _MP4_ReadBox_mvhd
1000d4b0 t _MP4_ReadBox_padb
1000ec80 t _MP4_ReadBox_rdrf
1000f080 t _MP4_ReadBox_rmdr
1000f2c0 t _MP4_ReadBox_rmqu
1000f4e0 t _MP4_ReadBox_rmvc
1000bbd0 t _MP4_ReadBox_sample_mp4s
1000b3a0 t _MP4_ReadBox_sample_soun
10010200 t _MP4_ReadBox_sample_text
100057b0 T _MP4_ReadBox_sample_vide
10008f70 t _MP4_ReadBox_smhd
1000c740 t _MP4_ReadBox_stco_co64
1000d190 t _MP4_ReadBox_stdp
1000c360 t _MP4_ReadBox_stsc
1000bc80 t _MP4_ReadBox_stsd
1000ce30 t _MP4_ReadBox_stsh
1000cb20 t _MP4_ReadBox_stss
1000bff0 t _MP4_ReadBox_stsz
10009fe0 t _MP4_ReadBox_stts
100076e0 t _MP4_ReadBox_tkhd
10009490 t _MP4_ReadBox_url
100097f0 t _MP4_ReadBox_urn
10008cf0 t _MP4_ReadBox_vmhd
10006270 T _MP4_ReadStream
10006480 T _MP4_SeekStream
10006430 T _MP4_TellStream
10002990 t _MP4_TrackCreate
10003c10 t _MP4_TrackDestroy
10003da0 t _MP4_TrackGetPTS
100033c0 t _MP4_TrackGetPos
10003500 t _MP4_TrackNextSample
100032f0 t _MP4_TrackSampleSize
100030e0 t _MP4_TrackSeek
10002fd0 t _MP4_TrackSelect
100038c0 t _MP4_TrackSetELST
10003050 t _MP4_TrackUnselect
1000fdc0 t ___MP4_BoxDumpStructure
1000ff30 t ___MP4_BoxGet
Sigmund Augdal wrote:
>I'm not sure of the details of which .c end up in which .o and .a, but the
>libmp4.c file is still needed by the mkv demux.
>
>Sigmund
>
>On Mon, Sep 27, 2004 at 02:30:52PM +0100, Damien Fouilleul wrote:
>
>
>>Sigmund,
>>
>>you are right, after re-doing a bootstrap and the rest, everything
>>compiled and linked neatly,
>>
>>however I've noticed that libmp4.c ended up in both libmkv_a-libmp4.o
>>and libmp4_plugin_a-libmp4.o, which are respectively linked in vlc.exe
>>and libmp4-plugin.dll. Hence,am i right to assume that assume libmp4.c
>>is no longer needed in the plugin ?
>>
>>Damien
>>
>>Sigmund Augdal wrote:
>>
>>
>>
>>>You still get this if you run make clean and do a new bootstrap on a
>>>unmodified svn tree? the dependency isn't on the libmp4 plugin, but on one
>>>of the source files that also makes up the libmp4 plugin. These files are
>>>allways available in the vlc source tree, so I see no problem using them.
>>>
>>>Sigmund Augdal
>>>
>>>On Mon, Sep 27, 2004 at 01:43:49PM +0100, Damien Fouilleul wrote:
>>>
>>>
>>>
>>>
>>>>Hi,
>>>>
>>>>I've noticed that libmvk.a had hard-dependencies on APIs in the 'libmp4'
>>>>plugin module, hence when I compile VLC.exe on Windows, I get the
>>>>following link errors:
>>>>
>>>>g++ -mno-cygwin -O2 -Wsign-compare -Wsign-compare -Wall -mms-bitfields
>>>>-pipe -L/usr/win32/lib -o vlc.exe src/vlc-vlc.o lib/libvlc.a
>>>>share/vlc_win32_rc.o ./modules/misc/memcpy/libmemcpymmx.a
>>>>./modules/video_chroma/libi420_rgb_mmx.a
>>>>./modules/video_chroma/libi422_yuy2_mmx.a
>>>>./modules/video_chroma/libi420_ymga_mmx.a
>>>>./modules/video_chroma/libi420_yuy2_mmx.a
>>>>./modules/misc/memcpy/libmemcpymmxext.a
>>>>./modules/misc/memcpy/libmemcpy3dn.a ./modules/demux/liblivedotcom.a
>>>>./modules/demux/libmkv.a ./modules/codec/ffmpeg/libffmpeg.a
>>>>-L/usr/local/lib -lkernel32 /usr/win32/lib/libiconv.a
>>>>/usr/win32/lib/libintl.a /usr/win32/lib/libiconv.a -lws2_32 -lnetapi32
>>>>-lwinmm -mwindows -L/usr/win32/lib
>>>>-L/usr/win32/live.com/UsageEnvironment -lUsageEnvironment
>>>>-L/usr/win32/live.com/groupsock -lgroupsock
>>>>-L/usr/win32/live.com/BasicUsageEnvironment -lBasicUsageEnvironment
>>>>-L/usr/win32/live.com/liveMedia -lliveMedia -lws2_32 -lz -lmatroska
>>>>-lebml -lavcodec -lz -lfaac -lmp3lame -lxml2
>>>>./modules/demux/libmkv.a(libmkv_a-mkv.o)(.text+0x1d0e):mkv.cpp:
>>>>undefined reference to `_MP4_MemoryStream'
>>>>./modules/demux/libmkv.a(libmkv_a-mkv.o)(.text+0x1d27):mkv.cpp:
>>>>undefined reference to `_MP4_ReadBoxCommon'
>>>>./modules/demux/libmkv.a(libmkv_a-mkv.o)(.text+0x1d33):mkv.cpp:
>>>>undefined reference to `_MP4_ReadBox_sample_vide'
>>>>./modules/demux/libmkv.a(libmkv_a-mkv.o)(.text+0x1dd2):mkv.cpp:
>>>>undefined reference to `_MP4_FreeBox_sample_vide'
>>>>
>>>>I've temporarily solved the problem by creating a WIN32 import lib for
>>>>libmp4 and use that when compiling VLC.exe, which change the hard
>>>>dependency to a soft one, but I don't think that this is a long term
>>>>solution, since in essence, plugins are 'optional' components and if
>>>>'libmp4_plugin.dll' is not available, vlc.exe will bail out when it
>>>>calls those _MP4_ APIs.
>>>>
>>>>I believe an explicit 'LoadLibrary' mechanism should be devised before
>>>>using these APIs.
>>>>
>>>>Damien
>>>>
>>>>
>>>>Subversion daemon wrote:
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>>r8795 | sigmunau | 2004-09-26 01:36:55 +0200 (Sun, 26 Sep 2004) | 4 lines
>>>>>Changed paths:
>>>>>M /trunk/modules/demux/Modules.am
>>>>>M /trunk/modules/demux/mkv.cpp
>>>>>M /trunk/modules/demux/mp4/libmp4.c
>>>>>M /trunk/modules/demux/mp4/libmp4.h
>>>>>
>>>>>mkv.cpp: added support for quicktime video codecs in mkv (tested with
>>>>>svq3)
>>>>>Modules.am: link mkv demux with mp4 demux
>>>>>mp4/*: export some functions needed by mkv demux
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>--
>>>>This is the vlc-devel mailing-list, see http://www.videolan.org/vlc/
>>>>To unsubscribe, please read http://developers.videolan.org/lists.html
>>>>
>>>>
>>>>
>>>>
>>>
>>>
>>--
>>This is the vlc-devel mailing-list, see http://www.videolan.org/vlc/
>>To unsubscribe, please read http://developers.videolan.org/lists.html
>>
>>
>
>
>
--
This is the vlc-devel mailing-list, see http://www.videolan.org/vlc/
To unsubscribe, please read http://developers.videolan.org/lists.html
More information about the vlc-devel
mailing list