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 |
* This library is free software; you can redistribute it and/or |
---|
10 |
* modify it under the terms of the GNU Lesser General Public |
---|
11 |
* License version 2.1, as published by the Free Software Foundation; |
---|
12 |
* |
---|
13 |
* This library 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 GNU |
---|
16 |
* Lesser General Public License for more details. |
---|
17 |
* |
---|
18 |
* You should have received a copy of the GNU Lesser General Public |
---|
19 |
* License along with this library; if not, write to the Free Software |
---|
20 |
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, |
---|
21 |
* MA 02110-1301 USA |
---|
22 |
*/ |
---|
23 |
|
---|
24 |
#ifndef __FFADO_AMDTPSLAVESTREAMPROCESSOR__ |
---|
25 |
#define __FFADO_AMDTPSLAVESTREAMPROCESSOR__ |
---|
26 |
|
---|
27 |
/** |
---|
28 |
* This class implements IEC61883-6 / AM824 / AMDTP based streaming |
---|
29 |
*/ |
---|
30 |
#include "AmdtpStreamProcessor.h" |
---|
31 |
|
---|
32 |
#include "../debugmodule/debugmodule.h" |
---|
33 |
|
---|
34 |
#include "cip.h" |
---|
35 |
#include <libiec61883/iec61883.h> |
---|
36 |
#include <pthread.h> |
---|
37 |
|
---|
38 |
#define AMDTP_MAX_PACKET_SIZE 2048 |
---|
39 |
|
---|
40 |
#define IEC61883_STREAM_TYPE_MIDI 0x0D |
---|
41 |
#define IEC61883_STREAM_TYPE_SPDIF 0x00 |
---|
42 |
#define IEC61883_STREAM_TYPE_MBLA 0x06 |
---|
43 |
|
---|
44 |
#define IEC61883_AM824_LABEL_MASK 0xFF000000 |
---|
45 |
#define IEC61883_AM824_GET_LABEL(x) (((x) & 0xFF000000) >> 24) |
---|
46 |
#define IEC61883_AM824_SET_LABEL(x,y) ((x) | ((y)<<24)) |
---|
47 |
|
---|
48 |
#define IEC61883_AM824_LABEL_MIDI_NO_DATA 0x80 |
---|
49 |
#define IEC61883_AM824_LABEL_MIDI_1X 0x81 |
---|
50 |
#define IEC61883_AM824_LABEL_MIDI_2X 0x82 |
---|
51 |
#define IEC61883_AM824_LABEL_MIDI_3X 0x83 |
---|
52 |
|
---|
53 |
namespace Streaming { |
---|
54 |
|
---|
55 |
class AmdtpSlaveReceiveStreamProcessor; |
---|
56 |
|
---|
57 |
class AmdtpSlaveTransmitStreamProcessor |
---|
58 |
: public AmdtpTransmitStreamProcessor |
---|
59 |
{ |
---|
60 |
|
---|
61 |
public: |
---|
62 |
AmdtpSlaveTransmitStreamProcessor(int port, int framerate, int dimension); |
---|
63 |
|
---|
64 |
virtual ~AmdtpSlaveTransmitStreamProcessor(); |
---|
65 |
|
---|
66 |
enum raw1394_iso_disposition |
---|
67 |
getPacket(unsigned char *data, unsigned int *length, |
---|
68 |
unsigned char *tag, unsigned char *sy, |
---|
69 |
int cycle, unsigned int dropped, unsigned int max_length); |
---|
70 |
|
---|
71 |
}; |
---|
72 |
|
---|
73 |
class AmdtpSlaveReceiveStreamProcessor |
---|
74 |
: public AmdtpReceiveStreamProcessor |
---|
75 |
{ |
---|
76 |
|
---|
77 |
public: |
---|
78 |
AmdtpSlaveReceiveStreamProcessor(int port, int framerate, int dimension); |
---|
79 |
|
---|
80 |
virtual ~AmdtpSlaveReceiveStreamProcessor(); |
---|
81 |
|
---|
82 |
enum raw1394_iso_disposition putPacket(unsigned char *data, unsigned int length, |
---|
83 |
unsigned char channel, unsigned char tag, unsigned char sy, |
---|
84 |
unsigned int cycle, unsigned int dropped); |
---|
85 |
|
---|
86 |
}; |
---|
87 |
|
---|
88 |
|
---|
89 |
} // end of namespace Streaming |
---|
90 |
|
---|
91 |
#endif /* __FFADO_AMDTPSLAVESTREAMPROCESSOR__ */ |
---|
92 |
|
---|