Project

General

Profile

Htsp » History » Version 16

Andreas Smas, 2009-02-28 17:10

1 1 Andreas Smas
2
3
4
5
6
----
7
8
= Client to Server methods =
9
10 5 Andreas Smas
----
11 1 Andreas Smas
=== getChallenge ===
12
13 7 Andreas Smas
Request a 32 byte challenge used to generate a authentication digest.
14
15
Request message fields:
16
{{{
17
None
18
}}}
19
20
Reply message fields:
21
{{{
22 9 Andreas Smas
challenge        bin  required   32 bytes of random challenge to be used in next authentication request from client.
23 7 Andreas Smas
}}}
24
25
26 5 Andreas Smas
----
27 1 Andreas Smas
=== authenticate ===
28
29 7 Andreas Smas
Request message fields:
30
{{{
31 8 Andreas Smas
username         str  required   Username.
32
digest           bin  required   SHA-1 hash of [password (not including terminating NUL)] + [challenge]
33 7 Andreas Smas
}}}
34
35
Reply message fields:
36
{{{
37 1 Andreas Smas
noaccess         int  optional   Set to '1' if access was denied.
38 9 Andreas Smas
challenge        bin  optional   32 bytes of random challenge to be used in next authentication request from client.
39
                                 Always present if 'noaccess' is set. This is supplied so the client does not have
40
                                 to issue an extra 'getChallenge' request.
41 7 Andreas Smas
}}}
42
43
44 5 Andreas Smas
----
45 10 Andreas Smas
=== setAsync ===
46
47
Switch the session into asynchronous mode.
48
When a session is in this mode the client will get continuous updates from the server about channels and tags.
49
This also includes creation and deletion of channels and tags. 
50
51
An interactive application that presents the user with information about channels and tags would probably want to switch to this mode.
52
53
54
Request message fields:
55
{{{
56
None
57
}}}
58
59
Reply message fields:
60
{{{
61
None
62
}}}
63
64
65 1 Andreas Smas
66 5 Andreas Smas
----
67 1 Andreas Smas
=== getEvent ===
68 6 Andreas Smas
69
----
70 1 Andreas Smas
=== subscribe ===
71 6 Andreas Smas
72
Request subscription to the given channel. A request for a subscription is always successful.
73
When the server is ready to transmit data it will first send a 'subscriptionStart' message.
74 4 Andreas Smas
75
76 1 Andreas Smas
77
Request message fields:
78
{{{
79 8 Andreas Smas
channelId        int  required   ID for channel. 
80
subscriptionId   int  required   Subscription ID. Selected by client. This value is not interpreted by the server in any form. 
81
                                 The value is used from now on in all messages related to the subscription.
82 1 Andreas Smas
}}}
83 6 Andreas Smas
84
Reply message fields:
85
{{{
86
None.
87 4 Andreas Smas
}}}
88 6 Andreas Smas
89 5 Andreas Smas
90 1 Andreas Smas
----
91 5 Andreas Smas
=== unsubscribe ===
92 1 Andreas Smas
93 5 Andreas Smas
Stop a subscription.
94
Attributes
95
{{{
96 8 Andreas Smas
subscriptionId   int  required   Subscription ID.
97 1 Andreas Smas
}}}
98
99 6 Andreas Smas
Reply message fields:
100
{{{
101
None.
102
}}}
103 2 Andreas Smas
104
105
----
106
107
= Server to Client methods =
108
109 12 Andreas Smas
----
110 2 Andreas Smas
=== channelAdd ===
111 1 Andreas Smas
112 11 Andreas Smas
A new channel has been created on the server.
113 1 Andreas Smas
114 11 Andreas Smas
This message is only sent if session is in asynchronous mode.
115
116
Message fields:
117
{{{
118
channelId        int   required   ID of channel.
119
channelName      str   required   Name of channel.
120
channelIcon      str   required   URL to an icon representative for the channel.
121
eventId          int   optional   ID of the current (or next to be) event on this channel.
122 13 Andreas Smas
tags             int[] optional   Tags this channel is mapped to.
123 11 Andreas Smas
}}}
124
125 12 Andreas Smas
----
126 1 Andreas Smas
=== channelUpdate ===
127
128 11 Andreas Smas
A channel has been updated on the server. All fields will be sent even if they are not changed. Most clients can process this and the 'channelAdd' message
129
with the very same code.
130 1 Andreas Smas
131 11 Andreas Smas
This message is only sent if session is in asynchronous mode.
132
133
Message fields:
134
{{{
135
channelId        int   required   ID of channel.
136
channelName      str   required   Name of channel.
137
channelIcon      str   optioanl   URL to an icon representative for the channel.
138
eventId          int   optional   ID of the current (or next to be) event on this channel.
139 13 Andreas Smas
tags             int[] required   Tags this channel is mapped to.
140 11 Andreas Smas
}}}
141
142 12 Andreas Smas
----
143 3 Andreas Smas
=== channelDelete ===
144 1 Andreas Smas
145 11 Andreas Smas
A channel has been deleted on the server.
146 1 Andreas Smas
147 11 Andreas Smas
This message is only sent if session is in asynchronous mode.
148
149
Message fields:
150
{{{
151
channelId        int   required   ID of channel.
152
}}}
153
154 12 Andreas Smas
----
155 1 Andreas Smas
=== tagAdd ===
156
157 11 Andreas Smas
A new tag has been created on the server.
158 1 Andreas Smas
159 11 Andreas Smas
This message is only sent if session is in asynchronous mode.
160
161
Message fields:
162
{{{
163 13 Andreas Smas
tagId            int   required   ID of tag.
164 11 Andreas Smas
tagName          str   required   Name of tag.
165
tagIcon          str   optional   URL to an icon representative for the channel.
166
channels         int[] required   Channels this tag is mapped to.
167
}}}
168
169 12 Andreas Smas
----
170 1 Andreas Smas
=== tagUpdate ===
171
172 11 Andreas Smas
A tag has been updated on the server.
173 1 Andreas Smas
174 11 Andreas Smas
This message is only sent if session is in asynchronous mode.
175
176
Message fields:
177
{{{
178 13 Andreas Smas
tagId            int   required   ID of tag.
179 11 Andreas Smas
tagName          str   required   Name of tag.
180
tagIcon          str   optional   URL to an icon representative for the channel.
181
channels         int[] required   Channels this tag is mapped to.
182
}}}
183
184 12 Andreas Smas
----
185 1 Andreas Smas
=== tagDelete ===
186
187 11 Andreas Smas
A tag has been deleted from the server.
188
189
This message is only sent if session is in asynchronous mode.
190 1 Andreas Smas
191 11 Andreas Smas
Message fields:
192
{{{
193 1 Andreas Smas
tagId            str   required   ID of tag.
194 11 Andreas Smas
}}}
195
196 12 Andreas Smas
----
197 11 Andreas Smas
=== subscriptionStart ===
198 2 Andreas Smas
199 14 Andreas Smas
Message fields:
200
{{{
201
subscriptionId   int   required   Subscription ID.
202
streams          msg[] required   Array of messages with stream information
203
204
205
'streams' message:
206
207
index            int   required   Index for this stream
208
type             str   required   Type of stream
209
language         str   optional   Language for stream
210
211
212
Stream types:
213
    AC3                           AC3 audio
214
    MPEG2AUDIO                    MPEG2 audio (MP2)
215
    MPEG2VIDEO                    MPEG2 video
216
    H264                          H264 video
217
218
219
}}}
220
221 12 Andreas Smas
----
222 2 Andreas Smas
=== subscriptionStop ===
223
224 15 Andreas Smas
Message fields:
225
{{{
226
subscriptionId   int   required   Subscription ID.
227
reason           str   optional   Reason for subscription stop.
228
}}}
229
230 12 Andreas Smas
----
231 2 Andreas Smas
=== subscriptionStatus ===
232
233 15 Andreas Smas
Message fields:
234
{{{
235
subscriptionId   int   required   Subscription ID.
236
status           str   optional   English clear text of status. Absence of this field means that the status is OK. 
237
}}}
238
239
240 12 Andreas Smas
----
241 2 Andreas Smas
=== queueStatus ===
242 15 Andreas Smas
243
The queueStatus message is sent every second during normal data delivery.
244
245
The transmit scheduler have different drop thresholds for different frame types.
246
If congestion occurs it will favor dropping B-frames before P-frames before I-frames.
247
All audio is recognized as I-frames. 
248
249
Message fields:
250
{{{
251
subscriptionId   int   required   Subscription ID.
252
packets          int   required   Number of data packets in queue.
253
bytes            int   required   Number of bytes in queue.
254
delay            int   required   Estimated delay of queue (in µs)
255
Bdrops           int   required   Number of B-frames dropped
256
Pdrops           int   required   Number of P-frames dropped
257
Idrops           int   required   Number of I-frames dropped
258
}}}
259 16 Andreas Smas
260
----
261
=== muxpkt ===
262
263
Streaming data.
264
265
Message fields:
266
{{{
267
subscriptionId   int   required   Subscription ID.
268
frametype        int   required   Type of frame as ASCII value: 'I', 'P', 'B'
269
stream           int   required   Stream index. Corresponds to the streams reported in the subscriptionStart message.
270
dts              int   required   Decode Time Stamp in µs.
271
pts              int   required   Presentation Time Stamp in µs.
272
duration         int   required   Duration of frame in µs.
273
payload          bin   required   Actual frame data.
274
275
}}}