1 /*****************************************************************************
2 * beos.cpp : BeOS plugin for vlc
3 *****************************************************************************
4 * Copyright (C) 2000 VideoLAN
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.
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.
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 *****************************************************************************/
23 /*****************************************************************************
25 *****************************************************************************/
28 #include <stdlib.h> /* malloc(), free() */
33 #include "common.h" /* boolean_t, byte_t */
38 #include "interface.h"
39 #include "audio_output.h"
41 #include "video_output.h"
43 /*****************************************************************************
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 );
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,
59 void aout_BeClose ( aout_thread_t *p_aout );
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 );
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 );
77 /*****************************************************************************
78 * GetConfig: get the plugin structure and configuration
79 *****************************************************************************/
80 plugin_info_t * GetConfig( void )
82 plugin_info_t * p_info = (plugin_info_t *) malloc( sizeof(plugin_info_t) );
84 p_info->psz_name = "BeOS";
85 p_info->psz_version = VERSION;
86 p_info->psz_author = "the VideoLAN team <vlc@videolan.org>";
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;
93 /* the beos plugin always works under BeOS :) */
94 p_info->i_score = 0x800;
99 /*****************************************************************************
100 * Following functions are only called through the p_info structure
101 *****************************************************************************/
103 static void aout_GetPlugin( p_aout_thread_t p_aout )
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;
115 static void vout_GetPlugin( p_vout_thread_t p_vout )
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;
125 static void intf_GetPlugin( p_intf_thread_t p_intf )
127 p_intf->p_sys_create = intf_BeCreate;
128 p_intf->p_sys_destroy = intf_BeDestroy;
129 p_intf->p_sys_manage = intf_BeManage;