00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018 #ifndef DVISO_H
00019 #define DVISO_H
00020
00021 #include "l1394_iso.h"
00022 #include "Thread.hpp"
00023 #include "libraw1394/raw1394.h"
00024 #include <deque>
00025
00026 using std::deque;
00027
00028 namespace L1394{
00029 class Node;
00030 namespace internal{
00031
00032
00033
00034
00035 class DvIso : public Iso{
00036
00037 public:
00038 DvIso(const Node* parent, raw1394handle_t);
00039 ~DvIso();
00040 virtual Frame* getFrame();
00041 virtual void releaseFrame(Frame*);
00042 virtual bool getFrameMode() const {return frame_mode;}
00043 virtual void setFrameMode(const bool b) {frame_mode = b;}
00044
00045 virtual int setParameter(const int buffercount,const int channel, const int buffersize);
00046
00047
00048
00049
00050 int startIsoListen();
00051
00052
00053
00054
00055 int stopIsoListen();
00056
00057 private:
00058 void isoRun();
00059
00060
00061
00062
00063 static int L1394IsoHandle(raw1394handle_t handle, int channel, size_t length, quadlet_t *data);
00064
00065 static void* run_static(void *me);
00066 static DvIso** dv_iso_array;
00067
00068 pthread_t thread;
00069 ThreadMutex mutex;
00070
00071 int channel;
00072 int buffer_count;
00073 bool iso_listen;
00074 bool frame_mode;
00075 const Node* parent;
00076
00077 deque < Frame* > frame_queue;
00078 deque < Frame* > ready_frames;
00079 Frame* current_frame;
00080
00081 raw1394handle_t iso_handler;
00082 };
00083 }
00084 }
00085 #endif