diff options
Diffstat (limited to 'src/libw32dll')
-rw-r--r-- | src/libw32dll/DirectShow/DS_VideoDecoder.c | 2 | ||||
-rw-r--r-- | src/libw32dll/DirectShow/Makefile.am | 33 | ||||
-rw-r--r-- | src/libw32dll/Makefile.am | 36 | ||||
-rw-r--r-- | src/libw32dll/dmo/DMO_VideoDecoder.c | 2 | ||||
-rw-r--r-- | src/libw32dll/dmo/Makefile.am | 28 | ||||
-rw-r--r-- | src/libw32dll/qt_decoder.c | 85 | ||||
-rw-r--r-- | src/libw32dll/w32codec.c | 66 | ||||
-rw-r--r-- | src/libw32dll/w32codec.h | 5 | ||||
-rw-r--r-- | src/libw32dll/wine/Makefile.am | 57 | ||||
-rw-r--r-- | src/libw32dll/wine/debugtools.h | 8 | ||||
-rw-r--r-- | src/libw32dll/wine/ext.h | 3 | ||||
-rw-r--r-- | src/libw32dll/wine/ldt_keeper.c | 13 | ||||
-rw-r--r-- | src/libw32dll/wine/pe_image.c | 2 | ||||
-rw-r--r-- | src/libw32dll/wine/registry.c | 41 | ||||
-rw-r--r-- | src/libw32dll/wine/win32.c | 21 | ||||
-rw-r--r-- | src/libw32dll/wine/windef.h | 7 |
16 files changed, 150 insertions, 259 deletions
diff --git a/src/libw32dll/DirectShow/DS_VideoDecoder.c b/src/libw32dll/DirectShow/DS_VideoDecoder.c index 44c6d26d7..c0a08d5e3 100644 --- a/src/libw32dll/DirectShow/DS_VideoDecoder.c +++ b/src/libw32dll/DirectShow/DS_VideoDecoder.c @@ -570,7 +570,7 @@ int DS_VideoDecoder_SetDestFmt(DS_VideoDecoder *this, int bits, unsigned int csp if (result != 0) { if (csp) - printf("Warning: unsupported color space\n"); + printf("Warning: unsupported colour space\n"); else printf("Warning: unsupported bit depth\n"); diff --git a/src/libw32dll/DirectShow/Makefile.am b/src/libw32dll/DirectShow/Makefile.am index a74c65815..02eddc00a 100644 --- a/src/libw32dll/DirectShow/Makefile.am +++ b/src/libw32dll/DirectShow/Makefile.am @@ -1,26 +1,9 @@ include $(top_srcdir)/misc/Makefile.common -AM_CFLAGS = $(X_CFLAGS) -fno-omit-frame-pointer \ - -Wmissing-prototypes -Wimplicit-function-declaration \ - -DWIN32_PATH=\"@w32_path@\" -DNOAVIFILE_HEADERS \ +AM_CFLAGS = $(X_CFLAGS) -fno-omit-frame-pointer +AM_CPPFLAGS = -DWIN32_PATH=\"$(w32_path)\" -DNOAVIFILE_HEADERS \ -I$(srcdir)/.. -I$(srcdir)/../wine -if HAVE_W32DLL -ds_filter_lib = libds_filter.la -endif - -noinst_LTLIBRARIES = $(ds_filter_lib) - -libds_filter_la_SOURCES = \ - allocator.c \ - cmediasample.c \ - guids.c \ - inputpin.c \ - outputpin.c \ - DS_Filter.c \ - DS_AudioDecoder.c \ - DS_VideoDecoder.c - noinst_HEADERS = \ allocator.h \ cmediasample.h \ @@ -32,3 +15,15 @@ noinst_HEADERS = \ DS_AudioDecoder.h \ DS_Filter.h \ DS_VideoDecoder.h + +noinst_LTLIBRARIES = libds_filter.la + +libds_filter_la_SOURCES = \ + allocator.c \ + cmediasample.c \ + guids.c \ + inputpin.c \ + outputpin.c \ + DS_Filter.c \ + DS_AudioDecoder.c \ + DS_VideoDecoder.c diff --git a/src/libw32dll/Makefile.am b/src/libw32dll/Makefile.am index 46027d0f1..26b340524 100644 --- a/src/libw32dll/Makefile.am +++ b/src/libw32dll/Makefile.am @@ -1,38 +1,32 @@ include $(top_srcdir)/misc/Makefile.common -AM_CFLAGS = -I$(srcdir)/wine -DWIN32_PATH=\"@w32_path@\" $(VISIBILITY_FLAG) +AM_CFLAGS = $(DEFAULT_OCFLAGS) $(VISIBILITY_FLAG) +AM_CPPFLAGS = -I$(srcdir)/wine -DWIN32_PATH=\"$(w32_path)\" +AM_LDFLAGS = $(xineplug_ldflags) -SUBDIRS = wine DirectShow dmo qtx - -if HAVE_W32DLL -w32dll_codec = xineplug_decode_w32dll.la -qt_codec = xineplug_decode_qt.la +SUBDIRS = +if ENABLE_W32DLL +SUBDIRS += wine DirectShow dmo qtx endif -libdir = $(XINE_PLUGINDIR) +EXTRA_DIST = common.c -lib_LTLIBRARIES = $(w32dll_codec) $(qt_codec) +noinst_HEADERS = libwin32.h w32codec.h -EXTRA_DIST = common.c +if ENABLE_W32DLL +xineplug_LTLIBRARIES = xineplug_decode_w32dll.la xineplug_decode_qt.la +endif xineplug_decode_w32dll_la_SOURCES = w32codec.c -xineplug_decode_w32dll_la_LDFLAGS = -avoid-version -module +xineplug_decode_w32dll_la_DEPS = $(XDG_BASEDIR_DEPS) xineplug_decode_w32dll_la_LIBADD = \ $(top_builddir)/src/libw32dll/wine/libwine.la \ - $(XINE_LIB) \ - $(PTHREAD_LIBS) \ - -lm \ $(top_builddir)/src/libw32dll/DirectShow/libds_filter.la \ $(top_builddir)/src/libw32dll/dmo/libdmo_filter.la \ - @KSTAT_LIBS@ + $(XINE_LIB) $(PTHREAD_LIBS) $(LTLIBINTL) -lm $(KSTAT_LIBS) $(XDG_BASEDIR_LIBS) +xineplug_decode_w32dll_la_CPPFLAGS = $(AM_CPPFLAGS) $(XDG_BASEDIR_CPPFLAGS) xineplug_decode_qt_la_SOURCES = qt_decoder.c -xineplug_decode_qt_la_LDFLAGS = -avoid-version -module xineplug_decode_qt_la_LIBADD = \ $(top_builddir)/src/libw32dll/wine/libwine.la \ - $(XINE_LIB) \ - $(PTHREAD_LIBS) \ - -lm \ - @KSTAT_LIBS@ - -noinst_HEADERS = libwin32.h w32codec.h + $(XINE_LIB) $(PTHREAD_LIBS) $(LTLIBINTL) -lm $(KSTAT_LIBS) $(XDG_BASEDIR_LIBS) diff --git a/src/libw32dll/dmo/DMO_VideoDecoder.c b/src/libw32dll/dmo/DMO_VideoDecoder.c index 3ad85645a..7b25085f0 100644 --- a/src/libw32dll/dmo/DMO_VideoDecoder.c +++ b/src/libw32dll/dmo/DMO_VideoDecoder.c @@ -524,7 +524,7 @@ int DMO_VideoDecoder_SetDestFmt(DMO_VideoDecoder *this, int bits, unsigned int c if (result != 0) { if (csp) - printf("Warning: unsupported color space\n"); + printf("Warning: unsupported colour space\n"); else printf("Warning: unsupported bit depth\n"); diff --git a/src/libw32dll/dmo/Makefile.am b/src/libw32dll/dmo/Makefile.am index 2b7cd3e37..531a4559a 100644 --- a/src/libw32dll/dmo/Makefile.am +++ b/src/libw32dll/dmo/Makefile.am @@ -1,22 +1,7 @@ include $(top_srcdir)/misc/Makefile.common -AM_CFLAGS = $(X_CFLAGS) -fno-omit-frame-pointer \ - -Wmissing-prototypes -Wimplicit-function-declaration \ - -DWIN32_PATH=\"@w32_path@\" -DNOAVIFILE_HEADERS \ - -I$(srcdir)/.. -I$(srcdir)/../wine - -if HAVE_W32DLL -dmo_filter_lib = libdmo_filter.la -endif - -noinst_LTLIBRARIES = $(dmo_filter_lib) - -libdmo_filter_la_SOURCES = \ - buffer.c \ - DMO_AudioDecoder.c \ - dmo.c \ - dmo_guids.c \ - DMO_VideoDecoder.c +AM_CFLAGS = $(X_CFLAGS) -fno-omit-frame-pointer +AM_CPPFLAGS = -DWIN32_PATH=\"$(w32_path)\" -DNOAVIFILE_HEADERS -I$(srcdir)/.. -I$(srcdir)/../wine noinst_HEADERS = \ DMO_AudioDecoder.h \ @@ -25,3 +10,12 @@ noinst_HEADERS = \ DMO_Filter.h \ dmo.h \ DMO_VideoDecoder.h + +noinst_LTLIBRARIES = libdmo_filter.la + +libdmo_filter_la_SOURCES = \ + buffer.c \ + DMO_AudioDecoder.c \ + dmo.c \ + dmo_guids.c \ + DMO_VideoDecoder.c diff --git a/src/libw32dll/qt_decoder.c b/src/libw32dll/qt_decoder.c index 95a0a79fd..2ef8ebc66 100644 --- a/src/libw32dll/qt_decoder.c +++ b/src/libw32dll/qt_decoder.c @@ -15,9 +15,7 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA - * - * $Id: qt_decoder.c,v 1.45 2006/07/10 22:08:43 dgp85 Exp $ + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA * * quicktime video/audio decoder plugin, using win32 dlls * most of this code comes directly from MPlayer @@ -40,9 +38,9 @@ */ #include "bswap.h" -#include "xine_internal.h" -#include "audio_out.h" -#include "buffer.h" +#include <xine/xine_internal.h> +#include <xine/audio_out.h> +#include <xine/buffer.h> #include "qtx/qtxsdk/components.h" #include "wine/win32.h" @@ -405,7 +403,7 @@ static void qta_init_driver (qta_decoder_t *this, buf_element_t *buf) { this->frame_size = this->wave.nChannels * this->wave.wBitsPerSample / 8; - this->output_open = this->stream->audio_out->open(this->stream->audio_out, + this->output_open = (this->stream->audio_out->open) (this->stream->audio_out, this->stream, this->wave.wBitsPerSample, this->wave.nSamplesPerSec, @@ -571,19 +569,6 @@ static audio_decoder_t *qta_open_plugin (audio_decoder_class_t *class_gen, /* * qta plugin class */ - -static char *qta_get_identifier (audio_decoder_class_t *this) { - return "qta"; -} - -static char *qta_get_description (audio_decoder_class_t *this) { - return "quicktime audio decoder plugin"; -} - -static void qta_dispose_class (audio_decoder_class_t *this) { - free (this); -} - static void *qta_init_class (xine_t *xine, void *data) { qta_class_t *this; @@ -597,14 +582,14 @@ static void *qta_init_class (xine_t *xine, void *data) { this = (qta_class_t *) xine_xmalloc (sizeof (qta_class_t)); this->decoder_class.open_plugin = qta_open_plugin; - this->decoder_class.get_identifier = qta_get_identifier; - this->decoder_class.get_description = qta_get_description; - this->decoder_class.dispose = qta_dispose_class; + this->decoder_class.identifier = "qta"; + this->decoder_class.description = N_("quicktime audio decoder plugin"); + this->decoder_class.dispose = default_audio_decoder_class_dispose; return this; } -static uint32_t audio_types[] = { +static const uint32_t audio_types[] = { BUF_AUDIO_QDESIGN1, BUF_AUDIO_QDESIGN2, BUF_AUDIO_QCLP, @@ -860,20 +845,20 @@ static void qtv_init_driver (qtv_decoder_t *this, buf_element_t *buf) { id=malloc (8+stdata_len) ; /* trak->stdata_len); */ id->idSize = 4+stdata_len; id->cType = FOUR_CHAR_CODE('S','V','Q','3'); - id->version = BE_16 (stdata+0x08); - id->revisionLevel = BE_16 (stdata+0x0C); - id->vendor = BE_32 (stdata+0x10); - id->temporalQuality = BE_32 (stdata+0x14); - id->spatialQuality = BE_32 (stdata+0x18); - id->width = BE_16 (stdata+0x1C); - id->height = BE_16 (stdata+0x1E); - id->hRes = BE_32 (stdata+0x20); - id->vRes = BE_32 (stdata+0x24); - id->dataSize = BE_32 (stdata+0x28); - id->frameCount = BE_16 (stdata+0x2C); + id->version = _X_BE_16 (stdata+0x08); + id->revisionLevel = _X_BE_16 (stdata+0x0C); + id->vendor = _X_BE_32 (stdata+0x10); + id->temporalQuality = _X_BE_32 (stdata+0x14); + id->spatialQuality = _X_BE_32 (stdata+0x18); + id->width = _X_BE_16 (stdata+0x1C); + id->height = _X_BE_16 (stdata+0x1E); + id->hRes = _X_BE_32 (stdata+0x20); + id->vRes = _X_BE_32 (stdata+0x24); + id->dataSize = _X_BE_32 (stdata+0x28); + id->frameCount = _X_BE_16 (stdata+0x2C); memcpy(&id->name,stdata+0x2D,32); - id->depth = BE_16 (stdata+0x4E); - id->clutID = BE_16 (stdata+0x50); + id->depth = _X_BE_16 (stdata+0x4E); + id->clutID = _X_BE_16 (stdata+0x50); if (stdata_len>0x56) memcpy (((char*)&id->clutID)+2, stdata+0x52, stdata_len-0x52); @@ -936,7 +921,7 @@ static void qtv_init_driver (qtv_decoder_t *this, buf_element_t *buf) { this->codec_initialized = 1; - this->stream->video_out->open (this->stream->video_out, this->stream); + (this->stream->video_out->open) (this->stream->video_out, this->stream); pthread_mutex_unlock(&win32_codec_mutex); @@ -1083,18 +1068,6 @@ static video_decoder_t *qtv_open_plugin (video_decoder_class_t *class_gen, * qtv plugin class */ -static char *qtv_get_identifier (video_decoder_class_t *this) { - return "qtvdec"; -} - -static char *qtv_get_description (video_decoder_class_t *this) { - return "quicktime binary-only codec based video decoder plugin"; -} - -static void qtv_dispose_class (video_decoder_class_t *this) { - free (this); -} - /* * some fake functions to make qt codecs happy */ @@ -1121,9 +1094,9 @@ static void *qtv_init_class (xine_t *xine, void *data) { this = (qtv_class_t *) xine_xmalloc (sizeof (qtv_class_t)); this->decoder_class.open_plugin = qtv_open_plugin; - this->decoder_class.get_identifier = qtv_get_identifier; - this->decoder_class.get_description = qtv_get_description; - this->decoder_class.dispose = qtv_dispose_class; + this->decoder_class.identifier = "qtvdec"; + this->decoder_class.description = N_("quicktime binary-only codec based video decoder plugin"); + this->decoder_class.dispose = default_video_decoder_class_dispose; return this; } @@ -1132,7 +1105,7 @@ static void *qtv_init_class (xine_t *xine, void *data) { * exported plugin catalog entry */ -static uint32_t qtv_supported_types[] = { BUF_VIDEO_SORENSON_V3, 0 }; +static const uint32_t qtv_supported_types[] = { BUF_VIDEO_SORENSON_V3, 0 }; static const decoder_info_t qtv_dec_info = { qtv_supported_types, /* supported types */ @@ -1141,7 +1114,7 @@ static const decoder_info_t qtv_dec_info = { const plugin_info_t xine_plugin_info[] EXPORTED = { /* type, API, "name", version, special_info, init_function */ - { PLUGIN_VIDEO_DECODER | PLUGIN_MUST_PRELOAD, 18, "qtv", XINE_VERSION_CODE, &qtv_dec_info, qtv_init_class }, - { PLUGIN_AUDIO_DECODER | PLUGIN_MUST_PRELOAD, 15, "qta", XINE_VERSION_CODE, &qta_dec_info, qta_init_class }, + { PLUGIN_VIDEO_DECODER | PLUGIN_MUST_PRELOAD, 19, "qtv", XINE_VERSION_CODE, &qtv_dec_info, qtv_init_class }, + { PLUGIN_AUDIO_DECODER | PLUGIN_MUST_PRELOAD, 16, "qta", XINE_VERSION_CODE, &qta_dec_info, qta_init_class }, { PLUGIN_NONE, 0, "", 0, NULL, NULL } }; diff --git a/src/libw32dll/w32codec.c b/src/libw32dll/w32codec.c index 99509372e..fb7d3a482 100644 --- a/src/libw32dll/w32codec.c +++ b/src/libw32dll/w32codec.c @@ -15,14 +15,11 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA - * - * $Id: w32codec.c,v 1.155 2006/07/10 22:08:43 dgp85 Exp $ + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA * * routines for using w32 codecs * DirectShow support by Miguel Freitas (Nov/2001) * DMO support (Dez/2002) - * */ #include <stdlib.h> @@ -53,11 +50,11 @@ #define LOG */ -#include "xine_internal.h" -#include "video_out.h" -#include "audio_out.h" -#include "buffer.h" -#include "xineutils.h" +#include <xine/xine_internal.h> +#include <xine/video_out.h> +#include <xine/audio_out.h> +#include <xine/buffer.h> +#include <xine/xineutils.h> #include "common.c" @@ -657,7 +654,7 @@ static void w32v_init_codec (w32v_decoder_t *this, int buf_type) { this->bufsize = VIDEOBUFSIZE; this->buf = malloc(this->bufsize); - this->stream->video_out->open (this->stream->video_out, this->stream); + (this->stream->video_out->open) (this->stream->video_out, this->stream); this->outfmt = outfmt; this->decoder_ok = 1; @@ -752,7 +749,7 @@ static void w32v_init_ds_dmo_codec (w32v_decoder_t *this, int buf_type) { this->bufsize = VIDEOBUFSIZE; this->buf = malloc(this->bufsize); - this->stream->video_out->open (this->stream->video_out, this->stream); + (this->stream->video_out->open) (this->stream->video_out, this->stream); this->outfmt = outfmt; this->decoder_ok = 1; @@ -1181,7 +1178,7 @@ static int w32a_init_audio (w32a_decoder_t *this, if (this->output_open) this->stream->audio_out->close (this->stream->audio_out, this->stream); - this->output_open = this->stream->audio_out->open( this->stream->audio_out, this->stream, + this->output_open = (this->stream->audio_out->open) ( this->stream->audio_out, this->stream, 16, in_fmt->nSamplesPerSec, _x_ao_channels2mode(in_fmt->nChannels)); if (!this->output_open) { @@ -1571,18 +1568,6 @@ static video_decoder_t *open_video_decoder_plugin (video_decoder_class_t *class_ * video decoder class */ -static char *get_video_identifier (video_decoder_class_t *this) { - return "w32v"; -} - -static char *get_video_description (video_decoder_class_t *this) { - return "win32 binary video codec plugin"; -} - -static void dispose_video_class (video_decoder_class_t *this) { - free (this); -} - static void init_routine(void) { pthread_mutex_init (&win32_codec_mutex, NULL); w32v_init_rgb_ycc(); @@ -1599,9 +1584,9 @@ static void *init_video_decoder_class (xine_t *xine, void *data) { this = (w32v_class_t *) xine_xmalloc (sizeof (w32v_class_t)); this->decoder_class.open_plugin = open_video_decoder_plugin; - this->decoder_class.get_identifier = get_video_identifier; - this->decoder_class.get_description = get_video_description; - this->decoder_class.dispose = dispose_video_class; + this->decoder_class.identifier = "w32v"; + this->decoder_class.description = N_("win32 binary video codec plugin"); + this->decoder_class.dispose = default_video_decoder_class_dispose; pthread_once (&once_control, init_routine); @@ -1637,19 +1622,6 @@ static audio_decoder_t *open_audio_decoder_plugin (audio_decoder_class_t *class_ /* * audio decoder plugin class */ - -static char *get_identifier (audio_decoder_class_t *this) { - return "win32 audio"; -} - -static char *get_description (audio_decoder_class_t *this) { - return "win32 binary audio codec plugin"; -} - -static void dispose_class (audio_decoder_class_t *this) { - free (this); -} - static void *init_audio_decoder_class (xine_t *xine, void *data) { w32a_class_t *this; @@ -1661,9 +1633,9 @@ static void *init_audio_decoder_class (xine_t *xine, void *data) { this = (w32a_class_t *) xine_xmalloc (sizeof (w32a_class_t)); this->decoder_class.open_plugin = open_audio_decoder_plugin; - this->decoder_class.get_identifier = get_identifier; - this->decoder_class.get_description = get_description; - this->decoder_class.dispose = dispose_class; + this->decoder_class.identifier = "win32 audio"; + this->decoder_class.description = N_("win32 binary audio codec plugin"); + this->decoder_class.dispose = default_audio_decoder_class_dispose; pthread_once (&once_control, init_routine); @@ -1675,7 +1647,7 @@ static void *init_audio_decoder_class (xine_t *xine, void *data) { * exported plugin catalog entry */ -static uint32_t video_types[] = { +static const uint32_t video_types[] = { BUF_VIDEO_MSMPEG4_V1, BUF_VIDEO_MSMPEG4_V2, BUF_VIDEO_MSMPEG4_V3, BUF_VIDEO_IV50, BUF_VIDEO_IV41, BUF_VIDEO_IV32, BUF_VIDEO_IV31, BUF_VIDEO_CINEPAK, /* BUF_VIDEO_ATIVCR1, */ @@ -1691,7 +1663,7 @@ static const decoder_info_t dec_info_video = { 1 /* priority */ }; -static uint32_t audio_types[] = { +static const uint32_t audio_types[] = { BUF_AUDIO_WMAV1, BUF_AUDIO_WMAV2, BUF_AUDIO_WMAV3, BUF_AUDIO_MSADPCM, BUF_AUDIO_MSIMAADPCM, BUF_AUDIO_MSGSM, BUF_AUDIO_IMC, BUF_AUDIO_LH, BUF_AUDIO_VOXWARE, BUF_AUDIO_ACELPNET, BUF_AUDIO_VIVOG723, BUF_AUDIO_WMAV, @@ -1706,7 +1678,7 @@ static const decoder_info_t dec_info_audio = { const plugin_info_t xine_plugin_info[] EXPORTED = { /* type, API, "name", version, special_info, init_function */ - { PLUGIN_VIDEO_DECODER | PLUGIN_MUST_PRELOAD, 18, "win32v", XINE_VERSION_CODE, &dec_info_video, init_video_decoder_class }, - { PLUGIN_AUDIO_DECODER | PLUGIN_MUST_PRELOAD, 15, "win32a", XINE_VERSION_CODE, &dec_info_audio, init_audio_decoder_class }, + { PLUGIN_VIDEO_DECODER | PLUGIN_MUST_PRELOAD, 19, "win32v", XINE_VERSION_CODE, &dec_info_video, init_video_decoder_class }, + { PLUGIN_AUDIO_DECODER | PLUGIN_MUST_PRELOAD, 16, "win32a", XINE_VERSION_CODE, &dec_info_audio, init_audio_decoder_class }, { PLUGIN_NONE, 0, "", 0, NULL, NULL } }; diff --git a/src/libw32dll/w32codec.h b/src/libw32dll/w32codec.h index 609ed7c90..1f02ba764 100644 --- a/src/libw32dll/w32codec.h +++ b/src/libw32dll/w32codec.h @@ -15,12 +15,9 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA - * - * $Id: w32codec.h,v 1.3 2001/06/10 00:21:53 guenter Exp $ + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA * * routines for using w32 codecs - * */ #include "wine/msacm.h" diff --git a/src/libw32dll/wine/Makefile.am b/src/libw32dll/wine/Makefile.am index 63da4068e..1756e3262 100644 --- a/src/libw32dll/wine/Makefile.am +++ b/src/libw32dll/wine/Makefile.am @@ -1,40 +1,13 @@ include $(top_srcdir)/misc/Makefile.common -LIBTOOL = $(SHELL) $(top_builddir)/libtool - -EXTRA_DIST = stubs.s wrapper.S - -noinst_LTLIBRARIES = $(wine_lib) - -AM_CFLAGS = $(X_CFLAGS) @W32_NO_OPTIMIZE@ \ - -Wmissing-prototypes -Wimplicit-function-declaration \ - -DWIN32_PATH=\"@w32_path@\" -I$(srcdir)/.. -D__WINE__ \ +# disable -fomit-frame-pointer, -finline-functions, and -frename-registers +# because they cause bad behavior of wine +AM_CFLAGS = $(DEFAULT_OCFLAGS) $(X_CFLAGS) @W32_NO_OPTIMIZE@ \ + -fno-omit-frame-pointer -fno-inline-functions -fno-rename-registers +AM_CPPFLAGS = -DWIN32_PATH=\"$(w32_path)\" -I$(srcdir)/.. -D__WINE__ \ -Ddbg_printf=__vprintf -DTRACE=__vprintf -# CFLAGS is here to filter out -fomit-frame-pointer, -# -finline-functions and -frename-registers because they cause bad -# behavior of wine -CFLAGS = `echo @CFLAGS@ | sed -e 's/-fomit-frame-pointer//g;s/-finline-functions//g;s/-frename-registers//g'` - -if HAVE_W32DLL -wine_lib = libwine.la -endif - -libwine_la_SOURCES = \ - afl.c \ - driver.c \ - elfdll.c \ - ext.c \ - ldt_keeper.c \ - module.c \ - pe_image.c \ - pe_resource.c \ - resource.c \ - registry.c \ - vfl.c \ - win32.c \ - stubs.s \ - wrapper.S +EXTRA_DIST = stubs.s wrapper.S noinst_HEADERS = \ avifmt.h \ @@ -74,3 +47,21 @@ noinst_HEADERS = \ winuser.h \ wrapper.h +noinst_LTLIBRARIES = libwine.la + +libwine_la_SOURCES = \ + afl.c \ + driver.c \ + elfdll.c \ + ext.c \ + ldt_keeper.c \ + module.c \ + pe_image.c \ + pe_resource.c \ + resource.c \ + registry.c \ + vfl.c \ + win32.c \ + stubs.s \ + wrapper.S +libwine_la_CPPFLAGS = $(AM_CPPFLAGS) $(XDG_BASEDIR_CPPFLAGS) diff --git a/src/libw32dll/wine/debugtools.h b/src/libw32dll/wine/debugtools.h index 038c05309..c6fac518d 100644 --- a/src/libw32dll/wine/debugtools.h +++ b/src/libw32dll/wine/debugtools.h @@ -8,7 +8,7 @@ #include "config.h" #include "windef.h" -#include "compat.h" +#include <xine/compat.h> struct _GUID; @@ -80,11 +80,7 @@ static inline LPCSTR debugstr_w( LPCWSTR s ) { return debugstr_wn( s, 80 ); } #endif #if 0 /* dbg_printf already defined as a macro */ -#ifdef __GNUC__ -extern int dbg_printf(const char *format, ...) __attribute__((format (printf,1,2))); -#else -extern int dbg_printf(const char *format, ...); -#endif +extern int dbg_printf(const char *format, ...) XINE_FORMAT_PRINTF(1,2); #endif #define TRACE_(X) TRACE diff --git a/src/libw32dll/wine/ext.h b/src/libw32dll/wine/ext.h index 7b284ca79..ad22edc5e 100644 --- a/src/libw32dll/wine/ext.h +++ b/src/libw32dll/wine/ext.h @@ -2,6 +2,7 @@ #define loader_ext_h #include "windef.h" +#include <xine/attributes.h> extern LPVOID FILE_dommap( int unix_handle, LPVOID start, DWORD size_high, DWORD size_low, @@ -9,6 +10,6 @@ extern LPVOID FILE_dommap( int unix_handle, LPVOID start, int prot, int flags ); extern int FILE_munmap( LPVOID start, DWORD size_high, DWORD size_low ); extern int wcsnicmp(const unsigned short* s1, const unsigned short* s2, int n); -extern int __attribute__ ((format (printf, 1, 2))) __vprintf( const char *format, ... ); +extern int XINE_FORMAT_PRINTF(1, 2) __vprintf( const char *format, ... ); #endif diff --git a/src/libw32dll/wine/ldt_keeper.c b/src/libw32dll/wine/ldt_keeper.c index 7f7169b86..39f1e0f49 100644 --- a/src/libw32dll/wine/ldt_keeper.c +++ b/src/libw32dll/wine/ldt_keeper.c @@ -17,8 +17,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA * - * $Id: ldt_keeper.c,v 1.16 2007/03/09 23:49:35 dgp85 Exp $ - * * * contents: * @@ -35,7 +33,6 @@ * Also, IMHO, that was slightly wrong. The TEB is supposed to be unique * per W32 thread. The current xine implementation will allocate different * TEBs for the audio and video codecs. - * */ @@ -81,7 +78,7 @@ int modify_ldt(int func, void *ptr, unsigned long bytecount); } #endif #else -#if defined(__NetBSD__) || defined(__FreeBSD__) || defined(__OpenBSD__) +#if defined(__NetBSD__) || defined(__FreeBSD_kernel__) || defined(__OpenBSD__) #include <machine/segments.h> #include <machine/sysarch.h> #endif @@ -156,7 +153,7 @@ void Setup_FS_Segment(ldt_fs_t *ldt_fs) void Check_FS_Segment(ldt_fs_t *ldt_fs) { -#if defined(__FreeBSD__) && defined(LDT_AUTO_ALLOC) +#if defined(__FreeBSD_kernel__) && defined(LDT_AUTO_ALLOC) int fs; __asm__ __volatile__( "movw %%fs,%%ax; mov %%eax,%0" : "=r" (fs) :: "%eax" @@ -174,7 +171,7 @@ void Check_FS_Segment(ldt_fs_t *ldt_fs) #endif } -#if defined(__NetBSD__) || defined(__FreeBSD__) || defined(__OpenBSD__) +#if defined(__NetBSD__) || defined(__FreeBSD_kernel__) || defined(__OpenBSD__) static void LDT_EntryToBytes( unsigned long *buffer, const struct modify_ldt_ldt_s *content ) { *buffer++ = ((content->base_addr & 0x0000ffff) << 16) | @@ -205,12 +202,12 @@ static int _modify_ldt(ldt_fs_t *ldt_fs, struct modify_ldt_ldt_s array) } #endif /*linux*/ -#if defined(__NetBSD__) || defined(__FreeBSD__) || defined(__OpenBSD__) +#if defined(__NetBSD__) || defined(__FreeBSD_kernel__) || defined(__OpenBSD__) { unsigned long d[2]; LDT_EntryToBytes( d, &array ); -#if defined(__FreeBSD__) && defined(LDT_AUTO_ALLOC) +#if defined(__FreeBSD_kernel__) && defined(LDT_AUTO_ALLOC) ret = i386_set_ldt(LDT_AUTO_ALLOC, (union descriptor *)d, 1); array.entry_number = ret; ldt_fs->teb_sel = LDT_SEL(ret); diff --git a/src/libw32dll/wine/pe_image.c b/src/libw32dll/wine/pe_image.c index aa29098c1..c99bbaed0 100644 --- a/src/libw32dll/wine/pe_image.c +++ b/src/libw32dll/wine/pe_image.c @@ -1,6 +1,6 @@ /* * Copyright 1994 Eric Youndale & Erik Bos - * Copyright 1995 Martin von Löwis + * Copyright 1995 Martin von Löwis * Copyright 1996-98 Marcus Meissner * * based on Eric Youndale's pe-test and: diff --git a/src/libw32dll/wine/registry.c b/src/libw32dll/wine/registry.c index 0f91499b3..20c21888d 100644 --- a/src/libw32dll/wine/registry.c +++ b/src/libw32dll/wine/registry.c @@ -18,7 +18,8 @@ #include "debugtools.h" #ifdef XINE_MAJOR -#include "xineutils.h" +#include <xine/xineutils.h> +#include <basedir.h> #endif //#undef TRACE @@ -302,44 +303,22 @@ static struct reg_value* insert_reg_value(int handle, const char* name, int type static void init_registry(void) { + xdgHandle tmph = xdgAllocHandle(); + const char *const xdg_cache_home = xdgCacheHome(tmph); + TRACE("Initializing registry\n"); // can't be free-ed - it's static and probably thread // unsafe structure which is stored in glibc -#ifdef MPLAYER - regpathname = get_path("registry"); - localregpathname = regpathname; -#else -#ifdef XINE_MAJOR - localregpathname = (char *)malloc(strlen(xine_get_homedir()) + 21); - sprintf(localregpathname, "%s/.xine/win32registry", xine_get_homedir()); -#else - // regpathname is an external pointer - // - // registry.c is holding it's own internal pointer - // localregpathname - which is being allocate/deallocated - - if (localregpathname == 0) - { - const char* pthn = regpathname; - if (!regpathname) - { - // avifile - for now reading data from user's home - struct passwd* pwent; - pwent = getpwuid(geteuid()); - pthn = pwent->pw_dir; - } - - localregpathname = (char*)malloc(strlen(pthn)+20); - strcpy(localregpathname, pthn); - strcat(localregpathname, "/.registry"); - } -#endif -#endif + localregpathname = malloc(strlen(xdg_cache_home) + sizeof("/"PACKAGE"/win32registry")); + strcpy(localregpathname, xdg_cache_home); + strcat(localregpathname, "/"PACKAGE"/win32registry"); open_registry(); insert_handle(HKEY_LOCAL_MACHINE, "HKLM"); insert_handle(HKEY_CURRENT_USER, "HKCU"); + + xdgFreeHandle(tmph); } #if 0 diff --git a/src/libw32dll/wine/win32.c b/src/libw32dll/wine/win32.c index 4fe1956b7..01a287c31 100644 --- a/src/libw32dll/wine/win32.c +++ b/src/libw32dll/wine/win32.c @@ -12,6 +12,7 @@ for DLL to know too much about its environment. ************************************************************/ #include "config.h" +#include <xine/attributes.h> #define QTX @@ -183,7 +184,7 @@ static void longcount_stub(long long* z) int LOADER_DEBUG=1; // active only if compiled with -DDETAILED_OUT //#define DETAILED_OUT -static inline void __attribute__((__format__(__printf__, 1, 2))) dbgprintf(char* fmt, ...) +static inline void XINE_FORMAT_PRINTF(1, 2) dbgprintf(char* fmt, ...) { #ifdef DETAILED_OUT if(LOADER_DEBUG) @@ -893,7 +894,7 @@ static void WINAPI expGetSystemInfo(SYSTEM_INFO* si) /* FIXME: better values for the two entries below... */ static int cache = 0; static SYSTEM_INFO cachedsi; -#if defined(__FreeBSD__) || defined(__NetBSD__) || defined(__svr4__) +#if defined(__FreeBSD_kernel__) || defined(__NetBSD__) || defined(__svr4__) unsigned int regs[4]; #endif dbgprintf("GetSystemInfo(%p) =>\n", si); @@ -957,7 +958,7 @@ static void WINAPI expGetSystemInfo(SYSTEM_INFO* si) /* disable cpuid based detection (mplayer's cpudetect.c does this - see above) */ #ifndef MPLAYER -#if defined(__FreeBSD__) || defined(__NetBSD__) || defined(__svr4__) +#if defined(__FreeBSD_kernel__) || defined(__NetBSD__) || defined(__svr4__) do_cpuid(1, regs); switch ((regs[0] >> 8) & 0xf) { // cpu family case 3: cachedsi.dwProcessorType = PROCESSOR_INTEL_386; @@ -3036,9 +3037,9 @@ static int WINAPI expGetSystemPaletteEntries(int hdc, int iStartIndex, int nEntr static int WINAPI expGetTimeZoneInformation(LPTIME_ZONE_INFORMATION lpTimeZoneInformation) { - const short name[]={'C', 'e', 'n', 't', 'r', 'a', 'l', ' ', 'S', 't', 'a', + static const short name[]={'C', 'e', 'n', 't', 'r', 'a', 'l', ' ', 'S', 't', 'a', 'n', 'd', 'a', 'r', 'd', ' ', 'T', 'i', 'm', 'e', 0}; - const short pname[]={'C', 'e', 'n', 't', 'r', 'a', 'l', ' ', 'D', 'a', 'y', + static const short pname[]={'C', 'e', 'n', 't', 'r', 'a', 'l', ' ', 'D', 'a', 'y', 'l', 'i', 'g', 'h', 't', ' ', 'T', 'i', 'm', 'e', 0}; dbgprintf("GetTimeZoneInformation(%p) => TIME_ZONE_ID_STANDARD\n", lpTimeZoneInformation); memset(lpTimeZoneInformation, 0, sizeof(TIME_ZONE_INFORMATION)); @@ -3976,7 +3977,7 @@ static void* exp__dllonexit() return NULL; } -static int __attribute__((__format__(__printf__, 2, 3))) expwsprintfA(char* string, char* format, ...) +static int XINE_FORMAT_PRINTF(2, 3) expwsprintfA(char* string, char* format, ...) { va_list va; int result; @@ -3987,7 +3988,7 @@ static int __attribute__((__format__(__printf__, 2, 3))) expwsprintfA(char* stri return result; } -static int __attribute__((__format__(__printf__, 2, 3))) expsprintf(char* str, const char* format, ...) +static int XINE_FORMAT_PRINTF(2, 3) expsprintf(char* str, const char* format, ...) { va_list args; int r; @@ -3997,7 +3998,7 @@ static int __attribute__((__format__(__printf__, 2, 3))) expsprintf(char* str, c va_end(args); return r; } -static int __attribute__((__format__(__printf__, 2, 3))) expsscanf(const char* str, const char* format, ...) +static int XINE_FORMAT_PRINTF(2, 3) expsscanf(const char* str, const char* format, ...) { va_list args; int r; @@ -4013,7 +4014,7 @@ static void* expfopen(const char* path, const char* mode) //return fopen(path, mode); return fdopen(0, mode); // everything on screen } -static int __attribute__((__format__(__printf__, 2, 3)))expfprintf(void* stream, const char* format, ...) +static int XINE_FORMAT_PRINTF(2, 3)expfprintf(void* stream, const char* format, ...) { va_list args; int r = 0; @@ -4026,7 +4027,7 @@ static int __attribute__((__format__(__printf__, 2, 3)))expfprintf(void* stream, return r; } -static int __attribute__((__format__(__printf__, 1, 2))) expprintf(const char* format, ...) +static int XINE_FORMAT_PRINTF(1, 2) expprintf(const char* format, ...) { va_list args; int r; diff --git a/src/libw32dll/wine/windef.h b/src/libw32dll/wine/windef.h index e7f691a02..b86f2f740 100644 --- a/src/libw32dll/wine/windef.h +++ b/src/libw32dll/wine/windef.h @@ -7,8 +7,9 @@ #ifndef __WINE_WINDEF_H #define __WINE_WINDEF_H +#include "config.h" + #ifdef __WINE__ -# include "config.h" # undef UNICODE #endif @@ -493,14 +494,14 @@ typedef LRESULT CALLBACK (*WNDPROC16)(HWND16,UINT16,WPARAM16,LPARAM); /* Macro for structure packing. */ +#define WINE_PACKED XINE_PACKED + #if defined(__GNUC__) || defined(__ICC) #ifndef _EGCS_ -#define WINE_PACKED __attribute__((packed)) #define WINE_UNUSED __attribute__((unused)) #define WINE_NORETURN __attribute__((noreturn)) #endif #else -#define WINE_PACKED /* nothing */ #define WINE_UNUSED /* nothing */ #define WINE_NORETURN /* nothing */ #endif |