Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
Steve Lhomme
VLC
Commits
e13aed00
Commit
e13aed00
authored
Jul 30, 2000
by
Sam Hocevar
Browse files
. autod�tection des plugins
. les aliases "gvlc" "fbvlc" "ggivlc" fonctionne comme il faut
parent
4af2fd10
Changes
48
Hide whitespace changes
Inline
Side-by-side
Makefile.in
View file @
e13aed00
...
...
@@ -211,6 +211,7 @@ video_decoder_obj = video_decoder/video_decoder.o \
video_decoder/vdec_idct.o
misc_obj
=
misc/mtime.o
\
misc/tests.o
\
misc/rsc_files.o
\
misc/netutils.o
\
misc/playlist.o
\
...
...
README
View file @
e13aed00
...
...
@@ -45,7 +45,7 @@ information about MPEG and DVD playing. Have a look at the documentation
section, as well as the bookmarks.
You can also try the OpenDVD site at http://www.opendvd.org/ or the
the LiVi
d
project at http://www.linuxvideo.org/. They have lots of
the LiVi
D
project at http://www.linuxvideo.org/. They have lots of
information, too.
...
...
include/config.h.in
View file @
e13aed00
...
...
@@ -272,6 +272,9 @@
/* Environment variable containing the display method */
#define VOUT_METHOD_VAR "vlc_vout"
/* Environment variable containing the YUV method */
#define YUV_METHOD_VAR "vlc_yuv"
/* The fallback method */
#define VOUT_DEFAULT_METHOD "x11"
...
...
include/main.h
View file @
e13aed00
...
...
@@ -38,6 +38,7 @@ typedef struct
int
i_argc
;
/* command line arguments count */
char
**
ppsz_argv
;
/* command line arguments */
char
**
ppsz_env
;
/* environment variables */
char
*
psz_arg0
;
/* program name (whithout path) */
/* Generic settings */
boolean_t
b_audio
;
/* is audio output allowed ? */
...
...
include/plugins.h
View file @
e13aed00
...
...
@@ -43,6 +43,8 @@ typedef struct plugin_info_s
void
*
vout_GetPlugin
;
void
*
intf_GetPlugin
;
void
*
yuv_GetPlugin
;
int
i_score
;
}
plugin_info_t
;
typedef
struct
plugin_bank_s
...
...
include/
plugins_export
.h
→
include/
tests
.h
View file @
e13aed00
/*****************************************************************************
*
plugins_export
.h
:
exporting plugins structure
*
tests
.h:
several test functions needed by the plugins
*****************************************************************************
* Copyright (C) 1999, 2000 VideoLAN
* Copyright (C)
1996, 1997, 1998,
1999, 2000 VideoLAN
*
* Authors:
*
...
...
@@ -23,36 +23,8 @@
/*****************************************************************************
* Prototypes
*****************************************************************************/
/* audio output */
int
aout_SysOpen
(
aout_thread_t
*
p_aout
);
int
aout_SysReset
(
aout_thread_t
*
p_aout
);
int
aout_SysSetFormat
(
aout_thread_t
*
p_aout
);
int
aout_SysSetChannels
(
aout_thread_t
*
p_aout
);
int
aout_SysSetRate
(
aout_thread_t
*
p_aout
);
long
aout_SysGetBufInfo
(
aout_thread_t
*
p_aout
,
long
l_buffer_info
);
void
aout_SysPlaySamples
(
aout_thread_t
*
p_aout
,
byte_t
*
buffer
,
int
i_size
);
void
aout_SysClose
(
aout_thread_t
*
p_aout
);
/* video output */
int
vout_SysCreate
(
vout_thread_t
*
p_vout
,
char
*
psz_display
,
int
i_root_window
,
void
*
p_data
);
int
vout_SysInit
(
p_vout_thread_t
p_vout
);
void
vout_SysEnd
(
p_vout_thread_t
p_vout
);
void
vout_SysDestroy
(
p_vout_thread_t
p_vout
);
int
vout_SysManage
(
p_vout_thread_t
p_vout
);
void
vout_SysDisplay
(
p_vout_thread_t
p_vout
);
void
vout_SetPalette
(
p_vout_thread_t
p_vout
,
u16
*
red
,
u16
*
green
,
u16
*
blue
,
u16
*
transp
);
/* interface */
int
intf_SysCreate
(
p_intf_thread_t
p_intf
);
void
intf_SysDestroy
(
p_intf_thread_t
p_intf
);
void
intf_SysManage
(
p_intf_thread_t
p_intf
);
/* YUV transformations */
int
yuv_SysInit
(
p_vout_thread_t
p_vout
);
int
yuv_SysReset
(
p_vout_thread_t
p_vout
);
void
yuv_SysEnd
(
p_vout_thread_t
p_vout
);
int
TestProgram
(
char
*
psz_program
);
int
TestMethod
(
char
*
psz_var
,
char
*
psz_method
);
int
TestVersion
(
char
*
psz_version
);
int
TestMMX
(
void
);
plugins/beos/aout_beos.cpp
View file @
e13aed00
...
...
@@ -75,9 +75,9 @@ extern "C"
{
/*****************************************************************************
* aout_
Sys
Open: opens a BPushGameSound
* aout_
Be
Open: opens a BPushGameSound
*****************************************************************************/
int
aout_
Sys
Open
(
aout_thread_t
*
p_aout
)
int
aout_
Be
Open
(
aout_thread_t
*
p_aout
)
{
/* Allocate structure */
p_aout
->
p_sys
=
(
aout_sys_t
*
)
malloc
(
sizeof
(
aout_sys_t
)
);
...
...
@@ -136,41 +136,41 @@ int aout_SysOpen( aout_thread_t *p_aout )
return
(
0
);
}
/*****************************************************************************
* aout_
Sys
Reset: resets the dsp
* aout_
Be
Reset: resets the dsp
*****************************************************************************/
int
aout_
Sys
Reset
(
aout_thread_t
*
p_aout
)
int
aout_
Be
Reset
(
aout_thread_t
*
p_aout
)
{
return
(
0
);
}
/*****************************************************************************
* aout_
Sys
SetFormat: sets the dsp output format
* aout_
Be
SetFormat: sets the dsp output format
*****************************************************************************/
int
aout_
Sys
SetFormat
(
aout_thread_t
*
p_aout
)
int
aout_
Be
SetFormat
(
aout_thread_t
*
p_aout
)
{
return
(
0
);
}
/*****************************************************************************
* aout_
Sys
SetChannels: sets the dsp's stereo or mono mode
* aout_
Be
SetChannels: sets the dsp's stereo or mono mode
*****************************************************************************/
int
aout_
Sys
SetChannels
(
aout_thread_t
*
p_aout
)
int
aout_
Be
SetChannels
(
aout_thread_t
*
p_aout
)
{
return
(
0
);
}
/*****************************************************************************
* aout_
Sys
SetRate: sets the dsp's audio output rate
* aout_
Be
SetRate: sets the dsp's audio output rate
*****************************************************************************/
int
aout_
Sys
SetRate
(
aout_thread_t
*
p_aout
)
int
aout_
Be
SetRate
(
aout_thread_t
*
p_aout
)
{
return
(
0
);
}
/*****************************************************************************
* aout_
Sys
GetBufInfo: buffer status query
* aout_
Be
GetBufInfo: buffer status query
*****************************************************************************/
long
aout_
Sys
GetBufInfo
(
aout_thread_t
*
p_aout
,
long
l_buffer_limit
)
long
aout_
Be
GetBufInfo
(
aout_thread_t
*
p_aout
,
long
l_buffer_limit
)
{
long
i_hard_pos
=
4
*
p_aout
->
p_sys
->
p_sound
->
CurrentPosition
();
...
...
@@ -189,11 +189,11 @@ long aout_SysGetBufInfo( aout_thread_t *p_aout, long l_buffer_limit )
}
/*****************************************************************************
* aout_
Sys
PlaySamples: plays a sound samples buffer
* aout_
Be
PlaySamples: plays a sound samples buffer
*****************************************************************************
* This function writes a buffer of i_length bytes in the dsp
*****************************************************************************/
void
aout_
Sys
PlaySamples
(
aout_thread_t
*
p_aout
,
byte_t
*
buffer
,
int
i_size
)
void
aout_
Be
PlaySamples
(
aout_thread_t
*
p_aout
,
byte_t
*
buffer
,
int
i_size
)
{
long
i_newbuf_pos
;
...
...
@@ -223,9 +223,9 @@ void aout_SysPlaySamples( aout_thread_t *p_aout, byte_t *buffer, int i_size )
}
/*****************************************************************************
* aout_
Sys
Close: closes the dsp audio device
* aout_
Be
Close: closes the dsp audio device
*****************************************************************************/
void
aout_
Sys
Close
(
aout_thread_t
*
p_aout
)
void
aout_
Be
Close
(
aout_thread_t
*
p_aout
)
{
p_aout
->
p_sys
->
p_sound
->
UnlockCyclic
();
p_aout
->
p_sys
->
p_sound
->
StopPlaying
(
);
...
...
plugins/beos/beos.cpp
View file @
e13aed00
...
...
@@ -40,14 +40,39 @@ extern "C"
#include "video.h"
#include "video_output.h"
#include "plugins_export.h"
/*****************************************************************************
* Exported prototypes
*****************************************************************************/
void
aout_GetPlugin
(
p_aout_thread_t
p_aout
);
void
vout_GetPlugin
(
p_vout_thread_t
p_vout
);
void
intf_GetPlugin
(
p_intf_thread_t
p_intf
);
static
void
aout_GetPlugin
(
p_aout_thread_t
p_aout
);
static
void
vout_GetPlugin
(
p_vout_thread_t
p_vout
);
static
void
intf_GetPlugin
(
p_intf_thread_t
p_intf
);
/* Audio output */
int
aout_BeOpen
(
aout_thread_t
*
p_aout
);
int
aout_BeReset
(
aout_thread_t
*
p_aout
);
int
aout_BeSetFormat
(
aout_thread_t
*
p_aout
);
int
aout_BeSetChannels
(
aout_thread_t
*
p_aout
);
int
aout_BeSetRate
(
aout_thread_t
*
p_aout
);
long
aout_BeGetBufInfo
(
aout_thread_t
*
p_aout
,
long
l_buffer_info
);
void
aout_BePlaySamples
(
aout_thread_t
*
p_aout
,
byte_t
*
buffer
,
int
i_size
);
void
aout_BeClose
(
aout_thread_t
*
p_aout
);
/* Video output */
int
vout_BeCreate
(
vout_thread_t
*
p_vout
,
char
*
psz_display
,
int
i_root_window
,
void
*
p_data
);
int
vout_BeInit
(
p_vout_thread_t
p_vout
);
void
vout_BeEnd
(
p_vout_thread_t
p_vout
);
void
vout_BeDestroy
(
p_vout_thread_t
p_vout
);
int
vout_BeManage
(
p_vout_thread_t
p_vout
);
void
vout_BeDisplay
(
p_vout_thread_t
p_vout
);
void
vout_BeSetPalette
(
p_vout_thread_t
p_vout
,
u16
*
red
,
u16
*
green
,
u16
*
blue
,
u16
*
transp
);
/* Interface */
int
intf_BeCreate
(
p_intf_thread_t
p_intf
);
void
intf_BeDestroy
(
p_intf_thread_t
p_intf
);
void
intf_BeManage
(
p_intf_thread_t
p_intf
);
/*****************************************************************************
* GetConfig: get the plugin structure and configuration
...
...
@@ -65,49 +90,43 @@ plugin_info_t * GetConfig( void )
p_info
->
intf_GetPlugin
=
intf_GetPlugin
;
p_info
->
yuv_GetPlugin
=
NULL
;
return
(
p_info
);
}
/* the beos plugin always works under BeOS :) */
p_info
->
i_score
=
0x800
;
/*****************************************************************************
* Test: tests if the plugin can be launched
*****************************************************************************/
int
Test
(
void
)
{
/* the BeOS plugin always works under BeOS :) */
return
(
1
);
return
(
p_info
);
}
/*****************************************************************************
* Following functions are only called through the p_info structure
*****************************************************************************/
void
aout_GetPlugin
(
p_aout_thread_t
p_aout
)
static
void
aout_GetPlugin
(
p_aout_thread_t
p_aout
)
{
p_aout
->
p_sys_open
=
aout_
Sys
Open
;
p_aout
->
p_sys_reset
=
aout_
Sys
Reset
;
p_aout
->
p_sys_setformat
=
aout_
Sys
SetFormat
;
p_aout
->
p_sys_setchannels
=
aout_
Sys
SetChannels
;
p_aout
->
p_sys_setrate
=
aout_
Sys
SetRate
;
p_aout
->
p_sys_getbufinfo
=
aout_
Sys
GetBufInfo
;
p_aout
->
p_sys_playsamples
=
aout_
Sys
PlaySamples
;
p_aout
->
p_sys_close
=
aout_
Sys
Close
;
p_aout
->
p_sys_open
=
aout_
Be
Open
;
p_aout
->
p_sys_reset
=
aout_
Be
Reset
;
p_aout
->
p_sys_setformat
=
aout_
Be
SetFormat
;
p_aout
->
p_sys_setchannels
=
aout_
Be
SetChannels
;
p_aout
->
p_sys_setrate
=
aout_
Be
SetRate
;
p_aout
->
p_sys_getbufinfo
=
aout_
Be
GetBufInfo
;
p_aout
->
p_sys_playsamples
=
aout_
Be
PlaySamples
;
p_aout
->
p_sys_close
=
aout_
Be
Close
;
}
void
vout_GetPlugin
(
p_vout_thread_t
p_vout
)
static
void
vout_GetPlugin
(
p_vout_thread_t
p_vout
)
{
p_vout
->
p_sys_create
=
vout_
Sys
Create
;
p_vout
->
p_sys_init
=
vout_
Sys
Init
;
p_vout
->
p_sys_end
=
vout_
Sys
End
;
p_vout
->
p_sys_destroy
=
vout_
Sys
Destroy
;
p_vout
->
p_sys_manage
=
vout_
Sys
Manage
;
p_vout
->
p_sys_display
=
vout_
Sys
Display
;
p_vout
->
p_sys_create
=
vout_
Be
Create
;
p_vout
->
p_sys_init
=
vout_
Be
Init
;
p_vout
->
p_sys_end
=
vout_
Be
End
;
p_vout
->
p_sys_destroy
=
vout_
Be
Destroy
;
p_vout
->
p_sys_manage
=
vout_
Be
Manage
;
p_vout
->
p_sys_display
=
vout_
Be
Display
;
}
void
intf_GetPlugin
(
p_intf_thread_t
p_intf
)
static
void
intf_GetPlugin
(
p_intf_thread_t
p_intf
)
{
p_intf
->
p_sys_create
=
intf_
Sys
Create
;
p_intf
->
p_sys_destroy
=
intf_
Sys
Destroy
;
p_intf
->
p_sys_manage
=
intf_
Sys
Manage
;
p_intf
->
p_sys_create
=
intf_
Be
Create
;
p_intf
->
p_sys_destroy
=
intf_
Be
Destroy
;
p_intf
->
p_sys_manage
=
intf_
Be
Manage
;
}
}
/* extern "C" */
plugins/beos/intf_beos.cpp
View file @
e13aed00
...
...
@@ -125,9 +125,9 @@ extern "C"
{
/*****************************************************************************
* intf_
Sys
Create: initialize dummy interface
* intf_
Be
Create: initialize dummy interface
*****************************************************************************/
int
intf_
Sys
Create
(
intf_thread_t
*
p_intf
)
int
intf_
Be
Create
(
intf_thread_t
*
p_intf
)
{
/* Allocate instance and initialize some members */
p_intf
->
p_sys
=
(
intf_sys_t
*
)
malloc
(
sizeof
(
intf_sys_t
)
);
...
...
@@ -162,9 +162,9 @@ int intf_SysCreate( intf_thread_t *p_intf )
}
/*****************************************************************************
* intf_
Sys
Destroy: destroy dummy interface
* intf_
Be
Destroy: destroy dummy interface
*****************************************************************************/
void
intf_
Sys
Destroy
(
intf_thread_t
*
p_intf
)
void
intf_
Be
Destroy
(
intf_thread_t
*
p_intf
)
{
/* Close input thread, if any (blocking) */
if
(
p_intf
->
p_input
)
...
...
@@ -188,9 +188,9 @@ void intf_SysDestroy( intf_thread_t *p_intf )
/*****************************************************************************
* intf_
Sys
Manage: event loop
* intf_
Be
Manage: event loop
*****************************************************************************/
void
intf_
Sys
Manage
(
intf_thread_t
*
p_intf
)
void
intf_
Be
Manage
(
intf_thread_t
*
p_intf
)
{
if
(
p_intf
->
p_sys
->
i_key
!=
-
1
)
{
...
...
plugins/beos/vout_beos.cpp
View file @
e13aed00
...
...
@@ -340,11 +340,11 @@ static int BeosOpenDisplay ( vout_thread_t *p_vout );
static
void
BeosCloseDisplay
(
vout_thread_t
*
p_vout
);
/*****************************************************************************
* vout_
Sys
Create: allocates dummy video thread output method
* vout_
Be
Create: allocates dummy video thread output method
*****************************************************************************
* This function allocates and initializes a dummy vout method.
*****************************************************************************/
int
vout_
Sys
Create
(
vout_thread_t
*
p_vout
,
char
*
psz_display
,
int
vout_
Be
Create
(
vout_thread_t
*
p_vout
,
char
*
psz_display
,
int
i_root_window
,
void
*
p_data
)
{
/* Allocate structure */
...
...
@@ -371,9 +371,9 @@ int vout_SysCreate( vout_thread_t *p_vout, char *psz_display,
}
/*****************************************************************************
* vout_
Sys
Init: initialize dummy video thread output method
* vout_
Be
Init: initialize dummy video thread output method
*****************************************************************************/
int
vout_
Sys
Init
(
vout_thread_t
*
p_vout
)
int
vout_
Be
Init
(
vout_thread_t
*
p_vout
)
{
VideoWindow
*
p_win
=
p_vout
->
p_sys
->
p_window
;
u32
i_page_size
;
...
...
@@ -406,9 +406,9 @@ int vout_SysInit( vout_thread_t *p_vout )
}
/*****************************************************************************
* vout_
Sys
End: terminate dummy video thread output method
* vout_
Be
End: terminate dummy video thread output method
*****************************************************************************/
void
vout_
Sys
End
(
vout_thread_t
*
p_vout
)
void
vout_
Be
End
(
vout_thread_t
*
p_vout
)
{
VideoWindow
*
p_win
=
p_vout
->
p_sys
->
p_window
;
...
...
@@ -422,11 +422,11 @@ void vout_SysEnd( vout_thread_t *p_vout )
}
/*****************************************************************************
* vout_
Sys
Destroy: destroy dummy video thread output method
* vout_
Be
Destroy: destroy dummy video thread output method
*****************************************************************************
* Terminate an output method created by DummyCreateOutputMethod
*****************************************************************************/
void
vout_
Sys
Destroy
(
vout_thread_t
*
p_vout
)
void
vout_
Be
Destroy
(
vout_thread_t
*
p_vout
)
{
BeosCloseDisplay
(
p_vout
);
...
...
@@ -434,12 +434,12 @@ void vout_SysDestroy( vout_thread_t *p_vout )
}
/*****************************************************************************
* vout_
Sys
Manage: handle dummy events
* vout_
Be
Manage: handle dummy events
*****************************************************************************
* This function should be called regularly by video output thread. It manages
* console events. It returns a non null value on error.
*****************************************************************************/
int
vout_
Sys
Manage
(
vout_thread_t
*
p_vout
)
int
vout_
Be
Manage
(
vout_thread_t
*
p_vout
)
{
if
(
p_vout
->
i_changes
&
VOUT_SIZE_CHANGE
)
{
...
...
@@ -468,12 +468,12 @@ int vout_SysManage( vout_thread_t *p_vout )
}
/*****************************************************************************
* vout_
Sys
Display: displays previously rendered output
* vout_
Be
Display: displays previously rendered output
*****************************************************************************
* This function send the currently rendered image to dummy image, waits until
* it is displayed and switch the two rendering buffers, preparing next frame.
*****************************************************************************/
void
vout_
Sys
Display
(
vout_thread_t
*
p_vout
)
void
vout_
Be
Display
(
vout_thread_t
*
p_vout
)
{
VideoWindow
*
p_win
=
p_vout
->
p_sys
->
p_window
;
...
...
plugins/dsp/aout_dsp.c
View file @
e13aed00
...
...
@@ -22,10 +22,10 @@
/* TODO:
*
* - an aout_
sys
GetFormats() function
* - an aout_
Dsp
GetFormats() function
* - dsp inline/static
* - make this library portable (see mpg123)
* - macroify aout_
sys
PlaySamples &/| aout_
sys
GetBufInfo ?
* - macroify aout_
Dsp
PlaySamples &/| aout_
Dsp
GetBufInfo ?
*
*/
...
...
@@ -74,12 +74,12 @@ typedef struct aout_sys_s
}
aout_sys_t
;
/*****************************************************************************
* aout_
Sys
Open: opens the audio device (the digital sound processor)
* aout_
Dsp
Open: opens the audio device (the digital sound processor)
*****************************************************************************
* - This function opens the dsp as an usual non-blocking write-only file, and
* modifies the p_aout->p_sys->i_fd with the file's descriptor.
*****************************************************************************/
int
aout_
Sys
Open
(
aout_thread_t
*
p_aout
)
int
aout_
Dsp
Open
(
aout_thread_t
*
p_aout
)
{
/* Allocate structure */
p_aout
->
p_sys
=
malloc
(
sizeof
(
aout_sys_t
)
);
...
...
@@ -106,9 +106,9 @@ int aout_SysOpen( aout_thread_t *p_aout )
}
/*****************************************************************************
* aout_
Sys
Reset: resets the dsp
* aout_
Dsp
Reset: resets the dsp
*****************************************************************************/
int
aout_
Sys
Reset
(
aout_thread_t
*
p_aout
)
int
aout_
Dsp
Reset
(
aout_thread_t
*
p_aout
)
{
if
(
ioctl
(
p_aout
->
i_fd
,
SNDCTL_DSP_RESET
,
NULL
)
<
0
)
{
...
...
@@ -120,13 +120,13 @@ int aout_SysReset( aout_thread_t *p_aout )
}
/*****************************************************************************
* aout_
Sys
SetFormat: sets the dsp output format
* aout_
Dsp
SetFormat: sets the dsp output format
*****************************************************************************
* This functions tries to initialize the dsp output format with the value
* contained in the dsp structure, and if this value could not be set, the
* default value returned by ioctl is set.
*****************************************************************************/
int
aout_
Sys
SetFormat
(
aout_thread_t
*
p_aout
)
int
aout_
Dsp
SetFormat
(
aout_thread_t
*
p_aout
)
{
int
i_format
;
...
...
@@ -147,11 +147,11 @@ int aout_SysSetFormat( aout_thread_t *p_aout )
}
/*****************************************************************************
* aout_
Sys
SetChannels: sets the dsp's stereo or mono mode
* aout_
Dsp
SetChannels: sets the dsp's stereo or mono mode
*****************************************************************************
* This function acts just like the previous one...
*****************************************************************************/
int
aout_
Sys
SetChannels
(
aout_thread_t
*
p_aout
)
int
aout_
Dsp
SetChannels
(
aout_thread_t
*
p_aout
)
{
boolean_t
b_stereo
=
p_aout
->
b_stereo
;
...
...
@@ -172,13 +172,13 @@ int aout_SysSetChannels( aout_thread_t *p_aout )
}
/*****************************************************************************
* aout_
Sys
SetRate: sets the dsp's audio output rate
* aout_
Dsp
SetRate: sets the dsp's audio output rate
*****************************************************************************
* This function tries to initialize the dsp with the rate contained in the
* dsp structure, but if the dsp doesn't support this value, the function uses
* the value returned by ioctl...
*****************************************************************************/
int
aout_
Sys
SetRate
(
aout_thread_t
*
p_aout
)
int
aout_
Dsp
SetRate
(
aout_thread_t
*
p_aout
)
{
long
l_rate
;
...
...
@@ -199,7 +199,7 @@ int aout_SysSetRate( aout_thread_t *p_aout )
}
/*****************************************************************************
* aout_
Sys
GetBufInfo: buffer status query
* aout_
Dsp
GetBufInfo: buffer status query
*****************************************************************************
* This function fills in the audio_buf_info structure :
* - int fragments : number of available fragments (partially usend ones not
...
...
@@ -209,7 +209,7 @@ int aout_SysSetRate( aout_thread_t *p_aout )
* - int bytes : available space in bytes (includes partially used fragments)
* Note! 'bytes' could be more than fragments*fragsize
*****************************************************************************/
long
aout_
Sys
GetBufInfo
(
aout_thread_t
*
p_aout
,
long
l_buffer_limit
)
long
aout_
Dsp
GetBufInfo
(
aout_thread_t
*
p_aout
,
long
l_buffer_limit
)
{
ioctl
(
p_aout
->
i_fd
,
SNDCTL_DSP_GETOSPACE
,
&
p_aout
->
p_sys
->
audio_buf
);
...
...
@@ -220,11 +220,11 @@ long aout_SysGetBufInfo( aout_thread_t *p_aout, long l_buffer_limit )
}
/*****************************************************************************
* aout_
Sys
PlaySamples: plays a sound samples buffer
* aout_
Dsp
PlaySamples: plays a sound samples buffer
*****************************************************************************
* This function writes a buffer of i_length bytes in the dsp
*****************************************************************************/
void
aout_
Sys
PlaySamples
(
aout_thread_t
*
p_aout
,
byte_t
*
buffer
,
int
i_size
)
void
aout_
Dsp
PlaySamples
(
aout_thread_t
*
p_aout
,
byte_t
*
buffer
,
int
i_size
)
{
if
(
p_aout
->
b_active
)
{
...
...
@@ -233,9 +233,9 @@ void aout_SysPlaySamples( aout_thread_t *p_aout, byte_t *buffer, int i_size )
}
/*****************************************************************************
* aout_
Sys
Close: closes the dsp audio device
* aout_
Dsp
Close: closes the dsp audio device
*****************************************************************************/
void
aout_
Sys
Close
(
aout_thread_t
*
p_aout
)
void
aout_
Dsp
Close
(
aout_thread_t
*
p_aout
)
{
close
(
p_aout
->
i_fd
);
}
...
...
plugins/dsp/dsp.c
View file @
e13aed00
...
...
@@ -25,12 +25,17 @@
*****************************************************************************/
#include "defs.h"
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <stdlib.h>
/* malloc(), free() */
#include <unistd.h>
/* close() */
#include "config.h"
#include "common.h"
/* boolean_t, byte_t */
#include "threads.h"
#include "mtime.h"
#include "tests.h"
#include "plugins.h"
#include "interface.h"
...
...
@@ -38,18 +43,30 @@
#include "video.h"
#include "video_output.h"
#include "
plugins_export
.h"
#include "
main
.h"
/*****************************************************************************
* Exported prototypes
*****************************************************************************/
void
aout_GetPlugin
(
p_aout_thread_t
p_aout
);
static
void
aout_GetPlugin
(
p_aout_thread_t
p_aout
);
/* Audio output */
int
aout_DspOpen
(
aout_thread_t
*
p_aout
);
int
aout_DspReset
(
aout_thread_t
*
p_aout
);
int
aout_DspSetFormat
(
aout_thread_t
*
p_aout
);
int
aout_DspSetChannels
(
aout_thread_t
*
p_aout
);
int
aout_DspSetRate
(
aout_thread_t
*
p_aout
);
long
aout_DspGetBufInfo
(
aout_thread_t
*
p_aout
,
long
l_buffer_info
);
void
aout_DspPlaySamples
(
aout_thread_t
*
p_aout
,
byte_t
*
buffer
,
int
i_size
);
void
aout_DspClose
(
aout_thread_t
*
p_aout
);
/*****************************************************************************
* GetConfig: get the plugin structure and configuration
*****************************************************************************/
plugin_info_t
*
GetConfig
(
void
)
{
int
i_fd
;
plugin_info_t
*
p_info
=
(
plugin_info_t
*
)
malloc
(
sizeof
(
plugin_info_t
)
);
p_info
->
psz_name
=
"OSS /dev/dsp"
;
...
...
@@ -61,31 +78,40 @@ plugin_info_t * GetConfig( void )
p_info
->
intf_GetPlugin
=
NULL
;
p_info
->
yuv_GetPlugin
=
NULL
;
return
(
p_info
);
}
/* Test if the device can be opened */
if
(
(
i_fd
=
open
(
main_GetPszVariable
(
AOUT_DSP_VAR
,
AOUT_DSP_DEFAULT
),
O_WRONLY
))
<
0
)
{
p_info
->
i_score
=
0
;
}
else
{
close
(
i_fd
);
p_info
->
i_score
=
0x100
;
}
/*****************************************************************************
* Test: tests if the plugin can be launched
*****************************************************************************/
int
Test
(
void
)
{
/* TODO: check if suitable */
return
(
1
);
/* If this plugin was requested, score it higher */
if
(
TestMethod
(
AOUT_METHOD_VAR
,
"dsp"
)
)
{
p_info
->
i_score
+=
0x200
;