summaryrefslogtreecommitdiff
path: root/src/frame.h
diff options
context:
space:
mode:
authordeva <deva>2005-05-22 15:49:22 +0000
committerdeva <deva>2005-05-22 15:49:22 +0000
commitb04122f3f7884de08eb5d59bb3fd2bff829f9039 (patch)
tree6898a061f4e10a6026faa1ffe4a7a319256dacdf /src/frame.h
parentd74c7a00c417cffdc93a82efa2841e23d823bea6 (diff)
Added multithreaded encoding support.
Diffstat (limited to 'src/frame.h')
-rw-r--r--src/frame.h34
1 files changed, 34 insertions, 0 deletions
diff --git a/src/frame.h b/src/frame.h
index aebe3cb..72cfe8e 100644
--- a/src/frame.h
+++ b/src/frame.h
@@ -31,6 +31,9 @@
/*
* $Log$
+ * Revision 1.6 2005/05/22 15:49:22 deva
+ * Added multithreaded encoding support.
+ *
* Revision 1.5 2005/05/03 08:31:59 deva
* Removed the error object, and replaced it with a more generic info object.
*
@@ -45,17 +48,48 @@
#ifndef __FRAME_H__
#define __FRAME_H__
+// Definition of vector
+#include <vector>
+
+// Definition of priority_queue
+#include <queue>
+
class Frame {
public:
Frame(unsigned char *d, int sz);
~Frame();
+ /*
+ // Smaller frame number is higher priority
+ bool operator<(const Frame& f) const {
+ return number > f.number;
+ }
+ */
+
unsigned char *data;
int size;
+ unsigned int number;
+
bool shoot;
bool freeze;
bool record;
};
+#include <functional>
+
+template <typename T>
+struct frame_priority : std::binary_function<T, T, bool> {
+ bool operator() (const T& a, const T& b) const {
+ return ((Frame*)a)->number > ((Frame*)b)->number;
+ }
+};
+
+// Additional helper types.
+typedef std::vector< Frame* > FrameVector;
+typedef std::queue< FrameVector* > FrameVectorQueue;
+typedef std::priority_queue< Frame*,
+ std::vector<Frame*>,
+ frame_priority<Frame*> > FramePriorityQueue;
+
#endif/*__FRAME_H__*/