Commit 595d7684 authored by Gildas Bazin's avatar Gildas Bazin

* Added a new very simple audio plugin for Win32. This plugin uses the
    waveOut API which is a lot easier to use for streaming stuff than
    directsound. (you don't have to take care of underflows anymore
    because it doesn't use circular buffers).
    If you are having a lot of underflows, this plugin is currently
    better adapted than the directx plugin.

* Moved some initialization stuff in audio_out.c so we can now the
    caracteristics of the audio stream before calling aout_Open().
parent 8c0d4cd7
......@@ -20,6 +20,7 @@ PLUGINS_DIR := ac3_adec \
beos \
chroma \
directx \
downmix \
dsp \
dummy \
dvd \
......@@ -30,7 +31,6 @@ PLUGINS_DIR := ac3_adec \
ggi \
glide \
gtk \
downmix \
idct \
imdct \
kde \
......@@ -65,6 +65,9 @@ PLUGINS_TARGETS := ac3_adec/ac3_adec \
chroma/chroma_i420_ymga \
chroma/chroma_i420_ymga_mmx \
directx/directx \
downmix/downmix \
downmix/downmixsse \
downmix/downmix3dn \
dsp/dsp \
dummy/dummy \
dummy/null \
......@@ -81,9 +84,6 @@ PLUGINS_TARGETS := ac3_adec/ac3_adec \
glide/glide \
gtk/gnome \
gtk/gtk \
downmix/downmix \
downmix/downmixsse \
downmix/downmix3dn \
idct/idct \
idct/idctclassic \
idct/idctmmx \
......@@ -118,6 +118,7 @@ PLUGINS_TARGETS := ac3_adec/ac3_adec \
text/ncurses \
text/rc \
vcd/vcd \
win32/waveout \
win32/win32 \
x11/x11 \
x11/xvideo
......
......@@ -95,6 +95,7 @@ LIB_QNX = @LIB_QNX@
LIB_QT = @LIB_QT@
LIB_RC = @LIB_RC@
LIB_SDL = @LIB_SDL@
LIB_WAVEOUT = @LIB_WAVEOUT@
LIB_WIN32 = @LIB_WIN32@
LIB_X11 = @LIB_X11@
LIB_XVIDEO = @LIB_XVIDEO@
......
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -1136,13 +1136,13 @@ dnl
dnl Windows DirectX module
dnl
AC_ARG_ENABLE(directx,
[ --disable-directx Windows DirectX support (default enabled on WIN32)])
[ --disable-directx Win32 DirectX support (default enabled on Win32)])
if test "x$enableval" != "xno"
then
if test $SYS = mingw32
then
AC_ARG_WITH(directx-path,
[ --with-directx-path=path Windows DirectX headers and libraries])
[ --with-directx-path=path Win32 DirectX headers and libraries])
if test "x$with_directx_path" = "x"
then
AC_CHECK_HEADERS(directx.h,
......@@ -1164,11 +1164,22 @@ then
fi
fi
dnl
dnl win32 waveOut plugin
dnl
AC_ARG_ENABLE(waveout,
[ --disable-waveout Win32 waveOut module (default enabled on Win32)])
if ((test "x$enableval" != "xno") && (test $SYS = mingw32))
then
PLUGINS="${PLUGINS} waveout"
LIB_WAVEOUT="-lwinmm"
fi
dnl
dnl Windows MFC interface module
dnl
AC_ARG_ENABLE(win32,
[ --enable-win32 Windows DirectX support (default disabled)],
[ --enable-win32 Win32 interface support (default disabled)],
[ if test "x$enableval" != "xno"
then
PLUGINS="${PLUGINS} win32"
......@@ -1482,6 +1493,7 @@ AC_SUBST(LIB_QNX)
AC_SUBST(LIB_QT)
AC_SUBST(LIB_RC)
AC_SUBST(LIB_SDL)
AC_SUBST(LIB_WAVEOUT)
AC_SUBST(LIB_WIN32)
AC_SUBST(LIB_X11)
AC_SUBST(LIB_XVIDEO)
......
win32_SRC = win32.cpp
waveout_SOURCES = waveout.c aout_waveout.c
This diff is collapsed.
/*****************************************************************************
* waveout.c : Windows waveOut plugin for vlc
*****************************************************************************
* Copyright (C) 2001 VideoLAN
* $Id: waveout.c,v 1.1 2002/01/25 06:43:34 gbazin 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.
*****************************************************************************/
/*****************************************************************************
* Preamble
*****************************************************************************/
#include <stdlib.h> /* malloc(), free() */
#include <string.h>
#include <videolan/vlc.h>
#include "audio_output.h"
/*****************************************************************************
* Capabilities defined in the other files.
*****************************************************************************/
void _M( aout_getfunctions )( function_list_t * p_function_list );
/*****************************************************************************
* Building configuration tree
*****************************************************************************/
MODULE_CONFIG_START
ADD_WINDOW( "Configuration for Windows waveOut module" )
ADD_COMMENT( "For now, the Windows WaveOut module cannot be configured" )
MODULE_CONFIG_STOP
MODULE_INIT_START
SET_DESCRIPTION( "Win32 waveOut extension module" )
ADD_CAPABILITY( AOUT, 150 )
ADD_SHORTCUT( "waveout" )
MODULE_INIT_STOP
MODULE_ACTIVATE_START
_M( aout_getfunctions )( &p_module->p_functions->aout );
MODULE_ACTIVATE_STOP
MODULE_DEACTIVATE_START
MODULE_DEACTIVATE_STOP
......@@ -2,7 +2,7 @@
* audio_output.c : audio output thread
*****************************************************************************
* Copyright (C) 1999-2001 VideoLAN
* $Id: audio_output.c,v 1.73 2002/01/15 11:51:11 asmax Exp $
* $Id: audio_output.c,v 1.74 2002/01/25 06:43:34 gbazin Exp $
*
* Authors: Michel Kaempf <maxx@via.ecp.fr>
* Cyril Deguet <asmax@via.ecp.fr>
......@@ -92,6 +92,28 @@ aout_thread_t *aout_CreateThread( int *pi_status, int i_channels, long l_rate )
return( NULL );
}
p_aout->l_rate = l_rate;
p_aout->i_channels = i_channels;
/* special setting for ac3 pass-through mode */
/* FIXME is it necessary ? (cf ac3_adec.c) */
if( main_GetIntVariable( AOUT_SPDIF_VAR, 0 ) && p_main->b_ac3 )
{
intf_WarnMsg( 4, "aout info: setting ac3 spdif" );
p_aout->i_format = AOUT_FMT_AC3;
p_aout->l_rate = 48000;
}
if( p_aout->l_rate == 0 )
{
intf_ErrMsg( "aout error: null sample rate" );
free( p_aout );
return( NULL );
}
/* FIXME: only works for i_channels == 1 or 2 ?? */
p_aout->b_stereo = ( p_aout->i_channels == 2 ) ? 1 : 0;
/* Choose the best module */
p_aout->p_module = module_Need( MODULE_CAPABILITY_AOUT,
main_GetPszVariable( AOUT_METHOD_VAR, NULL ),
......@@ -122,30 +144,6 @@ aout_thread_t *aout_CreateThread( int *pi_status, int i_channels, long l_rate )
return( NULL );
}
p_aout->l_rate = l_rate;
p_aout->i_channels = i_channels;
/* special setting for ac3 pass-through mode */
/* FIXME is it necessary ? (cf ac3_adec.c) */
if( main_GetIntVariable( AOUT_SPDIF_VAR, 0 ) && p_main->b_ac3 )
{
intf_WarnMsg( 4, "aout info: setting ac3 spdif" );
p_aout->i_format = AOUT_FMT_AC3;
p_aout->l_rate = 48000;
}
if( p_aout->l_rate == 0 )
{
intf_ErrMsg( "aout error: null sample rate" );
p_aout->pf_close( p_aout );
module_Unneed( p_aout->p_module );
free( p_aout );
return( NULL );
}
/* FIXME: only works for i_channels == 1 or 2 ?? */
p_aout->b_stereo = ( p_aout->i_channels == 2 ) ? 1 : 0;
if ( p_aout->pf_setformat( p_aout ) )
{
p_aout->pf_close( p_aout );
......
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