diff options
author | Pascal Quantin <pascal.quantin@gmail.com> | 2015-12-03 21:32:25 +0100 |
---|---|---|
committer | Guy Harris <guy@alum.mit.edu> | 2015-12-03 23:54:49 +0000 |
commit | 651e0884b7d9fdf64d5310c4e317d757d2357259 (patch) | |
tree | 5130af56d46332ddfb40e9ed3a71e04e9a67c88d | |
parent | 687b2dcadc22e2404c9ad7516eca2fa868338120 (diff) |
Change codecs from static to dynamic library
This allows to properly register codecs plugins.
See https://www.wireshark.org/lists/wireshark-dev/201511/msg00202.html for details.
Change-Id: Ibc13a19936abb7a2e81b86582a75fa424351565b
Reviewed-on: https://code.wireshark.org/review/12385
Petri-Dish: Pascal Quantin <pascal.quantin@gmail.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Guy Harris <guy@alum.mit.edu>
-rw-r--r-- | CMakeLists.txt | 1 | ||||
-rw-r--r-- | Makefile.am | 3 | ||||
-rw-r--r-- | Makefile.nmake | 13 | ||||
-rw-r--r-- | codecs/CMakeLists.txt | 35 | ||||
-rw-r--r-- | codecs/Makefile.am | 22 | ||||
-rw-r--r-- | codecs/Makefile.common | 2 | ||||
-rw-r--r-- | codecs/Makefile.nmake | 39 | ||||
-rw-r--r-- | codecs/codecs.h | 18 | ||||
-rw-r--r-- | codecs/speex/speex_resampler.h | 132 | ||||
-rw-r--r-- | debian/control | 13 | ||||
-rw-r--r-- | debian/libwscodecs0.install | 1 | ||||
-rw-r--r-- | debian/libwscodecs0.symbols | 32 | ||||
-rw-r--r-- | image/Makefile.nmake | 7 | ||||
-rw-r--r-- | image/libwscodecs.rc.in | 34 | ||||
-rw-r--r-- | packaging/nsis/Makefile.nmake | 2 | ||||
-rw-r--r-- | packaging/nsis/wireshark.nsi | 1 | ||||
-rw-r--r-- | ui/qt/Wireshark.pro | 5 |
17 files changed, 252 insertions, 108 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index d8282b8335..0f67545745 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1164,6 +1164,7 @@ set( IN_FILES image/tfshark.rc.in image/editcap.rc.in image/captype.rc.in + image/libwscodecs.rc.in image/libwsutil.rc.in image/wiretap.rc.in image/wireshark.exe.manifest.in diff --git a/Makefile.am b/Makefile.am index ebce8cc270..4f5544b0f7 100644 --- a/Makefile.am +++ b/Makefile.am @@ -404,7 +404,7 @@ wireshark_common_ldadd = \ caputils/libcaputils.a \ ui/libui.a \ ui/libui_dirty.a \ - codecs/libcodec.a \ + codecs/libwscodecs.la \ wiretap/libwiretap.la \ epan/libwireshark.la \ wsutil/libwsutil.la \ @@ -938,6 +938,7 @@ EXTRA_DIST = \ image/layout_5@2x.png \ image/layout_6.png \ image/layout_6@2x.png \ + image/libwscodecs.rc.in \ image/libwireshark.rc.in \ image/libwsutil.rc.in \ image/lo16-app-wireshark.png \ diff --git a/Makefile.nmake b/Makefile.nmake index d934e7e6fe..b71ac38e4d 100644 --- a/Makefile.nmake +++ b/Makefile.nmake @@ -235,7 +235,7 @@ RESOURCES=image\wireshark.res image\file_dlg_win32.res \ image\rawshark.res image\reordercap.res image\libwsutil.res -all: $(LIBS_CHECK) config.h ui\qt\config.pri tools image codecs $(C_ARES_DLL) $(ADNS_DLL) $(ZLIB_DLL) wsutil wiretap epan $(EXECUTABLES) wireshark.bsc $(RESOURCES) help install-all +all: $(LIBS_CHECK) config.h ui\qt\config.pri tools image $(C_ARES_DLL) $(ADNS_DLL) $(ZLIB_DLL) wsutil codecs wiretap epan $(EXECUTABLES) wireshark.bsc $(RESOURCES) help install-all !IFDEF MAKENSIS packaging: all @@ -326,16 +326,16 @@ $(RESOURCES): image ## (These variables (as well as '$(guilibsdll)' and '$(conlibsdll)') are defined in win32.mak). wiretap\wiretap-$(WTAP_VERSION).lib: image $(ZLIB_DLL) wiretap -$(PROGRAM_NAME_GTK).exe : $(LIBS_CHECK) config.h $(wireshark_gtk_OBJECTS) capchild caputils codecs epan ui gtk win32 image\wireshark.res image\file_dlg_win32.res wsutil\libwsutil.lib wiretap\wiretap-$(WTAP_VERSION).lib codecs\codecs.lib ui\libui.lib ui\gtk\libgtkui.lib ui\win32\libgtkui_win32.lib plugins +$(PROGRAM_NAME_GTK).exe : $(LIBS_CHECK) config.h $(wireshark_gtk_OBJECTS) capchild caputils epan ui gtk win32 image\wireshark.res image\file_dlg_win32.res wsutil\libwsutil.lib wiretap\wiretap-$(WTAP_VERSION).lib codecs\libwscodecs.lib ui\libui.lib ui\gtk\libgtkui.lib ui\win32\libgtkui_win32.lib plugins @echo Linking $@ $(LINK) @<< - /OUT:$(PROGRAM_NAME_GTK).exe $(guiflags) $(guilibsdll) $(LDFLAGS) /LARGEADDRESSAWARE $(wireshark_gtk_LIBS) $(GTK_LIBS) capchild\libcapchild.lib caputils\libcaputils.lib codecs\codecs.lib ui\gtk\libgtkui.lib ui\win32\libgtkui_win32.lib ui\libui.lib $(wireshark_gtk_OBJECTS) image\wireshark.res image\file_dlg_win32.res + /OUT:$(PROGRAM_NAME_GTK).exe $(guiflags) $(guilibsdll) $(LDFLAGS) /LARGEADDRESSAWARE $(wireshark_gtk_LIBS) $(GTK_LIBS) capchild\libcapchild.lib caputils\libcaputils.lib codecs\libwscodecs.lib ui\gtk\libgtkui.lib ui\win32\libgtkui_win32.lib ui\libui.lib $(wireshark_gtk_OBJECTS) image\wireshark.res image\file_dlg_win32.res << !IFDEF MANIFEST_INFO_REQUIRED mt.exe -nologo -manifest "wireshark.exe.manifest" -outputresource:$(PROGRAM_NAME).exe;1 !ENDIF -$(PROGRAM_NAME).exe : install-generated-files $(LIBS_CHECK) config.h capchild caputils codecs epan ui qt wsutil\libwsutil.lib wiretap\wiretap-$(WTAP_VERSION).lib plugins +$(PROGRAM_NAME).exe : install-generated-files $(LIBS_CHECK) config.h capchild caputils codecs\libwscodecs.lib epan ui qt wsutil\libwsutil.lib wiretap\wiretap-$(WTAP_VERSION).lib plugins tshark.exe : $(LIBS_CHECK) config.h $(tshark_OBJECTS) capchild caputils epan ui cli image\tshark.res wsutil\libwsutil.lib wiretap\wiretap-$(WTAP_VERSION).lib plugins @echo Linking $@ @@ -617,7 +617,7 @@ clean-local: dftest.obj dftest.exe randpkt.obj randpkt-core.obj randpkt.exe \ doxygen.cfg \ $(RESOURCES) libwireshark.dll wiretap-$(WTAP_VERSION).dll \ - libwsutil.dll \ + libwscodecs.lib libwsutil.dll \ wireshark.bsc rm -rf $(INSTALL_DIR) rm -rf $(INSTALL_DIR_QT) @@ -1253,6 +1253,9 @@ install-generated-files: doc if exist epan\libwireshark.lib xcopy .\epan\libwireshark.lib $(INSTALL_DIR) /d if exist epan\libwireshark.pdb xcopy .\epan\libwireshark.pdb $(INSTALL_DIR) /d !ENDIF + xcopy ".\codecs\libwscodecs.dll" $(INSTALL_DIR) /d + if exist ".\codecs\libwscodecs.lib" xcopy ".\codecs\libwscodecs.lib" $(INSTALL_DIR) /d + if exist ".\codecs\libwscodecs.pdb" xcopy ".\codecs\libwscodecs.pdb" $(INSTALL_DIR) /d xcopy ".\wiretap\wiretap-$(WTAP_VERSION).dll" $(INSTALL_DIR) /d if exist ".\wiretap\wiretap-$(WTAP_VERSION).lib" xcopy ".\wiretap\wiretap-$(WTAP_VERSION).lib" $(INSTALL_DIR) /d if exist ".\wiretap\wiretap-$(WTAP_VERSION).pdb" xcopy ".\wiretap\wiretap-$(WTAP_VERSION).pdb" $(INSTALL_DIR) /d diff --git a/codecs/CMakeLists.txt b/codecs/CMakeLists.txt index 63ac64d08d..9f4d64a1b2 100644 --- a/codecs/CMakeLists.txt +++ b/codecs/CMakeLists.txt @@ -44,9 +44,38 @@ if(SBC_FOUND) set(CODECS_FILES ${CODECS_FILES} sbc/sbc.c) endif() -add_library(codecs STATIC +set(codecs_LIBS + ${GMODULE2_LIBRARIES} + wsutil +) + +add_library(codecs ${LINK_MODE_LIB} ${CODECS_FILES} + ${CMAKE_BINARY_DIR}/image/libwscodecs.rc ) + +set(FULL_SO_VERSION "0.0.0") + set_target_properties(codecs PROPERTIES - LINK_FLAGS "${WS_LINK_FLAGS}" - FOLDER "Libs") + PREFIX "libws" + COMPILE_DEFINITIONS "WS_BUILD_DLL" + LINK_FLAGS "${WS_LINK_FLAGS}" + VERSION ${FULL_SO_VERSION} SOVERSION 0 + FOLDER "Libs" +) + +if(ENABLE_APPLICATION_BUNDLE) + set_target_properties(codecs PROPERTIES + LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/run/Wireshark.app/Contents/Frameworks + ) +endif() + +target_link_libraries(codecs ${codecs_LIBS}) + +if(NOT ${ENABLE_STATIC}) + install(TARGETS codecs + LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} + RUNTIME DESTINATION ${CMAKE_INSTALL_LIBDIR} + ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} + ) +endif() diff --git a/codecs/Makefile.am b/codecs/Makefile.am index 2d9698ed86..6d67087682 100644 --- a/codecs/Makefile.am +++ b/codecs/Makefile.am @@ -22,25 +22,31 @@ include Makefile.common include ../Makefile.am.inc +AM_CFLAGS =-DWS_BUILD_DLL + if HAVE_WARNINGS_AS_ERRORS -AM_CFLAGS = -Werror +AM_CFLAGS += -Werror endif -noinst_LIBRARIES = libcodec.a - CLEANFILES = \ - libcodec.a \ + libwscodec.la \ *~ MAINTAINERCLEANFILES = \ Makefile.in +lib_LTLIBRARIES = libwscodecs.la +# http://www.gnu.org/software/libtool/manual/html_node/Updating-version-info.html +libwscodecs_la_LDFLAGS = -version-info 0:0:0 @LDFLAGS_SHAREDLIB@ + # All sources that should be put in the source distribution tarball -libcodec_a_SOURCES = \ - $(LIBCODEC_SRC) \ +libwscodecs_la_SOURCES = \ + $(LIBCODECS_SRC) \ $(noinst_HEADERS) -libcodec_a_DEPENDENCIES = +libwscodecs_la_DEPENDENCIES = ${top_builddir}/wsutil/libwsutil.la + +libwscodecs_la_LIBADD = ${top_builddir}/wsutil/libwsutil.la # Common headers AM_CPPFLAGS = -I$(top_srcdir) -I$(top_srcdir)/wiretap @@ -48,7 +54,7 @@ AM_CPPFLAGS = -I$(top_srcdir) -I$(top_srcdir)/wiretap checkapi: $(PERL) $(top_srcdir)/tools/checkAPIs.pl -g abort -g termoutput -build \ -sourcedir=$(srcdir) \ - $(LIBCODEC_SRC) + $(LIBCODECS_SRC) EXTRA_DIST = \ CMakeLists.txt \ diff --git a/codecs/Makefile.common b/codecs/Makefile.common index e2510ba96d..f1af69f663 100644 --- a/codecs/Makefile.common +++ b/codecs/Makefile.common @@ -21,7 +21,7 @@ # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA -LIBCODEC_SRC = \ +LIBCODECS_SRC = \ codecs.c \ G711a/G711adecode.c \ G711u/G711udecode.c \ diff --git a/codecs/Makefile.nmake b/codecs/Makefile.nmake index 53aa69bda3..1cc2be66ba 100644 --- a/codecs/Makefile.nmake +++ b/codecs/Makefile.nmake @@ -1,17 +1,18 @@ -## Makefile for building codecs.lib with Microsoft C and nmake +## Makefile for building libcodecs.dll with Microsoft C and nmake ## Use: $(MAKE) /$(MAKEFLAGS) -f makefile.nmake # include ..\config.nmake +include <win32.mak> include ..\Makefile.nmake.inc ############### no need to modify below this line ######### CFLAGS=/I.. $(WARNINGS_ARE_ERRORS) $(STANDARD_CFLAGS) \ - $(GLIB_CFLAGS) + $(GLIB_CFLAGS) -DWS_BUILD_DLL DIRTY_CFLAGS=/I.. $(STANDARD_CFLAGS) \ - $(GLIB_CFLAGS) + $(GLIB_CFLAGS) -DWS_BUILD_DLL .c.obj:: $(CC) $(CFLAGS) -Fd.\ -c $< @@ -20,11 +21,11 @@ include Makefile.common # if you add files here, be sure to include them also in Makefile.am EXTRA_DIST # XXX - if the codec files weren't in subdirectories, we could just do -# LIBCODEC_OBJECTS = $(LIBCODEC_SRC:.c=.obj), and wouldn't need rules +# LIBCODECS_OBJECTS = $(LIBCODECS_SRC:.c=.obj), and wouldn't need rules # for each of the codecs below # -LIBCODEC_OBJECTS= \ - codecs.obj \ +LIBCODECS_OBJECTS= \ + codecs.obj \ G711udecode.obj \ G711adecode.obj \ G722decode.obj \ @@ -32,8 +33,21 @@ LIBCODEC_OBJECTS= \ resample.obj \ sbc.obj -codecs.lib : $(LIBCODEC_OBJECTS) - link /lib /out:codecs.lib $(LIBCODEC_OBJECTS) +libcodecs_LIBS = \ + $(GLIB_LIBS) \ + ..\wsutil\libwsutil.lib + +libwscodecs.lib: libwscodecs.dll +libwscodecs.exp: libwscodecs.dll + +libwscodecs.dll : $(LIBCODECS_OBJECTS) ..\image\libwscodecs.res + @echo Linking libwscodecs.dll + $(link) $(dlllflags) $(conlibsdll) \ + $(LOCAL_LDFLAGS) $(DLL_LDFLAGS) \ + /OUT:libwscodecs.dll \ + /IMPLIB:libwscodecs.lib \ + ..\image\libwscodecs.res \ + $(LIBCODECS_OBJECTS) $(libcodecs_LIBS) codecs.obj: codecs.c codecs.h $(CC) $(CFLAGS) -Fd.\ -c codecs.c /Fo%|fF.obj @@ -57,7 +71,12 @@ sbc.obj: sbc\sbc.c sbc\sbc_private.h $(CC) $(CFLAGS) -Fd.\ -c sbc\sbc.c /Fo%|fF.obj clean: - rm -f $(LIBCODEC_OBJECTS) codecs.lib *.nativecodeanalysis.xml *.pdb *.sbr + rm -f $(LIBCODECS_OBJECTS) \ + libwscodecs.lib \ + libwscodecs.exp \ + libwscodecs.dll \ + libwscodecs.dll.manifest \ + *.nativecodeanalysis.xml *.pdb *.sbr distclean: clean @@ -65,4 +84,4 @@ maintainer-clean: distclean checkapi: $(PERL) ../tools/checkAPIs.pl -g abort -g termoutput -build \ - $(LIBCODEC_SRC) + $(LIBCODECS_SRC) diff --git a/codecs/codecs.h b/codecs/codecs.h index 7ba918ac30..5fb90e644b 100644 --- a/codecs/codecs.h +++ b/codecs/codecs.h @@ -33,8 +33,8 @@ extern "C" { #endif /* __cplusplus */ #ifdef HAVE_PLUGINS -extern void codec_register_plugin_types(void); -extern void register_all_codecs(void); +WS_DLL_PUBLIC void codec_register_plugin_types(void); +WS_DLL_PUBLIC void register_all_codecs(void); #endif struct codec_handle; @@ -47,15 +47,15 @@ typedef unsigned (*codec_get_frequency_fn)(void *context); typedef size_t (*codec_decode_fn)(void *context, const void *input, size_t inputSizeBytes, void *output, size_t *outputSizeBytes); -extern gboolean register_codec(const char *name, codec_init_fn init_fn, +WS_DLL_PUBLIC gboolean register_codec(const char *name, codec_init_fn init_fn, codec_release_fn release_fn, codec_get_channels_fn channels_fn, codec_get_frequency_fn frequency_fn, codec_decode_fn decode_fn); -extern codec_handle_t find_codec(const char *name); -extern void *codec_init(codec_handle_t codec); -extern void codec_release(codec_handle_t codec, void *context); -extern unsigned codec_get_channels(codec_handle_t codec, void *context); -extern unsigned codec_get_frequency(codec_handle_t codec, void *context); -extern size_t codec_decode(codec_handle_t codec, void *context, const void *input, +WS_DLL_PUBLIC codec_handle_t find_codec(const char *name); +WS_DLL_PUBLIC void *codec_init(codec_handle_t codec); +WS_DLL_PUBLIC void codec_release(codec_handle_t codec, void *context); +WS_DLL_PUBLIC unsigned codec_get_channels(codec_handle_t codec, void *context); +WS_DLL_PUBLIC unsigned codec_get_frequency(codec_handle_t codec, void *context); +WS_DLL_PUBLIC size_t codec_decode(codec_handle_t codec, void *context, const void *input, size_t inputSizeBytes, void *output, size_t *outputSizeBytes); #ifdef __cplusplus diff --git a/codecs/speex/speex_resampler.h b/codecs/speex/speex_resampler.h index a71cd4fb68..59eb307f6e 100644 --- a/codecs/speex/speex_resampler.h +++ b/codecs/speex/speex_resampler.h @@ -124,11 +124,11 @@ typedef struct SpeexResamplerState_ SpeexResamplerState; * @return Newly created resampler state * @retval NULL Error: not enough memory */ -SpeexResamplerState *speex_resampler_init(spx_uint32_t nb_channels, - spx_uint32_t in_rate, - spx_uint32_t out_rate, - int quality, - int *err); +WS_DLL_PUBLIC SpeexResamplerState *speex_resampler_init(spx_uint32_t nb_channels, + spx_uint32_t in_rate, + spx_uint32_t out_rate, + int quality, + int *err); /** Create a new resampler with fractional input/output rates. The sampling * rate ratio is an arbitrary rational number with both the numerator and @@ -143,18 +143,18 @@ SpeexResamplerState *speex_resampler_init(spx_uint32_t nb_channels, * @return Newly created resampler state * @retval NULL Error: not enough memory */ -SpeexResamplerState *speex_resampler_init_frac(spx_uint32_t nb_channels, - spx_uint32_t ratio_num, - spx_uint32_t ratio_den, - spx_uint32_t in_rate, - spx_uint32_t out_rate, - int quality, - int *err); +WS_DLL_PUBLIC SpeexResamplerState *speex_resampler_init_frac(spx_uint32_t nb_channels, + spx_uint32_t ratio_num, + spx_uint32_t ratio_den, + spx_uint32_t in_rate, + spx_uint32_t out_rate, + int quality, + int *err); /** Destroy a resampler state. * @param st Resampler state */ -void speex_resampler_destroy(SpeexResamplerState *st); +WS_DLL_PUBLIC void speex_resampler_destroy(SpeexResamplerState *st); /** Resample a float array. The input and output buffers must *not* overlap. * @param st Resampler state @@ -166,12 +166,12 @@ void speex_resampler_destroy(SpeexResamplerState *st); * @param out Output buffer * @param out_len Size of the output buffer. Returns the number of samples written */ -int speex_resampler_process_float(SpeexResamplerState *st, - spx_uint32_t channel_index, - const float *in, - spx_uint32_t *in_len, - float *out, - spx_uint32_t *out_len); +WS_DLL_PUBLIC int speex_resampler_process_float(SpeexResamplerState *st, + spx_uint32_t channel_index, + const float *in, + spx_uint32_t *in_len, + float *out, + spx_uint32_t *out_len); /** Resample an int array. The input and output buffers must *not* overlap. * @param st Resampler state @@ -183,12 +183,12 @@ int speex_resampler_process_float(SpeexResamplerState *st, * @param out Output buffer * @param out_len Size of the output buffer. Returns the number of samples written */ -int speex_resampler_process_int(SpeexResamplerState *st, - spx_uint32_t channel_index, - const spx_int16_t *in, - spx_uint32_t *in_len, - spx_int16_t *out, - spx_uint32_t *out_len); +WS_DLL_PUBLIC int speex_resampler_process_int(SpeexResamplerState *st, + spx_uint32_t channel_index, + const spx_int16_t *in, + spx_uint32_t *in_len, + spx_int16_t *out, + spx_uint32_t *out_len); /** Resample an interleaved float array. The input and output buffers must *not* overlap. * @param st Resampler state @@ -199,11 +199,11 @@ int speex_resampler_process_int(SpeexResamplerState *st, * @param out_len Size of the output buffer. Returns the number of samples written. * This is all per-channel. */ -int speex_resampler_process_interleaved_float(SpeexResamplerState *st, - const float *in, - spx_uint32_t *in_len, - float *out, - spx_uint32_t *out_len); +WS_DLL_PUBLIC int speex_resampler_process_interleaved_float(SpeexResamplerState *st, + const float *in, + spx_uint32_t *in_len, + float *out, + spx_uint32_t *out_len); /** Resample an interleaved int array. The input and output buffers must *not* overlap. * @param st Resampler state @@ -214,29 +214,29 @@ int speex_resampler_process_interleaved_float(SpeexResamplerState *st, * @param out_len Size of the output buffer. Returns the number of samples written. * This is all per-channel. */ -int speex_resampler_process_interleaved_int(SpeexResamplerState *st, - const spx_int16_t *in, - spx_uint32_t *in_len, - spx_int16_t *out, - spx_uint32_t *out_len); +WS_DLL_PUBLIC int speex_resampler_process_interleaved_int(SpeexResamplerState *st, + const spx_int16_t *in, + spx_uint32_t *in_len, + spx_int16_t *out, + spx_uint32_t *out_len); /** Set (change) the input/output sampling rates (integer value). * @param st Resampler state * @param in_rate Input sampling rate (integer number of Hz). * @param out_rate Output sampling rate (integer number of Hz). */ -int speex_resampler_set_rate(SpeexResamplerState *st, - spx_uint32_t in_rate, - spx_uint32_t out_rate); +WS_DLL_PUBLIC int speex_resampler_set_rate(SpeexResamplerState *st, + spx_uint32_t in_rate, + spx_uint32_t out_rate); /** Get the current input/output sampling rates (integer value). * @param st Resampler state * @param in_rate Input sampling rate (integer number of Hz) copied. * @param out_rate Output sampling rate (integer number of Hz) copied. */ -void speex_resampler_get_rate(SpeexResamplerState *st, - spx_uint32_t *in_rate, - spx_uint32_t *out_rate); +WS_DLL_PUBLIC void speex_resampler_get_rate(SpeexResamplerState *st, + spx_uint32_t *in_rate, + spx_uint32_t *out_rate); /** Set (change) the input/output sampling rates and resampling ratio * (fractional values in Hz supported). @@ -246,11 +246,11 @@ void speex_resampler_get_rate(SpeexResamplerState *st, * @param in_rate Input sampling rate rounded to the nearest integer (in Hz). * @param out_rate Output sampling rate rounded to the nearest integer (in Hz). */ -int speex_resampler_set_rate_frac(SpeexResamplerState *st, - spx_uint32_t ratio_num, - spx_uint32_t ratio_den, - spx_uint32_t in_rate, - spx_uint32_t out_rate); +WS_DLL_PUBLIC int speex_resampler_set_rate_frac(SpeexResamplerState *st, + spx_uint32_t ratio_num, + spx_uint32_t ratio_den, + spx_uint32_t in_rate, + spx_uint32_t out_rate); /** Get the current resampling ratio. This will be reduced to the least * common denominator. @@ -258,63 +258,63 @@ int speex_resampler_set_rate_frac(SpeexResamplerState *st, * @param ratio_num Numerator of the sampling rate ratio copied * @param ratio_den Denominator of the sampling rate ratio copied */ -void speex_resampler_get_ratio(SpeexResamplerState *st, - spx_uint32_t *ratio_num, - spx_uint32_t *ratio_den); +WS_DLL_PUBLIC void speex_resampler_get_ratio(SpeexResamplerState *st, + spx_uint32_t *ratio_num, + spx_uint32_t *ratio_den); /** Set (change) the conversion quality. * @param st Resampler state * @param quality Resampling quality between 0 and 10, where 0 has poor * quality and 10 has very high quality. */ -int speex_resampler_set_quality(SpeexResamplerState *st, - int quality); +WS_DLL_PUBLIC int speex_resampler_set_quality(SpeexResamplerState *st, + int quality); /** Get the conversion quality. * @param st Resampler state * @param quality Resampling quality between 0 and 10, where 0 has poor * quality and 10 has very high quality. */ -void speex_resampler_get_quality(SpeexResamplerState *st, - int *quality); +WS_DLL_PUBLIC void speex_resampler_get_quality(SpeexResamplerState *st, + int *quality); /** Set (change) the input stride. * @param st Resampler state * @param stride Input stride */ -void speex_resampler_set_input_stride(SpeexResamplerState *st, - spx_uint32_t stride); +WS_DLL_PUBLIC void speex_resampler_set_input_stride(SpeexResamplerState *st, + spx_uint32_t stride); /** Get the input stride. * @param st Resampler state * @param stride Input stride copied */ -void speex_resampler_get_input_stride(SpeexResamplerState *st, - spx_uint32_t *stride); +WS_DLL_PUBLIC void speex_resampler_get_input_stride(SpeexResamplerState *st, + spx_uint32_t *stride); /** Set (change) the output stride. * @param st Resampler state * @param stride Output stride */ -void speex_resampler_set_output_stride(SpeexResamplerState *st, - spx_uint32_t stride); +WS_DLL_PUBLIC void speex_resampler_set_output_stride(SpeexResamplerState *st, + spx_uint32_t stride); /** Get the output stride. * @param st Resampler state copied * @param stride Output stride */ -void speex_resampler_get_output_stride(SpeexResamplerState *st, - spx_uint32_t *stride); +WS_DLL_PUBLIC void speex_resampler_get_output_stride(SpeexResamplerState *st, + spx_uint32_t *stride); /** Get the latency introduced by the resampler measured in input samples. * @param st Resampler state */ -int speex_resampler_get_input_latency(SpeexResamplerState *st); +WS_DLL_PUBLIC int speex_resampler_get_input_latency(SpeexResamplerState *st); /** Get the latency introduced by the resampler measured in output samples. * @param st Resampler state */ -int speex_resampler_get_output_latency(SpeexResamplerState *st); +WS_DLL_PUBLIC int speex_resampler_get_output_latency(SpeexResamplerState *st); /** Make sure that the first samples to go out of the resamplers don't have * leading zeros. This is only useful before starting to use a newly created @@ -324,18 +324,18 @@ int speex_resampler_get_output_latency(SpeexResamplerState *st); * is the same for the first frame). * @param st Resampler state */ -int speex_resampler_skip_zeros(SpeexResamplerState *st); +WS_DLL_PUBLIC int speex_resampler_skip_zeros(SpeexResamplerState *st); /** Reset a resampler so a new (unrelated) stream can be processed. * @param st Resampler state */ -int speex_resampler_reset_mem(SpeexResamplerState *st); +WS_DLL_PUBLIC int speex_resampler_reset_mem(SpeexResamplerState *st); /** Returns the English meaning for an error code * @param err Error code * @return English string */ -const char *speex_resampler_strerror(int err); +WS_DLL_PUBLIC const char *speex_resampler_strerror(int err); #ifdef __cplusplus } diff --git a/debian/control b/debian/control index e853edfb54..dbfcbf22ce 100644 --- a/debian/control +++ b/debian/control @@ -139,7 +139,7 @@ Architecture: any Multi-Arch: same Pre-Depends: ${misc:Pre-Depends} Depends: ${shlibs:Depends}, ${misc:Depends}, libwireshark-data (>= ${source:Version}), - libwsutil0 (>= ${source:Version}) + libwsutil0 (>= ${source:Version}), libwscodecs0 (>= ${source:Version}) Suggests: wireshark-doc (>= ${source:Version}) Conflicts: wireshark-common (<< 1.4.0~rc2-1) Replaces: wireshark-common (<< 1.4.0~rc2-1) @@ -172,6 +172,17 @@ Description: network packet dissection utilities library -- shared library This package contains the static library and the C header files that are needed for applications to use the libwsutil library. +Package: libwscodecs0 +Section: libs +Architecture: any +Multi-Arch: same +Pre-Depends: ${misc:Pre-Depends} +Depends: ${shlibs:Depends}, ${misc:Depends} +Conflicts: wireshark-common (<< 1.4.0~rc2-1), libwireshark1 (<< 1.4.2-2) +Replaces: wireshark-common (<< 1.4.0~rc2-1), libwireshark1 (<< 1.4.2-2) +Description: network packet dissection codecs library -- shared library + The libwscodecs library provides codec functions for libwireshark0. + Package: libwireshark-data Section: libs Architecture: all diff --git a/debian/libwscodecs0.install b/debian/libwscodecs0.install new file mode 100644 index 0000000000..418ba73dff --- /dev/null +++ b/debian/libwscodecs0.install @@ -0,0 +1 @@ +usr/lib/*/libwscodecs.so.* diff --git a/debian/libwscodecs0.symbols b/debian/libwscodecs0.symbols new file mode 100644 index 0000000000..a0931130ba --- /dev/null +++ b/debian/libwscodecs0.symbols @@ -0,0 +1,32 @@ +libwscodecs.so.0 libwireshark0 #MINVER# + codec_decode@Base 2.1.0 + codec_get_channels@Base 2.1.0 + codec_get_frequency@Base 2.1.0 + codec_init@Base 2.1.0 + codec_register_plugin_types@Base 2.1.0 + codec_release@Base 2.1.0 + find_codec@Base 2.1.0 + register_all_codecs@Base 2.1.0 + register_codec@Base 2.1.0 + ws_codec_resampler_destroy@Base 2.1.0 + ws_codec_resampler_get_input_latency@Base 2.1.0 + ws_codec_resampler_get_input_stride@Base 2.1.0 + ws_codec_resampler_get_output_latency@Base 2.1.0 + ws_codec_resampler_get_output_stride@Base 2.1.0 + ws_codec_resampler_get_quality@Base 2.1.0 + ws_codec_resampler_get_rate@Base 2.1.0 + ws_codec_resampler_get_ratio@Base 2.1.0 + ws_codec_resampler_init@Base 2.1.0 + ws_codec_resampler_init_frac@Base 2.1.0 + ws_codec_resampler_process_float@Base 2.1.0 + ws_codec_resampler_process_int@Base 2.1.0 + ws_codec_resampler_process_interleaved_float@Base 2.1.0 + ws_codec_resampler_process_interleaved_int@Base 2.1.0 + ws_codec_resampler_reset_mem@Base 2.1.0 + ws_codec_resampler_set_input_stride@Base 2.1.0 + ws_codec_resampler_set_output_stride@Base 2.1.0 + ws_codec_resampler_set_quality@Base 2.1.0 + ws_codec_resampler_set_rate@Base 2.1.0 + ws_codec_resampler_set_rate_frac@Base 2.1.0 + ws_codec_resampler_skip_zeros@Base 2.1.0 + ws_codec_resampler_strerror@Base 2.1.0 diff --git a/image/Makefile.nmake b/image/Makefile.nmake index d7910e651a..2e9a99de86 100644 --- a/image/Makefile.nmake +++ b/image/Makefile.nmake @@ -4,7 +4,7 @@ include ..\config.nmake # Nmake uses an implicit rule to build a .res from a .rc file! -ALL_RC=wireshark.rc libwireshark.rc tshark.rc tfshark.rc rawshark.rc capinfos.rc captype.rc editcap.rc text2pcap.rc mergecap.rc reordercap.rc wiretap.rc dumpcap.rc libwsutil.rc wireshark.exe.manifest +ALL_RC=wireshark.rc libwireshark.rc tshark.rc tfshark.rc rawshark.rc capinfos.rc captype.rc editcap.rc text2pcap.rc mergecap.rc reordercap.rc wiretap.rc dumpcap.rc libwscodecs.rc libwsutil.rc wireshark.exe.manifest all : $(ALL_RC) # wireshark.exe.manifest and wireshark.rc are used for both Qt and GTK+ executables. @@ -85,6 +85,11 @@ wiretap.rc : wiretap.rc.in ..\config.nmake -e s/@RC_VERSION@/$(RC_WTAP_VERSION)/ \ < wiretap.rc.in > $@ +libwscodecs.rc : libwscodecs.rc.in ..\config.nmake + sed -e s/@VERSION@/$(VERSION)/ \ + -e s/@RC_VERSION@/$(RC_VERSION)/ \ + < libwscodecs.rc.in > $@ + libwsutil.rc : libwsutil.rc.in ..\config.nmake sed -e s/@VERSION@/$(VERSION)/ \ -e s/@RC_VERSION@/$(RC_VERSION)/ \ diff --git a/image/libwscodecs.rc.in b/image/libwscodecs.rc.in new file mode 100644 index 0000000000..c87dba8987 --- /dev/null +++ b/image/libwscodecs.rc.in @@ -0,0 +1,34 @@ +#include "winver.h" + +VS_VERSION_INFO VERSIONINFO + FILEVERSION @RC_VERSION@ + PRODUCTVERSION @RC_VERSION@ + FILEFLAGSMASK 0x0L +#ifdef _DEBUG + FILEFLAGS VS_FF_DEBUG +#else + FILEFLAGS 0x0L +#endif + FILEOS VOS_NT_WINDOWS32 + FILETYPE VFT_DLL + FILESUBTYPE 0x0L +BEGIN + BLOCK "StringFileInfo" + BEGIN + BLOCK "040904b0" + BEGIN + VALUE "CompanyName", "The Wireshark developer community, http://www.wireshark.org/\0" + VALUE "FileDescription", "Wireshark codecs library\0" + VALUE "FileVersion", "@VERSION@\0" + VALUE "InternalName", "libwscodecs @VERSION@\0" + VALUE "LegalCopyright", "Copyright © 2000 Gerald Combs <gerald@wireshark.org>, Gilbert Ramirez <gram@alumni.rice.edu> and others\0" + VALUE "OriginalFilename", "libwscodecs.dll\0" + VALUE "ProductName", "Wireshark\0" + VALUE "ProductVersion", "@VERSION@\0" + END + END + BLOCK "VarFileInfo" + BEGIN + VALUE "Translation", 0x409, 1200 + END +END diff --git a/packaging/nsis/Makefile.nmake b/packaging/nsis/Makefile.nmake index 57a849d149..6f70c969fd 100644 --- a/packaging/nsis/Makefile.nmake +++ b/packaging/nsis/Makefile.nmake @@ -18,7 +18,7 @@ EXE=../../tshark.exe ../../editcap.exe \ ../../wireshark-gtk.exe \ !ENDIF ../../text2pcap.exe ../../mergecap.exe ../../capinfos.exe $(WIRESHARK_LIB_DIR)\WinPcap_$(WINPCAP_VERSION).exe -DLL=../../wiretap/wiretap-$(WTAP_VERSION).dll ../../wsutil/libwsutil.dll +DLL=../../wiretap/wiretap-$(WTAP_VERSION).dll ../../wsutil/libwsutil.dll ../../codecs/libwscodecs.dll DOC=../../doc/ws.css \ ../../doc/androiddump.html \ ../../doc/capinfos.html \ diff --git a/packaging/nsis/wireshark.nsi b/packaging/nsis/wireshark.nsi index a0bc298b5c..57ff291a8e 100644 --- a/packaging/nsis/wireshark.nsi +++ b/packaging/nsis/wireshark.nsi @@ -357,6 +357,7 @@ File "${STAGING_DIR}\wiretap-${WTAP_VERSION}.dll" !ifdef ENABLE_LIBWIRESHARK File "${STAGING_DIR}\libwireshark.dll" !endif +File "${STAGING_DIR}\libwscodecs.dll" File "${STAGING_DIR}\libwsutil.dll" !include all-manifest.nsh diff --git a/ui/qt/Wireshark.pro b/ui/qt/Wireshark.pro index 5a23b2b998..ac42adad99 100644 --- a/ui/qt/Wireshark.pro +++ b/ui/qt/Wireshark.pro @@ -482,7 +482,7 @@ win32 { -L../../epan -llibwireshark -L../../wsutil -llibwsutil \ -L../../wiretap -lwiretap-$${WTAP_VERSION} \ -L../../capchild -llibcapchild -L../../caputils -llibcaputils \ - -L.. -llibui -L../../codecs -lcodecs \ + -L.. -llibui -L../../codecs -llibwscodecs \ -L$${GLIB_DIR}/lib -lglib-2.0 -lgmodule-2.0 \ -L$${ZLIB_DIR}/lib -lzdll \ -L$${WINSPARKLE_DIR} -lWinSparkle @@ -524,7 +524,8 @@ win32 { EXTRA_BINFILES += \ ../../dumpcap.exe \ - ../../epan/libwireshark.dll ../../wiretap/wiretap-$${WTAP_VERSION}.dll ../../wsutil/libwsutil.dll \ + ../../epan/libwireshark.dll ../../wiretap/wiretap-$${WTAP_VERSION}.dll \ + ../../wsutil/libwsutil.dll ../../codecs/libwscodecs.dll \ $${GLIB_DIR}/bin/libglib-2.0-0.dll $${GLIB_DIR}/bin/libgmodule-2.0-0.dll \ $${GLIB_DIR}/bin/$${INTL_DLL} \ $${GLIB_DIR}/bin/gspawn-$${WIRESHARK_TARGET_PLATFORM}-helper.exe \ |