1 /*****************************************************************************
2 * VideoWindow.h: BeOS video window class prototype
3 *****************************************************************************
4 * Copyright (C) 1999, 2000, 2001 VideoLAN
5 * $Id: VideoWindow.h,v 1.3 2002/10/28 16:55:05 titer Exp $
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 * Stephan Aßmus <stippi@yellowbites.com>
12 * This program is free software; you can redistribute it and/or modify
13 * it under the terms of the GNU General Public License as published by
14 * the Free Software Foundation; either version 2 of the License, or
15 * (at your option) any later version.
17 * This program is distributed in the hope that it will be useful,
18 * but WITHOUT ANY WARRANTY; without even the implied warranty of
19 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20 * GNU General Public License for more details.
22 * You should have received a copy of the GNU General Public License
23 * along with this program; if not, write to the Free Software
24 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA.
25 *****************************************************************************/
27 #ifndef BEOS_VIDEO_WINDOW_H
28 #define BEOS_VIDEO_WINDOW_H
37 typedef struct colorcombo
46 colorcombo colspace[]=
48 {B_YCbCr420, "B_YCbCr420", VLC_FOURCC('I','4','2','0'), 3, 2},
49 {B_YUV422, "B_YUV422", VLC_FOURCC('Y','4','2','2'), 3, 2},
50 {B_YCbCr422, "B_YCbCr422", VLC_FOURCC('Y','U','Y','2'), 3, 2},
51 {B_RGB32, "B_RGB32", VLC_FOURCC('R','V','3','2'), 1, 4},
52 {B_RGB16, "B_RGB16", VLC_FOURCC('R','V','1','6'), 1, 2}
59 class VLCView : public BView
62 VLCView( BRect bounds);
65 virtual void AttachedToWindow();
66 virtual void MouseDown(BPoint where);
67 virtual void MouseMoved(BPoint where, uint32 transit,
68 const BMessage* dragMessage);
70 virtual void Draw(BRect updateRect);
71 virtual void KeyDown(const char* bytes, int32 numBytes);
74 bigtime_t fLastMouseMovedTime;
77 bool fIgnoreDoubleClick;
81 class VideoWindow : public BWindow
84 VideoWindow(int v_width,
87 vout_thread_t *p_vout);
88 virtual ~VideoWindow();
91 virtual void MessageReceived(BMessage* message);
92 virtual void Zoom(BPoint origin,
93 float width, float height);
94 virtual void FrameResized(float width, float height);
95 virtual void FrameMoved(BPoint origin);
96 virtual void ScreenChanged(BRect frame,
98 virtual void WindowActivated(bool active);
101 void drawBuffer(int bufferIndex);
103 void ToggleInterfaceShowing();
104 void SetInterfaceShowing(bool showIt);
106 void SetCorrectAspectRatio(bool doIt);
107 inline bool CorrectAspectRatio() const
108 { return fCorrectAspect; }
109 inline status_t InitCheck() const
110 { return fInitStatus; }
113 // this is the hook controling direct screen connection
114 int32 i_width; // aspect corrected bitmap size
116 BRect winSize; // current window size
117 bool is_zoomed, vsync;
119 BBitmap *overlaybitmap;
122 volatile bool teardownwindow;
123 thread_id fDrawThreadID;
128 status_t _AllocateBuffers(int width,
132 void _BlankBitmap(BBitmap* bitmap) const;
133 void _SetVideoSize(uint32 mode);
135 void _SaveScreenShot( BBitmap* bitmap,
137 uint32 translatorID ) const;
138 static int32 _save_screen_shot( void* cookie );
140 struct screen_shot_info
149 vout_thread_t *p_vout;
151 int32 fTrueWidth; // incomming bitmap size
154 window_feel fCachedFeel;
155 bool fInterfaceShowing;
156 status_t fInitStatus;
159 #endif // BEOS_VIDEO_WINDOW_H