-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMSEXDefines.h
474 lines (432 loc) · 20.4 KB
/
MSEXDefines.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
#ifndef MSEXDEFINES_H
#define MSEXDEFINES_H
#include "CITPDefines.h"
#include <QObject>
///////////////////////////////////////////
//
// Defines
//
///////////////////////////////////////////
#define LISTENTCPPORT 4811
#define LAYER_NUMBER 0x08
#define TRANSMIT_INTERVAL_LSTA 1000
#define NAME "LibreMediaServer"
#define STATE "BetaTesting..."
#define UUID "aaaaaaaa-eeee-ffff-dddd-bbbbbbbbbbbb"
// Cookies
#define COOKIE_MSEX 0X5845534d // 'MSEX'
#define COOKIE_MSEX_CINF 0x666e4943 // 'CInf'
#define COOKIE_MSEX_SINF 0x666e4953 // 'SInf'
#define COOKIE_MSEX_NACK 0x6b63614e // 'Nack'
#define COOKIE_MSEX_LSTA 0x6174534c // 'LSta'
#define COOKIE_MSEX_GELI 0x494c4547 // GELI
#define COOKIE_MSEX_ELIN 0x6e494c45 // ELIn
#define COOKIE_MSEX_ELUP 0x71554c45 // ELUp
#define COOKIE_MSEX_GEIN 0x6e494547 // GEIn
#define COOKIE_MSEX_MEIN 0x6e49454d // MEIn
#define COOKIE_MSEX_EEIN 0x6e494545 // EEIn
#define COOKIE_MSEX_GLEI 0x49454c47 // GLEI
#define COOKIE_MSEX_GELT 0x544c4547 // GELT
#define COOKIE_MSEX_ELTH 0x68544c45 // ELTh
#define COOKIE_MSEX_GETH 0x68544547 // GETh
#define COOKIE_MSEX_ETHN 0x6e685445 // EThn
#define COOKIE_MSEX_GVSR 0x72535647 // GVsr
#define COOKIE_MSEX_VSRC 0x63725356 // VSrc
#define COOKIE_MSEX_RQST 0x74537152 // RqSt
#define COOKIE_MSEX_STFR 0x72467453 // StFr
//////////////////////////////////////////////
// //
// Estructuras auxiliares //
// //
//////////////////////////////////////////////
// Estructura Layer Status V1.0
struct LayerStatus {
quint8 LayerNumber;
quint8 PhysicalOutput;
quint8 MediaLibraryNumber;
quint8 MediaNumber;
QString Name;
quint32 MediaPosition;
quint32 MediaLength;
quint8 MediaFPS;
quint32 LayerStatusFlags;
};
// Estructura Media Library ID. MSex 1.1
struct MSEXLibraryId {
quint8 Level; // 0 - 3
quint8 Level1; // Sublevel 1 specifier, when Depth >= 1.
quint8 Level2; // Sublevel 2 specifier, when Depth >= 2.
quint8 Level3; // Sublevel 3 specifier, when Depth == 3.
};
// Media Information for MELIn packages. v1.0
struct MediaInformation {
uint8 Number; // 0-based contiguous index of the media.
// uint32 SerialNumber; //MSEX 1.2
uint8 DMXRangeMin;// DMX range start value.
uint8 DMXRangeMax;// DMX range end value.
QString MediaName;// Media name.
uint64 MediaVersionTimestamp;// Media version in seconds since 1st January 1970.
uint16 MediaWidth; // Media width.
uint16 MediaHeight;// Media height.
uint32 MediaLength;// Media length (in frames).
uint8 MediaFPS;// Media resolution (in frames per second).
};
// Media Library for ELin packages v1.0
struct MediaLibrary {
quint8 m_Id; // Library id.
quint8 m_DMXRangeMin;// DMX range start value.
quint8 m_DMXRangeMax;// DMX range end value.
QString m_Name;// Library name.
// quint8 m_LibraryCount;// Number of sub libraries in the library. MSEX 1.2
quint8 m_ElementCount;// Number of elements in the library.
QList<MediaInformation> m_MediaInformation; // Pointer to the Medias Information List of this Library
};
// for ELUP
struct AffectedItems
{
uint8 ItemSet[32]; // A set of 256 bits used to indicate which item numbers have been changed
};
//////////////////////////////////////////////
// //
// Estructuras de paquetes //
// //
//////////////////////////////////////////////
// MSEX Header
struct CITP_MSEX_Header
{
CITP_Header CITPHeader; // The CITP header. CITP ContentType is "MSEX".
uint8 VersionMajor;
uint8 VersionMinor;
uint32 ContentType; // A cookie defining which MSEX message it is.
};
// Mensaje para solicitar una conexión
struct CITP_MSEX_CInf
{
CITP_MSEX_Header CITPMSEXHeader; // CITP MSEX header. MSEX ContentType is "CInf". Version is 1.2.
uint8 SupportedMSEXVersionsCount; // Number of following MSEX version pairs.
uint16 SupportedMSEXVersions[]; // Each 2 byte value is MSB = major MSEX version, LSB = minor MSEX version.
uint FutureMessageData[]; // A hint that future versions of this message may contain trailing data.
};
// SInf Versiones 1.0 y 1.1. Send after connection established
struct CITP_MSEX_10_SINF
{
CITP_MSEX_Header CITPMSEXHeader; // CITP MSEX header. MSEX ContentType is "SInf". Version is set to 1.0.
// ucs2 ProductName;// Display name of the product.
uint8 ProductVersionMajor;// Major version number of the product.
uint8 ProductVersionMinor;// Minor version number of the product.
uint8 LayerCount;// Number of following layer information blocks.
/* struct LayerInformation
{
ucs1 DMXSource[];// DMX-source connection string. See DMX Connection Strings in Definitions.
};*/
};
// SInf V1.2 Send after CINf received
struct CITP_MSEX_12_SINF
{
CITP_MSEX_Header CITPMSEXHeader;// CITP MSEX header. MSEX ContentType is "SInf". Version is at least 1.2
//and is the highest common version supported by both server and client.
QByteArray uuid; // A standard 36 character UUID that uniquely identifies this media server
QString ProductName; // Display name of the product.
uint8 ProductVersionMajor; // Major version number of the product.
uint8 ProductVersionMinor; // Minor version number of the product.
uint8 ProductVersionBugfix; // Bugfix version number of the product.
uint8 SupportedMSEXVersionsCount; // Number of following MSEX version pairs.
uint16 SupportedMSEXVersions; // Each 2 byte value is MSB = major MSEX version, LSB = minor MSEX version
uint16 SupportedLibraryTypes; // Bit-encoded flagword that identifies which library types are provided by
//the media server.
uint8 ThumbnailFormatsCount; // Number of following thumbnail format cookies
QByteArray ThumbnailFormats; // Must include "RGB8", but can also include "JPEG" and "PNG "
uint8 StreamFormatsCount; // Number of following stream format cookies
QByteArray StreamFormats; // Must include "RGB8", but can also include "JPEG" and "PNG "
uint8 LayerCount; // Number of following layer information blocks.
QString LayerInf;
};
// Nack Negative Acknowledge Message
struct CITP_MSEX_Nack
{
CITP_MSEX_Header CITPMSEXHeader; // CITP MSEX header. MSEX ContentType is "Nack" and version is 1.2.
uint32 ReceivedContentType; // MSEX message type of the message being NACKed (e.g. "GELT" if the Media
//Server does not support library thumbnails)
};
// Layer Status Message 1.0
struct CITP_MSEX_10_LSta
{
CITP_MSEX_Header CITPMSEXHeader; // CITP MSEX header. MSEX ContentType is "LSta" and version is 1.0.
uint8 LayerCount; // Number of following layer information blocks.
struct LayerStatus
{
uint8 LayerNumber; // 0-based layer number, corresponding to the layers reported in the SInf message.
uint8 PhysicalOutput; // Current physical video output index,0-based.
uint8 MediaLibraryNumber; // Current media library number.
uint8 MediaNumber; // Current media number.
ucs2 MediaName[]; // Current media name.
uint32 MediaPosition; // Current media position (in frames).
uint32 MediaLength; // Current media length (in frames).
uint8 MediaFPS; // Current media resolution in frames per second.
uint32 LayerStatusFlags; // Current layer status flags
// 0x0001 MediaPlaying
};
};
// Layer Status Message version 1.2
struct CITP_MSEX_12_LSta
{
CITP_MSEX_Header CITPMSEXHeader; // CITP MSEX header. MSEX ContentType is "LSta" and version is 1.2.
uint8 LayerCount; // Number of following layer information blocks.
};
// Get Element Library v 1.0
struct CITP_MSEX_10_GELI
{
CITP_MSEX_Header CITPMSEXHeader; // CITP MSEX header. MSEX ContentType is "GELI" and version is 1.0.
uint8 LibraryType; // Content type requested.
uint8 LibraryCount; // Number of libraries requested, set to 0 when requesting all available.
uint8 LibraryNumbers[]; // Requested library numbers, none if LibraryCount is 0.
};
// Get Element Library v1.1
struct CITP_MSEX_11_GELI
{
CITP_MSEX_Header CITPMSEXHeader; // CITP MSEX header. MSEX ContentType is "GELI" and version is 1.1.
uint8 LibraryType; // Content type requested.
MSEXLibraryId LibraryParentId; // Parent library id.
uint8 LibraryCount; // Number of libraries requested, set to 0 when requesting all available.
uint8 LibraryNumbers[]; // Requested library numbers, none if LibraryCount is 0.
};
// Get Element Library v1.2
struct CITP_MSEX_12_GELI
{
CITP_MSEX_Header CITPMSEXHeader; // CITP MSEX header. MSEX ContentType is "GELI" and version is 1.2.
uint8 LibraryType; // Content type requested.
MSEXLibraryId LibraryParentId; // Parent library id.
uint16 LibraryCount; // Number of libraries requested, set to 0 when requesting all available.
uint8 LibraryNumbers[]; // Requested library numbers, none if LibraryCount is 0.
};
// Elemnt Library Information v1.0
struct CITP_MSEX_ELIn
{
CITP_MSEX_Header CITPMSEXHeader; // CITP MSEX header. MSEX ContentType is "ELIn" and version is 1.1.
uint8 LibraryType; // Content type requested.
uint8 LibraryCount;// Number of following element library information blocks.
};
// Element Library Updated v1.2
struct CITP_MSEX_12_ELUp
{
CITP_MSEX_Header CITPMSEXHeader; // CITP MSEX header. MSEX ContentType is "ELUp" and version is 1.2.
uint8 LibraryType; // Content type of updated library.
MSEXLibraryId LibraryId; // Library that has been updated.
uint8 UpdateFlags; // Additional information flags.
// 0x01 Existing elements have been updated
// 0x02 Elements have been added or removed
// 0x04 Sub libraries have been updated
// 0x08 Sub libraries have been added or removed
// 0x10 All elements have been affected (ignore AffectedElements)
// 0x20 All sub libraries have been affected (ignore AffectedLibraris)
AffectedItems AffectedElements; // Which elements have been affected
AffectedItems AffectedLibraries; // Which sub-libraries have been affected
};
// Get Element Information v1.1
struct CITP_MSEX_11_GEIn
{
CITP_MSEX_Header CITPMSEXHeader; // CITP MSEX header. MSEX ContentType is "GEIn" and version is 1.1.
uint8 LibraryType; // Content type requested.
MSEXLibraryId LibraryId; // Library for which to retrieve elements
uint8 ElementCount; // Number of elements for which information is requested, set to 0 when requesting all available.
uint8 ElementNumbers[]; // Numbers of the elements for which information is requested.
};
// Get Element Information v1.0
struct CITP_MSEX_10_GEIn
{
CITP_MSEX_Header CITPMSEXHeader; // CITP MSEX header. MSEX ContentType is "GEIn" and version is 1.1.
quint8 LibraryType; // Content type requested.
quint8 LibraryId; // Library for which to retrieve elements
quint8 ElementCount; // Number of elements for which information is requested, set to 0 when requesting all available.
quint8 ElementNumbers; // Numbers of the elements for which information is requested.
};
// Media Element Information v1.0
struct CITP_MSEX_10_MEIn
{
CITP_MSEX_Header CITPMSEXHeader; // CITP MSEX header. MSEX ContentType is "MEIn" and version is 1.0
quint8 LibraryId; // Library containing the media elements.
qint8 ElementCount; // Number of following Media Information structs.
};
// Media Element Information v1.1
struct CITP_MSEX_11_MEIn
{
CITP_MSEX_Header CITPMSEXHeader; // CITP MSEX header. MSEX ContentType is "MEIn" and version is 1.1.
MSEXLibraryId LibraryId; // Library containing the media elements.
qint8 ElementCount; // Number of following Media Information blocks.
};
// Media Element Information v1.2
struct CITP_MSEX_12_MEIn
{
CITP_MSEX_Header CITPMSEXHeader; // CITP MSEX header. MSEX ContentType is "MEIn" and version is 1.1.
MSEXLibraryId LibraryId; // Library containing the media elements.
uint16 ElementCount; // Number of following Media Information blocks.
};
// Effect Element Information v1.2
struct CITP_MSEX_12_EEIn
{
CITP_MSEX_Header CITPMSEXHeader; // CITP MSEX header. MSEX ContentType is "EEIn" and version is 1.1.
MSEXLibraryId LibraryId;// Library containing the effect elements.
uint16 ElementCount;// Number of following (effect) information blocks.
struct EffectInformation
{
uint8 ElementNumber;
uint32 SerialNumber;
uint8 DMXRangeMin;
uint8 DMXRangeMax;
ucs2 EffectName[];
uint8 EffectParameterCount;
ucs2 EffectParameterNames[]; // List of effect parameter names.
};
};
// Generic Element Informatio v1.2
struct CITP_MSEX_12_GLEI
{
CITP_MSEX_Header CITPMSEXHeader; // CITP MSEX header. MSEX ContentType is "GLEI" and version is 1.1.
MSEXLibraryId LibraryId;
uint8 ElementCount;
uint16 LibraryType;
struct GenericInformation
{
uint8 ElementNumber;
uint32 SerialNumber;
uint8 DMXRangeMin;
uint8 DMXRangeMax;
ucs2 Name[];
uint64 VersionTimestamp;
};
};
// Get Element Libary Thumbnail
struct CITP_MSEX_12_GELT
{
CITP_MSEX_Header CITPMSEXHeader;// CITP MSEX header. MSEX ContentType is "GELT" and version is 1.2.
uint32 ThumbnailFormat;// Format of the thumbnail. Can be "RGB8" or "JPEG" (or "PNG " for MSEX 1.2 and up).
uint16 ThumbnailWidth;// Preferred thumbnail image width.
uint16 ThumbnailHeight;// Preferred thumbnail image height.
uint8 ThumbnailFlags;// Additional information flags.
// 0x01 Preserve aspect ratio of image (use width and height as maximum)
uint8 LibraryType;// 1 for Media, 2 for Effects.
uint16 LibraryCount;// Number of libraries requested, set to 0 when requesting all available.
MSEXLibraryId LibraryIds[];// Ids of the libraries requested, not present if LibraryCount is 0.
};
// Element Library Thumbnail
struct CITP_MSEX_11_ELTh
{
CITP_MSEX_Header CITPMSEXHeader;// CITP MSEX header. MSEX ContentType is "ELTh" and version is 1.1.
uint8 LibraryType;// 1 for Media, 2 for Effects.
MSEXLibraryId LibraryId;// Id of the library that the thumbnail belongs to.
uint32 ThumbnailFormat;// Format of the thumbnail. Can be "RGB8" or "JPEG" (or "PNG " for MSEX 1.2 and up).
uint16 ThumbnailWidth;// Thumbnail width.
uint16 ThumbnailHeight;// Thumbnail height.
uint16 ThumbnailBufferSize;// Size of the thumbnail buffer.
uint8 ThumbnailBuffer;// Thumbnail image buffer.
};
// Get Element Thumbnail v1.0
struct CITP_MSEX_10_GETh
{
CITP_MSEX_Header CITPMSEXHeader;
uint32 ThumbnailFormat; // Can be "RGB8" or "JPEG" (or "PNG " for MSEX 1.2 and up).
uint16 ThumbnailWidth;
uint16 ThumbnailHeight;
uint8 ThumbnailFlags; // Additional information flags. 0x01 Preserve aspect ratio of image (use width and height as maximum)
uint8 LibraryType; // 1 for Media, 2 for Effects.
uint8 LibraryNumber; // Number of the media's library.
uint8 ElementCount; // Number of medias for which information is requested, set to 0 when requesting all available.
uint8 ElementNumber; // The numbers of the requested elements.Not present if ElementCount is 0.
};
// Get Element Thumbnail v1.2
struct CITP_MSEX_12_GETh
{
CITP_MSEX_Header CITPMSEXHeader;// CITP MSEX header. MSEX ContentType is "GETh" and version is 1.2.
uint32 ThumbnailFormat;// Format of the thumbnail.Can be "RGB8" or "JPEG" (or "PNG " for MSEX 1.2 and up).
uint16 ThumbnailWidth; //Preferred thumbnail image width.
uint16 ThumbnailHeight; // Preferred thumbnail image height.
uint8 ThumbnailFlags; // Additional information flags.
//0x01 Preserve aspect ratio of image (use width and height as maximum)
uint8 LibraryType; //1 for Media, 2 for Effects.
MSEXLibraryId LibraryId; //Id of the media's library.
uint16 ElementCount; // Number of medias for which information is requested, set to 0 when requesting all available.
uint8 ElementNumbers[]; //The numbers of the requested elements. Not present if ElementCount = 0. For MSEX 1.2 these are 0-based contiguous index values.
};
// Element Thumbnail v1.0
struct CITP_MSEX_10_ETHN
{
CITP_MSEX_Header CITPMSEXHeader;// CITP MSEX header. MSEX ContentType is "EThn" and version is 1.1.
uint8 LibraryType;// 1 for Media, 2 for Effects.
uint8 LibraryId;// Id of the element's library.
uint8 ElementNumber;// Number of the element (For MSEX 1.2 this is a 0-based contiguous index value).
uint32 ThumbnailFormat;// Format of the thumbnail. Can be "RGB8" or "JPEG" (or "PNG " for MSEX 1.2 and up).
uint16 ThumbnailWidth;// Thumbnail width.
uint16 ThumbnailHeight;// Thumbnail height.
uint16 ThumbnailBufferSize;// Size of the thumbnail buffer.
// uint8 ThumbnailBuffer[];// Thumbnail image buffer.
};
// Element Thumbnail v1.1
struct CITP_MSEX_11_EThn
{
CITP_MSEX_Header CITPMSEXHeader;// CITP MSEX header. MSEX ContentType is "EThn" and version is 1.1.
uint8 LibraryType;// 1 for Media, 2 for Effects.
MSEXLibraryId LibraryId;// Id of the element's library.
uint8 ElementNumber;// Number of the element (For MSEX 1.2 this is a 0-based contiguous index value).
uint32 ThumbnailFormat;// Format of the thumbnail. Can be "RGB8" or "JPEG" (or "PNG " for MSEX 1.2 and up).
uint16 ThumbnailWidth;// Thumbnail width.
uint16 ThumbnailHeight;// Thumbnail height.
uint16 ThumbnailBufferSize;// Size of the thumbnail buffer.
uint8 ThumbnailBuffer;// Thumbnail image buffer.
};
// Get Video Sources
struct CITP_MSEX_GVSr
{
CITP_MSEX_Header CITPMSEXHeader; // CITP MSEX header. MSEX ContentType is "GVSr".
};
// Video Sources
struct CITP_MSEX_VSRC
{
CITP_MSEX_Header CITPMSEXHeader;// CITP MSEX header. MSEX ContentType is "VSrc".
uint16 SourceCount;// Number of following source information blocks.
uint16 SourceIdentifier; // Source identifier.
};
struct SourceInformation
{
signed char SourceName[];// Display name of the source (ie "Output 1", "Layer 2", "Camera 1" etc).
uint8 PhysicalOutput;// If applicable, 0-based index designating the physical video output index. Otherwise 0xFF.
uint8 LayerNumber;// If applicable, 0-based layer number, corresponding to the layers reported in the SInf message. Otherwise 0xFF.
uint16 Flags;// Information flags.
// 0x0001 Without effects
uint16 Width;// Full width.
uint16 Height;// Full height.
};
// Request Stream
struct CITP_MSEX_RqSt
{
CITP_MSEX_Header CITPMSEXHeader;// CITP MSEX header. MSEX ContentType is "RqSt".
uint16 SourceIdentifier;// Identifier of the source requested.
uint32 FrameFormat;// Requested frame format. Can be "RGB8" or "JPEG" (or "PNG " for MSEX 1.2 and up).
uint16 FrameWidth;// Preferred minimum frame width.
uint16 FrameHeight;// Preferred minimum frame height.
uint8 fps;// Preferred minimum frames per second.
uint8 Timeout;// Timeout in seconds (for instance 5 seconds, 0 to ask for only one frame).
};
// Stream Frame 1.0
struct CITP_MSEX_10_StFr
{
CITP_MSEX_Header CITPMSEXHeader;// The CITP MSEX header. MSEX ContentType is "StFr".
uint16 SourceIdentifier;// Identifier of the frame's source.
uint32 FrameFormat;// Requested frame format. Can be "RGB8" or "JPEG" (or "PNG " for MSEX 1.2 and up).
uint16 FrameWidth;// Preferred minimum frame width.
uint16 FrameHeight;// Preferred minimum frame height.
uint16 FrameBufferSize;// Size of the frame image buffer.
// uint8 FrameBuffer[];// Frame image buffer.
};
// Stream Frame 1.2
struct CITP_MSEX_12_StFr
{
CITP_MSEX_Header CITPMSEXHeader;// The CITP MSEX header. MSEX ContentType is "StFr".
ucs1 MediaServerUUID[36];// Source media server UUID.
uint16 SourceIdentifier;// Identifier of the frame's source.
uint32 FrameFormat;// Requested frame format. Can be "RGB8" or "JPEG" (or "PNG " for MSEX 1.2 and up).
uint16 FrameWidth;// Preferred minimum frame width.
uint16 FrameHeight;// Preferred minimum frame height.
uint16 FrameBufferSize;// Size of the frame image buffer.
uint8 FrameBuffer[];// Frame image buffer.
};
#endif // MSEXDEFINES_H