Commit 945f2946 authored by Sam Hocevar's avatar Sam Hocevar

  * DirectX plugin by Gildas Bazin <gbazin@netcourrier.com>.

    Notes: o I called it 'directx' instead of 'windx' because it
             made a lot more sense to me.
           o Completely untested. I didn't manage to compile it yet.
           o Code in vout_directx.c will go through a big rewrite when
             vout 4 is finished. Xav is already working on this.
parent e9cc5c05
......@@ -23,6 +23,13 @@ If you intend to debug stuff, you may want to disable optimizations:
--enable-mga --enable-gtk --enable-qt --enable-xvideo --enable-alsa \
--enable-debug
It is also possible to cross-compile for the Win32 platform using mingw32:
make distclean && CC=i586-mingw32msvc-gcc CFLAGS=-I/usr/i586-mingw32msvc \
RANLIB=i586-mingw32msvc-ranlib ./configure --host=i386-mingw32msvc \
--target=i386-mingw32msvc --build=i386-linux --disable-dsp \
--disable-gtk --disable-x11 --disable-xvideo
Building VideoLAN
=================
......
......@@ -11,7 +11,7 @@
#
# All possible plugin directories, needed for make clean
#
PLUGINS_DIR := alsa beos darwin dsp dummy \
PLUGINS_DIR := alsa beos darwin directx dsp dummy \
dvd esd fb ggi glide gtk \
downmix idct imdct \
macosx mga \
......@@ -22,8 +22,9 @@ PLUGINS_DIR := alsa beos darwin dsp dummy \
#
# All possible plugin objects
#
PLUGINS_TARGETS := alsa/alsa beos/beos darwin/darwin dsp/dsp dummy/dummy \
dvd/dvd esd/esd fb/fb ggi/ggi glide/glide gtk/gnome gtk/gtk \
PLUGINS_TARGETS := alsa/alsa beos/beos darwin/darwin directx/directx \
dsp/dsp dummy/dummy dvd/dvd esd/esd fb/fb ggi/ggi \
glide/glide gtk/gnome gtk/gtk \
downmix/downmix downmix/downmixsse downmix/downmix3dn \
idct/idct idct/idctclassic idct/idctmmx idct/idctmmxext \
imdct/imdct imdct/imdct3dn imdct/imdctsse \
......@@ -133,7 +134,7 @@ endif
#
# Generated header
#
H_OBJ = include/modules_builtin.h
H_OBJ = src/misc/modules_builtin.h
#
# Other lists of files
......@@ -176,6 +177,7 @@ distclean: clean
rm -f **/*.o **/*~ *.log
rm -f Makefile.opts
rm -f include/defs.h include/config.h include/modules_builtin.h
rm -f src/misc/modules_builtin.h
rm -f config*status config*cache config*log
rm -f gmon.out core build-stamp
rm -Rf .dep
......
......@@ -73,6 +73,7 @@ LIB_NCURSES = @LIB_NCURSES@
LIB_QT = @LIB_QT@
LIB_TS = @LIB_TS@
LIB_SDL = @LIB_SDL@
LIB_DIRECTX = @LIB_DIRECTX@
LIB_X11 = @LIB_X11@
LIB_XVIDEO = @LIB_XVIDEO@
LIB_YUV = @LIB_YUV@
......
This diff is collapsed.
......@@ -68,13 +68,13 @@ CFLAGS="${CFLAGS} -I/usr/local/include"
dnl Check for pthreads - borrowed from XMMS
PTHREAD_LIBS=error
AC_CHECK_LIB(pthread,pthread_attr_init,PTHREAD_LIBS="-lpthread")
if test "x$PTHREAD_LIBS" = xerror; then
if test "x${PTHREAD_LIBS}" = xerror; then
AC_CHECK_LIB(pthreads,pthread_attr_init,PTHREAD_LIBS="-lpthreads")
fi
if test "x$PTHREAD_LIBS" = xerror; then
if test "x${PTHREAD_LIBS}" = xerror; then
AC_CHECK_LIB(c_r,pthread_attr_init,PTHREAD_LIBS="-lc_r")
fi
if test "x$PTHREAD_LIBS" = xerror; then
if test "x${PTHREAD_LIBS}" = xerror; then
PTHREAD_LIBS=""
AC_CHECK_FUNC(pthread_attr_init)
fi
......@@ -395,6 +395,30 @@ AC_ARG_WITH(sdl,
LIB_SDL="${LIB_SDL} -L/usr/X11R6/lib -lSDL"])
fi
dnl
dnl Windows DirectX module
dnl
AC_ARG_WITH(directx,
[ --with-directx[=name] Windows DirectX support (default enabled)],
[ if test "x$withval" != "xno";
then
PLUGINS="${PLUGINS} directx";
if test "x$withval" != "xyes";
then
LIB_DIRECTX="${LIB_DIRECTX} -L"$withval"/lib -lddraw -ldsound"
INCLUDE="${INCLUDE} -I"$withval"/include"
else
AC_CHECK_HEADERS(directx.h, , [echo "Cannot find DirectX headers !"; exit])
LIB_DIRECTX="${LIB_DIRECTX} -L/usr/lib -lddraw -ldsound"
fi
fi ])
if test "x$withval" = "x";
then
AC_CHECK_HEADERS(directx.h,
[PLUGINS="${PLUGINS} directx"
LIB_DIRECTX="${LIB_DIRECTX} -L/usr/lib -lddraw -ldsound"])
fi
dnl
dnl Glide module
dnl
......@@ -562,6 +586,7 @@ AC_SUBST(LIB_NCURSES)
AC_SUBST(LIB_QT)
AC_SUBST(LIB_TS)
AC_SUBST(LIB_SDL)
AC_SUBST(LIB_DIRECTX)
AC_SUBST(LIB_X11)
AC_SUBST(LIB_XVIDEO)
AC_SUBST(LIB_YUV)
......
###############################################################################
# vlc (VideoLAN Client) DirectX module Makefile
# (c)2001 VideoLAN
###############################################################################
#
# Objects
#
PLUGIN_C = directx.o vout_directx.o aout_directx.o
BUILTIN_C = $(PLUGIN_C:%.o=BUILTIN_%.o)
ALL_OBJ = $(PLUGIN_C) $(BUILTIN_C)
#
# Virtual targets
#
include ../../Makefile.modules
#
# Real targets
#
../../lib/directx.so: $(PLUGIN_C)
$(CC) $(PCFLAGS) -o $@ $^ $(PLCFLAGS) $(LIB_DIRECTX)
../../lib/directx.a: $(BUILTIN_C)
ar r $@ $^
$(RANLIB) $@
This diff is collapsed.
/*****************************************************************************
* directx.c : Windows DirectX plugin for vlc
*****************************************************************************
* Copyright (C) 2000, 2001 VideoLAN
* $Id: directx.c,v 1.1 2001/06/02 01:09:03 sam Exp $
*
* Authors: Gildas Bazin <gbazin@netcourrier.com>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* 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, USA.
*****************************************************************************/
#define MODULE_NAME directx
#include "modules_inner.h"
/*****************************************************************************
* Preamble
*****************************************************************************/
#include "defs.h"
#include <stdlib.h> /* malloc(), free() */
#include "config.h"
#include "common.h" /* boolean_t, byte_t */
#include "threads.h"
#include "mtime.h"
#include "audio_output.h"
#include "video.h"
#include "video_output.h"
#include "modules.h"
#include "modules_export.h"
/*****************************************************************************
* Capabilities defined in the other files.
*****************************************************************************/
void _M( aout_getfunctions )( function_list_t * p_function_list );
void _M( vout_getfunctions )( function_list_t * p_function_list );
/*****************************************************************************
* Building configuration tree
*****************************************************************************/
MODULE_CONFIG_START
ADD_WINDOW( "Configuration for Windows DirectX module" )
ADD_COMMENT( "For now, the Windows DirectX module cannot be configured" )
MODULE_CONFIG_STOP
MODULE_INIT_START
p_module->i_capabilities = MODULE_CAPABILITY_NULL
| MODULE_CAPABILITY_VOUT
| MODULE_CAPABILITY_AOUT;
p_module->psz_longname = "DirectX module";
MODULE_INIT_STOP
MODULE_ACTIVATE_START
_M( aout_getfunctions )( &p_module->p_functions->aout );
_M( vout_getfunctions )( &p_module->p_functions->vout );
MODULE_ACTIVATE_STOP
MODULE_DEACTIVATE_START
MODULE_DEACTIVATE_STOP
This diff is collapsed.
......@@ -2,7 +2,7 @@
* gtk_menu.c : functions to handle menu items.
*****************************************************************************
* Copyright (C) 2000, 2001 VideoLAN
* $Id: gtk_menu.c,v 1.8 2001/05/31 16:10:05 stef Exp $
* $Id: gtk_menu.c,v 1.9 2001/06/02 01:09:03 sam Exp $
*
* Authors: Samuel Hocevar <sam@zoy.org>
* Stphane Borel <stef@via.ecp.fr>
......@@ -59,6 +59,12 @@
#include "modules_export.h"
#ifdef WIN32
#ifndef snprintf
#define snprintf _snprintf
#endif
#endif
/*
* Local Prototypes
*/
......
......@@ -2,7 +2,7 @@
* input_ts.c: TS demux and netlist management
*****************************************************************************
* Copyright (C) 1998, 1999, 2000 VideoLAN
* $Id: input_ts.c,v 1.24 2001/05/31 03:57:54 sam Exp $
* $Id: input_ts.c,v 1.25 2001/06/02 01:09:03 sam Exp $
*
* Authors: Henri Fallon <henri@videolan.org>
*
......@@ -283,9 +283,8 @@ static int TSRead( input_thread_t * p_input,
p_method = ( thread_ts_data_t * )p_input->p_plugin_data;
/* Initialize file descriptor set */
FD_ZERO( &(p_method->s_fdset) );
FD_SET( p_input->i_handle, &(p_method->s_fdset) );
FD_ZERO( &(p_method->fds) );
FD_SET( p_input->i_handle, &(p_method->fds) );
/* We'll wait 0.5 second if nothing happens */
s_wait.tv_sec = 0;
......@@ -295,7 +294,7 @@ static int TSRead( input_thread_t * p_input,
memset( pp_packets, 0, INPUT_READ_ONCE * sizeof(data_packet_t *) );
/* Fill if some data is available */
i_data = select( p_input->i_handle + 1, &(p_method->s_fdset), NULL, NULL,
i_data = select( p_input->i_handle + 1, &(p_method->fds), NULL, NULL,
&s_wait);
if( i_data == -1 )
......
......@@ -2,7 +2,7 @@
* input_ts.h: structures of the input not exported to other modules
*****************************************************************************
* Copyright (C) 1999, 2000 VideoLAN
* $Id: input_ts.h,v 1.6 2001/05/31 01:37:08 sam Exp $
* $Id: input_ts.h,v 1.7 2001/06/02 01:09:03 sam Exp $
*
* Authors: Henri Fallon <henri@via.ecp.fr>
*
......@@ -29,6 +29,6 @@
typedef struct thread_ts_data_s {
// FILE * stream;
fd_set s_fdset;
fd_set fds;
} thread_ts_data_t;
......@@ -4,7 +4,7 @@
* interface, such as message output. See config.h for output configuration.
*****************************************************************************
* Copyright (C) 1998, 1999, 2000 VideoLAN
* $Id: intf_msg.c,v 1.35 2001/05/31 01:37:08 sam Exp $
* $Id: intf_msg.c,v 1.36 2001/06/02 01:09:03 sam Exp $
*
* Authors: Vincent Seguin <seguin@via.ecp.fr>
*
......@@ -50,8 +50,10 @@
#include "main.h"
#ifdef WIN32
#ifndef snprintf
#define snprintf _snprintf /* snprintf not defined in mingw32 (bug?) */
#endif
#endif
/*****************************************************************************
* intf_msg_item_t
......
......@@ -2,7 +2,7 @@
* modules_core.h : Module management functions used by the core application.
*****************************************************************************
* Copyright (C) 2001 VideoLAN
* $Id: modules_core.h,v 1.6 2001/05/31 12:45:39 sam Exp $
* $Id: modules_core.h,v 1.1 2001/06/02 01:09:03 sam Exp $
*
* Authors: Samuel Hocevar <sam@zoy.org>
*
......
......@@ -2,7 +2,7 @@
* netutils.c: various network functions
*****************************************************************************
* Copyright (C) 1999, 2000, 2001 VideoLAN
* $Id: netutils.c,v 1.36 2001/05/31 01:37:08 sam Exp $
* $Id: netutils.c,v 1.37 2001/06/02 01:09:03 sam Exp $
*
* Authors: Vincent Seguin <seguin@via.ecp.fr>
* Benoit Steiner <benny@via.ecp.fr>
......@@ -262,7 +262,7 @@ int network_ChannelJoin( int i_channel )
struct timeval answer_delay;
int i_nbanswer;
char i_answer;
fd_set fd;
fd_set fds;
unsigned int i_rc;
char * psz_channel_server;
......@@ -369,9 +369,9 @@ int network_ChannelJoin( int i_channel )
*/
answer_delay.tv_sec = 5;
answer_delay.tv_usec = 0;
FD_ZERO( &fd );
FD_SET( i_socket, &fd );
i_nbanswer = select( i_socket + 1, &fd, NULL, NULL, &answer_delay );
FD_ZERO( &fds );
FD_SET( i_socket, &fds );
i_nbanswer = select( i_socket + 1, &fds, NULL, NULL, &answer_delay );
switch( i_nbanswer )
{
......
......@@ -2,7 +2,7 @@
* spu_decoder.c : spu decoder thread
*****************************************************************************
* Copyright (C) 2000 VideoLAN
* $Id: spu_decoder.c,v 1.46 2001/05/31 01:37:08 sam Exp $
* $Id: spu_decoder.c,v 1.47 2001/06/02 01:09:03 sam Exp $
*
* Authors: Samuel Hocevar <sam@zoy.org>
*
......@@ -412,6 +412,7 @@ static int ParseControlSequences( spudec_thread_t *p_spudec,
case SPU_CMD_FORCE_DISPLAY:
/* 00 (force displaying) */
p_spu->i_start = p_spudec->i_pts + ( i_date * 11000 );
b_force_display = 1;
break;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment