Skip to content

Commit

Permalink
Now using the native code from Opaque in aSPICE.
Browse files Browse the repository at this point in the history
This was accomplished by creating a link farm to the files except
ones that need to be different between the two projects.

Those files are essentially android-io.c and android-service.c.
  • Loading branch information
iiordanov committed Mar 13, 2014
1 parent 20aa8e7 commit 1016606
Show file tree
Hide file tree
Showing 278 changed files with 811 additions and 106,052 deletions.
4 changes: 2 additions & 2 deletions eclipse_projects/Opaque/jni/src/android/android-io.c
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ Java_com_undatech_opaque_SpiceCommunicator_SpiceButtonEvent(JNIEnv * env, jobjec

void uiCallbackInvalidate (SpiceDisplayPrivate *d, gint x, gint y, gint w, gint h) {
JNIEnv* env;
bool attached = attachThreadToJvm (&env);
gboolean attached = attachThreadToJvm (&env);

// Tell the UI that it needs to send in the bitmap to be updated and to redraw.
(*env)->CallStaticVoidMethod(env, jni_connector_class, jni_graphics_update, 0, x, y, w, h);
Expand All @@ -192,7 +192,7 @@ void uiCallbackInvalidate (SpiceDisplayPrivate *d, gint x, gint y, gint w, gint

void uiCallbackSettingsChanged (gint instance, gint width, gint height, gint bpp) {
JNIEnv* env;
bool attached = attachThreadToJvm (&env);
gboolean attached = attachThreadToJvm (&env);

// Ask for a new bitmap from the UI.
(*env)->CallStaticVoidMethod(env, jni_connector_class, jni_settings_changed, instance, width, height, bpp);
Expand Down
6 changes: 3 additions & 3 deletions eclipse_projects/Opaque/jni/src/android/android-service.c
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
static gboolean disconnect(gpointer user_data);

inline gboolean attachThreadToJvm(JNIEnv** env) {
gboolean attached = false;
gboolean attached = FALSE;
int rs2 = 0;
int rs1 = (*jvm)->GetEnv(jvm, (void**)env, JNI_VERSION_1_6);
switch (rs1) {
Expand All @@ -44,7 +44,7 @@ inline gboolean attachThreadToJvm(JNIEnv** env) {
if (rs2 != JNI_OK) {
__android_log_write(6, "android-io", "ERROR: Could not attach current thread to jvm.");
} else {
attached = true;
attached = TRUE;
}
break;
}
Expand Down Expand Up @@ -274,7 +274,7 @@ int connectSession (spice_connection *conn)
__android_log_write(6, "connectSession", "Starting.");
g_thread_init(NULL);
g_type_init();
mainloop = g_main_loop_new(NULL, false);
mainloop = g_main_loop_new(NULL, FALSE);

connection_connect(conn);
if (connections > 0) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ static void spice_display_init(SpiceDisplay *display)

d = display->priv = SPICE_DISPLAY_GET_PRIVATE(display);
memset(d, 0, sizeof(*d));
d->have_mitshm = true;
d->have_mitshm = TRUE;
d->mouse_last_x = -1;
d->mouse_last_y = -1;
}
Expand Down Expand Up @@ -158,10 +158,10 @@ static gboolean do_color_convert(SpiceDisplay *display,
guint16 *src = d->data_origin;

if (!d->convert)
return true;
return TRUE;

g_return_val_if_fail(d->format == SPICE_SURFACE_FMT_16_555 ||
d->format == SPICE_SURFACE_FMT_16_565, false);
d->format == SPICE_SURFACE_FMT_16_565, FALSE);

miny = MAX(y, 0);
minx = MAX(x, 0);
Expand Down Expand Up @@ -191,7 +191,7 @@ static gboolean do_color_convert(SpiceDisplay *display,
}
}

return true;
return TRUE;
}

/* ---------------------------------------------------------------- */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -261,7 +261,7 @@ void initialize(final String vvFileName, final ConnectionSettings settings) {
@Override
public void run() {
try {
spicecomm = new SpiceCommunicator (getContext(), RemoteCanvas.this, settings);
spicecomm = new SpiceCommunicator (getContext(), RemoteCanvas.this, settings.isRequestingNewDisplayResolution());
pointer = new RemoteSpicePointer (spicecomm, RemoteCanvas.this, handler);
keyboard = new RemoteSpiceKeyboard (getResources(), spicecomm, RemoteCanvas.this, handler, settings.getLayoutMap());
spicecomm.setHandler(handler);
Expand Down Expand Up @@ -294,7 +294,7 @@ void initialize(final ConnectionSettings settings) {
@Override
public void run() {
try {
spicecomm = new SpiceCommunicator (getContext(), RemoteCanvas.this, settings);
spicecomm = new SpiceCommunicator (getContext(), RemoteCanvas.this, settings.isRequestingNewDisplayResolution());
pointer = new RemoteSpicePointer (spicecomm, RemoteCanvas.this, handler);
keyboard = new RemoteSpiceKeyboard (getResources(), spicecomm, RemoteCanvas.this, handler, settings.getLayoutMap());
spicecomm.setHandler(handler);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,9 +83,9 @@ public native int SpiceClientConnect(String ip,

private Thread thread = null;

public SpiceCommunicator (Context context, RemoteCanvas canvas, ConnectionSettings connection) {
public SpiceCommunicator (Context context, RemoteCanvas canvas, boolean isRequestingNewDisplayResolution) {
this.canvas = canvas;
this.connection = connection;
this.isRequestingNewDisplayResolution = isRequestingNewDisplayResolution;
myself = this;
// At the moment it is mandatory to initialize gstreamer because it
// loads libgiognutls for libsoup to have SSL/TLS support.
Expand All @@ -102,9 +102,9 @@ public SpiceCommunicator (Context context, RemoteCanvas canvas, ConnectionSettin
private static SpiceCommunicator myself = null;
private RemoteCanvas canvas = null;
private CanvasDrawableContainer canvasDrawable = null;
private ConnectionSettings connection = null;
private Handler handler = null;
private ArrayList<String> vmNames = null;
private boolean isRequestingNewDisplayResolution = false;

public void setHandler(Handler handler) {
this.handler = handler;
Expand Down Expand Up @@ -340,7 +340,7 @@ public void requestNewResolutionIfNeeded() {
if (isInNormalProtocol) {
int currentWidth = this.width;
int currentHeight = this.height;
if (connection.isRequestingNewDisplayResolution()) {
if (isRequestingNewDisplayResolution) {
canvas.waitUntilInflated();
int desiredWidth = canvas.getDesiredWidth();
int desiredHeight = canvas.getDesiredHeight();
Expand Down Expand Up @@ -380,7 +380,7 @@ public void onSettingsChanged(int width, int height, int bpp) {
setIsInNormalProtocol(true);
handler.sendEmptyMessage(Constants.SPICE_CONNECT_SUCCESS);

if (connection.isRequestingNewDisplayResolution()) {
if (isRequestingNewDisplayResolution) {
requestNewResolutionIfNeeded();
}
}
Expand Down
1 change: 0 additions & 1 deletion eclipse_projects/bVNC/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,4 @@ local.properties
obj/
libs/armeabi/
libs/armeabi-v7a
assets
gst-build
1 change: 0 additions & 1 deletion eclipse_projects/bVNC/jni/Android.mk

This file was deleted.

1 change: 1 addition & 0 deletions eclipse_projects/bVNC/jni/Android.mk
3 changes: 0 additions & 3 deletions eclipse_projects/bVNC/jni/Application.mk

This file was deleted.

1 change: 1 addition & 0 deletions eclipse_projects/bVNC/jni/Application.mk
1 change: 1 addition & 0 deletions eclipse_projects/bVNC/jni/libs
240 changes: 0 additions & 240 deletions eclipse_projects/bVNC/jni/libs/deps/include/celt051/celt.h

This file was deleted.

Loading

0 comments on commit 1016606

Please sign in to comment.