summaryrefslogtreecommitdiff
path: root/src/frame.h
diff options
context:
space:
mode:
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__*/