vfs: check userland buffers before reading them.
[haiku.git] / src / apps / mediaplayer / media_node_framework / video / VideoTarget.h
blob4adc4d9b5724528101253260e1af895366dc2640
1 /*
2 * Copyright 2000-2008 Ingo Weinhold <ingo_weinhold@gmx.de> All rights reserved.
3 * Distributed under the terms of the MIT license.
4 */
6 /*! Derived classes are video consumer targets. Each time the consumer
7 has received a frame (that is not late and thus dropped) it calls
8 SetBitmap(). This method should immediately do whatever has to be done.
9 Until the next call to SetBitmap() the bitmap can be used -- thereafter
10 it is not allowed to use it any longer. Therefore the bitmap variable
11 is protected by a lock. Anytime it is going to be accessed, the object
12 must be locked.
14 #ifndef VIDEO_TARGET_H
15 #define VIDEO_TARGET_H
18 #include <Locker.h>
21 class BBitmap;
24 class VideoTarget {
25 public:
26 VideoTarget();
27 virtual ~VideoTarget();
29 bool LockBitmap();
30 void UnlockBitmap();
32 virtual void SetBitmap(const BBitmap* bitmap);
33 const BBitmap* GetBitmap() const;
35 protected:
36 BLocker fBitmapLock;
37 const BBitmap* volatile fBitmap;
40 #endif // VIDEO_TARGET_H