diff options
author | lambroslambrou@chromium.org <lambroslambrou@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-10-16 11:25:41 +0000 |
---|---|---|
committer | lambroslambrou@chromium.org <lambroslambrou@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-10-16 11:25:41 +0000 |
commit | a4c8142c329285f14864f5e146bfb2901a2856ae (patch) | |
tree | f95656551183bfca04efe7bbfd7acbb4c0ed3d94 /remoting/client/jni/chromoting_jni_runtime.h | |
parent | 3a793bc600142279258e366dd928a2770e62857b (diff) | |
download | chromium_src-a4c8142c329285f14864f5e146bfb2901a2856ae.zip chromium_src-a4c8142c329285f14864f5e146bfb2901a2856ae.tar.gz chromium_src-a4c8142c329285f14864f5e146bfb2901a2856ae.tar.bz2 |
Hold video frame in Bitmap instead of keeping a ByteBuffer reference.
Sometimes, the DesktopView was repainted whilst |JniInterface.sBuffer|
no longer referred to valid frame data. This CL cleans things up by
replacing the ByteBuffer with a Bitmap, and having JniFrameConsumer
copy the completely-decoded data directly into the Java Bitmap.
Review URL: https://codereview.chromium.org/24072012
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@228898 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'remoting/client/jni/chromoting_jni_runtime.h')
-rw-r--r-- | remoting/client/jni/chromoting_jni_runtime.h | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/remoting/client/jni/chromoting_jni_runtime.h b/remoting/client/jni/chromoting_jni_runtime.h index bfe8549..93d77bd 100644 --- a/remoting/client/jni/chromoting_jni_runtime.h +++ b/remoting/client/jni/chromoting_jni_runtime.h @@ -8,6 +8,7 @@ #include <jni.h> #include <string> +#include "base/android/scoped_java_ref.h" #include "base/at_exit.h" #include "net/url_request/url_request_context_getter.h" #include "remoting/base/auto_thread.h" @@ -79,8 +80,13 @@ class ChromotingJniRuntime { const std::string& id, const std::string& secret); - // Updates image dimensions and canvas memory space. Call on display thread. - void UpdateImageBuffer(int width, int height, jobject buffer); + // Creates a new Bitmap object to store a video frame. + base::android::ScopedJavaLocalRef<jobject> NewBitmap( + webrtc::DesktopSize size); + + // Updates video frame bitmap. |bitmap| must be an instance of + // android.graphics.Bitmap. Call on the display thread. + void UpdateFrameBitmap(jobject bitmap); // Updates cursor shape. Call on display thread. void UpdateCursorShape(const protocol::CursorShapeInfo& cursor_shape); |