VideoWindow.h 2.91 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.16 2002/04/01 07:37:53 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
35
36
37
38
39
#define OVERLAY 1
#define OPENGL  2

typedef struct colorcombo
{
	color_space colspace;
	const char *name;
	u32 chroma;
	int planes;
} colorcombo;

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

#define COLOR_COUNT 4
#define DEFAULT_COL 2

48

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

59

60
class VideoWindow : public BWindow
61
62
63
{
public:
    // standard constructor and destructor
64
    VideoWindow( int v_width, int v_height,
65
                 BRect frame); 
66
    ~VideoWindow();
67
    
68
69
70
71
72
    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);
73
    void            WindowActivated(bool active);
74
    int             SelectDrawingMode(int width, int height);
75
    
Sam Hocevar's avatar
   
Sam Hocevar committed
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
84
    VLCView	        *view;
    int             i_buffer;
Sam Hocevar's avatar
   
Sam Hocevar committed
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
};
Sam Hocevar's avatar
   
Sam Hocevar committed
94

95