OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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_JNI_DISPLAY_HANDLER_H_ | 5 #ifndef REMOTING_CLIENT_JNI_JNI_DISPLAY_HANDLER_H_ |
6 #define REMOTING_CLIENT_JNI_JNI_DISPLAY_HANDLER_H_ | 6 #define REMOTING_CLIENT_JNI_JNI_DISPLAY_HANDLER_H_ |
7 | 7 |
8 #include <jni.h> | 8 #include <jni.h> |
9 | 9 |
10 #include "base/android/scoped_java_ref.h" | 10 #include "base/android/scoped_java_ref.h" |
11 #include "base/macros.h" | 11 #include "base/macros.h" |
12 #include "base/memory/weak_ptr.h" | 12 #include "base/memory/weak_ptr.h" |
13 #include "remoting/client/jni/display_updater_factory.h" | 13 #include "remoting/client/jni/display_updater_factory.h" |
14 | 14 |
15 namespace remoting { | 15 namespace remoting { |
16 | 16 |
17 namespace protocol { | 17 namespace protocol { |
18 class CursorShapeInfo; | 18 class CursorShapeInfo; |
| 19 class VideoRenderer; |
19 } // namespace protocol | 20 } // namespace protocol |
20 | 21 |
21 class ChromotingJniRuntime; | 22 class ChromotingJniRuntime; |
22 class JniVideoRenderer; | |
23 | 23 |
24 // Handles display operations. Must be called and deleted on the display thread | 24 // Handles display operations. Must be called and deleted on the display thread |
25 // unless otherwise noted. | 25 // unless otherwise noted. |
26 class JniDisplayHandler : public DisplayUpdaterFactory { | 26 class JniDisplayHandler : public DisplayUpdaterFactory { |
27 public: | 27 public: |
28 JniDisplayHandler(ChromotingJniRuntime* runtime, | 28 JniDisplayHandler(ChromotingJniRuntime* runtime, |
29 base::android::ScopedJavaGlobalRef<jobject> java_display); | 29 base::android::ScopedJavaGlobalRef<jobject> java_display); |
30 | 30 |
31 // Must be deleted on the display thread. | 31 // Must be deleted on the display thread. |
32 ~JniDisplayHandler() override; | 32 ~JniDisplayHandler() override; |
33 | 33 |
34 void UpdateCursorShape(const protocol::CursorShapeInfo& cursor_shape); | 34 void UpdateCursorShape(const protocol::CursorShapeInfo& cursor_shape); |
35 | 35 |
36 // DisplayUpdaterFactory overrides (functions can be called on any thread). | 36 // DisplayUpdaterFactory overrides (functions can be called on any thread). |
37 std::unique_ptr<protocol::CursorShapeStub> CreateCursorShapeStub() override; | 37 std::unique_ptr<protocol::CursorShapeStub> CreateCursorShapeStub() override; |
38 std::unique_ptr<JniVideoRenderer> CreateVideoRenderer() override; | 38 std::unique_ptr<protocol::VideoRenderer> CreateVideoRenderer() override; |
39 | 39 |
40 // Creates a new Bitmap object to store a video frame. Can be called on any | 40 // Creates a new Bitmap object to store a video frame. Can be called on any |
41 // thread. | 41 // thread. |
42 static base::android::ScopedJavaLocalRef<jobject> NewBitmap(int width, | 42 static base::android::ScopedJavaLocalRef<jobject> NewBitmap(int width, |
43 int height); | 43 int height); |
44 | 44 |
45 // Updates video frame bitmap. |bitmap| must be an instance of | 45 // Updates video frame bitmap. |bitmap| must be an instance of |
46 // android.graphics.Bitmap. | 46 // android.graphics.Bitmap. |
47 void UpdateFrameBitmap(base::android::ScopedJavaGlobalRef<jobject> bitmap); | 47 void UpdateFrameBitmap(base::android::ScopedJavaGlobalRef<jobject> bitmap); |
48 | 48 |
(...skipping 15 matching lines...) Expand all Loading... |
64 | 64 |
65 base::android::ScopedJavaGlobalRef<jobject> java_display_; | 65 base::android::ScopedJavaGlobalRef<jobject> java_display_; |
66 base::WeakPtrFactory<JniDisplayHandler> weak_factory_; | 66 base::WeakPtrFactory<JniDisplayHandler> weak_factory_; |
67 | 67 |
68 DISALLOW_COPY_AND_ASSIGN(JniDisplayHandler); | 68 DISALLOW_COPY_AND_ASSIGN(JniDisplayHandler); |
69 }; | 69 }; |
70 | 70 |
71 } // namespace remoting | 71 } // namespace remoting |
72 | 72 |
73 #endif // REMOTING_CLIENT_JNI_JNI_DISPLAY_HANDLER_H_ | 73 #endif // REMOTING_CLIENT_JNI_JNI_DISPLAY_HANDLER_H_ |
OLD | NEW |