VideoWindow.h 3.03 KB
Newer Older
1
/*****************************************************************************
Sam Hocevar's avatar
 
Sam Hocevar committed
2
 * VideoWindow.h: BeOS video window class prototype
3
 *****************************************************************************
Sam Hocevar's avatar
 
Sam Hocevar committed
4
 * Copyright (C) 1999, 2000, 2001 VideoLAN
5
 * $Id: VideoWindow.h,v 1.20 2002/06/01 08:54:08 tcastley Exp $
6
 *
Sam Hocevar's avatar
 
Sam Hocevar committed
7
 * Authors: Jean-Marc Dressler <polux@via.ecp.fr>
Richard Shepherd's avatar
Richard Shepherd committed
8 9
 *          Tony Castley <tcastley@mail.powerup.com.au>
 *          Richard Shepherd <richard@rshepherd.demon.co.uk>
10 11 12 13 14
 *
 * 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.
15
 * 
16 17
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 19
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
20
 *
21 22 23
 * 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.
24
 *****************************************************************************/
25
#define BITMAP  0
26 27 28 29 30 31 32 33 34
#define OVERLAY 1
#define OPENGL  2

typedef struct colorcombo
{
	color_space colspace;
	const char *name;
	u32 chroma;
	int planes;
35
	int pixel_bytes;
36 37 38 39
} colorcombo;

colorcombo colspace[]=
{
40 41 42 43 44
	{B_YCbCr420, "B_YCbCr420", FOURCC_I420, 3, 2},
	{B_YUV422,   "B_YUV422",   FOURCC_Y422, 3, 2},
	{B_YCbCr422, "B_YCbCr422", FOURCC_YUY2, 3, 2},
	{B_RGB32,    "B_RGB32",    FOURCC_RV32, 1, 4},
	{B_RGB16,    "B_RGB16",    FOURCC_RV16, 1, 2}
45 46
};

47 48
#define COLOR_COUNT 5
#define DEFAULT_COL 3
49

50

Sam Hocevar's avatar
 
Sam Hocevar committed
51 52 53 54 55 56
class VLCView : public BView
{
public:
	VLCView( BRect bounds);
	~VLCView();
	
57
	void MouseDown(BPoint point);
58
	void Draw(BRect updateRect);
Sam Hocevar's avatar
 
Sam Hocevar committed
59 60
};

61

62
class VideoWindow : public BWindow
63 64 65
{
public:
    // standard constructor and destructor
66
    VideoWindow( int v_width, int v_height,
67
                 BRect frame); 
68
    ~VideoWindow();
69
    
70 71 72 73 74
    void	        Zoom(BPoint origin, float width, float height);
    void            FrameResized(float width, float height);
    void            FrameMoved(BPoint origin);
    void            ScreenChanged(BRect frame, color_space mode);
    void            drawBuffer(int bufferIndex);
75
    void            WindowActivated(bool active);
76
    int             SelectDrawingMode(int width, int height);
77
    bool            QuitRequested();
78
    
Sam Hocevar's avatar
 
Sam Hocevar committed
79
    // this is the hook controling direct screen connection
80
    int32           i_width;     // incomming bitmap size 
81
    int32           i_height;
82
    BRect           winSize;     // current window size
83
    bool            is_zoomed, vsync;
84
    BBitmap	        *bitmap[3];
85
    BBitmap         *overlaybitmap;
86 87
    VLCView	        *view;
    int             i_buffer;
Sam Hocevar's avatar
 
Sam Hocevar committed
88
    bool			teardownwindow;
89
    thread_id       fDrawThreadID;
90
    int             mode;
91
    int             colspace_index;
92

93
private:
94
    struct vout_thread_s   *p_vout;
95

96
};
Sam Hocevar's avatar
 
Sam Hocevar committed
97

Sam Hocevar's avatar
 
Sam Hocevar committed
98