Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
Ludmány Balázs
/
thin-client
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
A prog2-höz tartozó friss repo anyagok itt elérhetőek:
https://git.iit.bme.hu/
Commit
c7e27e43
authored
Jul 20, 2016
by
Ludmány Balázs
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix RGB byte order
parent
6d0e2fbc
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
16 additions
and
10 deletions
+16
-10
dispatcher.cpp
+2
-2
dispatcher.h
+2
-2
jpegdecoder.cpp
+1
-2
jpegdecoder.h
+2
-2
main.cpp
+1
-1
qvnc.h
+1
-1
uploader.cpp
+7
-0
No files found.
dispatcher.cpp
View file @
c7e27e43
...
@@ -31,7 +31,7 @@ void Dispatcher::GotBitmap(rfbClient *client, const uint8_t *buffer, int x, int
...
@@ -31,7 +31,7 @@ void Dispatcher::GotBitmap(rfbClient *client, const uint8_t *buffer, int x, int
{
{
Dispatcher
*
dispatcher
=
(
Dispatcher
*
)
rfbClientGetClientData
(
client
,
0
);
Dispatcher
*
dispatcher
=
(
Dispatcher
*
)
rfbClientGetClientData
(
client
,
0
);
// We have to make a deep copy because libvnc might free the buffer as soon as this function returns
// We have to make a deep copy because libvnc might free the buffer as soon as this function returns
dispatcher
->
uploader
()
->
gotBitmap
(
QByteArray
((
const
char
*
)
buffer
,
w
*
h
*
(
dispatcher
->
bitsPerPixel
()
/
8
)),
x
,
y
,
w
,
h
,
GL_
BGRA_EXT
,
GL_UNSIGNED_BYTE
);
dispatcher
->
uploader
()
->
gotBitmap
(
QByteArray
((
const
char
*
)
buffer
,
w
*
h
*
(
dispatcher
->
bitsPerPixel
()
/
8
)),
x
,
y
,
w
,
h
,
GL_
RGBA
,
GL_UNSIGNED_BYTE
);
}
}
rfbBool
Dispatcher
::
GotJpeg
(
rfbClient
*
client
,
const
uint8_t
*
buffer
,
int
length
,
int
x
,
int
y
,
int
w
,
int
h
)
rfbBool
Dispatcher
::
GotJpeg
(
rfbClient
*
client
,
const
uint8_t
*
buffer
,
int
length
,
int
x
,
int
y
,
int
w
,
int
h
)
...
@@ -77,7 +77,7 @@ QVector3D Dispatcher::colorMax() const
...
@@ -77,7 +77,7 @@ QVector3D Dispatcher::colorMax() const
return
QVector3D
(
m_client
->
format
.
redMax
,
m_client
->
format
.
greenMax
,
m_client
->
format
.
blueMax
);
return
QVector3D
(
m_client
->
format
.
redMax
,
m_client
->
format
.
greenMax
,
m_client
->
format
.
blueMax
);
}
}
ConcurrentQueue
<
Jpeg
*
,
64
u
>
*
Dispatcher
::
queue
()
ConcurrentQueue
<
Jpeg
*
,
256
u
>
*
Dispatcher
::
queue
()
{
{
return
&
m_queue
;
return
&
m_queue
;
}
}
...
...
dispatcher.h
View file @
c7e27e43
...
@@ -39,12 +39,12 @@ public:
...
@@ -39,12 +39,12 @@ public:
QVector3D
colorMax
()
const
;
QVector3D
colorMax
()
const
;
// getters
// getters
ConcurrentQueue
<
Jpeg
*
,
64
>*
queue
();
ConcurrentQueue
<
Jpeg
*
,
256u
>*
queue
();
Uploader
*
uploader
()
const
;
Uploader
*
uploader
()
const
;
private
:
private
:
rfbClient
*
m_client
;
rfbClient
*
m_client
;
Uploader
*
m_uploader
;
Uploader
*
m_uploader
;
ConcurrentQueue
<
Jpeg
*
,
64
>
m_queue
;
ConcurrentQueue
<
Jpeg
*
,
256u
>
m_queue
;
signals
:
signals
:
// libvnc events
// libvnc events
void
gotCopy
(
const
int
src_x
,
const
int
src_y
,
const
int
width
,
const
int
height
,
const
int
dest_x
,
const
int
dest_y
);
void
gotCopy
(
const
int
src_x
,
const
int
src_y
,
const
int
width
,
const
int
height
,
const
int
dest_x
,
const
int
dest_y
);
...
...
jpegdecoder.cpp
View file @
c7e27e43
...
@@ -2,7 +2,7 @@
...
@@ -2,7 +2,7 @@
JpegDecoder
::
JpegDecoder
(
ConcurrentQueue
<
Jpeg
*
,
64
u
>
*
queue
,
QObject
*
parent
)
:
JpegDecoder
::
JpegDecoder
(
ConcurrentQueue
<
Jpeg
*
,
256
u
>
*
queue
,
QObject
*
parent
)
:
QObject
(
parent
),
m_queue
(
queue
)
QObject
(
parent
),
m_queue
(
queue
)
{
{
}
}
...
@@ -19,7 +19,6 @@ void JpegDecoder::operate()
...
@@ -19,7 +19,6 @@ void JpegDecoder::operate()
jerr
.
mgr
.
error_exit
=
error_exit
;
jerr
.
mgr
.
error_exit
=
error_exit
;
if
(
setjmp
(
jerr
.
setjmp_buffer
))
{
if
(
setjmp
(
jerr
.
setjmp_buffer
))
{
jpeg_destroy_decompress
(
&
cinfo
);
jpeg_destroy_decompress
(
&
cinfo
);
return
;
}
}
jpeg_create_decompress
(
&
cinfo
);
jpeg_create_decompress
(
&
cinfo
);
cinfo
.
do_fancy_upsampling
=
TRUE
;
cinfo
.
do_fancy_upsampling
=
TRUE
;
...
...
jpegdecoder.h
View file @
c7e27e43
...
@@ -37,8 +37,8 @@ class JpegDecoder : public QObject
...
@@ -37,8 +37,8 @@ class JpegDecoder : public QObject
{
{
Q_OBJECT
Q_OBJECT
public
:
public
:
JpegDecoder
(
ConcurrentQueue
<
Jpeg
*
,
64
u
>
*
queue
,
QObject
*
parent
=
0
);
JpegDecoder
(
ConcurrentQueue
<
Jpeg
*
,
256
u
>
*
queue
,
QObject
*
parent
=
0
);
ConcurrentQueue
<
Jpeg
*
,
64
u
>
*
m_queue
;
ConcurrentQueue
<
Jpeg
*
,
256
u
>
*
m_queue
;
signals
:
signals
:
void
finished
(
const
unsigned
char
*
image
,
const
int
width
,
const
int
height
,
const
int
index
);
void
finished
(
const
unsigned
char
*
image
,
const
int
width
,
const
int
height
,
const
int
index
);
public
slots
:
public
slots
:
...
...
main.cpp
View file @
c7e27e43
...
@@ -16,7 +16,7 @@ int main(int argc, char *argv[])
...
@@ -16,7 +16,7 @@ int main(int argc, char *argv[])
format
.
setMajorVersion
(
2
);
format
.
setMajorVersion
(
2
);
format
.
setMinorVersion
(
0
);
format
.
setMinorVersion
(
0
);
format
.
setRenderableType
(
QSurfaceFormat
::
OpenGLES
);
format
.
setRenderableType
(
QSurfaceFormat
::
OpenGLES
);
format
.
setSwapBehavior
(
QSurfaceFormat
::
Sing
leBuffer
);
format
.
setSwapBehavior
(
QSurfaceFormat
::
Doub
leBuffer
);
format
.
setSwapInterval
(
0
);
format
.
setSwapInterval
(
0
);
QSurfaceFormat
::
setDefaultFormat
(
format
);
QSurfaceFormat
::
setDefaultFormat
(
format
);
QGuiApplication
::
setAttribute
(
Qt
::
AA_UseOpenGLES
,
true
);
QGuiApplication
::
setAttribute
(
Qt
::
AA_UseOpenGLES
,
true
);
...
...
qvnc.h
View file @
c7e27e43
#ifndef VNC_H
#ifndef VNC_H
#define VNC_H
#define VNC_H
#define DECODER_COUNT
64
#define DECODER_COUNT
16
#include <QQuickWindow>
#include <QQuickWindow>
#include <QObject>
#include <QObject>
...
...
uploader.cpp
View file @
c7e27e43
...
@@ -223,7 +223,14 @@ int Uploader::gotJpeg(const quint32 x, const quint32 y, const quint32 width, con
...
@@ -223,7 +223,14 @@ int Uploader::gotJpeg(const quint32 x, const quint32 y, const quint32 width, con
GLuint
id
;
GLuint
id
;
m_functions
->
glGenTextures
(
1
,
&
id
);
m_functions
->
glGenTextures
(
1
,
&
id
);
m_functions
->
glBindTexture
(
GL_TEXTURE_2D
,
id
);
m_functions
->
glBindTexture
(
GL_TEXTURE_2D
,
id
);
#ifdef GL_RGB8
m_functions
->
glTexImage2D
(
GL_TEXTURE_2D
,
0
,
GL_RGB8
,
real_width
,
real_height
,
0
,
GL_RGB
,
GL_UNSIGNED_BYTE
,
NULL
);
#elif GL_RGB8_OES
m_functions
->
glTexImage2D
(
GL_TEXTURE_2D
,
0
,
GL_RGB8_OES
,
real_width
,
real_height
,
0
,
GL_RGB
,
GL_UNSIGNED_BYTE
,
NULL
);
#else
m_functions
->
glTexImage2D
(
GL_TEXTURE_2D
,
0
,
GL_RGB
,
real_width
,
real_height
,
0
,
GL_RGB
,
GL_UNSIGNED_BYTE
,
NULL
);
m_functions
->
glTexImage2D
(
GL_TEXTURE_2D
,
0
,
GL_RGB
,
real_width
,
real_height
,
0
,
GL_RGB
,
GL_UNSIGNED_BYTE
,
NULL
);
#endif
m_textures
->
append
(
id
);
m_textures
->
append
(
id
);
float
bottom
=
(
float
)
height
/
(
float
)
real_height
;
float
bottom
=
(
float
)
height
/
(
float
)
real_height
;
...
...
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