10fc56ed5SStephan Aßmus/*
20fc56ed5SStephan Aßmus * Copyright 2000-2008 Ingo Weinhold <ingo_weinhold@gmx.de> All rights reserved.
30fc56ed5SStephan Aßmus * Distributed under the terms of the MIT license.
40fc56ed5SStephan Aßmus */
50fc56ed5SStephan Aßmus
60fc56ed5SStephan Aßmus/*!	Derived classes are video consumer targets. Each time the consumer
70fc56ed5SStephan Aßmus	has received a frame (that is not late and thus dropped) it calls
80fc56ed5SStephan Aßmus	SetBitmap(). This method should immediately do whatever has to be done.
90fc56ed5SStephan Aßmus	Until the next call to SetBitmap() the bitmap can be used -- thereafter
100fc56ed5SStephan Aßmus	it is not allowed to use it any longer. Therefore the bitmap variable
110fc56ed5SStephan Aßmus	is protected by a lock. Anytime it is going to be accessed, the object
120fc56ed5SStephan Aßmus	must be locked.
130fc56ed5SStephan Aßmus*/
140fc56ed5SStephan Aßmus#ifndef VIDEO_TARGET_H
150fc56ed5SStephan Aßmus#define VIDEO_TARGET_H
160fc56ed5SStephan Aßmus
170fc56ed5SStephan Aßmus
180fc56ed5SStephan Aßmus#include <Locker.h>
190fc56ed5SStephan Aßmus
200fc56ed5SStephan Aßmus
210fc56ed5SStephan Aßmusclass BBitmap;
220fc56ed5SStephan Aßmus
230fc56ed5SStephan Aßmus
240fc56ed5SStephan Aßmusclass VideoTarget {
250fc56ed5SStephan Aßmus public:
260fc56ed5SStephan Aßmus								VideoTarget();
270fc56ed5SStephan Aßmus	virtual						~VideoTarget();
280fc56ed5SStephan Aßmus
290fc56ed5SStephan Aßmus			bool				LockBitmap();
300fc56ed5SStephan Aßmus			void				UnlockBitmap();
310fc56ed5SStephan Aßmus
320fc56ed5SStephan Aßmus	virtual	void				SetBitmap(const BBitmap* bitmap);
330fc56ed5SStephan Aßmus			const BBitmap*		GetBitmap() const;
340fc56ed5SStephan Aßmus
350fc56ed5SStephan Aßmus protected:
360fc56ed5SStephan Aßmus			BLocker				fBitmapLock;
370fc56ed5SStephan Aßmus			const BBitmap* volatile	fBitmap;
380fc56ed5SStephan Aßmus};
390fc56ed5SStephan Aßmus
400fc56ed5SStephan Aßmus#endif	// VIDEO_TARGET_H