Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(60)

Unified Diff: remoting/client/jni/chromoting_jni.cc

Issue 19297003: Add support for drawing video onto a Java ByteBuffer (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Reword highly cryptic comment Created 7 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: remoting/client/jni/chromoting_jni.cc
diff --git a/remoting/client/jni/chromoting_jni.cc b/remoting/client/jni/chromoting_jni.cc
index 1016a49bcaebd3d02c356237ec5b92aed2d14923..dfa60fa9728269fdda1c19b3f8a9524885a943ad 100644
--- a/remoting/client/jni/chromoting_jni.cc
+++ b/remoting/client/jni/chromoting_jni.cc
@@ -9,7 +9,6 @@
#include "base/memory/singleton.h"
#include "net/android/net_jni_registrar.h"
#include "remoting/base/url_request_context.h"
-#include "remoting/client/jni/chromoting_jni_instance.h"
namespace remoting {
@@ -106,4 +105,31 @@ void ChromotingJni::DisplayAuthenticationPrompt() {
env->GetStaticMethodID(class_, "displayAuthenticationPrompt", "()V"));
}
+void ChromotingJni::UpdateImageBuffer(int width, int height, jobject buffer) {
+ DCHECK(display_task_runner_->BelongsToCurrentThread());
+
+ JNIEnv* env = base::android::AttachCurrentThread();
+ env->SetStaticIntField(
+ class_,
+ env->GetStaticFieldID(class_, "width", "I"),
+ width);
+ env->SetStaticIntField(
+ class_,
+ env->GetStaticFieldID(class_, "height", "I"),
+ height);
+ env->SetStaticObjectField(
+ class_,
+ env->GetStaticFieldID(class_, "buffer", "Ljava/nio/ByteBuffer;"),
+ buffer);
+}
+
+void ChromotingJni::RedrawCanvas() {
+ DCHECK(display_task_runner_->BelongsToCurrentThread());
+
+ JNIEnv* env = base::android::AttachCurrentThread();
+ env->CallStaticVoidMethod(
+ class_,
+ env->GetStaticMethodID(class_, "redrawGraphicsInternal", "()V"));
+}
+
} // namespace remoting

Powered by Google App Engine
This is Rietveld 408576698