2
2
* beos_init.cpp: Initialization for BeOS specific features
3
3
*****************************************************************************
4
4
* Copyright (C) 1999-2004 the VideoLAN team
5
* $Id: 7e0e74c29d598aeb4f3f78dd29cc6f04b94cd2e2 $
5
* $Id: 226725b42b39412db04807f50ea37d57e5a96db1 $
7
7
* Authors: Jean-Marc Dressler <polux@via.ecp.fr>
66
71
#include "../../modules/gui/beos/MsgVals.h"
67
72
#define REALLY_QUIT 'requ'
74
static vlc_object_t *p_appthread;
72
79
/*****************************************************************************
73
80
* Local prototypes.
74
81
*****************************************************************************/
75
static void AppThread( vlc_object_t *p_appthread );
82
static void* AppThread( vlc_object_t *p_appthread );
77
84
/*****************************************************************************
78
85
* system_Init: create a BApplication object and fill in program path.
79
86
*****************************************************************************/
80
void system_Init( vlc_t *p_this, int *pi_argc, char *ppsz_argv[] )
87
void system_Init( libvlc_int_t *p_this, int *pi_argc, const char *ppsz_argv[] )
82
p_this->p_libvlc->p_appthread =
83
90
(vlc_object_t *)vlc_object_create( p_this, sizeof(vlc_object_t) );
85
92
/* Create the BApplication thread and wait for initialization */
86
vlc_thread_create( p_this->p_libvlc->p_appthread, "app thread", AppThread,
87
VLC_THREAD_PRIORITY_LOW, VLC_TRUE );
93
vlc_thread_create( p_appthread, "app thread", AppThread,
94
VLC_THREAD_PRIORITY_LOW, true );
90
97
/*****************************************************************************
91
98
* system_Configure: check for system specific configuration options.
92
99
*****************************************************************************/
93
void system_Configure( vlc_t *, int *pi_argc, char *ppsz_argv[] )
100
void system_Configure( libvlc_int_t *, int *pi_argc, const char *ppsz_argv[] )
97
104
/*****************************************************************************
98
105
* system_End: destroy the BApplication object.
99
106
*****************************************************************************/
100
void system_End( vlc_t *p_this )
107
void system_End( libvlc_int_t *p_this )
102
109
/* Tell the BApplication to die */
103
110
be_app->PostMessage( REALLY_QUIT );
105
vlc_thread_join( p_this->p_libvlc->p_appthread );
106
vlc_object_destroy( p_this->p_libvlc->p_appthread );
112
vlc_thread_join( p_appthread );
113
vlc_object_release( p_appthread );
108
free( p_this->p_libvlc->psz_vlcpath );
115
free( vlc_global()->psz_vlcpath );
111
118
/* following functions are local */
113
120
/*****************************************************************************
114
121
* AppThread: the BApplication thread.
115
122
*****************************************************************************/
116
static void AppThread( vlc_object_t * p_this )
123
static void* AppThread( vlc_object_t * p_this )
118
125
VlcApplication * BeApp =
119
126
new VlcApplication("application/x-vnd.videolan-vlc");
120
vlc_object_attach( p_this, p_this->p_vlc );
127
vlc_object_attach( p_this, p_this->p_libvlc );
121
128
BeApp->p_this = p_this;
123
130
vlc_object_detach( p_this );
127
135
} /* extern "C" */