diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/input/input_dvd.c | 32 | ||||
-rw-r--r-- | src/input/input_file.c | 15 | ||||
-rw-r--r-- | src/input/libdvdnav/dvdnav.h | 7 | ||||
-rw-r--r-- | src/input/libdvdread/bswap.h | 2 | ||||
-rw-r--r-- | src/input/libdvdread/dvd_reader.h | 4 | ||||
-rw-r--r-- | src/liba52/bitstream.h | 4 | ||||
-rw-r--r-- | src/video_out/alphablend.h | 25 | ||||
-rwxr-xr-x | src/video_out/video_out_directx.c | 2 | ||||
-rw-r--r-- | src/xine-engine/audio_out.c | 12 | ||||
-rw-r--r-- | src/xine-engine/buffer.h | 3 | ||||
-rw-r--r-- | src/xine-engine/buffer_types.c | 9 | ||||
-rw-r--r-- | src/xine-engine/demux.c | 4 | ||||
-rw-r--r-- | src/xine-engine/osd.c | 4 | ||||
-rw-r--r-- | src/xine-engine/xine.c | 29 | ||||
-rw-r--r-- | src/xine-utils/xineutils.h | 4 |
15 files changed, 132 insertions, 24 deletions
diff --git a/src/input/input_dvd.c b/src/input/input_dvd.c index f50253b72..43803e605 100644 --- a/src/input/input_dvd.c +++ b/src/input/input_dvd.c @@ -18,7 +18,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: input_dvd.c,v 1.152 2003/04/13 16:02:53 tmattern Exp $ + * $Id: input_dvd.c,v 1.153 2003/04/22 23:30:29 tchamp Exp $ * */ @@ -40,10 +40,14 @@ #include <stdio.h> #include <stdlib.h> #include <stddef.h> + +#ifndef _MSC_VER #include <dirent.h> #include <sys/param.h> #include <sys/types.h> #include <sys/stat.h> +#endif /* _MSC_VER */ + #include <unistd.h> #include <fcntl.h> #include <time.h> @@ -51,11 +55,14 @@ #include <errno.h> #include <dlfcn.h> +#ifndef _MSC_VER #include <sys/mount.h> #include <sys/wait.h> #include <sys/poll.h> #include <sys/ioctl.h> +#endif /* _MSC_VER */ + #if defined(__NetBSD__) || defined(__OpenBSD__) || defined(__FreeBSD__) #include <sys/dvdio.h> @@ -65,13 +72,23 @@ #elif defined(HAVE_SYS_CDIO_H) #include <sys/cdio.h> #else + +#ifdef WIN32 +#include <io.h> /* read() */ +#else #warning "This might not compile due to missing cdrom ioctls" +#endif /* WIN32 */ + #endif /* DVDNAV includes */ #ifdef HAVE_DVDNAV +#ifndef _MSC_VER # include <dvdnav/dvdnav.h> #else +# include "dvdnav.h" +#endif /* _MSC_VER */ +#else # define DVDNAV_COMPILE # include "dvdnav.h" #endif @@ -125,11 +142,11 @@ # define trace_print(s, args...) /* Nothing */ # endif #else -# ifdef INPUT_DEBUG_TRACE -# define trace_print(s, ...) printf("input_dvd: " __func__ ": " s, __VA_ARGS_); -# else -# define trace_print(s, ...) /* Nothing */ -# endif +# ifndef _MSC_VER +# define trace_print(s, ...) /* Nothing */ +# else +# define trace_print printf +# endif /* _MSC_VER */ #endif /* Array to hold MRLs returned by get_autoplay_list */ @@ -1604,6 +1621,9 @@ static void *init_class (xine_t *xine, void *data) { /* * $Log: input_dvd.c,v $ + * Revision 1.153 2003/04/22 23:30:29 tchamp + * Additional changes for win32/msvc port; This is my first real commit so please be gentle with me; Everything builds except for the win32 ui + * * Revision 1.152 2003/04/13 16:02:53 tmattern * Input plugin api change: * old open() function replaced by : diff --git a/src/input/input_file.c b/src/input/input_file.c index 3356d6b31..612546ddf 100644 --- a/src/input/input_file.c +++ b/src/input/input_file.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: input_file.c,v 1.79 2003/04/13 16:02:53 tmattern Exp $ + * $Id: input_file.c,v 1.80 2003/04/22 23:30:35 tchamp Exp $ */ #ifdef HAVE_CONFIG_H @@ -75,6 +75,10 @@ static uint32_t file_plugin_get_capabilities (input_plugin_t *this_gen) { if (this->fh <0) return 0; +#ifdef _MSC_VER + /*return INPUT_CAP_SEEKABLE | INPUT_CAP_GET_DIR;*/ + return INPUT_CAP_SEEKABLE; +#else if (fstat (this->fh, &buf) == 0) { if (S_ISREG(buf.st_mode)) return INPUT_CAP_SEEKABLE; @@ -83,6 +87,7 @@ static uint32_t file_plugin_get_capabilities (input_plugin_t *this_gen) { } else perror ("system call fstat"); return 0; +#endif /* _MSC_VER */ } @@ -231,7 +236,15 @@ static int file_plugin_open (input_plugin_t *this_gen ) { else filename = decode_uri(this->mrl); +#ifdef _MSC_VER + /* + added O_BINARY flag, <CTRL>-Z char + is interperated as EOF on win32. + */ + this->fh = open (filename, O_RDONLY|O_BINARY); +#else this->fh = open (filename, O_RDONLY); +#endif /* _MSC_VER */ if (this->fh == -1) { return 0; diff --git a/src/input/libdvdnav/dvdnav.h b/src/input/libdvdnav/dvdnav.h index fa210ea53..44ef878e1 100644 --- a/src/input/libdvdnav/dvdnav.h +++ b/src/input/libdvdnav/dvdnav.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: dvdnav.h,v 1.10 2003/04/07 19:59:09 jcdutton Exp $ + * $Id: dvdnav.h,v 1.11 2003/04/22 23:30:36 tchamp Exp $ * */ @@ -34,11 +34,16 @@ extern "C" { #endif #ifdef HAVE_DVDNAV +#ifndef _MSC_VER # include <dvdnav/dvdnav_events.h> # include <dvdnav/dvd_types.h> #else # include "dvdnav_events.h" # include "dvd_types.h" +#endif /* _MSC_VER */ +#else +# include "dvdnav_events.h" +# include "dvd_types.h" #endif #include "dvd_reader.h" diff --git a/src/input/libdvdread/bswap.h b/src/input/libdvdread/bswap.h index 9c7402957..6eb9e37f2 100644 --- a/src/input/libdvdread/bswap.h +++ b/src/input/libdvdread/bswap.h @@ -65,7 +65,7 @@ * functionality! */ -#elif defined(__FreeBSD__) || defined(__sun) || defined(__bsdi__) +#elif defined(__FreeBSD__) || defined(__sun) || defined(__bsdi__) || defined(_MSC_VER) #define B2N_16(x) \ x = ((((x) & 0xff00) >> 8) | \ (((x) & 0x00ff) << 8)) diff --git a/src/input/libdvdread/dvd_reader.h b/src/input/libdvdread/dvd_reader.h index cc4ba5489..9f609dfd8 100644 --- a/src/input/libdvdread/dvd_reader.h +++ b/src/input/libdvdread/dvd_reader.h @@ -21,6 +21,10 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ +#if defined(_MSC_VER) +typedef long ssize_t; +#endif /* _MSC_VER */ + #include <sys/types.h> /** diff --git a/src/liba52/bitstream.h b/src/liba52/bitstream.h index 7d7ea7679..f242c37c4 100644 --- a/src/liba52/bitstream.h +++ b/src/liba52/bitstream.h @@ -21,6 +21,10 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ +#ifdef WIN32 +#include <unistd.h> +#endif + /* (stolen from the kernel) */ #ifdef WORDS_BIGENDIAN diff --git a/src/video_out/alphablend.h b/src/video_out/alphablend.h index 759b61254..71ecc73cd 100644 --- a/src/video_out/alphablend.h +++ b/src/video_out/alphablend.h @@ -27,12 +27,35 @@ #include "video_out.h" +/* _MSC_VER port changes */ +#undef ATTRIBUTE_PACKED +#undef PRAGMA_PACK_BEGIN +#undef PRAGMA_PACK_END + +#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 95) +#define ATTRIBUTE_PACKED __attribute__ ((packed)) +#define PRAGMA_PACK 0 +#endif + +#if !defined(ATTRIBUTE_PACKED) +#define ATTRIBUTE_PACKED +#define PRAGMA_PACK 1 +#endif + +#if PRAGMA_PACK +#pragma pack(8) +#endif + typedef struct { /* CLUT == Color LookUp Table */ uint8_t cb : 8; uint8_t cr : 8; uint8_t y : 8; uint8_t foo : 8; -} __attribute__ ((packed)) clut_t; +} ATTRIBUTE_PACKED clut_t; + +#if PRAGMA_PACK +#pragma pack() +#endif void blend_rgb16 (uint8_t * img, vo_overlay_t * img_overl, int img_width, int img_height, diff --git a/src/video_out/video_out_directx.c b/src/video_out/video_out_directx.c index 590574da2..0bca356ba 100755 --- a/src/video_out/video_out_directx.c +++ b/src/video_out/video_out_directx.c @@ -1270,7 +1270,7 @@ static void *init_class (xine_t *xine, void *visual_gen) { static vo_info_t vo_info_win32 = { 7, /* priority */ - XINE_VISUAL_TYPE_WIN32 /* visual type */ + XINE_VISUAL_TYPE_DIRECTX /* visual type */ }; /* diff --git a/src/xine-engine/audio_out.c b/src/xine-engine/audio_out.c index 11bd7b698..53b0eccba 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.123 2003/04/21 00:25:55 jstembridge Exp $ + * $Id: audio_out.c,v 1.124 2003/04/22 23:30:48 tchamp Exp $ * * 22-8-2001 James imported some useful AC3 sections from the previous alsa driver. * (c) 2001 Andy Lo A Foe <andy@alsaplayer.org> @@ -553,7 +553,7 @@ static void audio_filter_equalize (aos_t *this, int index, band, channel; int halflength, length; int out[EQ_CHANNELS], scaledpcm[EQ_CHANNELS]; - long long l; + int64_t l; int num_channels; num_channels = mode_channels (this->input.mode); @@ -575,11 +575,11 @@ static void audio_filter_equalize (aos_t *this, for (band = 0; band < EQ_BANDS; band++) { this->eq_data_history[band][channel].x[this->eq_i] = scaledpcm[channel]; - l = (long long)iir_cf[band].alpha * (long long)(this->eq_data_history[band][channel].x[this->eq_i] - this->eq_data_history[band][channel].x[this->eq_k]) - + (long long)iir_cf[band].gamma * (long long)this->eq_data_history[band][channel].y[this->eq_j] - - (long long)iir_cf[band].beta * (long long)this->eq_data_history[band][channel].y[this->eq_k]; + l = (int64_t)iir_cf[band].alpha * (int64_t)(this->eq_data_history[band][channel].x[this->eq_i] - this->eq_data_history[band][channel].x[this->eq_k]) + + (int64_t)iir_cf[band].gamma * (int64_t)this->eq_data_history[band][channel].y[this->eq_j] + - (int64_t)iir_cf[band].beta * (int64_t)this->eq_data_history[band][channel].y[this->eq_k]; this->eq_data_history[band][channel].y[this->eq_i] = (int)(l >> FP_FRBITS); - l = (long long)this->eq_data_history[band][channel].y[this->eq_i] * (long long)this->eq_gain[band]; + l = (int64_t)this->eq_data_history[band][channel].y[this->eq_i] * (int64_t)this->eq_gain[band]; out[channel] += (int)(l >> FP_FRBITS); } diff --git a/src/xine-engine/buffer.h b/src/xine-engine/buffer.h index 205f13b2b..7abfa9992 100644 --- a/src/xine-engine/buffer.h +++ b/src/xine-engine/buffer.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: buffer.h,v 1.107 2003/04/16 23:05:27 heinchen Exp $ + * $Id: buffer.h,v 1.108 2003/04/22 23:30:52 tchamp Exp $ * * * contents: @@ -197,6 +197,7 @@ extern "C" { #define BUF_AUDIO_FLAC 0x032C0000 #define BUF_AUDIO_DV 0x032D0000 #define BUF_AUDIO_WMAV 0x032E0000 +#define BUF_AUDIO_DIRECTX 0x032F0000 /* spu buffer types: */ diff --git a/src/xine-engine/buffer_types.c b/src/xine-engine/buffer_types.c index f144e732b..ff66dfc06 100644 --- a/src/xine-engine/buffer_types.c +++ b/src/xine-engine/buffer_types.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: buffer_types.c,v 1.56 2003/03/23 17:12:30 holstsn Exp $ + * $Id: buffer_types.c,v 1.57 2003/04/22 23:30:53 tchamp Exp $ * * * contents: @@ -833,6 +833,13 @@ static audio_db_t audio_db[] = { BUF_AUDIO_DV, "DV Audio" }, +{ + { + 0 + }, + BUF_AUDIO_DIRECTX, + "Directx Audio" +}, { { 0 }, 0, "last entry" } }; diff --git a/src/xine-engine/demux.c b/src/xine-engine/demux.c index 8cafe9f78..c6dcbf280 100644 --- a/src/xine-engine/demux.c +++ b/src/xine-engine/demux.c @@ -35,6 +35,10 @@ #include "demuxers/demux.h" #include "buffer.h" +#ifdef WIN32 +#include <winsock.h> +#endif + /* #define LOG */ diff --git a/src/xine-engine/osd.c b/src/xine-engine/osd.c index 3e6cb230a..892152872 100644 --- a/src/xine-engine/osd.c +++ b/src/xine-engine/osd.c @@ -89,14 +89,14 @@ struct osd_font_s { osd_font_t *next; }; -struct osd_ft2context_s { #ifdef HAVE_FT2 +struct osd_ft2context_s { int useme; FT_Library library; FT_Face face; int size; -#endif }; +#endif /* * open a new osd object. this will allocated an empty (all zero) drawing diff --git a/src/xine-engine/xine.c b/src/xine-engine/xine.c index 811a53888..5bba920cd 100644 --- a/src/xine-engine/xine.c +++ b/src/xine-engine/xine.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: xine.c,v 1.243 2003/04/17 19:01:24 miguelfreitas Exp $ + * $Id: xine.c,v 1.244 2003/04/22 23:30:55 tchamp Exp $ * * top-level xine functions * @@ -58,6 +58,11 @@ #include "xineutils.h" #include "compat.h" +#ifdef WIN32 +# include <fcntl.h> +# include <winsock.h> +#endif /* WIN32 */ + /* #define LOG */ @@ -1084,6 +1089,11 @@ void xine_exit (xine_t *this) { if(this->config) this->config->dispose(this->config); +#if defined(WIN32) + WSACleanup(); +#endif + + pthread_mutex_destroy(&this->streams_lock); free (this); @@ -1094,6 +1104,11 @@ xine_t *xine_new (void) { xine_t *this; int i; +#ifdef WIN32 + WSADATA Data; + int i_err; +#endif /* WIN32 */ + this = xine_xmalloc (sizeof (xine_t)); if (!this) { printf ("xine: failed to malloc xine_t\n"); @@ -1120,7 +1135,19 @@ xine_t *xine_new (void) { for (i = 0; i < XINE_LOG_NUM; i++) this->log_buffers[i] = new_scratch_buffer (25); + +#ifdef WIN32 + /* WinSock Library Init. */ + i_err = WSAStartup( MAKEWORD( 1, 1 ), &Data ); + + if( i_err ) + { + fprintf( stderr, "error: can't initiate WinSocks, error %i\n", i_err ); + } + +#endif /* WIN32 */ + /* * streams_lock */ diff --git a/src/xine-utils/xineutils.h b/src/xine-utils/xineutils.h index 1aa6899a6..33275b05c 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.48 2003/04/20 21:13:28 guenter Exp $ + * $Id: xineutils.h,v 1.49 2003/04/22 23:30:58 tchamp Exp $ * */ #ifndef XINEUTILS_H @@ -668,7 +668,7 @@ static inline char *_x_strpbrk(const char *s, const char *accept) { #define xine_strpbrk _x_strpbrk #endif -#ifdef HAVE_STRSEP +#if defined HAVE_STRSEP && !defined(_MSC_VER) #define xine_strsep strsep #else static inline char *_x_strsep(char **stringp, const char *delim) { |