1 |
/* |
---|
2 |
* Copyright (C) 2005-2007 by Pieter Palmers |
---|
3 |
* |
---|
4 |
* This file is part of FFADO |
---|
5 |
* FFADO = Free Firewire (pro-)audio drivers for linux |
---|
6 |
* |
---|
7 |
* FFADO is based upon FreeBoB |
---|
8 |
* |
---|
9 |
* FFADO is free software; you can redistribute it and/or modify |
---|
10 |
* it under the terms of the GNU General Public License as published by |
---|
11 |
* the Free Software Foundation; either version 2 of the License, or |
---|
12 |
* (at your option) any later version. |
---|
13 |
* FFADO is distributed in the hope that it will be useful, |
---|
14 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
---|
15 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
---|
16 |
* GNU General Public License for more details. |
---|
17 |
* |
---|
18 |
* You should have received a copy of the GNU General Public License |
---|
19 |
* along with FFADO; if not, write to the Free Software |
---|
20 |
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, |
---|
21 |
* MA 02111-1307 USA. |
---|
22 |
* |
---|
23 |
*/ |
---|
24 |
|
---|
25 |
#ifndef __FFADO_SYTMONITOR__ |
---|
26 |
#define __FFADO_SYTMONITOR__ |
---|
27 |
#include "src/libstreaming/IsoStream.h" |
---|
28 |
#include "src/libstreaming/cip.h" |
---|
29 |
#include "src/libstreaming/cycletimer.h" |
---|
30 |
#include "src/libutil/ringbuffer.h" |
---|
31 |
|
---|
32 |
using namespace Streaming; |
---|
33 |
|
---|
34 |
struct cycle_info { |
---|
35 |
unsigned int cycle; |
---|
36 |
unsigned int seconds; |
---|
37 |
unsigned int syt; |
---|
38 |
unsigned int full_syt; |
---|
39 |
unsigned int pres_seconds; |
---|
40 |
unsigned int pres_cycle; |
---|
41 |
unsigned int pres_offset; |
---|
42 |
uint64_t pres_ticks; |
---|
43 |
}; |
---|
44 |
|
---|
45 |
class SytMonitor |
---|
46 |
: public IsoStream |
---|
47 |
{ |
---|
48 |
|
---|
49 |
public: |
---|
50 |
SytMonitor(int port); |
---|
51 |
virtual ~SytMonitor(); |
---|
52 |
|
---|
53 |
virtual enum raw1394_iso_disposition |
---|
54 |
putPacket(unsigned char *data, unsigned int length, |
---|
55 |
unsigned char channel, unsigned char tag, unsigned char sy, |
---|
56 |
unsigned int cycle, unsigned int dropped); |
---|
57 |
|
---|
58 |
void dumpInfo(); |
---|
59 |
unsigned int getMaxPacketSize() {return 4096;}; |
---|
60 |
unsigned int getPacketsPerPeriod() {return 1;}; |
---|
61 |
|
---|
62 |
bool readNextCycleInfo(struct cycle_info *cif); |
---|
63 |
bool consumeNextCycleInfo(); |
---|
64 |
|
---|
65 |
bool putCycleInfo(struct cycle_info *cif); |
---|
66 |
|
---|
67 |
IsoHandler * getHandler() {return m_handler;}; |
---|
68 |
|
---|
69 |
protected: |
---|
70 |
ffado_ringbuffer_t * m_cinfo_buffer; |
---|
71 |
|
---|
72 |
DECLARE_DEBUG_MODULE; |
---|
73 |
}; |
---|
74 |
|
---|
75 |
|
---|
76 |
#endif /* __FFADO_SYTMONITOR__ */ |
---|