summaryrefslogtreecommitdiff
path: root/lib/frame.h
diff options
context:
space:
mode:
Diffstat (limited to 'lib/frame.h')
-rw-r--r--lib/frame.h7
1 files changed, 6 insertions, 1 deletions
diff --git a/lib/frame.h b/lib/frame.h
index 988f460..66c2ce7 100644
--- a/lib/frame.h
+++ b/lib/frame.h
@@ -28,12 +28,15 @@
#ifndef __FRAME_H__
#define __FRAME_H__
+#define START_USE_FRAME(x) x->usage++
+#define STOP_USE_FRAME(x) if(--x->usage == 0) delete x; x = NULL
+
// Definition of vector
#include <vector>
class Frame {
public:
- Frame(unsigned char *d, int sz);
+ Frame(unsigned char *d, int sz = 0);
~Frame();
unsigned char *data;
@@ -51,6 +54,8 @@ public:
char timecode[12];
bool endOfFrameStream;
+
+ int usage;
};
typedef std::vector< Frame* > FrameVector;