summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGuenter Bartsch <guenter@users.sourceforge.net>2003-04-20 21:13:21 +0000
committerGuenter Bartsch <guenter@users.sourceforge.net>2003-04-20 21:13:21 +0000
commitfeacf7fa8788c911b241385e40c631362af50395 (patch)
tree20491c9acd09fc0240ba7e349dbebd343a7fafc4
parent5031bfdd4c2a17d09804e99447d4f9cbae81a7b8 (diff)
downloadxine-lib-feacf7fa8788c911b241385e40c631362af50395.tar.gz
xine-lib-feacf7fa8788c911b241385e40c631362af50395.tar.bz2
merging in win32 port
CVS patchset: 4643 CVS date: 2003/04/20 21:13:21
-rw-r--r--src/xine-engine/audio_out.c35
-rw-r--r--src/xine-engine/configfile.h25
-rw-r--r--src/xine-engine/load_plugins.c22
-rw-r--r--src/xine-engine/metronom.h57
-rw-r--r--src/xine-engine/osd.c17
-rw-r--r--src/xine-engine/video_out.h63
-rw-r--r--src/xine-engine/vo_scale.h18
-rw-r--r--src/xine-utils/compat.h10
-rw-r--r--src/xine-utils/cpu_accel.c8
-rw-r--r--src/xine-utils/memcpy.c30
-rw-r--r--src/xine-utils/utils.c8
-rw-r--r--src/xine-utils/xineutils.h39
12 files changed, 243 insertions, 89 deletions
diff --git a/src/xine-engine/audio_out.c b/src/xine-engine/audio_out.c
index bd19095b4..9a58c159f 100644
--- a/src/xine-engine/audio_out.c
+++ b/src/xine-engine/audio_out.c
@@ -17,7 +17,7 @@
* along with self program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*
- * $Id: audio_out.c,v 1.121 2003/04/18 20:04:28 guenter Exp $
+ * $Id: audio_out.c,v 1.122 2003/04/20 21:13:21 guenter Exp $
*
* 22-8-2001 James imported some useful AC3 sections from the previous alsa driver.
* (c) 2001 Andy Lo A Foe <andy@alsaplayer.org>
@@ -412,8 +412,13 @@ static void ao_fill_gap (aos_t *this, int64_t pts_len) {
num_frames = pts_len * this->frames_per_kpts / 1024;
if (this->xine->verbosity >= XINE_VERBOSITY_LOG)
+#ifndef _MSC_VER
printf ("audio_out: inserting %d 0-frames to fill a gap of %lld pts\n",
num_frames, pts_len);
+#else
+ printf ("audio_out: inserting %d 0-frames to fill a gap of %I64d pts\n",
+ num_frames, pts_len);
+#endif /* _MSC_VER */
if ((this->output.mode == AO_CAP_MODE_A52) || (this->output.mode == AO_CAP_MODE_AC5)) {
write_pause_burst(this,num_frames);
@@ -782,7 +787,11 @@ static int resample_rate_adjust(aos_t *this, int64_t gap, audio_buffer_t *buf) {
info->reduce_gap = 1;
this->resample_sync_factor = (avg_gap < 0) ? 0.995 : 1.005;
#ifdef LOG_RESAMPLE_SYNC
+#ifndef _MSC_VER
printf("audio_out: sample rate adjusted to reduce gap: gap=%lld\n", avg_gap);
+#else
+ printf("audio_out: sample rate adjusted to reduce gap: gap=%I64d\n", avg_gap);
+#endif /* _MSC_VER */
#endif
return 0;
@@ -824,7 +833,11 @@ static int resample_rate_adjust(aos_t *this, int64_t gap, audio_buffer_t *buf) {
this->resample_sync_factor);
#endif
/* we want to add factor * num_frames to each buffer */
+#ifdef _MSC_VER
+ factor = (int64_t)gap_diff / (int64_t)info->window_duration + info->last_factor;
+#else
factor = (double)gap_diff / (double)info->window_duration + info->last_factor;
+#endif /* _MSC_VER */
info->last_factor = factor;
this->resample_sync_factor = 1.0 + factor;
@@ -967,8 +980,13 @@ static void *ao_loop (void *this_gen) {
hw_vpts = cur_time;
#ifdef LOG
+#ifndef _MSC_VER
printf ("audio_out: current delay is %lld, current time is %lld\n",
delay, cur_time);
+#else
+ printf ("audio_out: current delay is %I64d, current time is %I64d\n",
+ delay, cur_time);
+#endif /* _MSC_VER */
#endif
/* External A52 decoder delay correction */
if ((this->output.mode==AO_CAP_MODE_A52) || (this->output.mode==AO_CAP_MODE_AC5))
@@ -982,8 +1000,13 @@ static void *ao_loop (void *this_gen) {
*/
gap = in_buf->vpts - hw_vpts;
#ifdef LOG
+#ifndef _MSC_VER
printf ("audio_out: hw_vpts : %lld buffer_vpts : %lld gap : %lld\n",
hw_vpts, in_buf->vpts, gap);
+#else
+ printf ("audio_out: hw_vpts : %I64d buffer_vpts : %I64d gap : %I64d\n",
+ hw_vpts, in_buf->vpts, gap);
+#endif /* _MSC_VER */
#endif
if (this->resample_sync_method) {
@@ -1011,8 +1034,13 @@ static void *ao_loop (void *this_gen) {
fifo_append (this->free_fifo, in_buf);
#ifdef LOG
+#ifndef _MSC_VER
printf ("audio_out: audio package (vpts = %lld, gap = %lld) dropped\n",
in_buf->vpts, gap);
+#else
+ printf ("audio_out: audio package (vpts = %I64d, gap = %I64d) dropped\n",
+ in_buf->vpts, gap);
+#endif /* _MSC_VER */
#endif
in_buf = NULL;
@@ -1350,8 +1378,13 @@ static void ao_put_buffer (xine_audio_port_t *this_gen,
buf->extra_info->vpts = buf->vpts;
#ifdef LOG
+#ifndef _MSC_VER
printf ("audio_out: ao_put_buffer, pts=%lld, vpts=%lld, flushmode=%d\n",
pts, buf->vpts, this->discard_buffers);
+#else
+ printf ("audio_out: ao_put_buffer, pts=%I64d, vpts=%I64d, flushmode=%d\n",
+ pts, buf->vpts, this->discard_buffers);
+#endif /* _MSC_VER */
#endif
if (!this->discard_buffers)
diff --git a/src/xine-engine/configfile.h b/src/xine-engine/configfile.h
index 1df406037..f89f0d682 100644
--- a/src/xine-engine/configfile.h
+++ b/src/xine-engine/configfile.h
@@ -17,11 +17,14 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*
- * $Id: configfile.h,v 1.19 2002/10/26 03:56:32 storri Exp $
+ * $Id: configfile.h,v 1.20 2003/04/20 21:13:22 guenter Exp $
*
* config file management
*
*/
+/* For the _MSC_VER (Win32) port the "this" variable
+ * was removed from all prototypes.and changed to "cfg"
+ */
#ifndef HAVE_CONFIGFILE_H
#define HAVE_CONFIGFILE_H
@@ -99,7 +102,7 @@ struct config_values_s {
* from the config file otherwise
*/
- char* (*register_string) (config_values_t *this,
+ char* (*register_string) (config_values_t *,
const char *key,
const char *def_value,
const char *description,
@@ -108,7 +111,7 @@ struct config_values_s {
xine_config_cb_t changed_cb,
void *cb_data);
- int (*register_range) (config_values_t *this,
+ int (*register_range) (config_values_t *,
const char *key,
int def_value,
int min, int max,
@@ -118,7 +121,7 @@ struct config_values_s {
xine_config_cb_t changed_cb,
void *cb_data);
- int (*register_enum) (config_values_t *this,
+ int (*register_enum) (config_values_t *,
const char *key,
int def_value,
char **values,
@@ -128,7 +131,7 @@ struct config_values_s {
xine_config_cb_t changed_cb,
void *cb_data);
- int (*register_num) (config_values_t *this,
+ int (*register_num) (config_values_t *,
const char *key,
int def_value,
const char *description,
@@ -137,7 +140,7 @@ struct config_values_s {
xine_config_cb_t changed_cb,
void *cb_data);
- int (*register_bool) (config_values_t *this,
+ int (*register_bool) (config_values_t *,
const char *key,
int def_value,
const char *description,
@@ -147,10 +150,10 @@ struct config_values_s {
void *cb_data);
/* convenience function to update range, enum, num and bool values */
- void (*update_num) (config_values_t *this, const char *key, int value);
+ void (*update_num) (config_values_t *, const char *key, int value);
/* convenience function to update string values */
- void (*update_string) (config_values_t *this, const char *key, const char *value);
+ void (*update_string) (config_values_t *, const char *key, const char *value);
/* small utility function for enum handling */
int (*parse_enum) (const char *str, char **values);
@@ -162,17 +165,17 @@ struct config_values_s {
* and you changed the value of this item
*/
- cfg_entry_t* (*lookup_entry) (config_values_t *this, const char *key);
+ cfg_entry_t* (*lookup_entry) (config_values_t *, const char *key);
/*
* unregister callback function
*/
- void (*unregister_callback) (config_values_t *this, const char *key);
+ void (*unregister_callback) (config_values_t *, const char *key);
/*
* dispose of all config entries in memory
*/
- void (*dispose) (config_values_t *this);
+ void (*dispose) (config_values_t *);
/*
* config values are stored here:
diff --git a/src/xine-engine/load_plugins.c b/src/xine-engine/load_plugins.c
index cd96eb4b0..cfb3af0f7 100644
--- a/src/xine-engine/load_plugins.c
+++ b/src/xine-engine/load_plugins.c
@@ -17,7 +17,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*
- * $Id: load_plugins.c,v 1.147 2003/04/17 19:01:23 miguelfreitas Exp $
+ * $Id: load_plugins.c,v 1.148 2003/04/20 21:13:22 guenter Exp $
*
*
* Load input/demux/audio_out/video_out/codec plugins
@@ -513,8 +513,14 @@ static void save_plugin_list(FILE *fp, xine_list_t *plugins) {
while (node) {
fprintf(fp, "[%s]\n", node->filename );
+
+#ifndef _MSC_VER
fprintf(fp, "size=%llu\n", (unsigned long long) node->filesize );
fprintf(fp, "mtime=%llu\n", (unsigned long long) node->filemtime );
+#else
+ fprintf(fp, "size=%llu\n", (uint64_t) node->filesize );
+ fprintf(fp, "mtime=%llu\n", (uint64_t) node->filemtime );
+#endif /* _MSC_VER */
fprintf(fp, "type=%d\n", node->info->type );
fprintf(fp, "api=%d\n", node->info->API );
@@ -568,7 +574,13 @@ static void load_plugin_list(FILE *fp, xine_list_t *plugins) {
ao_info_t *ao_info = NULL;
post_info_t *post_info = NULL;
int i;
+
+#ifndef _MSC_VER
unsigned long long llu;
+#else
+ uint64_t llu;
+#endif /* _MSC_VER */
+
unsigned long lu;
char line[1024];
char *value;
@@ -929,18 +941,26 @@ void scan_plugins (xine_t *this) {
#ifdef LOG
printf("load_plugins: scan_plugins()\n");
#endif
+
+/* TODO - This needs to be fixed for WIN32 */
+#ifndef WIN32
if (this == NULL || this->config == NULL) {
fprintf(stderr, "%s(%s@%d): parameter should be non null, exiting\n",
__FILE__, __XINE_FUNCTION__, __LINE__);
abort();
}
+#endif
homedir = xine_get_homedir();
this->plugin_catalog = _new_catalog();
load_cached_catalog (this);
if ( !(pluginpath = getenv("XINE_PLUGIN_PATH")) ){
+#ifndef _MSC_VER
pluginpath = "~/.xine/plugins:" XINE_PLUGINDIR;
+#else
+ pluginpath = XINE_PLUGINDIR;
+#endif
}
plugindir = xine_xmalloc(strlen(pluginpath)+strlen(homedir)+2);
j=0;
diff --git a/src/xine-engine/metronom.h b/src/xine-engine/metronom.h
index 79129fbc9..9dd5b946d 100644
--- a/src/xine-engine/metronom.h
+++ b/src/xine-engine/metronom.h
@@ -17,7 +17,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*
- * $Id: metronom.h,v 1.44 2003/03/27 18:57:08 miguelfreitas Exp $
+ * $Id: metronom.h,v 1.45 2003/04/20 21:13:23 guenter Exp $
*
* metronom: general pts => virtual calculation/assoc
*
@@ -39,6 +39,9 @@
* encoded streams.
*
*/
+/* For the _MSC_VER (Win32) port the "this" variable
+ * was removed from all prototypes.and changed to "met"
+ */
#ifndef HAVE_METRONOM_H
#define HAVE_METRONOM_H
@@ -79,7 +82,7 @@ struct metronom_s {
*
* parameter pts_per_smpls : 1/90000 sec per 65536 samples
*/
- void (*set_audio_rate) (metronom_t *this, int64_t pts_per_smpls);
+ void (*set_audio_rate) (metronom_t *, int64_t pts_per_smpls);
/*
* called by video output driver for *every* frame
@@ -93,7 +96,7 @@ struct metronom_s {
*
*/
- void (*got_video_frame) (metronom_t *this, vo_frame_t *frame);
+ void (*got_video_frame) (metronom_t *, vo_frame_t *frame);
/*
* called by audio output driver whenever audio samples are delivered to it
@@ -108,7 +111,7 @@ struct metronom_s {
*
*/
- int64_t (*got_audio_samples) (metronom_t *this, int64_t pts,
+ int64_t (*got_audio_samples) (metronom_t *, int64_t pts,
int nsamples);
/*
@@ -121,7 +124,7 @@ struct metronom_s {
* due to the lack of regularity on spu packets)
*/
- int64_t (*got_spu_packet) (metronom_t *this, int64_t pts);
+ int64_t (*got_spu_packet) (metronom_t *, int64_t pts);
/*
* tell metronom about discontinuities.
@@ -151,16 +154,16 @@ struct metronom_s {
* just switch to the new disc_offset and resume synced operation.
*
*/
- void (*handle_audio_discontinuity) (metronom_t *this, int type, int64_t disc_off);
- void (*handle_video_discontinuity) (metronom_t *this, int type, int64_t disc_off);
+ void (*handle_audio_discontinuity) (metronom_t *, int type, int64_t disc_off);
+ void (*handle_video_discontinuity) (metronom_t *, int type, int64_t disc_off);
/*
* set/get options for metronom, constants see below
*/
- void (*set_option) (metronom_t *this, int option, int64_t value);
- int64_t (*get_option) (metronom_t *this, int option);
+ void (*set_option) (metronom_t *, int option, int64_t value);
+ int64_t (*get_option) (metronom_t *, int option);
- void (*exit) (metronom_t *this);
+ void (*exit) (metronom_t *);
/*
* pointer to current xine stream object.
@@ -225,8 +228,8 @@ struct metronom_clock_s {
/*
* set/get options for clock, constants see below
*/
- void (*set_option) (metronom_clock_t *this, int option, int64_t value);
- int64_t (*get_option) (metronom_clock_t *this, int option);
+ void (*set_option) (metronom_clock_t *, int option, int64_t value);
+ int64_t (*get_option) (metronom_clock_t *, int option);
/*
* system clock reference (SCR) functions
@@ -236,31 +239,31 @@ struct metronom_clock_s {
* start clock (no clock reset)
* at given pts
*/
- void (*start_clock) (metronom_clock_t *this, int64_t pts);
+ void (*start_clock) (metronom_clock_t *, int64_t pts);
/*
* stop metronom clock
*/
- void (*stop_clock) (metronom_clock_t *this);
+ void (*stop_clock) (metronom_clock_t *);
/*
* resume clock from where it was stopped
*/
- void (*resume_clock) (metronom_clock_t *this);
+ void (*resume_clock) (metronom_clock_t *);
/*
* get current clock value in vpts
*/
- int64_t (*get_current_time) (metronom_clock_t *this);
+ int64_t (*get_current_time) (metronom_clock_t *);
/*
* adjust master clock to external timer (e.g. audio hardware)
*/
- void (*adjust_clock) (metronom_clock_t *this, int64_t desired_pts);
+ void (*adjust_clock) (metronom_clock_t *, int64_t desired_pts);
/*
@@ -268,15 +271,15 @@ struct metronom_clock_s {
* for constants see xine_internal.h
*/
- int (*set_speed) (metronom_clock_t *this, int speed);
+ int (*set_speed) (metronom_clock_t *, int speed);
/*
* (un)register a System Clock Reference provider at the metronom
*/
- int (*register_scr) (metronom_clock_t *this, scr_plugin_t *scr);
- void (*unregister_scr) (metronom_clock_t *this, scr_plugin_t *scr);
+ int (*register_scr) (metronom_clock_t *, scr_plugin_t *scr);
+ void (*unregister_scr) (metronom_clock_t *, scr_plugin_t *scr);
- void (*exit) (metronom_clock_t *this);
+ void (*exit) (metronom_clock_t *);
scr_plugin_t* scr_master;
scr_plugin_t** scr_list;
@@ -307,7 +310,7 @@ struct scr_plugin_s
{
int interface_version;
- int (*get_priority) (scr_plugin_t *this);
+ int (*get_priority) (scr_plugin_t *);
/*
* set/get clock speed
@@ -316,15 +319,15 @@ struct scr_plugin_s
* returns actual speed
*/
- int (*set_speed) (scr_plugin_t *this, int speed);
+ int (*set_speed) (scr_plugin_t *, int speed);
- void (*adjust) (scr_plugin_t *this, int64_t vpts);
+ void (*adjust) (scr_plugin_t *, int64_t vpts);
- void (*start) (scr_plugin_t *this, int64_t start_vpts);
+ void (*start) (scr_plugin_t *, int64_t start_vpts);
- int64_t (*get_current) (scr_plugin_t *this);
+ int64_t (*get_current) (scr_plugin_t *);
- void (*exit) (scr_plugin_t *this);
+ void (*exit) (scr_plugin_t *);
metronom_clock_t *clock;
};
diff --git a/src/xine-engine/osd.c b/src/xine-engine/osd.c
index 6c78c9344..3e6cb230a 100644
--- a/src/xine-engine/osd.c
+++ b/src/xine-engine/osd.c
@@ -33,7 +33,10 @@
#include <sys/types.h>
#include <dirent.h>
#include <errno.h>
+
+#ifndef _MSC_VER
#include <iconv.h>
+#endif /* _MSC_VER */
#ifdef HAVE_LANGINFO_CODESET
#include <langinfo.h>
@@ -728,12 +731,15 @@ static int osd_render_text (osd_object_t *osd, int x1, int y1,
osd_font_t *font;
int i, y;
uint8_t *dst, *src;
- iconv_t cd;
char *inbuf;
uint16_t unicode;
size_t inbytesleft;
int def_charset_flag = 0;
+#ifndef _MSC_VER
+ iconv_t cd;
+#endif /* _MSC_VER */
+
#ifdef LOG_DEBUG
printf("osd_render_text %p (%d,%d) \"%s\"\n", osd, x1, y1, text);
#endif
@@ -780,6 +786,7 @@ static int osd_render_text (osd_object_t *osd, int x1, int y1,
#endif
}
+#ifndef _MSC_VER
/* prepare conversion to UCS-2 */
if ((cd = iconv_open("UCS-2", encoding)) == (iconv_t)-1) {
printf(_("osd: unsupported conversion %s -> UCS-2\n"), encoding);
@@ -792,12 +799,14 @@ static int osd_render_text (osd_object_t *osd, int x1, int y1,
}
}
}
+#endif /* _MSC_VER */
while( inbytesleft ) {
char *outbuf = (char*)&unicode;
size_t outbytesleft = 2;
size_t count;
+#ifndef _MSC_VER
/* get unicode value */
count = iconv(cd, &inbuf, &inbytesleft, &outbuf, &outbytesleft);
if (count == (size_t)-1 && errno != E2BIG) {
@@ -809,6 +818,7 @@ static int osd_render_text (osd_object_t *osd, int x1, int y1,
inbuf++;
unicode = ALIAS_CHARACTER;
}
+#endif /* _MSC_VER */
#ifdef HAVE_FT2
if (osd->ft2 && osd->ft2->useme) {
@@ -907,8 +917,11 @@ static int osd_render_text (osd_object_t *osd, int x1, int y1,
#endif
}
+
+#ifndef _MSC_VER
iconv_close(cd);
-
+#endif /* _MSC_VER */
+
pthread_mutex_unlock (&this->osd_mutex);
return 1;
diff --git a/src/xine-engine/video_out.h b/src/xine-engine/video_out.h
index 64bc438ad..1c06eb75e 100644
--- a/src/xine-engine/video_out.h
+++ b/src/xine-engine/video_out.h
@@ -17,7 +17,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*
- * $Id: video_out.h,v 1.83 2003/02/07 17:28:12 mroi Exp $
+ * $Id: video_out.h,v 1.84 2003/04/20 21:13:25 guenter Exp $
*
*
* xine version of video_out.h
@@ -31,6 +31,9 @@
* a vo_driver for output
*
*/
+/* For the _MSC_VER (Win32) port the "this" variable
+ * was removed from all prototypes.and changed to "met"
+ */
#ifndef HAVE_VIDEO_OUT_H
#define HAVE_VIDEO_OUT_H
@@ -148,10 +151,10 @@ struct vo_frame_s {
*/
struct xine_video_port_s {
- uint32_t (*get_capabilities) (xine_video_port_t *this); /* for constants see below */
+ uint32_t (*get_capabilities) (xine_video_port_t *); /* for constants see below */
/* open display driver for video output */
- void (*open) (xine_video_port_t *this, xine_stream_t *stream);
+ void (*open) (xine_video_port_t *, xine_stream_t *stream);
/*
* get_frame - allocate an image buffer from display driver
@@ -162,36 +165,36 @@ struct xine_video_port_s {
* format == FOURCC descriptor of image format
* flags == field/prediction flags
*/
- vo_frame_t* (*get_frame) (xine_video_port_t *this, uint32_t width,
+ vo_frame_t* (*get_frame) (xine_video_port_t *, uint32_t width,
uint32_t height, int ratio_code,
int format, int flags);
- vo_frame_t* (*get_last_frame) (xine_video_port_t *this);
+ vo_frame_t* (*get_last_frame) (xine_video_port_t *);
/* overlay stuff */
- void (*enable_ovl) (xine_video_port_t *this, int ovl_enable);
+ void (*enable_ovl) (xine_video_port_t *, int ovl_enable);
/* video driver is no longer used by decoder => close */
- void (*close) (xine_video_port_t *this, xine_stream_t *stream);
+ void (*close) (xine_video_port_t *, xine_stream_t *stream);
/* called on xine exit */
- void (*exit) (xine_video_port_t *this);
+ void (*exit) (xine_video_port_t *);
/* get overlay instance (overlay source) */
- video_overlay_instance_t* (*get_overlay_instance) (xine_video_port_t *this);
+ video_overlay_instance_t* (*get_overlay_instance) (xine_video_port_t *);
/* flush video_out fifo */
- void (*flush) (xine_video_port_t *this);
+ void (*flush) (xine_video_port_t *);
/* * Get/Set video property
*
* See VO_PROP_* bellow
*/
- int (*get_property) (xine_video_port_t *this, int property);
- int (*set_property) (xine_video_port_t *this, int property, int value);
+ int (*get_property) (xine_video_port_t *, int property);
+ int (*set_property) (xine_video_port_t *, int property, int value);
/* return true if port is opened for this stream */
- int (*status) (xine_video_port_t *this, xine_stream_t *stream,
+ int (*status) (xine_video_port_t *, xine_stream_t *stream,
int *width, int *height, int64_t *img_duration);
/* the driver in use */
@@ -279,25 +282,25 @@ struct xine_video_port_s {
struct vo_driver_s {
- uint32_t (*get_capabilities) (vo_driver_t *this); /* for constants see above */
+ uint32_t (*get_capabilities) (vo_driver_t *); /* for constants see above */
/*
* allocate an vo_frame_t struct,
* the driver must supply the copy, field and dispose functions
*/
- vo_frame_t* (*alloc_frame) (vo_driver_t *this);
+ vo_frame_t* (*alloc_frame) (vo_driver_t *);
/*
* check if the given image fullfills the format specified
* (re-)allocate memory if necessary
*/
- void (*update_frame_format) (vo_driver_t *this, vo_frame_t *img,
+ void (*update_frame_format) (vo_driver_t *, vo_frame_t *img,
uint32_t width, uint32_t height,
int ratio_code, int format, int flags);
/* display a given frame */
- void (*display_frame) (vo_driver_t *this, vo_frame_t *vo_img);
+ void (*display_frame) (vo_driver_t *, vo_frame_t *vo_img);
/* overlay_begin and overlay_end are used by drivers suporting
* persistent overlays. they can be optimized to update only when
@@ -311,18 +314,18 @@ struct vo_driver_s {
*
* any function pointer from this group may be set to NULL.
*/
- void (*overlay_begin) (vo_driver_t *this, vo_frame_t *vo_img, int changed);
- void (*overlay_blend) (vo_driver_t *this, vo_frame_t *vo_img, vo_overlay_t *overlay);
- void (*overlay_end) (vo_driver_t *this, vo_frame_t *vo_img);
+ void (*overlay_begin) (vo_driver_t *, vo_frame_t *vo_img, int changed);
+ void (*overlay_blend) (vo_driver_t *, vo_frame_t *vo_img, vo_overlay_t *overlay);
+ void (*overlay_end) (vo_driver_t *, vo_frame_t *vo_img);
/*
* these can be used by the gui directly:
*/
- int (*get_property) (vo_driver_t *this, int property);
- int (*set_property) (vo_driver_t *this,
+ int (*get_property) (vo_driver_t *, int property);
+ int (*set_property) (vo_driver_t *,
int property, int value);
- void (*get_property_min_max) (vo_driver_t *this,
+ void (*get_property_min_max) (vo_driver_t *,
int property, int *min, int *max);
/*
@@ -332,20 +335,20 @@ struct vo_driver_s {
* etc. to the driver
*/
- int (*gui_data_exchange) (vo_driver_t *this, int data_type,
+ int (*gui_data_exchange) (vo_driver_t *, int data_type,
void *data);
/* check if a redraw is needed (due to resize)
* this is only used for still frames, normal video playback
* must call that inside display_frame() function.
*/
- int (*redraw_needed) (vo_driver_t *this);
+ int (*redraw_needed) (vo_driver_t *);
/*
* free all resources, close driver
*/
- void (*dispose) (vo_driver_t *this);
+ void (*dispose) (vo_driver_t *);
void *node; /* needed by plugin_loader */
};
@@ -357,24 +360,24 @@ struct video_driver_class_s {
/*
* open a new instance of this plugin class
*/
- vo_driver_t* (*open_plugin) (video_driver_class_t *this, const void *visual);
+ vo_driver_t* (*open_plugin) (video_driver_class_t *, const void *visual);
/*
* return short, human readable identifier for this plugin class
*/
- char* (*get_identifier) (video_driver_class_t *this);
+ char* (*get_identifier) (video_driver_class_t *);
/*
* return human readable (verbose = 1 line) description for
* this plugin class
*/
- char* (*get_description) (video_driver_class_t *this);
+ char* (*get_description) (video_driver_class_t *);
/*
* free all class-related resources
*/
- void (*dispose) (video_driver_class_t *this);
+ void (*dispose) (video_driver_class_t *);
};
diff --git a/src/xine-engine/vo_scale.h b/src/xine-engine/vo_scale.h
index 6cb2474cc..a3f5d8d5e 100644
--- a/src/xine-engine/vo_scale.h
+++ b/src/xine-engine/vo_scale.h
@@ -17,12 +17,15 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*
- * $Id: vo_scale.h,v 1.5 2002/11/22 18:06:14 mroi Exp $
+ * $Id: vo_scale.h,v 1.6 2003/04/20 21:13:26 guenter Exp $
*
* vo_scale.h
*
* keeps video scaling information
*/
+/* For the _MSC_VER (Win32) port the "this" variable
+ * was removed from all prototypes.and changed to "met"
+ */
#ifndef HAVE_VO_SCALE_H
#define HAVE_VO_SCALE_H
@@ -35,6 +38,9 @@ extern "C" {
#include "config.h"
#endif
+/* Added during _MSC_VER port */
+#include <configfile.h>
+
typedef struct {
int x, y;
int w, h;
@@ -147,27 +153,27 @@ typedef struct vo_scale_s vo_scale_t;
* taking into account aspect ratio and zoom factor
*/
-void vo_scale_compute_ideal_size (vo_scale_t *this);
+void vo_scale_compute_ideal_size (vo_scale_t *);
/*
* make ideal width/height "fit" into the gui
*/
-void vo_scale_compute_output_size (vo_scale_t *this);
+void vo_scale_compute_output_size (vo_scale_t *);
/*
* return true if a redraw is needed due resizing, zooming,
* aspect ratio changing, etc.
*/
-int vo_scale_redraw_needed (vo_scale_t *this);
+int vo_scale_redraw_needed (vo_scale_t *);
/*
*
*/
-void vo_scale_translate_gui2video(vo_scale_t *this,
+void vo_scale_translate_gui2video(vo_scale_t *,
int x, int y,
int *vid_x, int *vid_y);
@@ -181,7 +187,7 @@ char *vo_scale_aspect_ratio_name(int a);
* initialize rescaling struct
*/
-void vo_scale_init(vo_scale_t *this, int support_zoom, int scaling_disabled, config_values_t *config );
+void vo_scale_init(vo_scale_t *, int support_zoom, int scaling_disabled, config_values_t *config );
#ifdef __cplusplus
}
diff --git a/src/xine-utils/compat.h b/src/xine-utils/compat.h
index c18e8b442..a6592b030 100644
--- a/src/xine-utils/compat.h
+++ b/src/xine-utils/compat.h
@@ -17,7 +17,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*
- * $Id: compat.h,v 1.2 2001/12/14 21:03:03 f1rmb Exp $
+ * $Id: compat.h,v 1.3 2003/04/20 21:13:26 guenter Exp $
*
*/
@@ -30,10 +30,12 @@
extern "C" {
#endif
-#ifndef __GNUC__
-#define __XINE_FUNCTION__ __func__
-#else
+#if defined _MSC_VER
+#define __XINE_FUNCTION__ __FILE__
+#elif defined __GNUC__
#define __XINE_FUNCTION__ __FUNCTION__
+#else
+#define __XINE_FUNCTION__ __func__
#endif
#ifndef NAME_MAX
diff --git a/src/xine-utils/cpu_accel.c b/src/xine-utils/cpu_accel.c
index feca22e51..965c89271 100644
--- a/src/xine-utils/cpu_accel.c
+++ b/src/xine-utils/cpu_accel.c
@@ -36,6 +36,8 @@
#ifdef ARCH_X86
static uint32_t arch_accel (void)
{
+#ifndef _MSC_VER
+
uint32_t eax, ebx, ecx, edx;
int AMD;
uint32_t caps;
@@ -111,6 +113,9 @@ static uint32_t arch_accel (void)
caps |= MM_ACCEL_X86_MMXEXT;
return caps;
+#else /* _MSC_VER */
+ return 0;
+#endif
}
static jmp_buf sigill_return;
@@ -165,6 +170,8 @@ uint32_t xine_mm_accel (void)
accel = arch_accel ();
#ifdef ARCH_X86
+#ifndef _MSC_VER
+
/* test OS support for SSE */
if( accel & MM_ACCEL_X86_SSE ) {
void (*old_sigill_handler)(int);
@@ -182,6 +189,7 @@ uint32_t xine_mm_accel (void)
signal (SIGILL, old_sigill_handler);
}
+#endif /* _MSC_VER */
#endif /* ARCH_X86 */
initialized++;
diff --git a/src/xine-utils/memcpy.c b/src/xine-utils/memcpy.c
index c2f3b2a84..68094364f 100644
--- a/src/xine-utils/memcpy.c
+++ b/src/xine-utils/memcpy.c
@@ -36,7 +36,10 @@
#ifdef ARCH_PPC
#include "ppcasm_string.h"
#endif
+
+#ifndef _MSC_VER
#include <sys/times.h>
+#endif
#include <stdlib.h>
#include <string.h>
@@ -111,6 +114,7 @@ quote of the day:
#ifdef ARCH_X86
+#ifndef _MSC_VER
/* for small memory blocks (<256 bytes) this version is faster */
#define small_memcpy(to,from,n)\
{\
@@ -371,19 +375,25 @@ void * mmx2_memcpy(void * to, const void * from, size_t len)
static void *linux_kernel_memcpy(void *to, const void *from, size_t len) {
return __memcpy(to,from,len);
}
-
+#endif /* _MSC_VER */
#endif /* ARCH_X86 */
static struct {
char *name;
void *(* function)(void *to, const void *from, size_t len);
+
+#ifdef _MSC_VER
+ uint64_t time; /* This type could be used for non-MSC build too! */
+#else
unsigned long long time;
+#endif /* _MSC_VER */
+
uint32_t cpu_require;
} memcpy_method[] =
{
{ NULL, NULL, 0, 0 },
{ "glibc memcpy()", memcpy, 0, 0 },
-#ifdef ARCH_X86
+#if defined(ARCH_X86) && !defined(_MSC_VER)
{ "linux kernel memcpy()", linux_kernel_memcpy, 0, 0 },
{ "MMX optimized memcpy()", mmx_memcpy, 0, MM_MMX },
{ "MMXEXT optimized memcpy()", mmx2_memcpy, 0, MM_MMXEXT },
@@ -396,7 +406,7 @@ static struct {
{ NULL, NULL, 0, 0 }
};
-#ifdef ARCH_X86
+#if defined(ARCH_X86) && !defined(_MSC_VER)
static unsigned long long int rdtsc(int config_flags)
{
unsigned long long int x;
@@ -410,11 +420,16 @@ static unsigned long long int rdtsc(int config_flags)
}
}
#else
-static unsigned long long int rdtsc(int config_flags)
+
+static uint64_t rdtsc(int config_flags)
{
/* FIXME: implement an equivalent for using optimized memcpy on other
architectures */
+#ifndef _MSC_VER
return times(NULL);
+#else
+ return ((uint64_t)0);
+#endif /* _MSC_VER */
}
#endif
@@ -443,13 +458,18 @@ static void update_fast_memcpy(void *this_gen, xine_cfg_entry_t *entry) {
#define BUFSIZE 1024*1024
void xine_probe_fast_memcpy(config_values_t *config)
{
+#ifdef _MSC_VER
+ uint64_t t;
+#else
unsigned long long t;
+#endif /* _MSC_VER */
+
char *buf1, *buf2;
int i, j, best;
int config_flags = -1;
static char *memcpy_methods[] = {
"probe", "glibc",
-#ifdef ARCH_X86
+#if defined(ARCH_X86) && !defined(_MSC_VER)
"kernel", "mmx", "mmxext", "sse",
#endif
#ifdef ARCH_PPC
diff --git a/src/xine-utils/utils.c b/src/xine-utils/utils.c
index 828d7d934..d79388cea 100644
--- a/src/xine-utils/utils.c
+++ b/src/xine-utils/utils.c
@@ -17,7 +17,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*
- * $Id: utils.c,v 1.12 2003/03/03 17:29:07 mroi Exp $
+ * $Id: utils.c,v 1.13 2003/04/20 21:13:28 guenter Exp $
*
*/
#define _POSIX_PTHREAD_SEMANTICS 1 /* for 5-arg getpwuid_r on solaris */
@@ -77,6 +77,11 @@ void *xine_xmalloc_aligned(size_t alignment, size_t size, void **base) {
#endif
const char *xine_get_homedir(void) {
+
+#ifdef WIN32
+ return XINE_HOMEDIR;
+#else
+
struct passwd pwd, *pw = NULL;
static char homedir[BUFSIZ] = {0,};
@@ -104,6 +109,7 @@ const char *xine_get_homedir(void) {
}
return homedir;
+#endif /* _MSC_VER */
}
char *xine_chomp(char *str) {
diff --git a/src/xine-utils/xineutils.h b/src/xine-utils/xineutils.h
index 2fe21dca2..1aa6899a6 100644
--- a/src/xine-utils/xineutils.h
+++ b/src/xine-utils/xineutils.h
@@ -17,7 +17,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*
- * $Id: xineutils.h,v 1.47 2003/03/25 21:26:01 heikos Exp $
+ * $Id: xineutils.h,v 1.48 2003/04/20 21:13:28 guenter Exp $
*
*/
#ifndef XINEUTILS_H
@@ -101,8 +101,13 @@ uint32_t xine_mm_accel (void);
#ifdef ARCH_X86
typedef union {
+#ifdef _MSC_VER
+ int64_t q; /* Quadword (64-bit) value */
+ uint64_t uq; /* Unsigned Quadword */
+#else
long long q; /* Quadword (64-bit) value */
unsigned long long uq; /* Unsigned Quadword */
+#endif
int d[2]; /* 2 Doubleword (32-bit) values */
unsigned int ud[2]; /* 2 Unsigned Doubleword */
short w[4]; /* 4 Word (16-bit) values */
@@ -569,7 +574,18 @@ typedef union {
/* Optimized/fast memcpy */
+/*
+ TODO : fix dll linkage problem for xine_fast_memcpy on win32
+
+ xine_fast_memcpy dll linkage is screwy here.
+ declairing as dllinport seems to fix the problem
+ but causes compiler warning with libxineutils
+*/
+#ifdef _MSC_VER
+void __declspec( dllimport ) *(* xine_fast_memcpy)(void *to, const void *from, size_t len);
+#else
extern void *(* xine_fast_memcpy)(void *to, const void *from, size_t len);
+#endif
#ifdef HAVE_XINE_INTERNAL_H
/* Benchmark available memcpy methods */
@@ -820,6 +836,25 @@ void xine_print_trace(void);
} \
} while(0)
#else /* not GNU C, assume we have a C99 compiler */
+
+#ifdef _MSC_VER
+/*
+ #define XINE_ASSERT(exp, desc) ((void)((exp) || \
+ (printf desc, _assert(#exp, __FILE__, __LINE__), 0)))
+
+*/
+# define XINE_ASSERT(exp, desc) \
+ do { \
+ if (!(exp)) { \
+ printf("%s:%s:%d: assertion `%s' failed. ", \
+ __FILE__, __XINE_FUNCTION__, __LINE__, #exp); \
+ printf(desc); \
+ printf("\n\n"); \
+ xine_print_trace(); \
+ XINE_ABORT(); \
+ } \
+ } while(0)
+#else
# define XINE_ASSERT(exp, ...) \
do { \
if (!(exp)) { \
@@ -831,6 +866,8 @@ void xine_print_trace(void);
XINE_ABORT(); \
} \
} while(0)
+#endif /* _MSC_VER */
+
#endif