diff options
Diffstat (limited to 'lib')
| -rw-r--r-- | lib/Makefile.am | 2 | ||||
| -rw-r--r-- | lib/frame.cc | 3 | ||||
| -rw-r--r-- | lib/frame.h | 7 | 
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; | 
