Commit 612de004 authored by Christian Beier's avatar Christian Beier

Revert "LibVNCClient: Add H.264 encoding for framebuffer updates"

This reverts commit d891478e.

Conflicts:
	configure.ac
	libvncclient/h264.c
parent 10710949
...@@ -23,10 +23,6 @@ ...@@ -23,10 +23,6 @@
#include <gdk/gdkkeysyms.h> #include <gdk/gdkkeysyms.h>
#include <rfb/rfbclient.h> #include <rfb/rfbclient.h>
#ifdef LIBVNCSERVER_CONFIG_LIBVA
#include <gdk/gdkx.h>
#endif
static rfbClient *cl; static rfbClient *cl;
static gchar *server_cut_text = NULL; static gchar *server_cut_text = NULL;
static gboolean framebuffer_allocated = FALSE; static gboolean framebuffer_allocated = FALSE;
...@@ -61,14 +57,6 @@ static gboolean expose_event (GtkWidget *widget, ...@@ -61,14 +57,6 @@ static gboolean expose_event (GtkWidget *widget,
cl->format.greenMax = (1 << image->visual->green_prec) - 1; cl->format.greenMax = (1 << image->visual->green_prec) - 1;
cl->format.blueMax = (1 << image->visual->blue_prec) - 1; cl->format.blueMax = (1 << image->visual->blue_prec) - 1;
#ifdef LIBVNCSERVER_CONFIG_LIBVA
/* Allow libvncclient to use a more efficient way
* of putting the framebuffer on the screen when
* using the H.264 format.
*/
cl->outputWindow = GDK_WINDOW_XID(widget->window);
#endif
SetFormatAndEncodings (cl); SetFormatAndEncodings (cl);
framebuffer_allocated = TRUE; framebuffer_allocated = TRUE;
...@@ -79,14 +67,12 @@ static gboolean expose_event (GtkWidget *widget, ...@@ -79,14 +67,12 @@ static gboolean expose_event (GtkWidget *widget,
gdk_cursor_unref( cur ); gdk_cursor_unref( cur );
} }
#ifndef LIBVNCSERVER_CONFIG_LIBVA
gdk_draw_image (GDK_DRAWABLE (widget->window), gdk_draw_image (GDK_DRAWABLE (widget->window),
widget->style->fg_gc[gtk_widget_get_state(widget)], widget->style->fg_gc[gtk_widget_get_state(widget)],
image, image,
event->area.x, event->area.y, event->area.x, event->area.y,
event->area.x, event->area.y, event->area.x, event->area.y,
event->area.width, event->area.height); event->area.width, event->area.height);
#endif
return FALSE; return FALSE;
} }
...@@ -476,12 +462,10 @@ static void update (rfbClient *cl, int x, int y, int w, int h) { ...@@ -476,12 +462,10 @@ static void update (rfbClient *cl, int x, int y, int w, int h) {
dialog_connecting = NULL; dialog_connecting = NULL;
} }
#ifndef LIBVNCSERVER_CONFIG_LIBVA
GtkWidget *drawing_area = rfbClientGetClientData (cl, gtk_init); GtkWidget *drawing_area = rfbClientGetClientData (cl, gtk_init);
if (drawing_area != NULL) if (drawing_area != NULL)
gtk_widget_queue_draw_area (drawing_area, x, y, w, h); gtk_widget_queue_draw_area (drawing_area, x, y, w, h);
#endif
} }
static void kbd_leds (rfbClient *cl, int value, int pad) { static void kbd_leds (rfbClient *cl, int value, int pad) {
......
...@@ -149,18 +149,6 @@ AC_SUBST(SSL_LIBS) ...@@ -149,18 +149,6 @@ AC_SUBST(SSL_LIBS)
AM_CONDITIONAL(HAVE_LIBSSL, test ! -z "$SSL_LIBS") AM_CONDITIONAL(HAVE_LIBSSL, test ! -z "$SSL_LIBS")
# See if we want libva support
AH_TEMPLATE(CONFIG_LIBVA, [Build libva support])
AC_ARG_WITH(libva,
[ --without-libva disable support for libva],,)
if test "x$with_libva" != "xno"; then
AC_CHECK_LIB(va-x11, vaGetDisplay,
VA_LIBS="-lva -lva-x11"
[AC_DEFINE(CONFIG_LIBVA) CONFIG_LIBVA="true"], ,)
fi
AC_SUBST(VA_LIBS)
AM_CONDITIONAL(CONFIG_LIBVA, test ! -z "$VA_LIBS")
AC_ARG_WITH(jpeg, AC_ARG_WITH(jpeg,
......
...@@ -14,7 +14,7 @@ endif ...@@ -14,7 +14,7 @@ endif
libvncclient_la_SOURCES=cursor.c listen.c rfbproto.c sockets.c vncviewer.c ../common/minilzo.c $(TLSSRCS) libvncclient_la_SOURCES=cursor.c listen.c rfbproto.c sockets.c vncviewer.c ../common/minilzo.c $(TLSSRCS)
libvncclient_la_LIBADD=$(TLSLIBS) $(VA_LIBS) libvncclient_la_LIBADD=$(TLSLIBS)
noinst_HEADERS=../common/lzodefs.h ../common/lzoconf.h ../common/minilzo.h tls.h noinst_HEADERS=../common/lzodefs.h ../common/lzoconf.h ../common/minilzo.h tls.h
......
This diff is collapsed.
...@@ -167,10 +167,6 @@ static void FillRectangle(rfbClient* client, int x, int y, int w, int h, uint32_ ...@@ -167,10 +167,6 @@ static void FillRectangle(rfbClient* client, int x, int y, int w, int h, uint32_
static void CopyRectangle(rfbClient* client, uint8_t* buffer, int x, int y, int w, int h) { static void CopyRectangle(rfbClient* client, uint8_t* buffer, int x, int y, int w, int h) {
int j; int j;
if (client->frameBuffer == NULL) {
return;
}
#define COPY_RECT(BPP) \ #define COPY_RECT(BPP) \
{ \ { \
int rs = w * BPP / 8, rs2 = client->width * BPP / 8; \ int rs = w * BPP / 8, rs2 = client->width * BPP / 8; \
...@@ -273,9 +269,6 @@ static rfbBool HandleZRLE24Up(rfbClient* client, int rx, int ry, int rw, int rh) ...@@ -273,9 +269,6 @@ static rfbBool HandleZRLE24Up(rfbClient* client, int rx, int ry, int rw, int rh)
static rfbBool HandleZRLE24Down(rfbClient* client, int rx, int ry, int rw, int rh); static rfbBool HandleZRLE24Down(rfbClient* client, int rx, int ry, int rw, int rh);
static rfbBool HandleZRLE32(rfbClient* client, int rx, int ry, int rw, int rh); static rfbBool HandleZRLE32(rfbClient* client, int rx, int ry, int rw, int rh);
#endif #endif
#ifdef LIBVNCSERVER_CONFIG_LIBVA
static rfbBool HandleH264 (rfbClient* client, int rx, int ry, int rw, int rh);
#endif
/* /*
* Server Capability Functions * Server Capability Functions
...@@ -1376,10 +1369,6 @@ SetFormatAndEncodings(rfbClient* client) ...@@ -1376,10 +1369,6 @@ SetFormatAndEncodings(rfbClient* client)
encs[se->nEncodings++] = rfbClientSwap32IfLE(rfbEncodingCoRRE); encs[se->nEncodings++] = rfbClientSwap32IfLE(rfbEncodingCoRRE);
} else if (strncasecmp(encStr,"rre",encStrLen) == 0) { } else if (strncasecmp(encStr,"rre",encStrLen) == 0) {
encs[se->nEncodings++] = rfbClientSwap32IfLE(rfbEncodingRRE); encs[se->nEncodings++] = rfbClientSwap32IfLE(rfbEncodingRRE);
#ifdef LIBVNCSERVER_CONFIG_LIBVA
} else if (strncasecmp(encStr,"h264",encStrLen) == 0) {
encs[se->nEncodings++] = rfbClientSwap32IfLE(rfbEncodingH264);
#endif
} else { } else {
rfbClientLog("Unknown encoding '%.*s'\n",encStrLen,encStr); rfbClientLog("Unknown encoding '%.*s'\n",encStrLen,encStr);
} }
...@@ -1448,10 +1437,6 @@ SetFormatAndEncodings(rfbClient* client) ...@@ -1448,10 +1437,6 @@ SetFormatAndEncodings(rfbClient* client)
encs[se->nEncodings++] = rfbClientSwap32IfLE(client->appData.qualityLevel + encs[se->nEncodings++] = rfbClientSwap32IfLE(client->appData.qualityLevel +
rfbEncodingQualityLevel0); rfbEncodingQualityLevel0);
} }
#ifdef LIBVNCSERVER_CONFIG_LIBVA
encs[se->nEncodings++] = rfbClientSwap32IfLE(rfbEncodingH264);
rfbClientLog("h264 encoding added\n");
#endif
} }
...@@ -2171,14 +2156,6 @@ HandleRFBServerMessage(rfbClient* client) ...@@ -2171,14 +2156,6 @@ HandleRFBServerMessage(rfbClient* client)
break; break;
} }
#endif
#ifdef LIBVNCSERVER_CONFIG_LIBVA
case rfbEncodingH264:
{
if (!HandleH264(client, rect.r.x, rect.r.y, rect.r.w, rect.r.h))
return FALSE;
break;
}
#endif #endif
default: default:
...@@ -2416,7 +2393,6 @@ HandleRFBServerMessage(rfbClient* client) ...@@ -2416,7 +2393,6 @@ HandleRFBServerMessage(rfbClient* client)
#define UNCOMP -8 #define UNCOMP -8
#include "zrle.c" #include "zrle.c"
#undef BPP #undef BPP
#include "h264.c"
/* /*
......
...@@ -116,11 +116,7 @@ static rfbBool MallocFrameBuffer(rfbClient* client) { ...@@ -116,11 +116,7 @@ static rfbBool MallocFrameBuffer(rfbClient* client) {
static void initAppData(AppData* data) { static void initAppData(AppData* data) {
data->shareDesktop=TRUE; data->shareDesktop=TRUE;
data->viewOnly=FALSE; data->viewOnly=FALSE;
#ifdef LIBVNCSERVER_CONFIG_LIBVA
data->encodingsString="h264 tight zrle ultra copyrect hextile zlib corre rre raw";
#else
data->encodingsString="tight zrle ultra copyrect hextile zlib corre rre raw"; data->encodingsString="tight zrle ultra copyrect hextile zlib corre rre raw";
#endif
data->useBGR233=FALSE; data->useBGR233=FALSE;
data->nColours=0; data->nColours=0;
data->forceOwnCmap=FALSE; data->forceOwnCmap=FALSE;
...@@ -158,9 +154,6 @@ rfbClient* rfbGetClient(int bitsPerSample,int samplesPerPixel, ...@@ -158,9 +154,6 @@ rfbClient* rfbGetClient(int bitsPerSample,int samplesPerPixel,
/* default: use complete frame buffer */ /* default: use complete frame buffer */
client->updateRect.x = -1; client->updateRect.x = -1;
client->frameBuffer = NULL;
client->outputWindow = 0;
client->format.bitsPerPixel = bytesPerPixel*8; client->format.bitsPerPixel = bytesPerPixel*8;
client->format.depth = bitsPerSample*samplesPerPixel; client->format.depth = bitsPerSample*samplesPerPixel;
client->appData.requestedDepth=client->format.depth; client->appData.requestedDepth=client->format.depth;
......
...@@ -874,21 +874,6 @@ typedef struct { ...@@ -874,21 +874,6 @@ typedef struct {
#endif #endif
/*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
* h264 - h264 encoding. We have an rfbH264Header structure
* giving the number of bytes following. Finally the data follows is
* h264 encoded frame.
*/
typedef struct {
uint32_t nBytes;
uint32_t slice_type;
uint32_t width;
uint32_t height;
} rfbH264Header;
#define sz_rfbH264Header 16
/*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
* XCursor encoding. This is a special encoding used to transmit X-style * XCursor encoding. This is a special encoding used to transmit X-style
* cursor shapes from server to clients. Note that for this encoding, * cursor shapes from server to clients. Note that for this encoding,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment