Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
L
libvncserver
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
rasky
libvncserver
Commits
1fd42ce9
Commit
1fd42ce9
authored
Aug 08, 2003
by
dscho
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
make --without-jpeg, --without-zlib work
parent
f9e17961
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
39 additions
and
1 deletion
+39
-1
rfbproto.c
libvncclient/rfbproto.c
+25
-1
tight.c
libvncclient/tight.c
+4
-0
zlib.c
libvncclient/zlib.c
+4
-0
main.c
main.c
+4
-0
rfbserver.c
rfbserver.c
+2
-0
No files found.
libvncclient/rfbproto.c
View file @
1fd42ce9
...
...
@@ -133,9 +133,11 @@ static rfbBool HandleCoRRE32(rfbClient* client, int rx, int ry, int rw, int rh);
static
rfbBool
HandleHextile8
(
rfbClient
*
client
,
int
rx
,
int
ry
,
int
rw
,
int
rh
);
static
rfbBool
HandleHextile16
(
rfbClient
*
client
,
int
rx
,
int
ry
,
int
rw
,
int
rh
);
static
rfbBool
HandleHextile32
(
rfbClient
*
client
,
int
rx
,
int
ry
,
int
rw
,
int
rh
);
#ifdef LIBVNCSERVER_HAVE_LIBZ
static
rfbBool
HandleZlib8
(
rfbClient
*
client
,
int
rx
,
int
ry
,
int
rw
,
int
rh
);
static
rfbBool
HandleZlib16
(
rfbClient
*
client
,
int
rx
,
int
ry
,
int
rw
,
int
rh
);
static
rfbBool
HandleZlib32
(
rfbClient
*
client
,
int
rx
,
int
ry
,
int
rw
,
int
rh
);
#ifdef LIBVNCSERVER_HAVE_LIBJPEG
static
rfbBool
HandleTight8
(
rfbClient
*
client
,
int
rx
,
int
ry
,
int
rw
,
int
rh
);
static
rfbBool
HandleTight16
(
rfbClient
*
client
,
int
rx
,
int
ry
,
int
rw
,
int
rh
);
static
rfbBool
HandleTight32
(
rfbClient
*
client
,
int
rx
,
int
ry
,
int
rw
,
int
rh
);
...
...
@@ -148,6 +150,8 @@ static void JpegSkipInputData(j_decompress_ptr cinfo, long num_bytes);
static
void
JpegTermSource
(
j_decompress_ptr
cinfo
);
static
void
JpegSetSrcManager
(
j_decompress_ptr
cinfo
,
uint8_t
*
compressedData
,
int
compressedLen
);
#endif
#endif
/* The zlib encoding requires expansion/decompression/deflation of the
compressed data in the "buffer" above into another, result buffer.
...
...
@@ -155,13 +159,17 @@ static void JpegSetSrcManager(j_decompress_ptr cinfo, uint8_t *compressedData,
based on the bitsPerPixel, height and width of the rectangle. We
allocate this buffer one time to be the full size of the buffer. */
#ifdef LIBVNCSERVER_HAVE_LIBZ
static
int
raw_buffer_size
=
-
1
;
static
char
*
raw_buffer
;
static
z_stream
decompStream
;
static
rfbBool
decompStreamInited
=
FALSE
;
#endif
#ifdef LIBVNCSERVER_HAVE_LIBJPEG
/*
* Variables for the ``tight'' encoding implementation.
*/
...
...
@@ -186,7 +194,7 @@ static uint8_t tightPrevRow[2048*3*sizeof(uint16_t)];
/* JPEG decoder state. */
static
rfbBool
jpegError
;
#endif
/*
* ConnectToRFBServer.
...
...
@@ -408,6 +416,7 @@ SetFormatAndEncodings(rfbClient* client)
encs
[
se
->
nEncodings
++
]
=
rfbClientSwap32IfLE
(
rfbEncodingRaw
);
}
else
if
(
strncasecmp
(
encStr
,
"copyrect"
,
encStrLen
)
==
0
)
{
encs
[
se
->
nEncodings
++
]
=
rfbClientSwap32IfLE
(
rfbEncodingCopyRect
);
#ifdef LIBVNCSERVER_HAVE_LIBJPEG
}
else
if
(
strncasecmp
(
encStr
,
"tight"
,
encStrLen
)
==
0
)
{
encs
[
se
->
nEncodings
++
]
=
rfbClientSwap32IfLE
(
rfbEncodingTight
);
requestLastRectEncoding
=
TRUE
;
...
...
@@ -415,12 +424,15 @@ SetFormatAndEncodings(rfbClient* client)
requestCompressLevel
=
TRUE
;
if
(
client
->
appData
.
enableJPEG
)
requestQualityLevel
=
TRUE
;
#endif
}
else
if
(
strncasecmp
(
encStr
,
"hextile"
,
encStrLen
)
==
0
)
{
encs
[
se
->
nEncodings
++
]
=
rfbClientSwap32IfLE
(
rfbEncodingHextile
);
#ifdef LIBVNCSERVER_HAVE_LIBZ
}
else
if
(
strncasecmp
(
encStr
,
"zlib"
,
encStrLen
)
==
0
)
{
encs
[
se
->
nEncodings
++
]
=
rfbClientSwap32IfLE
(
rfbEncodingZlib
);
if
(
client
->
appData
.
compressLevel
>=
0
&&
client
->
appData
.
compressLevel
<=
9
)
requestCompressLevel
=
TRUE
;
#endif
}
else
if
(
strncasecmp
(
encStr
,
"corre"
,
encStrLen
)
==
0
)
{
encs
[
se
->
nEncodings
++
]
=
rfbClientSwap32IfLE
(
rfbEncodingCoRRE
);
}
else
if
(
strncasecmp
(
encStr
,
"rre"
,
encStrLen
)
==
0
)
{
...
...
@@ -472,9 +484,13 @@ SetFormatAndEncodings(rfbClient* client)
}
encs
[
se
->
nEncodings
++
]
=
rfbClientSwap32IfLE
(
rfbEncodingCopyRect
);
#ifdef LIBVNCSERVER_HAVE_LIBJPEG
encs
[
se
->
nEncodings
++
]
=
rfbClientSwap32IfLE
(
rfbEncodingTight
);
#endif
encs
[
se
->
nEncodings
++
]
=
rfbClientSwap32IfLE
(
rfbEncodingHextile
);
#ifdef LIBVNCSERVER_HAVE_LIBZ
encs
[
se
->
nEncodings
++
]
=
rfbClientSwap32IfLE
(
rfbEncodingZlib
);
#endif
encs
[
se
->
nEncodings
++
]
=
rfbClientSwap32IfLE
(
rfbEncodingCoRRE
);
encs
[
se
->
nEncodings
++
]
=
rfbClientSwap32IfLE
(
rfbEncodingRRE
);
...
...
@@ -813,6 +829,7 @@ HandleRFBServerMessage(rfbClient* client)
break
;
}
#ifdef LIBVNCSERVER_HAVE_LIBZ
case
rfbEncodingZlib
:
{
switch
(
client
->
format
.
bitsPerPixel
)
{
...
...
@@ -832,6 +849,7 @@ HandleRFBServerMessage(rfbClient* client)
break
;
}
#ifdef LIBVNCSERVER_HAVE_LIBJPEG
case
rfbEncodingTight
:
{
switch
(
client
->
format
.
bitsPerPixel
)
{
...
...
@@ -850,6 +868,8 @@ HandleRFBServerMessage(rfbClient* client)
}
break
;
}
#endif
#endif
default:
rfbClientLog
(
"Unknown rect encoding %d
\n
"
,
...
...
@@ -989,6 +1009,8 @@ PrintPixelFormat(format)
}
}
#ifdef LIBVNCSERVER_HAVE_LIBJPEG
static
long
ReadCompactLen
(
rfbClient
*
client
)
{
...
...
@@ -1072,6 +1094,8 @@ JpegSetSrcManager(j_decompress_ptr cinfo, uint8_t *compressedData,
cinfo
->
src
=
&
jpegSrcManager
;
}
#endif
/* avoid name clashes with LibVNCServer */
#define vncEncryptBytes rfbEncryptBytes
...
...
libvncclient/tight.c
View file @
1fd42ce9
...
...
@@ -17,6 +17,8 @@
* USA.
*/
#ifdef LIBVNCSERVER_HAVE_LIBJPEG
/*
* tight.c - handle ``tight'' encoding.
*
...
...
@@ -604,3 +606,5 @@ DecompressJpegRectBPP(rfbClient* client, int x, int y, int w, int h)
#endif
#endif
libvncclient/zlib.c
View file @
1fd42ce9
...
...
@@ -18,6 +18,8 @@
* USA.
*/
#ifdef LIBVNCSERVER_HAVE_LIBZ
/*
* zlib.c - handle zlib encoding.
*
...
...
@@ -156,3 +158,5 @@ HandleZlibBPP (rfbClient* client, int rx, int ry, int rw, int rh)
}
#undef CARDBPP
#endif
main.c
View file @
1fd42ce9
...
...
@@ -719,7 +719,9 @@ void rfbNewFramebuffer(rfbScreenInfoPtr rfbScreen, char *framebuffer,
rfbReleaseClientIterator
(
iterator
);
}
#ifdef LIBVNCSERVER_HAVE_LIBJPEG
extern
void
TightCleanup
();
#endif
void
rfbScreenCleanup
(
rfbScreenInfoPtr
rfbScreen
)
{
...
...
@@ -740,7 +742,9 @@ void rfbScreenCleanup(rfbScreenInfoPtr rfbScreen)
if
(
rfbScreen
->
cursor
)
rfbFreeCursor
(
rfbScreen
->
cursor
);
free
(
rfbScreen
);
#ifdef LIBVNCSERVER_HAVE_LIBJPEG
TightCleanup
();
#endif
}
void
rfbInitServer
(
rfbScreenInfoPtr
rfbScreen
)
...
...
rfbserver.c
View file @
1fd42ce9
...
...
@@ -1215,8 +1215,10 @@ rfbSendFramebufferUpdate(cl, givenUpdateRegion)
fu
->
type
=
rfbFramebufferUpdate
;
if
(
nUpdateRegionRects
!=
0xFFFF
)
{
if
(
cl
->
screen
->
maxRectsPerUpdate
>
0
#ifdef LIBVNCSERVER_HAVE_LIBJPEG
/* Tight encoding counts the rectangles differently */
&&
cl
->
preferredEncoding
!=
rfbEncodingTight
#endif
&&
nUpdateRegionRects
>
cl
->
screen
->
maxRectsPerUpdate
)
{
sraRegion
*
newUpdateRegion
=
sraRgnBBox
(
updateRegion
);
sraRgnDestroy
(
updateRegion
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment