root/trunk/freebob/src/ieee1394service.h

Revision 43, 2.1 kB (checked in by wagi, 19 years ago)

Debug module overhaul.
Compile warnings removed.
Creating and destroying of AvDevices? now done as described in mail.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
Line 
1 /* ieee1394service.h
2  * Copyright (C) 2004 by Daniel Wagner
3  *
4  * This file is part of FreeBob.
5  *
6  * FreeBob is free software; you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License as published by
8  * the Free Software Foundation; either version 2 of the License, or
9  * (at your option) any later version.
10  * FreeBob is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13  * GNU General Public License for more details.
14  *
15  * You should have received a copy of the GNU General Public License
16  * along with FreeBob; if not, write to the Free Software
17  * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
18  * MA 02111-1307 USA.
19  */
20 #ifndef IEEE1394SERVICE_H
21 #define IEEE1394SERVICE_H
22
23 #include <libraw1394/raw1394.h>
24 #include <libavc1394/rom1394.h>
25 #include <pthread.h>
26
27 #include "freebob.h"
28 #include "debugmodule.h"
29
30 /* XXX: add those to avc1394.h */
31
32 class Ieee1394Service {
33  public:
34     FBReturnCodes initialize();
35     void shutdown();
36
37     static Ieee1394Service* instance();
38     FBReturnCodes discoveryDevices( unsigned int iGenerationCount );
39
40     unsigned int getGenerationCount();
41
42  protected:
43     static int resetHandler( raw1394handle_t handle,
44                              unsigned int iGeneration );
45     void setGenerationCount( unsigned int iGeneration );
46
47     bool startRHThread();
48     void stopRHThread();
49     static void* rHThread( void* arg );
50
51     void printAvcUnitInfo( int iNodeId );
52     void printRomDirectory( int iNodeId,  rom1394_directory* pRomDir );
53
54     void avDeviceTests( octlet_t oGuid, int iPort, int iNodeId );
55  private:
56     Ieee1394Service();
57     ~Ieee1394Service();
58
59     static Ieee1394Service* m_pInstance;
60     raw1394handle_t m_handle;
61     raw1394handle_t m_rhHandle;
62     int m_iPort;                  // XXX dw: port in 1394 service makes no sense
63     bool m_bInitialised;
64     pthread_t m_thread;
65     pthread_mutex_t m_mutex;
66     bool m_bRHThreadRunning;
67     unsigned int m_iGenerationCount;
68
69     DECLARE_DEBUG_MODULE;
70 };
71
72 #endif
Note: See TracBrowser for help on using the browser.