vout_beos.cpp 19 KB
Newer Older
1
2
3
/*****************************************************************************
 * vout_beos.cpp: beos video output display method
 *****************************************************************************
Sam Hocevar's avatar
   
Sam Hocevar committed
4
 * Copyright (C) 2000, 2001 VideoLAN
5
 * $Id: vout_beos.cpp,v 1.51 2002/04/02 10:44:40 tcastley Exp $
6
 *
Sam Hocevar's avatar
   
Sam Hocevar committed
7
8
 * Authors: Jean-Marc Dressler <polux@via.ecp.fr>
 *          Samuel Hocevar <sam@zoy.org>
Richard Shepherd's avatar
Richard Shepherd committed
9
 *          Tony Castley <tcastley@mail.powerup.com.au>
Sam Hocevar's avatar
   
Sam Hocevar committed
10
 *          Richard Shepherd <richard@rshepherd.demon.co.uk>
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
 *
 * 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 <errno.h>                                                 /* ENOMEM */
#include <stdlib.h>                                                /* free() */
#include <stdio.h>
#include <string.h>                                            /* strerror() */
34
35
#include <InterfaceKit.h>
#include <DirectWindow.h>
36
#include <Application.h>
37
#include <Bitmap.h>
38
39
40

extern "C"
{
Sam Hocevar's avatar
   
Sam Hocevar committed
41
#include <videolan/vlc.h>
42
43
44
45

#include "video.h"
#include "video_output.h"

Sam Hocevar's avatar
   
Sam Hocevar committed
46
#include "interface.h"
47

48
49
}

Sam Hocevar's avatar
   
Sam Hocevar committed
50
#include "VideoWindow.h"
51
#include "DrawingTidbits.h"
52
53

/*****************************************************************************
Sam Hocevar's avatar
   
Sam Hocevar committed
54
 * vout_sys_t: BeOS video output method descriptor
55
56
 *****************************************************************************
 * This structure is part of the video output thread descriptor.
Sam Hocevar's avatar
   
Sam Hocevar committed
57
 * It describes the BeOS specific properties of an output thread.
58
59
60
 *****************************************************************************/
typedef struct vout_sys_s
{
Sam Hocevar's avatar
   
Sam Hocevar committed
61
    VideoWindow *  p_window;
Sam Hocevar's avatar
   
Sam Hocevar committed
62

Sam Hocevar's avatar
   
Sam Hocevar committed
63
64
    s32 i_width;
    s32 i_height;
Sam Hocevar's avatar
   
Sam Hocevar committed
65
66
67
68

    u8 *pp_buffer[2];
    int i_index;

69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
} vout_sys_t;

/*****************************************************************************
 * beos_GetAppWindow : retrieve a BWindow pointer from the window name
 *****************************************************************************/
BWindow *beos_GetAppWindow(char *name)
{
    int32       index;
    BWindow     *window;
    
    for (index = 0 ; ; index++)
    {
        window = be_app->WindowAt(index);
        if (window == NULL)
            break;
84
        if (window->LockWithTimeout(20000) == B_OK)
85
86
87
88
89
90
91
92
93
94
95
        {
            if (strcmp(window->Name(), name) == 0)
            {
                window->Unlock();
                break;
            }
            window->Unlock();
        }
    }
    return window; 
}
96
97
98
99
100
101
102
/****************************************************************************
 * DrawingThread : thread that really does the drawing
 ****************************************************************************/
int32 Draw(void *data)
{
    VideoWindow* p_win;
    p_win = (VideoWindow *) data;
103

104
    if ( p_win->LockWithTimeout(50000) == B_OK )
105
    {
106
107
108
        if (p_win->vsync)
        {
            BScreen *screen;
109
            screen = new BScreen(p_win);
110
            screen-> WaitForRetrace(22000);
111
            delete screen;
112
        }
113
        if (p_win-> mode == OVERLAY)
114
        {
115
116
117
118
119
120
121
122
123
            p_win-> overlaybitmap->LockBits();
	        memcpy(p_win-> overlaybitmap->Bits(), 
	               p_win-> bitmap[p_win-> i_buffer]->Bits(),
		           p_win-> bitmap[p_win-> i_buffer]->BitsLength() );
            p_win-> overlaybitmap->UnlockBits();
            p_win-> view-> Invalidate();
        }
        else
        {
124
125
            p_win-> view-> DrawBitmap( p_win-> bitmap[p_win-> i_buffer], 
                                       p_win-> view->Bounds() );
126
127
128
129
130
131
132
133
        }                                
        p_win-> Unlock();
    }
    else
    {
        intf_Msg("Dropped Frame");
    }
    return B_OK;
Sam Hocevar's avatar
   
Sam Hocevar committed
134
135
}

136
/*****************************************************************************
137
 * VideoWindow constructor and destructor
138
 *****************************************************************************/
139
VideoWindow::VideoWindow( int v_width, int v_height, 
140
141
142
                          BRect frame )
            : BWindow( frame, NULL, B_TITLED_WINDOW, 
                    B_NOT_CLOSABLE | B_NOT_MINIMIZABLE )
143
{
144
145
146
147
148
149
150
151
    BView *mainView =  new BView( Bounds(), "mainView", 
                                  B_FOLLOW_ALL, B_FULL_UPDATE_ON_RESIZE);
    AddChild(mainView);
    mainView->SetViewColor(kBlack);
                                  
    /* create the view to do the display */
    view = new VLCView( Bounds() );
    mainView->AddChild(view);
152

Sam Hocevar's avatar
   
Sam Hocevar committed
153
    /* set the VideoWindow variables */
154
    teardownwindow = false;
155
    is_zoomed = false;
156

157
158
    /* call ScreenChanged to set vsync correctly */
    BScreen *screen;
159
    screen = new BScreen(this);
160
161
    ScreenChanged(screen->Frame(), screen->ColorSpace());
    delete screen;
Sam Hocevar's avatar
   
Sam Hocevar committed
162
    
163
    // remember current settings
164
165
166
167
    i_width = frame.IntegerWidth();
    i_height = frame.IntegerHeight();
    FrameResized(frame.IntegerWidth(), frame.IntegerHeight());

168
    mode = SelectDrawingMode(v_width, v_height);
169
    Show();
170
171
172
173
174
175
}

VideoWindow::~VideoWindow()
{
    int32 result;

176
    teardownwindow = true;
177
    Lock();
178
179
180
181
182
    view->ClearViewOverlay();
    wait_for_thread(fDrawThreadID, &result);
    delete overlaybitmap;
    delete bitmap[0];
    delete bitmap[1];
183
    Quit();
184
185
186
}

void VideoWindow::drawBuffer(int bufferIndex)
187
{
188
189
190
191
192
193
    status_t status;

    i_buffer = bufferIndex;
    fDrawThreadID = spawn_thread(Draw, "drawing_thread",
                                 B_DISPLAY_PRIORITY, (void*) this);
    wait_for_thread(fDrawThreadID, &status);
194
195
196
197
198
199
200
}

void VideoWindow::Zoom(BPoint origin, float width, float height )
{
    if(is_zoomed)
    {
        is_zoomed = !is_zoomed;
201
202
        MoveTo(winSize.left, winSize.top);
        ResizeTo(winSize.IntegerWidth(), winSize.IntegerHeight());
203
204
205
206
207
208
        be_app->ShowCursor();
    }
    else
    {
        is_zoomed = !is_zoomed;
        BScreen *screen;
209
        screen = new BScreen(this);
210
211
        BRect rect = screen->Frame();
        delete screen;
212
213
        MoveTo(0,0);
        ResizeTo(rect.IntegerWidth(), rect.IntegerHeight());
214
        be_app->ObscureCursor();
215
    }
216
    view->Invalidate();
217
218
219
220
221
}

void VideoWindow::FrameMoved(BPoint origin) 
{
	if (is_zoomed) return ;
222
223
    winSize = Frame();
    view->Invalidate();
224
225
226
227
}

void VideoWindow::FrameResized( float width, float height )
{
228
229
230
231
232
    float out_width, out_height;
    float out_left, out_top;
    float width_scale = width / i_width;
    float height_scale = height / i_height;

233
234
    if (width_scale <= height_scale)
    {
235
236
        out_width = (i_width * width_scale);
        out_height = (i_height * width_scale);
237
        out_left = 0; 
238
        out_top = (height - out_height) / 2;
239
240
241
    }
    else   /* if the height is proportionally smaller */
    {
242
243
        out_width = (i_width * height_scale);
        out_height = (i_height * height_scale);
244
        out_top = 0;
245
        out_left = (width - out_width) /2;
246
    }
247
248
249
250
251
252
253
    view->MoveTo(out_left,out_top);
    view->ResizeTo(out_width, out_height);
	if (!is_zoomed)
	{
        winSize = Frame();
    }
    view->Invalidate();
254
255
256
257
258
259
}

void VideoWindow::ScreenChanged(BRect frame, color_space mode)
{
    BScreen *screen;
    float refresh;
Sam Hocevar's avatar
   
Sam Hocevar committed
260
    
261
262
    view->Invalidate();
    screen = new BScreen(this);
263
    display_mode disp_mode; 
Sam Hocevar's avatar
   
Sam Hocevar committed
264
    
265
266
267
268
269
270
271
272
    screen-> GetMode(&disp_mode); 
    refresh = 
         (disp_mode.timing.pixel_clock * 1000)/((disp_mode.timing.h_total)* 
         (disp_mode.timing.v_total)); 
    if (refresh  < 61) 
    { 
        vsync = true; 
    } 
273
274
}

275
276
277
278
279
void VideoWindow::WindowActivated(bool active)
{
    view->Invalidate();
}

280
281
282
283
int VideoWindow::SelectDrawingMode(int width, int height)
{
    int drawingMode = BITMAP;

284
    int noOverlay = config_GetIntVariable( "nooverlay" );
285
286
    for (int i = 0; i < COLOR_COUNT; i++)
    {
287
        if (noOverlay) break;
288
289
290
291
292
293
        overlaybitmap = new BBitmap ( BRect( 0, 0, width, height ), 
                                  B_BITMAP_WILL_OVERLAY|B_BITMAP_RESERVE_OVERLAY_CHANNEL,
                                  colspace[i].colspace);

        if(overlaybitmap && overlaybitmap->InitCheck() == B_OK) 
        {
294
295
296
            overlay_restrictions r;
            overlaybitmap->GetOverlayRestrictions(&r);

297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
            drawingMode = OVERLAY;
            colspace_index = i;
            memset(overlaybitmap->Bits(), 0, overlaybitmap->BitsLength());
            rgb_color key;
		    view->SetViewOverlay(overlaybitmap, overlaybitmap->Bounds() ,view->Bounds(),
		                         &key, B_FOLLOW_ALL,
			                     B_OVERLAY_FILTER_HORIZONTAL|B_OVERLAY_FILTER_VERTICAL);
		    view->SetViewColor(key);
            SetTitle(VOUT_TITLE " (Overlay)");
            intf_Msg("Color index good: %i", colspace_index);
            break;
        }
        else
        {
            delete overlaybitmap;
            intf_Msg("Color index bad: %i", colspace_index);
        }        
	}

    if (drawingMode == BITMAP)
	{
        // fallback to RGB32
        colspace_index = DEFAULT_COL;
        SetTitle(VOUT_TITLE " (Bitmap)");
    }
    
    bitmap[0] = new BBitmap( BRect( 0, 0, width, height ), colspace[colspace_index].colspace);
    bitmap[1] = new BBitmap( BRect( 0, 0, width, height ), colspace[colspace_index].colspace);
    memset(bitmap[0]->Bits(), 0, bitmap[0]->BitsLength());
    memset(bitmap[1]->Bits(), 0, bitmap[1]->BitsLength());
    intf_Msg("Color index used: %i", colspace_index);
    return drawingMode;
}

Sam Hocevar's avatar
   
Sam Hocevar committed
331
332
333
/*****************************************************************************
 * VLCView::VLCView
 *****************************************************************************/
334
335
336
VLCView::VLCView(BRect bounds) : BView(bounds, "", B_FOLLOW_NONE,
                                       B_WILL_DRAW)

Sam Hocevar's avatar
   
Sam Hocevar committed
337
{
Sam Hocevar's avatar
   
Sam Hocevar committed
338
    SetViewColor(B_TRANSPARENT_32_BIT);
Sam Hocevar's avatar
   
Sam Hocevar committed
339
340
341
342
343
344
345
346
347
348
}

/*****************************************************************************
 * VLCView::~VLCView
 *****************************************************************************/
VLCView::~VLCView()
{
}

/*****************************************************************************
349
 * VLCVIew::MouseDown
Sam Hocevar's avatar
   
Sam Hocevar committed
350
351
352
 *****************************************************************************/
void VLCView::MouseDown(BPoint point)
{
Sam Hocevar's avatar
   
Sam Hocevar committed
353
354
    BWindow *win = Window();
    win->Zoom();
Sam Hocevar's avatar
   
Sam Hocevar committed
355
356
}

357
358
359
360
361
/*****************************************************************************
 * VLCVIew::Draw
 *****************************************************************************/
void VLCView::Draw(BRect updateRect) 
{
362
    VideoWindow *win = (VideoWindow *) Window();
363
    if (win->mode == BITMAP)
364
      FillRect(updateRect);
365
366
367
}


368
369
370
371
372
373
extern "C"
{

/*****************************************************************************
 * Local prototypes
 *****************************************************************************/
Sam Hocevar's avatar
   
Sam Hocevar committed
374
375
376
377
378
379
380
static int  vout_Create     ( vout_thread_t * );
static int  vout_Init       ( vout_thread_t * );
static void vout_End        ( vout_thread_t * );
static void vout_Destroy    ( vout_thread_t * );
static int  vout_Manage     ( vout_thread_t * );
static void vout_Display    ( vout_thread_t *, picture_t * );
static void vout_Render     ( vout_thread_t *, picture_t * );
Sam Hocevar's avatar
   
Sam Hocevar committed
381
382
383
384
385
386
387
388

static int  BeosOpenDisplay ( vout_thread_t *p_vout );
static void BeosCloseDisplay( vout_thread_t *p_vout );

/*****************************************************************************
 * Functions exported as capabilities. They are declared as static so that
 * we don't pollute the namespace too much.
 *****************************************************************************/
Sam Hocevar's avatar
   
Sam Hocevar committed
389
void _M( vout_getfunctions )( function_list_t * p_function_list )
Sam Hocevar's avatar
   
Sam Hocevar committed
390
391
392
393
394
395
396
{
    p_function_list->functions.vout.pf_create     = vout_Create;
    p_function_list->functions.vout.pf_init       = vout_Init;
    p_function_list->functions.vout.pf_end        = vout_End;
    p_function_list->functions.vout.pf_destroy    = vout_Destroy;
    p_function_list->functions.vout.pf_manage     = vout_Manage;
    p_function_list->functions.vout.pf_display    = vout_Display;
Sam Hocevar's avatar
   
Sam Hocevar committed
397
    p_function_list->functions.vout.pf_render     = vout_Render;
Sam Hocevar's avatar
   
Sam Hocevar committed
398
399
}

400
/*****************************************************************************
Sam Hocevar's avatar
   
Sam Hocevar committed
401
 * vout_Create: allocates BeOS video thread output method
402
 *****************************************************************************
Sam Hocevar's avatar
   
Sam Hocevar committed
403
 * This function allocates and initializes a BeOS vout method.
404
 *****************************************************************************/
Sam Hocevar's avatar
   
Sam Hocevar committed
405
int vout_Create( vout_thread_t *p_vout )
406
407
408
409
410
{
    /* Allocate structure */
    p_vout->p_sys = (vout_sys_t*) malloc( sizeof( vout_sys_t ) );
    if( p_vout->p_sys == NULL )
    {
Sam Hocevar's avatar
   
Sam Hocevar committed
411
        intf_ErrMsg( "error: %s", strerror(ENOMEM) );
412
413
        return( 1 );
    }
414
415
    p_vout->p_sys->i_width = p_vout->render.i_width;
    p_vout->p_sys->i_height = p_vout->render.i_height;
416

417
418
419
420
    return( 0 );
}

/*****************************************************************************
Sam Hocevar's avatar
   
Sam Hocevar committed
421
 * vout_Init: initialize BeOS video thread output method
422
 *****************************************************************************/
Sam Hocevar's avatar
   
Sam Hocevar committed
423
int vout_Init( vout_thread_t *p_vout )
424
{
Sam Hocevar's avatar
   
Sam Hocevar committed
425
426
427
428
429
    int i_index;
    picture_t *p_pic;

    I_OUTPUTPICTURES = 0;

Sam Hocevar's avatar
   
Sam Hocevar committed
430
431
432
433
434
435
    /* Open and initialize device */
    if( BeosOpenDisplay( p_vout ) )
    {
        intf_ErrMsg("vout error: can't open display");
        return 0;
    }
436
    /* Set the buffers */
437
438
439
    p_vout->p_sys->pp_buffer[0] = (u8*)p_vout->p_sys->p_window->bitmap[0]->Bits();
    p_vout->p_sys->pp_buffer[1] = (u8*)p_vout->p_sys->p_window->bitmap[1]->Bits();

440
441
442
443
    p_vout->output.i_width  = p_vout->render.i_width;
    p_vout->output.i_height = p_vout->render.i_height;

    /* Assume we have square pixels */
Sam Hocevar's avatar
   
Sam Hocevar committed
444
    p_vout->output.i_aspect = p_vout->p_sys->i_width
Sam Hocevar's avatar
   
Sam Hocevar committed
445
                               * VOUT_ASPECT_FACTOR / p_vout->p_sys->i_height;
446

447
    p_vout->output.i_chroma = colspace[p_vout->p_sys->p_window->colspace_index].chroma;
Sam Hocevar's avatar
   
Sam Hocevar committed
448

Sam Hocevar's avatar
   
Sam Hocevar committed
449
450
451
452
    p_vout->output.i_rmask  = 0x00ff0000;
    p_vout->output.i_gmask  = 0x0000ff00;
    p_vout->output.i_bmask  = 0x000000ff;

Sam Hocevar's avatar
   
Sam Hocevar committed
453
454
455
456
457
458
459
460
461
462
463
    p_pic = NULL;

    /* Find an empty picture slot */
    for( i_index = 0 ; i_index < VOUT_MAX_PICTURES ; i_index++ )
    {
        if( p_vout->p_picture[ i_index ].i_status == FREE_PICTURE )
        {
            p_pic = p_vout->p_picture + i_index;
            break;
        }
    }
464

Sam Hocevar's avatar
   
Sam Hocevar committed
465
    if( p_pic == NULL )
Sam Hocevar's avatar
   
Sam Hocevar committed
466
    {
Sam Hocevar's avatar
   
Sam Hocevar committed
467
        return 0;
468
    }
Sam Hocevar's avatar
   
Sam Hocevar committed
469
470
471
472
473

    p_vout->p_sys->i_index = 0;
    p_pic->p->p_pixels = p_vout->p_sys->pp_buffer[0];
    p_pic->p->i_lines = p_vout->p_sys->i_height;
    p_pic->p->b_margin = 0;
474
475
    p_pic->p->i_pitch = p_vout->p_sys->p_window->bitmap[0]->BytesPerRow();
    p_pic->p->i_pixel_bytes = p_pic->p->i_pitch / p_vout->p_sys->p_window->bitmap[0]->Bounds().IntegerWidth();
Sam Hocevar's avatar
   
Sam Hocevar committed
476

477
    p_pic->i_planes = colspace[p_vout->p_sys->p_window->colspace_index].planes;
Sam Hocevar's avatar
   
Sam Hocevar committed
478
479
480
481
482
483
484
485

    p_pic->i_status = DESTROYED_PICTURE;
    p_pic->i_type   = DIRECT_PICTURE;

    PP_OUTPUTPICTURE[ I_OUTPUTPICTURES ] = p_pic;

    I_OUTPUTPICTURES++;

486
487
488
489
    return( 0 );
}

/*****************************************************************************
Sam Hocevar's avatar
   
Sam Hocevar committed
490
 * vout_End: terminate BeOS video thread output method
491
 *****************************************************************************/
Sam Hocevar's avatar
   
Sam Hocevar committed
492
void vout_End( vout_thread_t *p_vout )
493
{
Sam Hocevar's avatar
   
Sam Hocevar committed
494
    BeosCloseDisplay( p_vout );
495
496
497
}

/*****************************************************************************
Sam Hocevar's avatar
   
Sam Hocevar committed
498
 * vout_Destroy: destroy BeOS video thread output method
499
500
501
 *****************************************************************************
 * Terminate an output method created by DummyCreateOutputMethod
 *****************************************************************************/
Sam Hocevar's avatar
   
Sam Hocevar committed
502
void vout_Destroy( vout_thread_t *p_vout )
503
504
505
506
507
{
    free( p_vout->p_sys );
}

/*****************************************************************************
Sam Hocevar's avatar
   
Sam Hocevar committed
508
 * vout_Manage: handle BeOS events
509
510
511
512
 *****************************************************************************
 * This function should be called regularly by video output thread. It manages
 * console events. It returns a non null value on error.
 *****************************************************************************/
Sam Hocevar's avatar
   
Sam Hocevar committed
513
int vout_Manage( vout_thread_t *p_vout )
514
{
515
                          
Sam Hocevar's avatar
   
Sam Hocevar committed
516
517
518
519
520
521
522
523
524
    return( 0 );
}

/*****************************************************************************
 * vout_Render: render previously calculated output
 *****************************************************************************/
void vout_Render( vout_thread_t *p_vout, picture_t *p_pic )
{
    ;
525
526
527
}

/*****************************************************************************
Sam Hocevar's avatar
   
Sam Hocevar committed
528
 * vout_Display: displays previously rendered output
529
 *****************************************************************************
Sam Hocevar's avatar
   
Sam Hocevar committed
530
 * This function send the currently rendered image to BeOS image, waits until
531
532
 * it is displayed and switch the two rendering buffers, preparing next frame.
 *****************************************************************************/
Sam Hocevar's avatar
   
Sam Hocevar committed
533
void vout_Display( vout_thread_t *p_vout, picture_t *p_pic )
534
535
{
    VideoWindow * p_win = p_vout->p_sys->p_window;
Sam Hocevar's avatar
   
Sam Hocevar committed
536

537
    /* draw buffer if required */    
Sam Hocevar's avatar
   
Sam Hocevar committed
538
    if (!p_win->teardownwindow)
539
    { 
Sam Hocevar's avatar
   
Sam Hocevar committed
540
       p_win->drawBuffer(p_vout->p_sys->i_index);
541
    }
542
    /* change buffer */
Sam Hocevar's avatar
   
Sam Hocevar committed
543
544
    p_vout->p_sys->i_index = ++p_vout->p_sys->i_index & 1;
    p_pic->p->p_pixels = p_vout->p_sys->pp_buffer[p_vout->p_sys->i_index];
545
546
547
548
549
}

/* following functions are local */

/*****************************************************************************
Sam Hocevar's avatar
   
Sam Hocevar committed
550
 * BeosOpenDisplay: open and initialize BeOS device
551
552
553
 *****************************************************************************/
static int BeosOpenDisplay( vout_thread_t *p_vout )
{ 
554

Sam Hocevar's avatar
   
Sam Hocevar committed
555
556
    p_vout->p_sys->p_window = new VideoWindow( p_vout->p_sys->i_width - 1,
                                               p_vout->p_sys->i_height - 1,
557
558
559
                                               BRect( 20, 50,
                                                      20 + p_vout->i_window_width -1, 
                                                      50 + p_vout->i_window_height ));
560

Sam Hocevar's avatar
   
Sam Hocevar committed
561
    if( p_vout->p_sys->p_window == NULL )
562
    {
Sam Hocevar's avatar
   
Sam Hocevar committed
563
        intf_ErrMsg( "error: cannot allocate memory for VideoWindow" );
564
565
566
567
568
569
570
        return( 1 );
    }   
    
    return( 0 );
}

/*****************************************************************************
Sam Hocevar's avatar
   
Sam Hocevar committed
571
 * BeosDisplay: close and reset BeOS device
572
573
574
575
576
577
578
 *****************************************************************************
 * Returns all resources allocated by BeosOpenDisplay and restore the original
 * state of the device.
 *****************************************************************************/
static void BeosCloseDisplay( vout_thread_t *p_vout )
{    
    /* Destroy the video window */
579
    delete p_vout->p_sys->p_window;
580
581
}

582
583


584
} /* extern "C" */