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

Side by Side Diff: remoting/client/jni/chromoting_jni_runtime.h

Issue 24072012: Hold video frame in Bitmap instead of keeping a ByteBuffer reference. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Keep track of buffers in JniFrameConsumer Created 7 years, 2 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 unified diff | Download patch
« no previous file with comments | « remoting/client/jni/DEPS ('k') | remoting/client/jni/chromoting_jni_runtime.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef REMOTING_CLIENT_JNI_CHROMOTING_JNI_RUNTIME_H_ 5 #ifndef REMOTING_CLIENT_JNI_CHROMOTING_JNI_RUNTIME_H_
6 #define REMOTING_CLIENT_JNI_CHROMOTING_JNI_RUNTIME_H_ 6 #define REMOTING_CLIENT_JNI_CHROMOTING_JNI_RUNTIME_H_
7 7
8 #include <jni.h> 8 #include <jni.h>
9 #include <string> 9 #include <string>
10 10
11 #include "base/android/scoped_java_ref.h"
11 #include "base/at_exit.h" 12 #include "base/at_exit.h"
12 #include "net/url_request/url_request_context_getter.h" 13 #include "net/url_request/url_request_context_getter.h"
13 #include "remoting/base/auto_thread.h" 14 #include "remoting/base/auto_thread.h"
14 #include "remoting/client/jni/chromoting_jni_instance.h" 15 #include "remoting/client/jni/chromoting_jni_instance.h"
15 #include "remoting/protocol/connection_to_host.h" 16 #include "remoting/protocol/connection_to_host.h"
16 17
17 template<typename T> struct DefaultSingletonTraits; 18 template<typename T> struct DefaultSingletonTraits;
18 19
19 namespace remoting { 20 namespace remoting {
20 21
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
72 protocol::ErrorCode error); 73 protocol::ErrorCode error);
73 74
74 // Pops up a dialog box asking the user to enter a PIN. Call on UI thread. 75 // Pops up a dialog box asking the user to enter a PIN. Call on UI thread.
75 void DisplayAuthenticationPrompt(bool pairing_supported); 76 void DisplayAuthenticationPrompt(bool pairing_supported);
76 77
77 // Saves new pairing credentials to permanent storage. Call on UI thread. 78 // Saves new pairing credentials to permanent storage. Call on UI thread.
78 void CommitPairingCredentials(const std::string& host, 79 void CommitPairingCredentials(const std::string& host,
79 const std::string& id, 80 const std::string& id,
80 const std::string& secret); 81 const std::string& secret);
81 82
82 // Updates image dimensions and canvas memory space. Call on display thread. 83 // Creates a new Bitmap object to store a video frame.
83 void UpdateImageBuffer(int width, int height, jobject buffer); 84 base::android::ScopedJavaLocalRef<jobject> NewBitmap(
85 webrtc::DesktopSize size);
86
87 // Updates video frame bitmap. |bitmap| must be an instance of
88 // android.graphics.Bitmap. Call on the display thread.
89 void UpdateFrameBitmap(jobject bitmap);
84 90
85 // Updates cursor shape. Call on display thread. 91 // Updates cursor shape. Call on display thread.
86 void UpdateCursorShape(const protocol::CursorShapeInfo& cursor_shape); 92 void UpdateCursorShape(const protocol::CursorShapeInfo& cursor_shape);
87 93
88 // Draws the latest image buffer onto the canvas. Call on the display thread. 94 // Draws the latest image buffer onto the canvas. Call on the display thread.
89 void RedrawCanvas(); 95 void RedrawCanvas();
90 96
91 private: 97 private:
92 ChromotingJniRuntime(); 98 ChromotingJniRuntime();
93 99
(...skipping 28 matching lines...) Expand all
122 scoped_refptr<ChromotingJniInstance> session_; 128 scoped_refptr<ChromotingJniInstance> session_;
123 129
124 friend struct DefaultSingletonTraits<ChromotingJniRuntime>; 130 friend struct DefaultSingletonTraits<ChromotingJniRuntime>;
125 131
126 DISALLOW_COPY_AND_ASSIGN(ChromotingJniRuntime); 132 DISALLOW_COPY_AND_ASSIGN(ChromotingJniRuntime);
127 }; 133 };
128 134
129 } // namespace remoting 135 } // namespace remoting
130 136
131 #endif 137 #endif
OLDNEW
« no previous file with comments | « remoting/client/jni/DEPS ('k') | remoting/client/jni/chromoting_jni_runtime.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698