1 |
/* |
---|
2 |
* Copyright (C) 2005-2009 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 |
* This program 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) version 3 of the License. |
---|
13 |
* |
---|
14 |
* This program is distributed in the hope that it will be useful, |
---|
15 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
---|
16 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
---|
17 |
* GNU General Public License for more details. |
---|
18 |
* |
---|
19 |
* You should have received a copy of the GNU General Public License |
---|
20 |
* along with this program. If not, see <http://www.gnu.org/licenses/>. |
---|
21 |
* |
---|
22 |
*/ |
---|
23 |
|
---|
24 |
#ifndef __FFADO_AMDTPOXFORDRECEIVESTREAMPROCESSOR__ |
---|
25 |
#define __FFADO_AMDTPOXFORDRECEIVESTREAMPROCESSOR__ |
---|
26 |
|
---|
27 |
/** |
---|
28 |
* This class implements IEC61883-6 / AM824 / AMDTP based streaming |
---|
29 |
* |
---|
30 |
* but with all quircks required to make the oxford FW-92x devices working |
---|
31 |
*/ |
---|
32 |
|
---|
33 |
#include "debugmodule/debugmodule.h" |
---|
34 |
|
---|
35 |
#include "../amdtp/AmdtpReceiveStreamProcessor.h" |
---|
36 |
#include "libutil/ringbuffer.h" |
---|
37 |
|
---|
38 |
namespace Streaming { |
---|
39 |
|
---|
40 |
/*! |
---|
41 |
\brief The Base Class for an Oxford AMDTP receive stream processor |
---|
42 |
|
---|
43 |
This class implements a ReceiveStreamProcessor that demultiplexes |
---|
44 |
AMDTP streams into Ports. (Oxford style) |
---|
45 |
|
---|
46 |
*/ |
---|
47 |
class AmdtpOxfordReceiveStreamProcessor |
---|
48 |
: public AmdtpReceiveStreamProcessor |
---|
49 |
{ |
---|
50 |
|
---|
51 |
public: |
---|
52 |
/** |
---|
53 |
* Create a Oxford AMDTP receive StreamProcessor |
---|
54 |
* @param port 1394 port |
---|
55 |
* @param dimension number of substreams in the ISO stream |
---|
56 |
* (midi-muxed is only one stream) |
---|
57 |
*/ |
---|
58 |
AmdtpOxfordReceiveStreamProcessor(FFADODevice &parent, int dimension); |
---|
59 |
virtual ~AmdtpOxfordReceiveStreamProcessor(); |
---|
60 |
|
---|
61 |
virtual enum eChildReturnValue processPacketHeader(unsigned char *data, unsigned int length, |
---|
62 |
unsigned char tag, unsigned char sy, |
---|
63 |
uint32_t pkt_ctr); |
---|
64 |
virtual enum eChildReturnValue processPacketData(unsigned char *data, unsigned int length); |
---|
65 |
|
---|
66 |
virtual bool prepareChild(); |
---|
67 |
|
---|
68 |
protected: |
---|
69 |
// packet start timestamp |
---|
70 |
uint64_t m_next_packet_timestamp; |
---|
71 |
|
---|
72 |
// this contains the payload data |
---|
73 |
ffado_ringbuffer_t *m_temp_buffer; |
---|
74 |
|
---|
75 |
unsigned int m_packet_size_bytes; |
---|
76 |
char *m_payload_buffer; |
---|
77 |
|
---|
78 |
// dll stuff |
---|
79 |
double m_dll_e2; |
---|
80 |
float m_dll_b; |
---|
81 |
float m_dll_c; |
---|
82 |
uint64_t m_expected_time_of_receive; |
---|
83 |
float m_nominal_ticks_per_frame; |
---|
84 |
}; |
---|
85 |
|
---|
86 |
|
---|
87 |
} // end of namespace Streaming |
---|
88 |
|
---|
89 |
#endif /* __FFADO_AMDTPOXFORDRECEIVESTREAMPROCESSOR__ */ |
---|
90 |
|
---|