1 | /* |
---|
2 | * Adium is the legal property of its developers, whose names are listed in the copyright file included |
---|
3 | * with this source distribution. |
---|
4 | * |
---|
5 | * This program is free software; you can redistribute it and/or modify it under the terms of the GNU |
---|
6 | * General Public License as published by the Free Software Foundation; either version 2 of the License, |
---|
7 | * or (at your option) any later version. |
---|
8 | * |
---|
9 | * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even |
---|
10 | * the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General |
---|
11 | * Public License for more details. |
---|
12 | * |
---|
13 | * You should have received a copy of the GNU General Public License along with this program; if not, |
---|
14 | * write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
---|
15 | */ |
---|
16 | |
---|
17 | /*! |
---|
18 | * A payload type. |
---|
19 | */ |
---|
20 | @interface VCPayload : NSObject { |
---|
21 | int mId; // Id (in the RTP domain) |
---|
22 | NSString* mName; // Printable name |
---|
23 | int mChannels; // Number of channels |
---|
24 | |
---|
25 | int mQuality; // Overall output quality (0:worst - 10:best) |
---|
26 | int mCost; // Computational cost (0:light - 10:heavy) |
---|
27 | } |
---|
28 | |
---|
29 | + (id) createWithId:(int)ptid name:(NSString*)ptname channels:(int)ptchannels; |
---|
30 | - (id) initWithId:(int)ptid name:(NSString*)ptname channels:(int)ptchannels; |
---|
31 | |
---|
32 | @end |
---|
33 | |
---|
34 | |
---|
35 | /*! |
---|
36 | * Audio payload type. |
---|
37 | */ |
---|
38 | @interface VCAudioPayload : VCPayload { |
---|
39 | int mClockrate; // Sample rate |
---|
40 | } |
---|
41 | |
---|
42 | + (id) createWithId:(int)ptid name:(NSString*)ptname channels:(int)ptchannels clockrate:(int)ptrate; |
---|
43 | - (id) initWithId:(int)ptid name:(NSString*)ptname channels:(int)ptchannels clockrate:(int)ptrate; |
---|
44 | |
---|
45 | @end |
---|
46 | |
---|
47 | |
---|
48 | |
---|
49 | /*! |
---|
50 | * Transport endpoint definition. |
---|
51 | */ |
---|
52 | @interface VCTransport : NSObject { |
---|
53 | NSString *mName; // Transport name (optional) |
---|
54 | NSString *mIp; // IP address or hostname |
---|
55 | int mPort; // Port number |
---|
56 | } |
---|
57 | |
---|
58 | + (id) createWithName:(NSString*)name ip:(NSString*)ip port:(int)port; |
---|
59 | - (id) initWithName:(NSString*)name ip:(NSString*)ip port:(int)port; |
---|
60 | |
---|
61 | @end |
---|
62 | |
---|
63 | |
---|
64 | /*! |
---|
65 | * Supported protocols. |
---|
66 | * This list should grow in the future... |
---|
67 | */ |
---|
68 | typedef enum { |
---|
69 | VC_RTP = 0 |
---|
70 | } VCProtocol; |
---|
71 | |
---|
72 | |
---|
73 | /*! |
---|
74 | * Protocol provider. |
---|
75 | * A "protocol provider" must implement a protocol (ie, RTP) and be able to |
---|
76 | * create connections with that protocol between two endpoints. |
---|
77 | */ |
---|
78 | @protocol VCProtocolProvider |
---|
79 | /*! |
---|
80 | * Provides a list of audio payloads this protocol provider supports. |
---|
81 | */ |
---|
82 | - (NSArray*) getAudioPayloadsForProtocol:(VCProtocol)protocol; |
---|
83 | |
---|
84 | /*! |
---|
85 | * Provides a list of video payloads this protocol provider supports. |
---|
86 | */ |
---|
87 | - (NSArray*) getVideoPayloadsForProtocol:(VCProtocol)protocol; |
---|
88 | |
---|
89 | /*! |
---|
90 | * Create a connection between two transport points, with the specified payload |
---|
91 | * type. It should return FALSE if the protocol can not create this connection. |
---|
92 | */ |
---|
93 | - (id) createConnectionWithProtocol:(VCProtocol)protocol |
---|
94 | payload:(VCPayload*)payload |
---|
95 | from:(VCTransport*)local |
---|
96 | to:(VCTransport*)remote; |
---|
97 | |
---|
98 | /*! |
---|
99 | * Create a set of connections between several transport points, with the |
---|
100 | * specified payload types. It should return "nil" if the protocol can not create |
---|
101 | * these connections. |
---|
102 | */ |
---|
103 | - (NSArray*) createConnectionsWithProtocol:(VCProtocol)protocol |
---|
104 | payloads:(NSArray*)payload |
---|
105 | from:(NSArray*)local |
---|
106 | to:(NSArray*)remote; |
---|
107 | @end |
---|
108 | |
---|
109 | |
---|
110 | /*! |
---|
111 | * Connection. |
---|
112 | */ |
---|
113 | @protocol VCConnection |
---|
114 | - (BOOL) start; |
---|
115 | - (BOOL) stop; |
---|
116 | @end |
---|
117 | |
---|