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 \ ...@@ -20,6 +20,7 @@ PLUGINS_DIR := ac3_adec \
beos \ beos \
chroma \ chroma \
directx \ directx \
downmix \
dsp \ dsp \
dummy \ dummy \
dvd \ dvd \
...@@ -30,7 +31,6 @@ PLUGINS_DIR := ac3_adec \ ...@@ -30,7 +31,6 @@ PLUGINS_DIR := ac3_adec \
ggi \ ggi \
glide \ glide \
gtk \ gtk \
downmix \
idct \ idct \
imdct \ imdct \
kde \ kde \
...@@ -65,6 +65,9 @@ PLUGINS_TARGETS := ac3_adec/ac3_adec \ ...@@ -65,6 +65,9 @@ PLUGINS_TARGETS := ac3_adec/ac3_adec \
chroma/chroma_i420_ymga \ chroma/chroma_i420_ymga \
chroma/chroma_i420_ymga_mmx \ chroma/chroma_i420_ymga_mmx \
directx/directx \ directx/directx \
downmix/downmix \
downmix/downmixsse \
downmix/downmix3dn \
dsp/dsp \ dsp/dsp \
dummy/dummy \ dummy/dummy \
dummy/null \ dummy/null \
...@@ -81,9 +84,6 @@ PLUGINS_TARGETS := ac3_adec/ac3_adec \ ...@@ -81,9 +84,6 @@ PLUGINS_TARGETS := ac3_adec/ac3_adec \
glide/glide \ glide/glide \
gtk/gnome \ gtk/gnome \
gtk/gtk \ gtk/gtk \
downmix/downmix \
downmix/downmixsse \
downmix/downmix3dn \
idct/idct \ idct/idct \
idct/idctclassic \ idct/idctclassic \
idct/idctmmx \ idct/idctmmx \
...@@ -118,6 +118,7 @@ PLUGINS_TARGETS := ac3_adec/ac3_adec \ ...@@ -118,6 +118,7 @@ PLUGINS_TARGETS := ac3_adec/ac3_adec \
text/ncurses \ text/ncurses \
text/rc \ text/rc \
vcd/vcd \ vcd/vcd \
win32/waveout \
win32/win32 \ win32/win32 \
x11/x11 \ x11/x11 \
x11/xvideo x11/xvideo
......
...@@ -95,6 +95,7 @@ LIB_QNX = @LIB_QNX@ ...@@ -95,6 +95,7 @@ LIB_QNX = @LIB_QNX@
LIB_QT = @LIB_QT@ LIB_QT = @LIB_QT@
LIB_RC = @LIB_RC@ LIB_RC = @LIB_RC@
LIB_SDL = @LIB_SDL@ LIB_SDL = @LIB_SDL@
LIB_WAVEOUT = @LIB_WAVEOUT@
LIB_WIN32 = @LIB_WIN32@ LIB_WIN32 = @LIB_WIN32@
LIB_X11 = @LIB_X11@ LIB_X11 = @LIB_X11@
LIB_XVIDEO = @LIB_XVIDEO@ 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 ...@@ -1136,13 +1136,13 @@ dnl
dnl Windows DirectX module dnl Windows DirectX module
dnl dnl
AC_ARG_ENABLE(directx, 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" if test "x$enableval" != "xno"
then then
if test $SYS = mingw32 if test $SYS = mingw32
then then
AC_ARG_WITH(directx-path, 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" if test "x$with_directx_path" = "x"
then then
AC_CHECK_HEADERS(directx.h, AC_CHECK_HEADERS(directx.h,
...@@ -1164,11 +1164,22 @@ then ...@@ -1164,11 +1164,22 @@ then
fi fi
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
dnl Windows MFC interface module dnl Windows MFC interface module
dnl dnl
AC_ARG_ENABLE(win32, AC_ARG_ENABLE(win32,
[ --enable-win32 Windows DirectX support (default disabled)], [ --enable-win32 Win32 interface support (default disabled)],
[ if test "x$enableval" != "xno" [ if test "x$enableval" != "xno"
then then
PLUGINS="${PLUGINS} win32" PLUGINS="${PLUGINS} win32"
...@@ -1482,6 +1493,7 @@ AC_SUBST(LIB_QNX) ...@@ -1482,6 +1493,7 @@ AC_SUBST(LIB_QNX)
AC_SUBST(LIB_QT) AC_SUBST(LIB_QT)
AC_SUBST(LIB_RC) AC_SUBST(LIB_RC)
AC_SUBST(LIB_SDL) AC_SUBST(LIB_SDL)
AC_SUBST(LIB_WAVEOUT)
AC_SUBST(LIB_WIN32) AC_SUBST(LIB_WIN32)
AC_SUBST(LIB_X11) AC_SUBST(LIB_X11)
AC_SUBST(LIB_XVIDEO) AC_SUBST(LIB_XVIDEO)
......
win32_SRC = win32.cpp 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 @@ ...@@ -2,7 +2,7 @@
* audio_output.c : audio output thread * audio_output.c : audio output thread
***************************************************************************** *****************************************************************************
* Copyright (C) 1999-2001 VideoLAN * 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> * Authors: Michel Kaempf <maxx@via.ecp.fr>
* Cyril Deguet <asmax@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 ) ...@@ -92,6 +92,28 @@ aout_thread_t *aout_CreateThread( int *pi_status, int i_channels, long l_rate )
return( NULL ); 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 */ /* Choose the best module */
p_aout->p_module = module_Need( MODULE_CAPABILITY_AOUT, p_aout->p_module = module_Need( MODULE_CAPABILITY_AOUT,
main_GetPszVariable( AOUT_METHOD_VAR, NULL ), main_GetPszVariable( AOUT_METHOD_VAR, NULL ),
...@@ -122,30 +144,6 @@ aout_thread_t *aout_CreateThread( int *pi_status, int i_channels, long l_rate ) ...@@ -122,30 +144,6 @@ aout_thread_t *aout_CreateThread( int *pi_status, int i_channels, long l_rate )
return( NULL ); 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 ) ) if ( p_aout->pf_setformat( p_aout ) )
{ {
p_aout->pf_close( 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