Project

General

Profile

Htsp » History » Version 116

Jaroslav Kysela, 2014-11-16 15:53

1 111 Jaroslav Kysela
h1. Home Tv Streaming Protocol (HTSP) - Version 17
2 1 Andreas Smas
3
h2. General
4 58 sbi -
5
HTSP is a TCP based protocol primarily intended for streaming of live TV and related meta data such as channels, group of channels (called tags in HTSP) and electronic program guide (EPG) information.
6
7 61 Adam Sutton
The transmission and reception of a channel over HTSP is referred to as a subscription. A single HTSP session can handle as many concurrent subscriptions as the bandwidth and CPU permits.
8 1 Andreas Smas
9 61 Adam Sutton
The HTSP server in tvheadend has a payload-aware scheduler for prioritizing more important packets (such as I-frames) before less important ones (such as B-frames). This makes HTSP suitable for long-distance transmissions and/or paths with non-perfect delivery.
10 1 Andreas Smas
(It has been tested with a server in Stockholm and the client in Berlin).
11
12 17 Andreas Smas
For information about the HTSP wire format please read [[htsmsgbinary|HTSMSG binary format]]
13 1 Andreas Smas
14 61 Adam Sutton
If you're looking to develop a new client, there are several existing client implementations from which you might be able to gain knowledge:
15
16
* "XBMC":https://github.com/opdenkamp/xbmc/tree/master/xbmc/pvrclients/tvheadend
17
* "Showtime":https://github.com/andoma/showtime/tree/master/src/backend/htsp
18 65 John Törnblom
* "TVHGuide":https://github.com/john-tornblom/TVHGuide
19 69 Adam Sutton
* "PyHTSP":https://github.com/adamsutton/tvheadend/tree/master/lib/py/tvh/htsp.py (This is a demo client and is WIP, it has limited functionality).
20 1 Andreas Smas
21 22 Andreas Smas
----
22 18 Andreas Smas
23 84 Jaroslav Kysela
h2. Protocol Changes
24 83 Jaroslav Kysela
25 110 Jaroslav Kysela
h3. v16..v17
26
27
* extended subscriptionStart server-to-client method
28
** added meta field
29
* changed H264 meta data handling (codec meta data are in the meta field only in start message)
30
* VORBIS and AAC codecs have codec specific meta data in the meta field in start message
31 115 Jaroslav Kysela
* changed subscribe method
32
** the normts is always active and the parameter is ignored
33
34 110 Jaroslav Kysela
35 107 Jaroslav Kysela
h3. v15..v16
36
37
* added getProfiles, getDvrConfigs methods
38
* removed getCodecs methods
39
* extended subscribe method
40
** add profile field
41
42 105 Jaroslav Kysela
h3. v14..v15
43
44
* extended channelAdd, channelUpdate server-to-client methods
45 106 Jaroslav Kysela
** the channelIcon URL can be relative 'imagecache/%d' or '/imagecache/%d'
46 1 Andreas Smas
* extended getChannel method
47 106 Jaroslav Kysela
** the channelIcon URL can be relative 'imagecache/%d' or '/imagecache/%d'
48
49 105 Jaroslav Kysela
50 100 Jaroslav Kysela
h3. v13..v14
51
52
* added getChannel method
53
54 85 Jaroslav Kysela
h3. v12..v13
55
56
* added addAutorecEntry method
57
* added deleteAutorecEntry method
58 92 Jaroslav Kysela
* added autorecEntryAdd, autorecEntryUpdate, autorecEntryDelete server-to-client methods
59 85 Jaroslav Kysela
* extended channelAdd server-to-client method
60 87 Jaroslav Kysela
** added channelNumberMinor (for {major}.{minor} channel numbers)
61
* extended dvrEntryAdd and dvrEntryUpdate server-to-client methods
62 88 Jaroslav Kysela
** added eventId, autorecId, startExtra, stopExtra, retention, priority, contentType fields
63 97 Jaroslav Kysela
* extended addDvrEntry method
64
** added retention
65
* extended updateDvrEntry method
66
** added retention, priority
67
* extended epgQuery method
68
** added minduration, maxduration
69 85 Jaroslav Kysela
* added subscriptionGrace server-to-client method
70 97 Jaroslav Kysela
71 85 Jaroslav Kysela
72 83 Jaroslav Kysela
h3. v11..v12
73
74
* added subscriptionFilterStream method
75
* added getDvrCutpoints method
76
77
78
h3. v10..v11
79
80 86 Jaroslav Kysela
* added audio_type in the subscriptionStart server-to-client method
81 83 Jaroslav Kysela
* added getCodecs method
82
83 58 sbi -
h2. Communication
84
85
86 69 Adam Sutton
This communication is currently implemented by using htsmsg's. All strings are encoded as UTF-8.
87 1 Andreas Smas
88
There are two distinct ways for communication within HTSP.
89
90 28 Andreas Smas
Apart from this there is a number of messages that needs to be exchanged during login, see the login section below.
91
92 1 Andreas Smas
93 58 sbi -
h3. RPC communication
94
95
96 1 Andreas Smas
There is a normal RPC way of doing things. I.e. the client sends a request and the server responds with a reply. All the RPC methods are listed below as the 'Client to Server' methods. Apart from all message fields listed within each message type the client can add an additional field:
97 18 Andreas Smas
98 17 Andreas Smas
RPC request extra fields:
99 58 sbi -
<pre>
100 28 Andreas Smas
seq              int  optional   Sequence number. This field will be echoed back by the server in the reply.
101 1 Andreas Smas
username         str  optional   Username, in combination with 'digest' this can be used to raise the privileges
102
                                 for the session in combination with invocation of a method. 
103 28 Andreas Smas
digest           bin  optional   Used to raise privileges.
104 58 sbi -
</pre>
105 18 Andreas Smas
106 1 Andreas Smas
The followings field should be used by the client to match the reply with the request.
107
All replies are guaranteed to arrive in the same order as the requests.
108
Even so, probably the best way to implement the request-reply client is by taking advantage of the 'seq' field.
109
110
RPC reply extra fields:
111 58 sbi -
<pre>
112 18 Andreas Smas
seq              int  optional   Sequence number. Same as in the request.
113 19 Andreas Smas
error            str  optional   If present an error has occurred and the text describes the error.
114
noaccess         int  optional   If present and set to '1' the user is prohibited from invoking the method due to 
115 1 Andreas Smas
                                 access restrictions. 
116 58 sbi -
</pre>
117 1 Andreas Smas
118 18 Andreas Smas
119 58 sbi -
h3. Streaming communication
120
121
122 19 Andreas Smas
For streaming of live TV and various related messages the server will continuously push data to the client.
123 1 Andreas Smas
These messages are referred to as asynchronous messages and always have the 'method' field set and never have the 'seq' field set.
124
Also, the client can enable an additional asyncMetadata mode and by doing so it will be notified by the server when meta data changes. (EPG updates, creation of channels and tags, etc). 
125
126 34 Andreas Smas
127 58 sbi -
h3. Authentication
128
129
130 29 Andreas Smas
In Tvheadend, each method has an associated access restriction. Currently there is only one restriction (Streaming). However, this may change in the future.
131 1 Andreas Smas
132
Privileges for these restrictions may be granted in two ways: Username + Password and/or Source IP address.
133
Therefore it is possible to gain permissions to the system without entering a username and password.
134
While this is really useful it also complicates the authentication schema a bit.
135
Upon connect the initial privileges will be raised based on the source address.
136
137
Before any username / password based authentication has taken place the client must have
138 34 Andreas Smas
obtained a challenge (which stays fixed for the session). This is done via the 'hello' method.
139 1 Andreas Smas
140
In principle it's possible to use two different authentication idioms with HTSP.
141
Depending on how your application works one or another may be more suitable.
142
While they do not really differ from a protocol point of view it's worth mentioning a bit about them here:
143
144
145 58 sbi -
h3. Initial login authentication
146
147
148 1 Andreas Smas
The client performs all of its authentication using the 'login' method.
149
150
It may choose to send:
151 58 sbi -
* Username and password: Privileges will be raised based on these credentials.
152
* Username only: Privileges will be based on just the source address. The username will be used for various logging purposes.
153
* Nothing: Privileges will be based on just the source address.
154 1 Andreas Smas
155
If no privileges are granted after the login message has been received by the server (i.e. both network and username + password based)
156
the server will reply with 'noaccess' set to 1. A client that only employs initial login should honor this flag and ask the
157
user for a username + password and retry by using the 'authenticate' method. I.e. it should not send the 'login' method again.
158
159
160 58 sbi -
h3. On-demand authentication
161
162
163 1 Andreas Smas
The client performs all of its authentication when it needs to.
164
165
When using this method, the client will check every RPC reply for the 'noaccess' field.
166
If it set to 1 it whould ask the user for username + password and retry the request but also
167 58 sbi -
add 'username' and 'digest' to the original message. (See _RPC request extra fields_ above)
168 1 Andreas Smas
169
Typically it would not send a username or digest during login.
170 29 Andreas Smas
171
----
172 34 Andreas Smas
173 66 Adam Sutton
h2. Client to Server (RPC) methods
174 34 Andreas Smas
175
h3. hello
176 58 sbi -
177
Used to identify the client toward the server and to get the session challenge used to
178 1 Andreas Smas
hash passwords into digests. The client can request a different version of the HTSP
179 66 Adam Sutton
protocol with this method. If no 'hello' message is sent the server assumes latest version
180 1 Andreas Smas
is to be used.
181 34 Andreas Smas
182 66 Adam Sutton
Client/Server should select lowest common version, if this is not possible connection should be terminated.
183 1 Andreas Smas
184
Request message fields:
185
<pre>
186 66 Adam Sutton
htspversion        u32   required   Client preferred HTSP version.
187
clientname         str   required   Client software name.
188
clientversion      str   required   Client software version.
189 58 sbi -
</pre>
190 1 Andreas Smas
191
Reply message fields:
192 34 Andreas Smas
<pre>
193 66 Adam Sutton
htspversion        u32   required   The server supports all versions of the protocol up to and including this number.
194
servername         str   required   Server software name.
195
serverversion      str   required   Server software version.
196
servercapability   str[] required   Server capabilities (Added in version 6)
197 1 Andreas Smas
challenge          bin   required   32 bytes randomized data used to generate authentication digests
198 73 Adam Sutton
webroot            str   optional   Server HTTP webroot (Added in version 8)
199
                                    Note: any access to TVH webserver should include this at start of URL path
200 1 Andreas Smas
</pre>
201
202 70 Adam Sutton
Note: possible values for servercapability[]:
203
<pre>
204
cwc                Descrambling available
205
v4l                Analogue TV available
206
linuxdvb           Linux DVB API available
207 1 Andreas Smas
imagecache         Image caching available
208 73 Adam Sutton
timeshift          Timeshifting available (Added in version 9).
209 70 Adam Sutton
</pre>
210
211 58 sbi -
h3. authenticate
212 1 Andreas Smas
213
This can be used to issue authentication without doing anything else.
214
If no privileges are gained it will return with 'noaccess' set to 1.
215
216 33 Andreas Smas
Request message fields:
217 1 Andreas Smas
<pre>
218 66 Adam Sutton
None   
219 33 Andreas Smas
</pre>
220 58 sbi -
221
Reply message fields:
222
<pre>
223 66 Adam Sutton
noaccess           u32   optional   If set to 1, no privileges were granted.
224 33 Andreas Smas
</pre>
225 1 Andreas Smas
226
----
227
228 66 Adam Sutton
h3. getDiskSpace (Added in version 3)
229 58 sbi -
230 66 Adam Sutton
Return diskspace status from Tvheadend's PVR storage
231 1 Andreas Smas
232 66 Adam Sutton
Request message fields:
233
<pre>
234
None
235
</pre>
236 1 Andreas Smas
237 66 Adam Sutton
Reply message fields:
238
<pre>
239
freediskspace      s64   required   Bytes available.
240
totaldiskspace     s64   required   Total capacity.
241
</pre>
242 1 Andreas Smas
243 66 Adam Sutton
h3. getSysTime (Added in version 3)
244 1 Andreas Smas
245 66 Adam Sutton
Return system time on the server.
246
247 1 Andreas Smas
Request message fields:
248
<pre>
249
None
250
</pre>
251
252
Reply message fields:
253 58 sbi -
<pre>
254 66 Adam Sutton
time               s64  required   UNIX time.
255
timezone           s32  required   Minutes west of GMT.
256 1 Andreas Smas
</pre>
257 23 Andreas Smas
258 1 Andreas Smas
----
259
260 66 Adam Sutton
h3. enableAsyncMetadata
261 1 Andreas Smas
262 66 Adam Sutton
When this is enabled the client will get continuous updates from the server about added, update or deleted channels, tags, dvr and epg entries.
263 1 Andreas Smas
264 66 Adam Sutton
An interactive application that presents the user with information about these things should probably enable this and the implement the various server to client methods.
265 1 Andreas Smas
266
Request message fields:
267
<pre>
268 66 Adam Sutton
epg                u32   optional   Set to 1, to include EPG data in async, implied by epgMaxTime (Added in version 6).
269
lastUpdate         s64   optional   Only provide metadata that has changed since this time (Added in version 6).
270
epgMaxTime         s64   optional   Maximum time to return EPG data up to (Added in version 6)
271
language           str   optional   RFC 2616 compatible language list (Added in version 6)
272 1 Andreas Smas
</pre>
273
274
Reply message fields:
275
<pre>
276 66 Adam Sutton
None
277 1 Andreas Smas
</pre>
278
279 66 Adam Sutton
Once the reply as been sent the initial data set will be provided, and then updates will arrive asynchronously after that. The initial data dump is sent using the following messages:
280 1 Andreas Smas
281 66 Adam Sutton
<pre>
282
tagAdd                   optional
283
channelAdd               optional
284
tagUpdate                optional
285
dvrEntryAdd              optional
286
eventAdd                 optional   (Added in version 6)
287
initialSyncComplete      required
288
</pre>
289 1 Andreas Smas
290 66 Adam Sutton
----
291 1 Andreas Smas
292 101 Jaroslav Kysela
h3. getChannel (Added in version 14)
293
294
Request information about the given channel.
295
296
Request message fields:
297
<pre>
298
channelId          u32   required   Channel ID.
299
</pre>
300
301
Reply message fields:
302
<pre>
303
see channelAdd
304
</pre>
305
306
----
307
308 66 Adam Sutton
h3. getEvent
309 1 Andreas Smas
310 66 Adam Sutton
Request information about the given event. An event typically corresponds to a program on a channel.
311 1 Andreas Smas
312 66 Adam Sutton
The language field in the request allows preference for languages to be requested for the various string fields.
313
314 1 Andreas Smas
Request message fields:
315 45 mdd -
<pre>
316 66 Adam Sutton
eventId            u32   required   Event ID.
317
language           str   optional   RFC 2616 compatible language list (Added in version 6)
318 1 Andreas Smas
</pre>
319
320
Reply message fields:
321
<pre>
322 66 Adam Sutton
see eventAdd
323 1 Andreas Smas
</pre>
324
325 66 Adam Sutton
h3. getEvents (Added in version 4)
326 1 Andreas Smas
327 66 Adam Sutton
Request information about a set of events. If no options are specified the entire EPG database will be returned.
328 57 sbi -
329 58 sbi -
Request message fields:
330 1 Andreas Smas
<pre>
331 66 Adam Sutton
eventId            u32   optional   Event ID to begin from (Optional since version 6)
332
channelId          u32   optional   Channel ID to get data for (Added in version 6)
333
numFollowing       u32   optional   Number of events to add (Optional since version 6)
334
maxTime            u64   optional   Maximum time to return data up to (Added in version 6)
335
language           str   optional   RFC 2616 compatible language list (Added in version 6)
336 1 Andreas Smas
</pre>
337
338
Reply message fields:
339
<pre>
340 66 Adam Sutton
events             msg[] required   List of events, using response message fields from eventAdd
341 1 Andreas Smas
</pre>
342 45 mdd -
343 66 Adam Sutton
h3. epgQuery (Added in version 4)
344 1 Andreas Smas
345 66 Adam Sutton
Query the EPG (event titles) and optionally restrict to channel/tag/content type.
346 1 Andreas Smas
347 66 Adam Sutton
Request message fields:
348
<pre>
349
query              str   required  Title regular expression to search for
350
channelId          u32   optional  [[ChannelId]] to restrict search to
351
tagId              u32   optional  [[TagId]] to restrict search to
352
contentType        u32   optional  DVB content type to restrict search to
353 98 Jaroslav Kysela
minduration        u32   optional  Minimal duration in seconds (Added in version 13)
354
maxduration        u32   optional  Maximal duration in seconds (Added in version 13)
355 66 Adam Sutton
language           str   optional  RFC 2616 compatible language list for title (Added in version 6)
356
full               u32   optional  Output full event list rather than just IDs
357
</pre>
358 1 Andreas Smas
359 66 Adam Sutton
Reply message fields:
360 1 Andreas Smas
361 66 Adam Sutton
if full == 1
362
<pre>
363
events             msg[] optional   List of events, using response message fields from eventAdd
364
</pre>
365
else
366
<pre>
367
eventIds           u32[] optional  List of eventIds that match the query
368
</pre>
369 1 Andreas Smas
370 66 Adam Sutton
h3. getEpgObject
371
372
Get detailed EPG Object info.
373
374 58 sbi -
Request message fields:
375 1 Andreas Smas
<pre>
376 66 Adam Sutton
id                 u32   required  Object ID
377
type               u32   optional  Object type
378 1 Andreas Smas
</pre>
379 58 sbi -
380 1 Andreas Smas
Reply message fields:
381 66 Adam Sutton
382 1 Andreas Smas
<pre>
383 66 Adam Sutton
TODO
384 1 Andreas Smas
</pre>
385
386 58 sbi -
----
387 1 Andreas Smas
388 109 Jaroslav Kysela
h3. getDvrConfigs (Added in version 16)
389
390
Return a list of DVR configurations.
391
392
Reply message fields:
393
<pre>
394
dvrconfigs         msg[]      optional   Supported DVR configurations.
395
</pre>
396
397
Message fields:
398
<pre>
399
uuid               str        required   DVR configuration ID
400
name               str        required   DVR configuration Name
401
comment            str        required   DVR configuration Comment
402
</pre>
403
404 66 Adam Sutton
h3. addDvrEntry (Added in version 4)
405
406 1 Andreas Smas
Create a new DVR entry. Either eventId or channelId, start and stop must be specified.
407
408
Request message fields:
409 66 Adam Sutton
<pre>
410
eventId            u32   optional   Event ID (Optional since version 5).
411
channelId          u32   optional   Channel ID (Added in version 5)
412
start              s64   optional   Time to start recording (Added in version 5)
413 96 Jaroslav Kysela
stop               s64   optional   Time to stop recording (Added in version 5)
414 66 Adam Sutton
retention          u32   optional   Retention time in days (Added in version 13)
415
creator            str   optional   Name of the event creator (Added in version 5)
416
priority           u32   optional   Recording priority (Added in version 5)
417
startExtra         s64   optional   Pre-recording buffer in minutes (Added in version 5)
418
stopExtra          s64   optional   Post-recording buffer in minutes (Added in version 5)
419
title              str   optional   Recording title, if no eventId (Added in version 6)
420 1 Andreas Smas
description        str   optional   Recording description, if no eventId (Added in version 5)
421 109 Jaroslav Kysela
configName         str   optional   DVR configuration name or UUID
422 40 Andreas Smas
</pre>
423 1 Andreas Smas
424
Reply message fields:
425
<pre>
426 66 Adam Sutton
success            u32   required   1 if entry was added, 0 otherwise
427
id                 u32   optional   ID of created DVR entry
428 1 Andreas Smas
error              str   optional   English clear text of error message
429
</pre>
430 66 Adam Sutton
431 1 Andreas Smas
h3. updateDvrEntry (Added in version 5)
432 66 Adam Sutton
433 1 Andreas Smas
Update an existing DVR entry.
434
435
Request message fields:
436 66 Adam Sutton
<pre>
437
id                 u32   required   DVR Entry ID
438
start              s64   optional   New start time
439
stop               s64   optional   New stop time
440
title              str   optional   New entry title
441
description        str   optional   New entry description (Added in version 6)
442 1 Andreas Smas
startExtra         s64   optional   New pre-record buffer (Added in version 6)
443 66 Adam Sutton
stopExtra          s64   optional   New post-record buffer (Added in version 6)
444 109 Jaroslav Kysela
configName         str   optional   New DVR configuration name or UUID
445 99 Jaroslav Kysela
retention          u32   optional   Retention in days (Added in version 13)
446
priority           u32   optional   Recording priority (Added in version 13)
447 1 Andreas Smas
</pre>
448
449
Reply message fields:
450
<pre>
451 66 Adam Sutton
success            u32   required   1 if update as successful, otherwise 0
452
error              str   optional   Error message if update failed
453 40 Andreas Smas
</pre>
454
455 66 Adam Sutton
h3. cancelDvrEntry (Added in version 5)
456 1 Andreas Smas
457 66 Adam Sutton
Cancel an existing recording, but don't remove the entry from the database.
458 1 Andreas Smas
459 66 Adam Sutton
Request message fields:
460
<pre>
461
id                 u32   required   dvrEnryId to delete
462
</pre>
463 1 Andreas Smas
464 66 Adam Sutton
Reply message fields:
465
<pre>
466
success            int   required   1 if entry was cancelled
467
error              str   optional   Error message if cancellation failed
468
</pre>
469 1 Andreas Smas
470 66 Adam Sutton
h3. deleteDvrEntry (Added in version 4)
471
472
Delete an existing DVR entry from the database.
473
474
Request message fields:
475 1 Andreas Smas
<pre>
476 66 Adam Sutton
id                 u32   required   DVR Entry ID
477 1 Andreas Smas
</pre>
478
479 11 Andreas Smas
Reply message fields:
480 1 Andreas Smas
<pre>
481 66 Adam Sutton
success            u32   required   1 if entry was removed
482
error              str   optional   Error message if the delete fails
483 1 Andreas Smas
</pre>
484
485 103 Jaroslav Kysela
h3. getDvrCutpoints (Added in version 12)
486
487
Get DVR cutpoints.
488
489
Request message fields:
490
<pre>
491
id                 u32   required   DVR Entry ID
492
</pre>
493
494
Reply message fields:
495
<pre>
496
cutpoints          msg[] optional   List of cutpoint entries, if a file is found and has some valid data.
497
</pre>
498
499
Cutpoint fields:
500
<pre>
501
start              u32   required   Cut start time in ms.
502
end                u32   required   Cut end time in ms.
503
type               u32   required   Action type: 
504
                                      0=Cut, 1=Mute, 2=Scene, 
505
                                      3=Commercial break.
506
</pre>
507
508 102 Jaroslav Kysela
---
509
510 91 Jaroslav Kysela
h3. addAutorecEntry (Added in version 13)
511
512
Create a new Autorec DVR entry. Title must be specified.
513
514
Request message fields:
515
<pre>
516
title              str   required   Title for the recordings.
517
configName         str   optional   DVR Configuration Name / UUID.
518
channelId          u32   optional   Channel ID.
519
minDuration        u32   optional   Minimal duration in seconds (0 = Any).
520
maxDuration        u32   optional   Maximal duration in seconds (0 = Any).
521
daysOfWeek         u32   optional   Bitmask - Days of week (0x01 = Monday, 0x40 = Sunday, 0x7f = Whole Week, 0 = Not set).
522
priority           u32   optional   Priority (0 = Important, 1 = High, 2 = Normal, 3 = Low, 4 = Unimportant, 5 = Not set).
523
approxTime         u32   optional   Minutes from midnight (up to 24*60).
524
startExtra         s64   optional   Extra start minutes (pre-time).
525
stopExtra          s64   optional   Extra stop minutes (post-time).
526
comment            str   optional   User Comment.
527
</pre>
528 83 Jaroslav Kysela
529
Reply message fields:
530
<pre>
531
success            u32   required   1 if entry was added, 0 otherwise
532
id                 str   optional   ID (string!) of created autorec DVR entry
533
error              str   optional   English clear text of error message
534
</pre>
535
536
h3. deleteAutorecEntry (Added in version 13)
537
538
Delete an existing autorec DVR entry from the database.
539
540
Request message fields:
541
<pre>
542
id                 str   required   Autorec DVR Entry ID (string!)
543
</pre>
544
545
Reply message fields:
546
<pre>
547
success            u32   required   1 if entry was removed
548
error              str   optional   Error message if the delete fails
549
</pre>
550
551 1 Andreas Smas
----
552
553 66 Adam Sutton
h3. getTicket (Added in version 5)
554 1 Andreas Smas
555 66 Adam Sutton
Get a ticket to allow access to a channel or recording via HTTP
556 1 Andreas Smas
557 66 Adam Sutton
Request message fields:
558 1 Andreas Smas
<pre>
559 66 Adam Sutton
channelId          u32  optional   Channel to gain access for
560
dvrId              u32  optional   DVR file to gain access for
561 1 Andreas Smas
</pre>
562
563
Reply message fields:
564
<pre>
565 66 Adam Sutton
path               str  required   The full path for access URL (no scheme, host or port)
566
ticket             str  required   The ticket to pass in the URL query string
567 1 Andreas Smas
</pre>
568
569 66 Adam Sutton
h3. subscribe
570 1 Andreas Smas
571 66 Adam Sutton
Request subscription to the given channel. 
572 1 Andreas Smas
573 66 Adam Sutton
Request message fields:
574
<pre>
575
channelId          u32   required   ID for channel. 
576
subscriptionId     u32   required   Subscription ID. Selected by client. This value is not interpreted by the server in any form. 
577
                                    The value is used from now on in all messages related to the subscription.
578 1 Andreas Smas
weight             u32   optional   Weighting of this subscription (same as recording priority).
579 73 Adam Sutton
90khz              u32   optional   Request PTS/DTS in default 90kHz timebase, default is 1MHz (Added in version 7)
580
normts             u32   optional   Request PTS/DTS normalisation (Added in version 7)
581
                                    Note: this will mean missing timestamps are added, first packet should be ~0 and will always be an i-frame.
582
                                    Note: this is implied if timeshiftPeriod is enabled
583 114 Jaroslav Kysela
                                    Note: from version 17, this is always enabled and this parameter is ignored.
584 73 Adam Sutton
queueDepth         u32   optional   Change the default packet queue lengths, default 500000 bytes (Added in version 7)
585
                                    Note: I-frame depth is 3*queueDepth, P-frame is 2*queueDepth and B-frame is queueDepth
586
timeshiftPeriod    u32   optional   The number of seconds to keep in the timeshift buffer (Added in version 9)
587
                                    Note: this may be bounded by server configuration settings
588 108 Jaroslav Kysela
profile            str   optional   Select stream profile (Added in version 16).
589 11 Andreas Smas
</pre>
590 66 Adam Sutton
591 1 Andreas Smas
Reply message fields:
592
<pre>
593 73 Adam Sutton
90khz              u32   optional   Indicates 90khz timestamps will be used
594
normts             u32   optional   Indicates timestamps will be normalised (and fixed)
595
timeshiftPeriod    u32   optional   The actual timeshiftPeriod to be used
596 66 Adam Sutton
</pre>
597 1 Andreas Smas
598 66 Adam Sutton
h3. unsubscribe
599
600
Stop a subscription.
601
602
Request message fields:
603 1 Andreas Smas
<pre>
604 66 Adam Sutton
subscriptionId     u32   required   Subscription ID.
605 58 sbi -
</pre>
606
607 11 Andreas Smas
Reply message fields:
608 1 Andreas Smas
<pre>
609 66 Adam Sutton
None
610 58 sbi -
</pre>
611 11 Andreas Smas
612 66 Adam Sutton
h3. subscriptionChangeWeight (Added in version 5)
613 1 Andreas Smas
614 66 Adam Sutton
Change the weight of an existing subscription
615 1 Andreas Smas
616 66 Adam Sutton
Request message fields:
617
<pre>
618
subscriptionId     u32   required   Subscription ID.
619
weight             u32   optional   The new subscription weight.
620 1 Andreas Smas
</pre>
621
622
Reply message fields:
623
<pre>
624 69 Adam Sutton
None
625 1 Andreas Smas
</pre>
626
627 73 Adam Sutton
h3. subscriptionSkip (Added in version 9)
628
629
Skip a timeshift enabled subscription. The response will be asynchronous subscriptionSkip().
630
631
Request message fields:
632
<pre>
633
subscriptionId     u32   required   Subscription ID.
634
absolute           u32   optional   The skip request is absolute
635
time               u64   optional   Specify skip using time (units are as for PTS)
636
size               u64   optional   Specify skip using size (Not currently used)
637
</pre>
638
639
Reply message fields:
640
<pre>
641
None
642
</pre>
643
644
h3. subscriptionSeek (Added in version 9)
645
646
Synonym for subscriptionSkip
647
648
h3. subscriptionSpeed (Added in version 9)
649
650
Set the playback speed for the subscription. The response will be asynchronous subscriptionSpeed().
651
652
Request message fields:
653
<pre>
654
subscriptionId     u32   required   Subscription ID.
655
speed              u32   required   Specify speed (0=pause, 100=1x fwd, -100=1x backward)
656
</pre>
657
658
Reply message fields:
659
<pre>
660
None
661
</pre>
662
663
h3. subscriptionLive (Added in version 9)
664
665
Return a timeshifted session to live. Reply will be asynchronous subscriptionSkip().
666
667
Request message fields:
668
<pre>
669
subscriptionId     u32   required   Subscription ID.
670
</pre>
671
672
Reply message fields:
673
<pre>
674
None
675 82 Jaroslav Kysela
</pre>
676 1 Andreas Smas
677 83 Jaroslav Kysela
h3. subscriptionFilterStream (Added in version 12)
678 1 Andreas Smas
679 83 Jaroslav Kysela
Enable or disable specified streams by index.
680
681
Request message fields:
682
<pre>
683
subscriptionId     u32        required   Subscription ID.
684
enable             list[u32]  optional   Enable stream indexes
685
disable            list[u32]  optional   Disable (filter out) stream indexes
686
</pre>
687
688
Reply message fields:
689 1 Andreas Smas
<pre>
690
None
691 109 Jaroslav Kysela
</pre>
692
693
---
694
695
h3. getProfiles (Added in version 16)
696
697
Return a list of stream profiles (configurations).
698
699
Reply message fields:
700
<pre>
701
profiles           msg[]      optional   Supported profiles
702
</pre>
703
704
Message fields:
705
<pre>
706
uuid               str        required   Profile ID
707
name               str        required   Profile Name
708
comment            str        required   Profile Comment
709 83 Jaroslav Kysela
</pre>
710
711
h3. getCodecs (Added in version 11, Removed in version 16)
712
713 82 Jaroslav Kysela
Return a list of encoders (codecs).
714
715 1 Andreas Smas
Reply message fields:
716 82 Jaroslav Kysela
<pre>
717 83 Jaroslav Kysela
encoders           list[str]  optional   Supported encoders
718 82 Jaroslav Kysela
</pre>
719
720 70 Adam Sutton
h3. fileOpen (Added in version 8)
721 69 Adam Sutton
722
Open a file within the Tvheadend file system. This is now the preferred method (in place of HTTP) for accessing recordings.
723
724
Accessing recordings via HTSP will overcome the limitations of standard HTTP streaming which cannot handle both skipping and growing files (i.e. in-progress recordings) at the same time.
725
726 1 Andreas Smas
Request message fields:
727 69 Adam Sutton
<pre>
728 70 Adam Sutton
file               str   required   File path to open
729 1 Andreas Smas
</pre>
730
731 70 Adam Sutton
Valid file paths:
732
<pre>
733
/dvrfile/ID        will open the file associated with DVR entry ID
734 74 Adam Sutton
/imagecache/ID     will open the file associated with imagecache entry ID (Note: only works for HTSPv10+)
735 70 Adam Sutton
</pre>
736
737 69 Adam Sutton
Reply message fields:
738
<pre>
739
id                 u32   required   The file handle used for further file operations
740
size               u64   optional   The size of the file in bytes
741 1 Andreas Smas
mtime              u64   optional   The last time the file was modified
742 69 Adam Sutton
</pre>
743
744 70 Adam Sutton
h3. fileRead (Added in version 8)
745 69 Adam Sutton
746 1 Andreas Smas
Read data from a file.
747
748 69 Adam Sutton
Request message fields:
749
<pre>
750
id                 u32   required   The file handle used for further file operations
751 70 Adam Sutton
size               u64   required   The amount of data to read
752
offset             u64   optional   Offset into the file to read (default is current position)
753 69 Adam Sutton
</pre>
754 1 Andreas Smas
755 69 Adam Sutton
Reply message fields:
756
<pre>
757
data               bin   required   The data read from the file (size may be less than requested)
758
</pre>
759
760 70 Adam Sutton
h3. fileClose (Added in version 8)
761 69 Adam Sutton
762
Close an opened file.
763
764
Request message fields:
765
<pre>
766 1 Andreas Smas
id                 u32   required   The file handle to be closed
767 69 Adam Sutton
</pre>
768
769
Reply message fields:
770
<pre>
771
None
772
</pre>
773 70 Adam Sutton
774 69 Adam Sutton
h3. fileStat (Added in version 8)
775
776
Get status of a file.
777
778
Request message fields:
779
<pre>
780
id                 u32   required   The file handle to be stat'd
781 1 Andreas Smas
</pre>
782
783
Reply message fields:
784
<pre>
785
size               u64   optional   The size of the file in bytes
786
mtime              u64   optional   The last time the file was modified
787
</pre>
788 70 Adam Sutton
789
h3. fileSeek (Added in version 8)
790
791
Seek to position in a file.
792
793
Request message fields:
794
<pre>
795
id                 u32   required   The file handle to be stat'd
796
offset             u64   required   The position to seek in the file
797
whence             str   required   Where to seek relative to (default=SEEK_SET)
798
</pre>
799
800
Note: valid values for whence
801
<pre>
802
SEEK_SET           Seek relative to start of file
803
SEEK_CUR           Seek relative to current position in file
804 72 Adam Sutton
SEEK_END           Seek relative (backwards) to end of file
805 70 Adam Sutton
</pre>
806
807
Reply message fields:
808
<pre>
809
offset             u64   optional   The new absolute position within the file
810
</pre>
811 66 Adam Sutton
812 1 Andreas Smas
h1. Server to Client methods
813
814
----
815
816
h3. channelAdd
817
818
A new channel has been created on the server.
819
820
Message fields:
821
<pre>
822
channelId          u32   required   ID of channel.
823 66 Adam Sutton
channelNumber      u32   required   Channel number, 0 means unconfigured.
824 90 Jaroslav Kysela
channelNumberMinor u32   optional   Minor channel number (Added in version 13).
825 1 Andreas Smas
channelName        str   required   Name of channel.
826 70 Adam Sutton
channelIcon        str   optional   URL to an icon representative for the channel
827
                                    (For v8+ clients this could be a relative /imagecache/ID URL
828 73 Adam Sutton
                                     intended to be fed to fileOpen() or HTTP server)
829 104 Jaroslav Kysela
                                    (For v15+ clients this could be a relative imagecache/ID URL
830
                                     intended to be fed to fileOpen() or HTTP server)
831 66 Adam Sutton
eventId            u32   optional   ID of the current event on this channel.
832
nextEventId        u32   optional   ID of the next event on the channel.
833
tags               u32[] optional   Tags this channel is mapped to.
834
services           msg[] optional   List of available services (Added in version 5)
835 13 Andreas Smas
</pre>
836 1 Andreas Smas
837 66 Adam Sutton
Service fields:
838 1 Andreas Smas
<pre>
839 66 Adam Sutton
name               str   required   Service name
840
type               str   required   Service type
841
caid               u32   optional   Encryption CA ID
842
caname             str   optional   Encryption CA name
843 11 Andreas Smas
</pre>
844 1 Andreas Smas
845 66 Adam Sutton
h3. channelUpdate
846 11 Andreas Smas
847 66 Adam Sutton
Same as channelAdd, but all fields (except channelId) are optional.
848
849 58 sbi -
h3. channelDelete
850 1 Andreas Smas
851
A channel has been deleted on the server.
852 58 sbi -
853
Message fields:
854 1 Andreas Smas
<pre>
855 66 Adam Sutton
channelId          u32   required   ID of channel.
856 1 Andreas Smas
</pre>
857
858
----
859
860
h3. tagAdd
861 11 Andreas Smas
862 1 Andreas Smas
A new tag has been created on the server.
863
864
Message fields:
865
<pre>
866 66 Adam Sutton
tagId              u32   required   ID of tag.
867
tagName            str   required   Name of tag.
868
tagIcon            str   optional   URL to an icon representative for the channel.
869
tagTitledIcon      u32   optional   Icon includes a title
870
members            u32[] optional   Channel IDs of those that belong to the tag
871 1 Andreas Smas
</pre>
872 11 Andreas Smas
873 39 elupus -
h3. tagUpdate
874 58 sbi -
875 66 Adam Sutton
Same as tagAdd, but all fields (except tagId) are optional.
876 11 Andreas Smas
877
h3. tagDelete
878 1 Andreas Smas
879 58 sbi -
A tag has been deleted from the server.
880 1 Andreas Smas
881
Message fields:
882
<pre>
883 66 Adam Sutton
tagId              u32   required   ID of tag.
884 58 sbi -
</pre>
885
886 12 Andreas Smas
----
887 1 Andreas Smas
888 66 Adam Sutton
h3. dvrEntryAdd (Added in version 4)
889 58 sbi -
890 1 Andreas Smas
A new recording has been created on the server.
891 58 sbi -
892 1 Andreas Smas
Message fields:
893 2 Andreas Smas
<pre>
894 66 Adam Sutton
id                 u32   required   ID of dvrEntry.
895
channel            u32   required   Channel of dvrEntry.
896
start              s64   required   Time of when this entry was scheduled to start recording.
897
stop               s64   required   Time of when this entry was scheduled to stop recording.
898 89 Jaroslav Kysela
startExtra         s64   required   Extra start time (pre-time) in minutes (Added in version 13).
899
stopExtra          s64   required   Extra stop time (post-time) in minutes (Added in version 13).
900
retention          s64   required   DVR Entry retention time in days.
901
priority           u32   required   Priority (0 = Important, 1 = High, 2 = Normal, 3 = Low, 4 = Unimportant, 5 = Not set) (Added in version 13).
902
eventId            u32   optional   Associated EPG Event ID (Added in version 13).
903
autorecId          u32   optional   Associated Autorec ID (Added in version 13).
904
contentType        u32   optional   Content Type (like in the DVB standard) (Added in version 13).
905 66 Adam Sutton
title              str   optional   Title of recording
906
summary            str   optional   Short description of the recording (Added in version 6).
907
description        str   optional   Long description of the recording.
908
state              str   required   Recording state
909
error              str   optional   Plain english error description (e.g. "Aborted by user").
910 48 mdd -
</pre>
911 1 Andreas Smas
912 66 Adam Sutton
TODO: recording states
913 48 mdd -
914
h3. dvrEntryUpdate
915
916 66 Adam Sutton
Message fields:
917
<pre>
918
Same as dvrEntryAdd, but all fields (except id) are optional.
919
</pre>
920 51 elupus -
921 66 Adam Sutton
h3. dvrEntryDelete (Added in version 4)
922 58 sbi -
923 66 Adam Sutton
A recording has been deleted from the server.
924 58 sbi -
925 48 mdd -
Message fields:
926
<pre>
927 66 Adam Sutton
id                 u32   required   ID of recording to delete.
928 1 Andreas Smas
</pre>
929 48 mdd -
930 58 sbi -
----
931 48 mdd -
932 95 Jaroslav Kysela
h3. autorecEntryAdd (Added in version 13)
933
934
A new autorec recording has been created on the server.
935
936
Message fields:
937
<pre>
938
id                 str   required   ID (string!) of dvrAutorecEntry.
939
enabled            u32   required   If autorec entry is enabled (activated).
940
minDuration        u32   required   Minimal duration in seconds (0 = Any).
941
maxDuration        u32   required   Maximal duration in seconds (0 = Any).
942
retention          u32   required   Retention time (in days).
943
daysOfWeek         u32   required   Bitmask - Days of week (0x01 = Monday, 0x40 = Sunday, 0x7f = Whole Week, 0 = Not set).
944
priority           u32   required   Priority (0 = Important, 1 = High, 2 = Normal, 3 = Low, 4 = Unimportant, 5 = Not set).
945
approxTime         u32   required   Minutes from midnight (up to 24*60).
946
startExtra         s64   required   Extra start minutes (pre-time).
947
stopExtra          s64   required   Extra stop minutes (post-time).
948
title              str   optional   Title.
949
channel            u32   optional   Channel ID.
950
</pre>
951
952
h3. autorecEntryUpdate (Added in version 13)
953
954
Message fields:
955
<pre>
956
Same as autorecEntryUpdate but all fields (except id) are optional.
957
</pre>
958
959
h3. autorecEntryDelete (Added in version 13)
960
961
Message fields:
962
<pre>
963
id                 str   required   Autorec Entry ID (string!)
964
</pre>
965
966
----
967
968 66 Adam Sutton
h3. eventAdd (Added in version 6)
969 48 mdd -
970 66 Adam Sutton
Message fields:
971
<pre>
972
eventId            u32   required   Event ID
973
channelId          u32   required   The channel this event is related to.
974
start              u64   required   Start time of event, UNIX time.
975
stop               u64   required   Ending time of event, UNIX time.
976
title              str   optional   Title of event.
977
summary            str   optional   Short description of the event (Added in version 6).
978
description        str   optional   Long description of the event.
979
serieslinkId       u32   optional   Series Link ID (Added in version 6).
980
episodeId          u32   optional   Episode ID (Added in version 6).
981
seasonId           u32   optional   Season ID (Added in version 6).
982
brandId            u32   optional   Brand ID (Added in version 6).
983
contentType        u32   optional   DVB content code (Added in version 4, Modified in version 6*).
984
ageRating          u32   optional   Minimum age rating (Added in version 6).
985
starRating         u32   optional   Star rating (1-5) (Added in version 6).
986
firstAired         s64   optional   Original broadcast time, UNIX time (Added in version 6).
987
seasonNumber       u32   optional   Season number (Added in version 6).
988
seasonCount        u32   optional   Show season count (Added in version 6).
989
episodeNumber      u32   optional   Episode number (Added in version 6).
990
episodeCount       u32   optional   Season episode count (Added in version 6).
991
partNumber         u32   optional   Multi-part episode part number (Added in version 6).
992
partCount          u32   optional   Multi-part episode part count (Added in version 6).
993
episodeOnscreen    str   optional   Textual representation of episode number (Added in version 6).
994
image              str   optional   URL to a still capture from the episode (Added in version 6).
995
dvrId              u32   optional   ID of a recording (Added in version 5).
996
nextEventId        u32   optional   ID of next event on the same channel.
997
</pre>
998 48 mdd -
999 66 Adam Sutton
* *contentType previously had the major DVB category in the bottom 4 bits, 
1000
  however in v6 this has been changed to properly match DVB, so top 4 bits
1001
  as major category and bottom 4 bits has sub-category. Clients requesting
1002
  v5 or lower will get the old output.
1003 48 mdd -
1004 66 Adam Sutton
h3. eventUpdate (Added in version 6)
1005 35 Andreas Smas
1006 58 sbi -
Message fields:
1007
<pre>
1008 66 Adam Sutton
Same as eventAdd but all fields (except eventId) are optional.
1009 35 Andreas Smas
</pre>
1010 58 sbi -
1011 77 John Törnblom
h3. eventDelete (Added in version 6)
1012 35 Andreas Smas
1013 66 Adam Sutton
Message fields:
1014
<pre>
1015
eventId            u32   required   Event ID
1016
</pre>
1017 14 Andreas Smas
1018 66 Adam Sutton
---
1019 14 Andreas Smas
1020 66 Adam Sutton
h3. initialSyncCompleted (Added in version 2)
1021 14 Andreas Smas
1022 66 Adam Sutton
Sent after all the initial metadata has been sent when session has been set to async mode.
1023 38 Andreas Smas
1024
Message fields:
1025 14 Andreas Smas
<pre>
1026
</pre>
1027
1028
----
1029
1030
h3. subscriptionStart
1031 53 Andreas Smas
1032 66 Adam Sutton
Asynchronous message output when a new subscription is successfully started.
1033 14 Andreas Smas
1034
Message fields:
1035 1 Andreas Smas
<pre>
1036 66 Adam Sutton
subscriptionId     u32   required   Subscription ID.
1037
streams            msg[] required   Array of messages with stream information
1038
sourceinfo         msg   optional   Source information.
1039
</pre>
1040 37 Andreas Smas
1041 66 Adam Sutton
Stream message fields:
1042
<pre>
1043
index              u32   required   Index for this stream
1044
type               str   required   Type of stream
1045 113 Jaroslav Kysela
meta               bin   optional   Codec metadata (private data, libav - extradata) (Added in version 17)
1046 66 Adam Sutton
language           str   optional   Language for stream
1047
Video components only:
1048
width              u32   optional   Width of video in pixels
1049
height             u32   optional   Height of video in pixels
1050 68 Andreas Smas
aspect_num         u32   optional   Aspect ratio numerator (Added in version 5) *Can be incorrect and should not be relied upon*
1051
aspect_den         u32   optional   Aspect ratio denonminator (Added in version 5) *Can be incorrect and should not be relied upon*
1052 66 Adam Sutton
Audio components only:
1053 76 Dave Chapman
audio_type         u32   optional   Audio type - 0=Normal; 1=Clean effects; 2=Hearing impaired; 3=Visually impaired commentary; 4-255=Reserved (Added in version 11)
1054 66 Adam Sutton
channels           u32   optional   Number of audio channels (Added in version 5)
1055
rate               u32   optional   Audio bitrate (Added in version 5)
1056
Subtitle components only:
1057
composition_id     u32   optional   ??? (Added in version 5)
1058
ancillary_id       u32   optional   ??? (Added in version 5)
1059
</pre>
1060 2 Andreas Smas
1061 66 Adam Sutton
Sourceinfo message fields:
1062
<pre>
1063
adapter            str   optional   Adapter name
1064
mux                str   optional   Transponder name
1065
network            str   optional   Network name
1066
provider           str   optional   ???
1067
service            str   optional   Service name
1068
</pre>
1069 15 Andreas Smas
1070 66 Adam Sutton
Video Stream types:
1071 1 Andreas Smas
<pre>
1072 79 Jaroslav Kysela
MPEG2VIDEO                    MPEG2 video, meta field is present (configuration blocks)
1073
H264                          H264 video, meta field is present (configuration blocks)
1074
HEVC                          HEVC video, meta field is present (configuration blocks)
1075 66 Adam Sutton
</pre>
1076 15 Andreas Smas
1077 1 Andreas Smas
Audio Stream types:
1078
<pre>
1079 66 Adam Sutton
MPEG2AUDIO                    MPEG2 audio (MP2)
1080
AC3                           AC3 audio
1081 79 Jaroslav Kysela
AAC                           ADTS framed AAC (one AAC packet per ADTS frame), meta field is present (MPEG4 config)
1082 66 Adam Sutton
EAC3                          Enhanced AC3 audio
1083 79 Jaroslav Kysela
VORBIS                        Vorbis audio, meta field is present with the main vorbis header
1084 16 Andreas Smas
</pre>
1085
1086 66 Adam Sutton
Subtitle Stream types:
1087
<pre>
1088
TELETEXT                      ???
1089
DVBSUB                        ???
1090
</pre>
1091 55 Lars Op den Kamp -
1092 112 Jaroslav Kysela
h3. subscriptionGrace
1093
1094
Notifies client about the grace timeout (timeout for stream activation). It can be issues multiple times.
1095
For example a configuration with satellite rotors requires more than 120 seconds to tune, so users
1096
should be notified..
1097
1098
Message fields:
1099
<pre>
1100
subscriptionId     u32   required   Subscription ID.
1101
graceTimeout       u32   required   Grace timeout in seconds.
1102
</pre>
1103
1104 55 Lars Op den Kamp -
h3. subscriptionStop
1105
1106 66 Adam Sutton
A subscription has been stopped.
1107 55 Lars Op den Kamp -
1108
Message fields:
1109
<pre>
1110 66 Adam Sutton
subscriptionId     u32   required   Subscription ID.
1111 1 Andreas Smas
status             str   optional   Error message if subscription stopped unexpectedly.
1112
</pre>
1113
1114 73 Adam Sutton
h3. subscriptionSkip (Added version 9)
1115
1116
A subscription has been skipped.
1117
1118
Message fields:
1119
<pre>
1120
subscriptionId     u32   required   Subscription ID.
1121
error              u32   optional   The last skip command caused an error.
1122
absolute           u32   optional   Indicates the output is absolute (Note: should always be 1 at the moment)
1123
time               u64   optional   The time the subscription has skipped to.
1124
size               u64   optional   The position in the file we've skipped to (Note: not currently used).
1125
</pre>
1126
1127
h3. subscriptionSpeed (Added version 9)
1128
1129
A subscription's playback speed has changed.
1130
1131
This can happen even without a speed request, should playback reach either end of the buffer.
1132
1133
Message fields:
1134
<pre>
1135
subscriptionId     u32   required   Subscription ID.
1136
speed              u32   required   The new speed of the subscription
1137
</pre>
1138
1139 55 Lars Op den Kamp -
h3. subscriptionStatus
1140
1141 66 Adam Sutton
Subscription status update.
1142 58 sbi -
1143
Message fields:
1144
<pre>
1145 66 Adam Sutton
subscriptionId     u32   required   Subscription ID.
1146
status             str   optional   English clear text of error status. Absence of this field means that the status is OK. 
1147 16 Andreas Smas
</pre>
1148 58 sbi -
1149 16 Andreas Smas
h3. queueStatus
1150
1151 1 Andreas Smas
The queueStatus message is sent every second during normal data delivery.
1152 60 John Törnblom
1153
The transmit scheduler have different drop thresholds for different frame types.
1154 66 Adam Sutton
1155 1 Andreas Smas
If congestion occurs it will favor dropping B-frames before P-frames before I-frames.
1156
All audio is recognized as I-frames. 
1157 58 sbi -
1158 1 Andreas Smas
Message fields:
1159
<pre>
1160 66 Adam Sutton
subscriptionId     u32   required   Subscription ID.
1161
packets            u32   required   Number of data packets in queue.
1162
bytes              u32   required   Number of bytes in queue.
1163
delay              u32   optional   Estimated delay of queue (in µs).
1164 1 Andreas Smas
Bdrops             u32   required   Number of B-frames dropped
1165 66 Adam Sutton
Pdrops             u32   required   Number of P-frames dropped
1166
Idrops             u32   required   Number of I-frames dropped
1167 73 Adam Sutton
delay              s64   required   Delta between first and last DTS (Added in version 9)
1168 1 Andreas Smas
</pre>
1169
1170
h3. signalStatus
1171
1172
The signalStatus message is sent every second during normal data delivery.
1173
1174
The optional fields may not have been implemented or may not be supported by the active adapter.
1175
1176
Message fields:
1177
<pre>
1178 66 Adam Sutton
subscriptionId     u32   required   Subscription ID.
1179
feStatus           str   required   Frontend status.
1180
feSNR              u32   optional   Signal to noise ratio.
1181 1 Andreas Smas
feSignal           u32   optional   Signal status percentage.
1182
feBER              u32   optional   Bit error rate.
1183
feUNC              u32   optional   Uncorrected blocks.
1184 73 Adam Sutton
</pre>
1185
1186
h3. timeshiftStatus
1187
1188
Provide status every second about the timeshift buffer.
1189
1190
Message fields:
1191
<pre>
1192
subscriptionId     u32   required   Subscription ID.
1193
full               u32   required   Indicates whether the buffer is full
1194
shift              s64   required   Current position relative to live
1195
start              s64   optional   PTS of the first frame in the buffer
1196
end                s64   optional   PTS of the last frame in the buffer
1197 1 Andreas Smas
</pre>
1198
1199
h3. muxpkt
1200
1201
Streaming data.
1202
1203
Message fields:
1204
<pre>
1205 66 Adam Sutton
subscriptionId     u32   required   Subscription ID.
1206
frametype          u32   required   Type of frame as ASCII value: 'I', 'P', 'B'
1207
stream             u32   required   Stream index. Corresponds to the streams reported in the subscriptionStart message.
1208
dts                s64   optional   Decode Time Stamp in µs.
1209
pts                s64   optional   Presentation Time Stamp in µs.
1210
duration           u32   required   Duration of frame in µs.
1211
payload            bin   required   Actual frame data.
1212 1 Andreas Smas
</pre>