Update: UltraVNC 1.4.3.6 and UltraVNC SC 1.4.3.6: viewtopic.php?t=37885
Important: Please update to latest version before to create a reply, a topic or an issue: viewtopic.php?t=37864

Join us on social networks and share our announcements:
- Website: https://uvnc.com/
- GitHub: https://github.com/ultravnc
- Mastodon: https://mastodon.social/@ultravnc
- Facebook: https://www.facebook.com/ultravnc1
- X/Twitter: https://twitter.com/ultravnc1
- Reddit community: https://www.reddit.com/r/ultravnc
- OpenHub: https://openhub.net/p/ultravnc

Mirror Display Questions

Developers may discuss here
Post Reply
vbguyny
Posts: 3
Joined: 2012-08-23 02:56

Mirror Display Questions

Post by vbguyny »

I am utilizing the Mirror Display driver. I have converted the C++ demo app to a program which starts the driver and creates the c:\video0.dat file which then a VB6 app file maps to a memory pointer.

Anyway the questions that I have relate to the file layout of c:\video0.dat. Here is what I have deduced:

The first 4 bytes is the counter (values 0 - 2000) and then the next 56,000 bytes are the changes buffer structures which contain the location and type fields. Then the remaining bytes is the actual picture data for the screen which is determined by the width, height, and depth of the screen. Could someone please verify this?

The next question relates to the different values of the Type field in the changes record. Could someone please explain to me (or provide me with a link) what the definitions are for the following values:
SCREEN_SCREEN
BLIT
SOLIDFILL
BLEND
TRANS
PLG
TEXTOUT

The final question relates to the SOLIDFILL value. I am assuming this means that there is a solid color in this region. However, how can I deterimine the value of this color besides using some GDI api?

-Mike
User avatar
Rudi De Vos
Admin & Developer
Admin & Developer
Posts: 6838
Joined: 2004-04-23 10:21
Contact:

Re: Mirror Display Questions

Post by Rudi De Vos »

The buffer is the structured ( fix size) followed by the image data buffer.
Location [0] is a special case, it's a counter the get higher each time the ringbuffer pass 1999, can be used to check if more then 1999 rects where added.

SCREEN_SCREEN -> data is moved from pos a to pos b on screen
BLIT : standard image data
SOLIDFILL: single color image data
BLEND:standard image data
TRANS:standard image data
PLG:standard image data
TEXTOUT:standard image data, but it's text, ( in case you use a compound compressor, don't use a lossless.

the actual picture data for the screen contain the solidfill, just go to the correct position and use memcpy to get the color.
vbguyny
Posts: 3
Joined: 2012-08-23 02:56

Re: Mirror Display Questions

Post by vbguyny »

@Rudi: Thanks for your response! Could you please explain a little more regarding the statement below:
Location [0] is a special case, it's a counter the get higher each time the ringbuffer pass 1999, can be used to check if more then 1999 rects where added.
Thanks again.
-Mike
User avatar
Rudi De Vos
Admin & Developer
Admin & Developer
Posts: 6838
Joined: 2004-04-23 10:21
Contact:

Re: Mirror Display Questions

Post by Rudi De Vos »

The ringbuffer has 2000 spots.
VNC handle [lastpos-newpos]
If the sreen has very fast moving little updates, it's possible to generate more then 2000 updates in a single run.
In this case, the driver overwrite the ringbuffer possition before it is handled by vnc.
Using the counter ( [0].type, you can check if you had more then 2000 updates. Use a fullscreen update
the prevent missed updates.
vbguyny
Posts: 3
Joined: 2012-08-23 02:56

Re: Mirror Display Questions

Post by vbguyny »

@Rudi, Thanks for the clarification. Your information has helped me understand how to use the mirror display driver better. The issue that I was having is that I was incorrectly skipping the last element of the ringbuffer every time I was checking it. I know that this wouldn't have been an issue if I simply used the screen capture example from the start, but my application is written in VB6 so I had to start from scratch.
Post Reply