1*0fc56ed5SStephan Aßmus /* 2*0fc56ed5SStephan Aßmus * Copyright 2000-2008 Ingo Weinhold <ingo_weinhold@gmx.de> All rights reserved. 3*0fc56ed5SStephan Aßmus * Distributed under the terms of the MIT license. 4*0fc56ed5SStephan Aßmus */ 5*0fc56ed5SStephan Aßmus 6*0fc56ed5SStephan Aßmus /*! Derived classes are video consumer targets. Each time the consumer 7*0fc56ed5SStephan Aßmus has received a frame (that is not late and thus dropped) it calls 8*0fc56ed5SStephan Aßmus SetBitmap(). This method should immediately do whatever has to be done. 9*0fc56ed5SStephan Aßmus Until the next call to SetBitmap() the bitmap can be used -- thereafter 10*0fc56ed5SStephan Aßmus it is not allowed to use it any longer. Therefore the bitmap variable 11*0fc56ed5SStephan Aßmus is protected by a lock. Anytime it is going to be accessed, the object 12*0fc56ed5SStephan Aßmus must be locked. 13*0fc56ed5SStephan Aßmus */ 14*0fc56ed5SStephan Aßmus #ifndef VIDEO_TARGET_H 15*0fc56ed5SStephan Aßmus #define VIDEO_TARGET_H 16*0fc56ed5SStephan Aßmus 17*0fc56ed5SStephan Aßmus 18*0fc56ed5SStephan Aßmus #include <Locker.h> 19*0fc56ed5SStephan Aßmus 20*0fc56ed5SStephan Aßmus 21*0fc56ed5SStephan Aßmus class BBitmap; 22*0fc56ed5SStephan Aßmus 23*0fc56ed5SStephan Aßmus 24*0fc56ed5SStephan Aßmus class VideoTarget { 25*0fc56ed5SStephan Aßmus public: 26*0fc56ed5SStephan Aßmus VideoTarget(); 27*0fc56ed5SStephan Aßmus virtual ~VideoTarget(); 28*0fc56ed5SStephan Aßmus 29*0fc56ed5SStephan Aßmus bool LockBitmap(); 30*0fc56ed5SStephan Aßmus void UnlockBitmap(); 31*0fc56ed5SStephan Aßmus 32*0fc56ed5SStephan Aßmus virtual void SetBitmap(const BBitmap* bitmap); 33*0fc56ed5SStephan Aßmus const BBitmap* GetBitmap() const; 34*0fc56ed5SStephan Aßmus 35*0fc56ed5SStephan Aßmus protected: 36*0fc56ed5SStephan Aßmus BLocker fBitmapLock; 37*0fc56ed5SStephan Aßmus const BBitmap* volatile fBitmap; 38*0fc56ed5SStephan Aßmus }; 39*0fc56ed5SStephan Aßmus 40*0fc56ed5SStephan Aßmus #endif // VIDEO_TARGET_H 41