]> git.sesse.net Git - vlc/blob - plugins/beos/beos.cpp
. autod�tection des plugins
[vlc] / plugins / beos / beos.cpp
1 /*****************************************************************************
2  * beos.cpp : BeOS plugin for vlc
3  *****************************************************************************
4  * Copyright (C) 2000 VideoLAN
5  *
6  * Authors:
7  *
8  * This program is free software; you can redistribute it and/or modify
9  * it under the terms of the GNU General Public License as published by
10  * the Free Software Foundation; either version 2 of the License, or
11  * (at your option) any later version.
12  * 
13  * This program is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16  * GNU General Public License for more details.
17  *
18  * You should have received a copy of the GNU General Public License
19  * along with this program; if not, write to the Free Software
20  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111, USA.
21  *****************************************************************************/
22
23 /*****************************************************************************
24  * Preamble
25  *****************************************************************************/
26 #include "defs.h"
27
28 #include <stdlib.h>                                      /* malloc(), free() */
29
30 extern "C"
31 {
32 #include "config.h"
33 #include "common.h"                                     /* boolean_t, byte_t */
34 #include "threads.h"
35 #include "mtime.h"
36 #include "plugins.h"
37
38 #include "interface.h"
39 #include "audio_output.h"
40 #include "video.h"
41 #include "video_output.h"
42
43 /*****************************************************************************
44  * Exported prototypes
45  *****************************************************************************/
46 static void aout_GetPlugin( p_aout_thread_t p_aout );
47 static void vout_GetPlugin( p_vout_thread_t p_vout );
48 static void intf_GetPlugin( p_intf_thread_t p_intf );
49
50 /* Audio output */
51 int     aout_BeOpen         ( aout_thread_t *p_aout );
52 int     aout_BeReset        ( aout_thread_t *p_aout );
53 int     aout_BeSetFormat    ( aout_thread_t *p_aout );
54 int     aout_BeSetChannels  ( aout_thread_t *p_aout );
55 int     aout_BeSetRate      ( aout_thread_t *p_aout );
56 long    aout_BeGetBufInfo   ( aout_thread_t *p_aout, long l_buffer_info );
57 void    aout_BePlaySamples  ( aout_thread_t *p_aout, byte_t *buffer,
58                               int i_size );
59 void    aout_BeClose        ( aout_thread_t *p_aout );
60
61 /* Video output */
62 int     vout_BeCreate       ( vout_thread_t *p_vout, char *psz_display,
63                               int i_root_window, void *p_data );
64 int     vout_BeInit         ( p_vout_thread_t p_vout );
65 void    vout_BeEnd          ( p_vout_thread_t p_vout );
66 void    vout_BeDestroy      ( p_vout_thread_t p_vout );
67 int     vout_BeManage       ( p_vout_thread_t p_vout );
68 void    vout_BeDisplay      ( p_vout_thread_t p_vout );
69 void    vout_BeSetPalette   ( p_vout_thread_t p_vout,
70                               u16 *red, u16 *green, u16 *blue, u16 *transp );
71
72 /* Interface */
73 int     intf_BeCreate       ( p_intf_thread_t p_intf );
74 void    intf_BeDestroy      ( p_intf_thread_t p_intf );
75 void    intf_BeManage       ( p_intf_thread_t p_intf );
76
77 /*****************************************************************************
78  * GetConfig: get the plugin structure and configuration
79  *****************************************************************************/
80 plugin_info_t * GetConfig( void )
81 {
82     plugin_info_t * p_info = (plugin_info_t *) malloc( sizeof(plugin_info_t) );
83
84     p_info->psz_name    = "BeOS";
85     p_info->psz_version = VERSION;
86     p_info->psz_author  = "the VideoLAN team <vlc@videolan.org>";
87
88     p_info->aout_GetPlugin = aout_GetPlugin;
89     p_info->vout_GetPlugin = vout_GetPlugin;
90     p_info->intf_GetPlugin = intf_GetPlugin;
91     p_info->yuv_GetPlugin = NULL;
92
93     /* the beos plugin always works under BeOS :) */
94     p_info->i_score = 0x800;
95
96     return( p_info );
97 }
98
99 /*****************************************************************************
100  * Following functions are only called through the p_info structure
101  *****************************************************************************/
102
103 static void aout_GetPlugin( p_aout_thread_t p_aout )
104 {
105     p_aout->p_sys_open        = aout_BeOpen;
106     p_aout->p_sys_reset       = aout_BeReset;
107     p_aout->p_sys_setformat   = aout_BeSetFormat;
108     p_aout->p_sys_setchannels = aout_BeSetChannels;
109     p_aout->p_sys_setrate     = aout_BeSetRate;
110     p_aout->p_sys_getbufinfo  = aout_BeGetBufInfo;
111     p_aout->p_sys_playsamples = aout_BePlaySamples;
112     p_aout->p_sys_close       = aout_BeClose;
113 }
114
115 static void vout_GetPlugin( p_vout_thread_t p_vout )
116 {
117     p_vout->p_sys_create  = vout_BeCreate;
118     p_vout->p_sys_init    = vout_BeInit;
119     p_vout->p_sys_end     = vout_BeEnd;
120     p_vout->p_sys_destroy = vout_BeDestroy;
121     p_vout->p_sys_manage  = vout_BeManage;
122     p_vout->p_sys_display = vout_BeDisplay;
123 }
124
125 static void intf_GetPlugin( p_intf_thread_t p_intf )
126 {
127     p_intf->p_sys_create  = intf_BeCreate;
128     p_intf->p_sys_destroy = intf_BeDestroy;
129     p_intf->p_sys_manage  = intf_BeManage;
130 }
131
132 } /* extern "C" */