summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authordeva <deva>2006-04-10 13:04:31 +0000
committerdeva <deva>2006-04-10 13:04:31 +0000
commit582bcd19d6a58c266f5453961c87acf72fae5353 (patch)
tree5ee3bdc1726d833da65efab320e5eabfcb802e51 /lib
parent46b3c21f079a10e1ed072976d355a8026bcb7580 (diff)
*** empty log message ***
Diffstat (limited to 'lib')
-rw-r--r--lib/Makefile.am2
-rw-r--r--lib/frame.cc3
-rw-r--r--lib/frame.h7
3 files changed, 11 insertions, 1 deletions
diff --git a/lib/Makefile.am b/lib/Makefile.am
index f2293d1..6f01ef1 100644
--- a/lib/Makefile.am
+++ b/lib/Makefile.am
@@ -10,6 +10,7 @@ libmiav_la_SOURCES = \
info.cc \
info_simple.cc \
jpeg_mem_dest.cc \
+ libdv_wrapper.cc \
miav_config.cc \
mutex.cc \
network.cc \
@@ -32,6 +33,7 @@ EXTRA_DIST = \
info.h \
info_simple.h \
jpeg_mem_dest.h \
+ libdv_wrapper.h \
miav_config.h \
mutex.h \
network.h \
diff --git a/lib/frame.cc b/lib/frame.cc
index 568c46b..caab521 100644
--- a/lib/frame.cc
+++ b/lib/frame.cc
@@ -34,11 +34,14 @@ Frame::Frame(unsigned char *d, int sz)
{
if(sz) data = new unsigned char[sz];
if(sz && d) memcpy(data, d, sz);
+ if(sz == 0 && d) data = d;
size = sz;
number = 0;
memset(timecode, 0, sizeof(timecode));
endOfFrameStream = false;
+
+ usage = 0;
}
Frame::~Frame()
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;