/[rtss_sdk]/trunk/Include/RTSSSharedMemory.h
ViewVC logotype

Contents of /trunk/Include/RTSSSharedMemory.h

Parent Directory Parent Directory | Revision Log Revision Log


Revision 11 - (show annotations) (download)
Sat Aug 9 05:49:59 2014 UTC (4 years, 11 months ago) by william
File MIME type: text/plain
File size: 17094 byte(s)
update Include/RTSSSharedMemory.h 
* fix member comments so they function with Intellisense (the comment must be declared before the member, not after)
* clean up code (put code into #pragma region/endregion tags)
* put defined flags into named enumeration structures
1
2 //
3 // This header file defines statistics server's shared memory format
4 //
5
6 #ifndef _RTSS_SHARED_MEMORY_INCLUDED_
7 #define _RTSS_SHARED_MEMORY_INCLUDED_
8
9 #pragma region OSD FLAGS
10 enum OSDFLAGS
11 {
12 //use this flag to force the server to update OSD
13 OSDFLAG_UPDATED = 0x00000001,
14 };
15 #pragma endregion
16
17 #pragma region STAT FLAGS
18 enum STATFLAGS
19 {
20 STATFLAG_RECORD = 0x00000001,
21 };
22 #pragma endregion
23
24 #pragma region APPLICATION FLAGS
25 enum APPFLAGS
26 {
27 APPFLAG_DD = 0x00000010,
28 APPFLAG_D3D8 = 0x00000100,
29 APPFLAG_D3D9 = 0x00001000,
30 APPFLAG_D3D9EX = 0x00002000,
31 APPFLAG_OGL = 0x00010000,
32 APPFLAG_D3D10 = 0x00100000,
33 APPFLAG_D3D11 = 0x01000000,
34 APPFLAG_API_USAGE_MASK = (APPFLAG_DD | APPFLAG_D3D8 | APPFLAG_D3D9 | APPFLAG_D3D9EX | APPFLAG_OGL | APPFLAG_D3D10 | APPFLAG_D3D11),
35 APPFLAG_PROFILE_UPDATE_REQUESTED = 0x10000000,
36 };
37 #pragma endregion
38
39 #pragma region SCREEN CAPTURE FLAGS
40 enum SCREEENCAPFLAGS
41 {
42 SCREENCAPTUREFLAG_REQUEST_CAPTURE = 0x00000001,
43 SCREENCAPTUREFLAG_REQUEST_CAPTURE_OSD = 0x00000010,
44 };
45 #pragma endregion
46
47 #pragma region VIDEO CAPTURE FLAGS
48 enum VIDEOCAPFLAGS
49 {
50 VIDEOCAPTUREFLAG_REQUEST_CAPTURE_START = 0x00000001,
51 VIDEOCAPTUREFLAG_REQUEST_CAPTURE_PROGRESS = 0x00000002,
52 VIDEOCAPTUREFLAG_REQUEST_CAPTURE_STOP = 0x00000004,
53 VIDEOCAPTUREFLAG_REQUEST_CAPTURE_MASK = 0x00000007,
54 VIDEOCAPTUREFLAG_REQUEST_CAPTURE_OSD = 0x00000010,
55 VIDEOCAPTUREFLAG_INTERNAL_RESIZE = 0x00010000,
56 };
57 #pragma endregion
58
59 #pragma region RTSS_SHARED_MEMORY V1_0 struture
60 // v1.0 memory structure
61 typedef struct RTSS_SHARED_MEMORY_V_1_0
62 {
63 //signature allows applications to verify status of shared memory
64 //The signature can be set to:
65 //'RTSS' - statistics server's memory is initialized and contains
66 // valid data
67 //0xDEAD - statistics server's memory is marked for deallocation and
68 // no longer contain valid data
69 //otherwise the memory is not initialized
70 DWORD dwSignature;
71 //structure version ((major<<16) + minor)
72 //must be set to 0x00010000 for v1.0 structure
73 DWORD dwVersion;
74 //start time of framerate measurement period (in milliseconds)
75 //Take a note that this field must contain non-zero value to calculate
76 //framerate properly!
77 DWORD dwTime0;
78 //end time of framerate measurement period (in milliseconds)
79 DWORD dwTime1;
80 //amount of frames rendered during (dwTime1 - dwTime0) period
81 //to calculate framerate use the following formula:
82 //1000.0f * dwFrames / (dwTime1 - dwTime0)
83 DWORD dwFrames;
84
85 } RTSS_SHARED_MEMORY_V_1_0, *LPRTSS_SHARED_MEMORY_V_1_0;
86 #pragma endregion
87
88 #pragma region RTSS_SHARED_MEMORY V1_1 struture
89 // v1.1 memory structure
90 typedef struct RTSS_SHARED_MEMORY_V_1_1
91 {
92 //signature allows applications to verify status of shared memory
93 //The signature can be set to:
94 //'RTSS' - statistics server's memory is initialized and contains
95 // valid data
96 //0xDEAD - statistics server's memory is marked for deallocation and
97 // no longer contain valid data
98 //otherwise the memory is not initialized
99 DWORD dwSignature;
100 //structure version ((major<<16) + minor)
101 //must be set to 0x00010001 for v1.1 structure
102 DWORD dwVersion;
103 //start time of framerate measurement period (in milliseconds)
104 //Take a note that this field must contain non-zero value to calculate
105 //framerate properly!
106 DWORD dwTime0;
107 //end time of framerate measurement period (in milliseconds)
108 DWORD dwTime1;
109 //amount of frames rendered during (dwTime1 - dwTime0) period
110 //to calculate framerate use the following formula:
111 //1000.0f * dwFrames / (dwTime1 - dwTime0)
112 DWORD dwFrames;
113 //bitmask, containing combination of OSDFLAG_... flags
114 //Note: set OSDFLAG_UPDATED flag as soon as you change any OSD related field
115 DWORD dwOSDFlags;
116 //OSD X-coordinate (coordinate wrapping is allowed, i.e. -5 defines 5
117 //pixel offset from the right side of the screen)
118 DWORD dwOSDX;
119 //OSD Y-coordinate (coordinate wrapping is allowed, i.e. -5 defines 5
120 //pixel offset from the bottom side of the screen)
121 DWORD dwOSDY;
122 //OSD pixel zooming ratio
123 DWORD dwOSDPixel;
124 //OSD color in RGB format
125 DWORD dwOSDColor;
126 //OSD text
127 char szOSD[256];
128 //OSD owner ID
129 //Use this field to capture OSD and prevent other applications from
130 //using OSD when it is already in use by your application.
131 //You should change this field only if it is empty (i.e. when OSD is
132 //not owned by any application) or if it is set to your own application's
133 //ID (i.e. when you own OSD)
134 //You shouldn't change any OSD related feilds until you own OSD
135 char szOSDOwner[32];
136 } RTSS_SHARED_MEMORY_V_1_1, *LPRTSS_SHARED_MEMORY_V_1_1;
137 #pragma endregion
138
139 #pragma region RTSS_SHARED_MEMORY V1_2 struture
140 // v1.2 memory structure
141 typedef struct RTSS_SHARED_MEMORY_V_1_2
142 {
143 //signature allows applications to verify status of shared memory
144 //The signature can be set to:
145 //'RTSS' - statistics server's memory is initialized and contains
146 // valid data
147 //0xDEAD - statistics server's memory is marked for deallocation and
148 // no longer contain valid data
149 //otherwise the memory is not initialized
150 DWORD dwSignature;
151 //structure version ((major<<16) + minor)
152 //must be set to 0x00010002 for v1.2 structure
153 DWORD dwVersion;
154 //start time of framerate measurement period (in milliseconds)
155 //Take a note that this field must contain non-zero value to calculate
156 //framerate properly!
157 DWORD dwTime0;
158 //end time of framerate measurement period (in milliseconds)
159 DWORD dwTime1;
160 //amount of frames rendered during (dwTime1 - dwTime0) period
161 //to calculate framerate use the following formula:
162 //1000.0f * dwFrames / (dwTime1 - dwTime0)
163 DWORD dwFrames;
164 //bitmask, containing combination of OSDFLAG_... flags
165 //Note: set OSDFLAG_UPDATED flag as soon as you change any OSD related field
166 DWORD dwOSDFlags;
167 //OSD X-coordinate (coordinate wrapping is allowed, i.e. -5 defines 5
168 //pixel offset from the right side of the screen)
169 DWORD dwOSDX;
170 //OSD Y-coordinate (coordinate wrapping is allowed, i.e. -5 defines 5
171 //pixel offset from the bottom side of the screen)
172 DWORD dwOSDY;
173 //OSD pixel zooming ratio
174 DWORD dwOSDPixel;
175 //OSD color in RGB format
176 DWORD dwOSDColor;
177 //primary OSD slot text
178 char szOSD[256];
179 //primary OSD slot owner ID
180 //Use this field to capture OSD slot and prevent other applications from
181 //using OSD when it is already in use by your application.
182 //You should change this field only if it is empty (i.e. when OSD slot is
183 //not owned by any application) or if it is set to your own application's
184 //ID (i.e. when you own OSD slot)
185 //You shouldn't change any OSD related feilds until you own OSD slot
186 char szOSDOwner[32];
187 //OSD slot 1 text
188 char szOSD1[256];
189 //OSD slot 1 owner ID
190 char szOSD1Owner[32];
191 //OSD slot 2 text
192 char szOSD2[256];
193 //OSD slot 2 owner ID
194 char szOSD2Owner[32];
195 //OSD slot 3 text
196 char szOSD3[256];
197 //OSD slot 3 owner ID
198 char szOSD3Owner[32];
199 } RTSS_SHARED_MEMORY_V_1_2, *LPRTSS_SHARED_MEMORY_V_1_2;
200 #pragma endregion
201
202 #pragma region RTSS_SHARED_MEMORY V1_3 struture
203 // v1.3 memory structure
204 typedef struct RTSS_SHARED_MEMORY_V_1_3
205 {
206 //signature allows applications to verify status of shared memory
207 //The signature can be set to:
208 //'RTSS' - statistics server's memory is initialized and contains
209 // valid data
210 //0xDEAD - statistics server's memory is marked for deallocation and
211 // no longer contain valid data
212 //otherwise the memory is not initialized
213 DWORD dwSignature;
214 //structure version ((major<<16) + minor)
215 //must be set to 0x00010003 for v1.3 structure
216 DWORD dwVersion;
217 //start time of framerate measurement period (in milliseconds)
218 //Take a note that this field must contain non-zero value to calculate
219 //framerate properly!
220 DWORD dwTime0;
221 //end time of framerate measurement period (in milliseconds)
222 DWORD dwTime1;
223 //amount of frames rendered during (dwTime1 - dwTime0) period
224 //to calculate framerate use the following formula:
225 //1000.0f * dwFrames / (dwTime1 - dwTime0)
226 DWORD dwFrames;
227 //bitmask, containing combination of OSDFLAG_... flags
228 //Note: set OSDFLAG_UPDATED flag as soon as you change any OSD related field
229 DWORD dwOSDFlags;
230 //OSD X-coordinate (coordinate wrapping is allowed, i.e. -5 defines 5
231 //pixel offset from the right side of the screen)
232 DWORD dwOSDX;
233 //OSD Y-coordinate (coordinate wrapping is allowed, i.e. -5 defines 5
234 //pixel offset from the bottom side of the screen)
235 DWORD dwOSDY;
236 //OSD pixel zooming ratio
237 DWORD dwOSDPixel;
238 //OSD color in RGB format
239 DWORD dwOSDColor;
240 //primary OSD slot text
241 char szOSD[256];
242 //primary OSD slot owner ID
243 //Use this field to capture OSD slot and prevent other applications from
244 //using OSD when it is already in use by your application.
245 //You should change this field only if it is empty (i.e. when OSD slot is
246 //not owned by any application) or if it is set to your own application's
247 //ID (i.e. when you own OSD slot)
248 //You shouldn't change any OSD related feilds until you own OSD slot
249 char szOSDOwner[32];
250 //OSD slot 1 text
251 char szOSD1[256];
252 //OSD slot 1 owner ID
253 char szOSD1Owner[32];
254 //OSD slot 2 text
255 char szOSD2[256];
256 //OSD slot 2 owner ID
257 char szOSD2Owner[32];
258 //OSD slot 3 text
259 char szOSD3[256];
260 //OSD slot 3 owner ID
261 char szOSD3Owner[32];
262 //bitmask containing combination of STATFLAG_... flags
263 DWORD dwStatFlags;
264 //statistics record period start time
265 DWORD dwStatTime0;
266 //statistics record period end time
267 DWORD dwStatTime1;
268 //total amount of frames rendered during statistics record period
269 DWORD dwStatFrames;
270 //amount of min/avg/max measurements during statistics record period
271 DWORD dwStatCount;
272 //minimum instantaneous framerate measured during statistics record period
273 DWORD dwStatFramerateMin;
274 //average instantaneous framerate measured during statistics record period
275 DWORD dwStatFramerateAvg;
276 //maximum instantaneous framerate measured during statistics record period
277 DWORD dwStatFramerateMax;
278 } RTSS_SHARED_MEMORY_V_1_3, *LPRTSS_SHARED_MEMORY_V_1_3;
279 #pragma endregion
280
281 #pragma region RTSS_SHARED_MEMORY V2_0 struture
282 // v2.0 memory structure
283 typedef struct RTSS_SHARED_MEMORY
284 {
285 //signature allows applications to verify status of shared memory
286 //The signature can be set to:
287 //'RTSS' - statistics server's memory is initialized and contains
288 // valid data
289 //0xDEAD - statistics server's memory is marked for deallocation and
290 // no longer contain valid data
291 //otherwise the memory is not initialized
292 DWORD dwSignature;
293 //structure version ((major<<16) + minor)
294 //must be set to 0x0002xxxx for v2.x structure
295 DWORD dwVersion;
296 //size of RTSS_SHARED_MEMORY_OSD_ENTRY for compatibility with future versions
297 DWORD dwAppEntrySize;
298 //offset of arrOSD array for compatibility with future versions
299 DWORD dwAppArrOffset;
300 //size of arrOSD array for compatibility with future versions
301 DWORD dwAppArrSize;
302 //size of RTSS_SHARED_MEMORY_APP_ENTRY for compatibility with future versions
303 DWORD dwOSDEntrySize;
304 //offset of arrApp array for compatibility with future versions
305 DWORD dwOSDArrOffset;
306 //size of arrOSD array for compatibility with future versions
307 DWORD dwOSDArrSize;
308 //Global OSD frame ID. Increment it to force the server to update OSD for all currently active 3D applications.
309 DWORD dwOSDFrame;
310
311 #pragma region OSD Descriptor
312 //OSD descriptor structure
313 typedef struct RTSS_SHARED_MEMORY_OSD_ENTRY
314 {
315 /* osd related related fields */
316 //OSD slot text
317 char szOSD[256];
318 //OSD slot owner ID
319 char szOSDOwner[256];
320 /* the next fields are valid for v2.7 and newer shared memory format only */
321 //extended OSD slot text
322 char szOSDEx[4096];
323 } RTSS_SHARED_MEMORY_OSD_ENTRY, *LPRTSS_SHARED_MEMORY_OSD_ENTRY;
324 #pragma endregion
325
326 #pragma region Application Descriptor
327 //application descriptor structure
328 typedef struct RTSS_SHARED_MEMORY_APP_ENTRY
329 {
330 /* application identification related fields */
331 //process ID
332 DWORD dwProcessID;
333 //process executable name
334 char szName[MAX_PATH];
335 //application specific flags
336 DWORD dwFlags;
337
338 /* instantaneous framerate related fields */
339
340 //start time of framerate measurement period (in milliseconds)
341 //Take a note that this field must contain non-zero value to calculate
342 //framerate properly!
343 DWORD dwTime0;
344 //end time of framerate measurement period (in milliseconds)
345 DWORD dwTime1;
346 //amount of frames rendered during (dwTime1 - dwTime0) period
347 DWORD dwFrames;
348 //frame time (in microseconds)
349 //to calculate framerate use the following formulas:
350 //1000.0f * dwFrames / (dwTime1 - dwTime0) for framerate calculated once per second
351 //or 1000000.0f / dwFrameTime for framerate calculated once per frame
352 DWORD dwFrameTime;
353
354 /* framerate statistics related fields */
355
356 //bitmask containing combination of STATFLAG_... flags
357 DWORD dwStatFlags;
358 //statistics record period start time
359 DWORD dwStatTime0;
360 //statistics record period end time
361 DWORD dwStatTime1;
362 //total amount of frames rendered during statistics record period
363 DWORD dwStatFrames;
364 //amount of min/avg/max measurements during statistics record period
365 DWORD dwStatCount;
366 //minimum instantaneous framerate measured during statistics record period
367 DWORD dwStatFramerateMin;
368 //average instantaneous framerate measured during statistics record period
369 DWORD dwStatFramerateAvg;
370 //maximum instantaneous framerate measured during statistics record period
371 DWORD dwStatFramerateMax;
372
373 /* OSD related fields */
374
375 //OSD X-coordinate (coordinate wrapping is allowed, i.e. -5 defines 5
376 //pixel offset from the right side of the screen)
377 DWORD dwOSDX;
378 //OSD Y-coordinate (coordinate wrapping is allowed, i.e. -5 defines 5
379 //pixel offset from the bottom side of the screen)
380 DWORD dwOSDY;
381 //OSD pixel zooming ratio
382 DWORD dwOSDPixel;
383 //OSD color in RGB format
384 DWORD dwOSDColor;
385 //application specific OSD frame ID. Don't change it directly!
386 DWORD dwOSDFrame;
387 // Screen capture flags
388 DWORD dwScreenCaptureFlags;
389 // Screen capture path
390 char szScreenCapturePath[MAX_PATH];
391
392 /* the next fields are valid for v2.1 and newer shared memory format only */
393 //OSD background color in RGB format
394 DWORD dwOSDBgndColor;
395
396
397 /* next fields are valid for v2.2 and newer shared memory format only */
398 // Video capture flags
399 DWORD dwVideoCaptureFlags;
400 // Video capture path
401 char szVideoCapturePath[MAX_PATH];
402 // Video capture framerate
403 DWORD dwVideoFramerate;
404 // Video capture framesize
405 DWORD dwVideoFramesize;
406 // Video capture format
407 DWORD dwVideoFormat;
408 // Video capture quality
409 DWORD dwVideoQuality;
410 // Video capture thread count
411 DWORD dwVideoCaptureThreads;
412
413 // Screen capture Quality
414 DWORD dwScreenCaptureQuality;
415 // Screen capture thread count
416 DWORD dwScreenCaptureThreads;
417
418 /* the next fields are valid for v2.3 and newer shared memory format only */
419 // Audio capture flags
420 DWORD dwAudioCaptureFlags;
421
422 //next fields are valid for v2.4 and newer shared memory format only */
423 // Video capture extended flags
424 DWORD dwVideoCaptureFlagsEx;
425
426 /* the next fields are valid for v2.5 and newer shared memory format only */
427 // Audio capture extended flags
428 DWORD dwAudioCaptureFlags2;
429
430 //minimum instantaneous frametime measured during statistics record period
431 DWORD dwStatFrameTimeMin;
432 //average instantaneous frametime measured during statistics record period
433 DWORD dwStatFrameTimeAvg;
434 //maximum instantaneous frametime measured during statistics record period
435 DWORD dwStatFrameTimeMax;
436 //number of frames measured during statistics record period
437 DWORD dwStatFrameTimeCount;
438
439 // Statiscs FrameTime buffer
440 DWORD dwStatFrameTimeBuf[1024];
441 // Statiscs FrameTime buffer current position
442 DWORD dwStatFrameTimeBufPos;
443 // Statiscs FrameTime buffer framerate
444 DWORD dwStatFrameTimeBufFramerate;
445
446 /* the next fields are valid for v2.6 and newer shared memory format only */
447
448 // Audio capture PTTEvent Push
449 LARGE_INTEGER qwAudioCapturePTTEventPush;
450 // Audio capture PTTEvent Release
451 LARGE_INTEGER qwAudioCapturePTTEventRelease;
452
453 // Audio capture PTTEvent Push2
454 LARGE_INTEGER qwAudioCapturePTTEventPush2;
455 // Audio capture PTTEvent Release2
456 LARGE_INTEGER qwAudioCapturePTTEventRelease2;
457
458 } RTSS_SHARED_MEMORY_APP_ENTRY, *LPRTSS_SHARED_MEMORY_APP_ENTRY;
459 #pragma endregion
460
461 //array of OSD slots
462 RTSS_SHARED_MEMORY_OSD_ENTRY arrOSD[8];
463 //array of application descriptors
464 RTSS_SHARED_MEMORY_APP_ENTRY arrApp[256];
465
466 } RTSS_SHARED_MEMORY, *LPRTSS_SHARED_MEMORY;
467 #pragma endregion
468
469 #endif //_RTSS_SHARED_MEMORY_INCLUDED_

  ViewVC Help
Powered by ViewVC 1.1.22