]> git.sesse.net Git - vlc/blob - plugins/beos/VideoWindow.h
Improved overlay detection, default colour space selection.
[vlc] / plugins / beos / VideoWindow.h
1 /*****************************************************************************
2  * VideoWindow.h: BeOS video window class prototype
3  *****************************************************************************
4  * Copyright (C) 1999, 2000, 2001 VideoLAN
5  * $Id: VideoWindow.h,v 1.15 2002/04/01 05:49:00 tcastley Exp $
6  *
7  * Authors: Jean-Marc Dressler <polux@via.ecp.fr>
8  *          Tony Castley <tcastley@mail.powerup.com.au>
9  *          Richard Shepherd <richard@rshepherd.demon.co.uk>
10  *
11  * This program is free software; you can redistribute it and/or modify
12  * it under the terms of the GNU General Public License as published by
13  * the Free Software Foundation; either version 2 of the License, or
14  * (at your option) any later version.
15  * 
16  * This program is distributed in the hope that it will be useful,
17  * but WITHOUT ANY WARRANTY; without even the implied warranty of
18  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
19  * GNU General Public License for more details.
20  *
21  * You should have received a copy of the GNU General Public License
22  * along with this program; if not, write to the Free Software
23  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111, USA.
24  *****************************************************************************/
25 #define BITMAP  0
26 #define OVERLAY 1
27 #define OPENGL  2
28
29 typedef struct colorcombo
30 {
31         color_space colspace;
32         const char *name;
33         u32 chroma;
34         int planes;
35 } colorcombo;
36
37 colorcombo colspace[]=
38 {
39         {B_YUV422,   "B_YUV422",   FOURCC_Y422, 3},
40         {B_YCbCr422, "B_YCbCr422", FOURCC_UYVY, 3},
41         {B_RGB32,    "B_RGB32",    FOURCC_RV32, 1},
42         {B_RGB16,    "B_RGB16",    FOURCC_RV16, 1}
43 };
44
45 #define COLOR_COUNT 4
46 #define DEFAULT_COL 2
47
48
49 class VLCView : public BView
50 {
51 public:
52         VLCView( BRect bounds);
53         ~VLCView();
54         
55         void MouseDown(BPoint point);
56         void Draw(BRect updateRect);
57 };
58
59
60 class VideoWindow : public BWindow
61 {
62 public:
63     // standard constructor and destructor
64     VideoWindow( int v_width, int v_height,
65                  BRect frame); 
66     ~VideoWindow();
67     
68     void                Zoom(BPoint origin, float width, float height);
69     void            FrameResized(float width, float height);
70     void            FrameMoved(BPoint origin);
71     void            ScreenChanged(BRect frame, color_space mode);
72     void            drawBuffer(int bufferIndex);
73     void            WindowActivated(bool active);
74     int             SelectDrawingMode(int width, int height);
75     
76     // this is the hook controling direct screen connection
77     int32           i_width;     // incomming bitmap size 
78     int32           i_height;
79     BRect           winSize;     // current window size
80     bool            is_zoomed, vsync;
81     BBitmap             *bitmap[2];
82     BBitmap         *overlaybitmap;
83     VLCView             *view;
84     int             i_buffer;
85     bool                        teardownwindow;
86     thread_id       fDrawThreadID;
87     int             mode;
88     int             colspace_index;
89
90 private:
91     struct vout_thread_s   *p_vout;
92
93 };
94
95