OLD | NEW |
---|---|
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 The Chromium Authors. All rights reserved. |
Sergey Ulanov
2016/06/28 17:59:50
2016
Year needs to be updated whenever a file is r
Yuwei
2016/06/28 18:46:06
Done.
| |
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_VIDEO_RENDERER_H_ | 5 #ifndef REMOTING_CLIENT_JNI_JNI_VIDEO_RENDERER_H_ |
6 #define REMOTING_CLIENT_JNI_JNI_VIDEO_RENDERER_H_ | 6 #define REMOTING_CLIENT_JNI_JNI_VIDEO_RENDERER_H_ |
7 | 7 |
8 #include "base/memory/ref_counted.h" | 8 #include <list> |
9 #include <memory> | |
10 | |
11 #include "base/compiler_specific.h" | |
12 #include "base/macros.h" | |
13 #include "base/memory/weak_ptr.h" | |
14 #include "remoting/protocol/frame_consumer.h" | |
9 #include "remoting/protocol/video_renderer.h" | 15 #include "remoting/protocol/video_renderer.h" |
10 | 16 #include "third_party/webrtc/modules/desktop_capture/desktop_geometry.h" |
11 namespace base { | |
12 class SingleThreadTaskRunner; | |
13 } // namespace base | |
14 | 17 |
15 namespace remoting { | 18 namespace remoting { |
16 | 19 |
17 namespace protocol { | 20 class ClientContext; |
Yuwei
2016/06/28 00:18:35
This is from the old JniFrameConsumer. The code re
| |
18 class PerformanceTracker; | 21 class ChromotingJniRuntime; |
19 } // namespace protocol | 22 class JniClient; |
23 class JniDisplayHandler; | |
24 class SoftwareVideoRenderer; | |
20 | 25 |
21 // An extension of VideoRenderer that allows renderer to be initialized after | 26 // FrameConsumer and VideoRenderer implementation that draws onto a JNI direct |
22 // it is constructed. | 27 // byte buffer. |
23 class JniVideoRenderer : public protocol::VideoRenderer { | 28 class JniVideoRenderer : public protocol::FrameConsumer, |
29 public protocol::VideoRenderer { | |
24 public: | 30 public: |
25 ~JniVideoRenderer() override {} | 31 JniVideoRenderer( |
26 virtual void Initialize( | 32 ChromotingJniRuntime* jni_runtime, |
27 scoped_refptr<base::SingleThreadTaskRunner> decode_task_runner, | 33 base::WeakPtr<JniDisplayHandler> display); |
28 protocol::PerformanceTracker* perf_tracker) = 0; | 34 |
29 protected: | 35 ~JniVideoRenderer() override; |
30 JniVideoRenderer() {} | 36 |
37 // FrameConsumer implementation. | |
38 std::unique_ptr<webrtc::DesktopFrame> AllocateFrame( | |
39 const webrtc::DesktopSize& size) override; | |
40 void DrawFrame(std::unique_ptr<webrtc::DesktopFrame> frame, | |
41 const base::Closure& done) override; | |
42 PixelFormat GetPixelFormat() override; | |
43 | |
44 // JniVideoRenderer implementation. | |
45 void OnSessionConfig(const protocol::SessionConfig& config) override; | |
46 protocol::VideoStub* GetVideoStub() override; | |
47 protocol::FrameConsumer* GetFrameConsumer() override; | |
48 void Initialize(const ClientContext& client_context, | |
49 protocol::PerformanceTracker* perf_tracker) override; | |
50 | |
51 private: | |
52 class Renderer; | |
53 | |
54 void OnFrameRendered(const base::Closure& done); | |
55 | |
56 // Used to obtain task runner references and make calls to Java methods. | |
57 ChromotingJniRuntime* jni_runtime_; | |
58 | |
59 std::unique_ptr<SoftwareVideoRenderer> video_renderer_; | |
60 | |
61 // Renderer object used to render the frames on the display thread. | |
62 std::unique_ptr<Renderer> renderer_; | |
63 | |
64 base::WeakPtrFactory<JniVideoRenderer> weak_factory_; | |
65 | |
66 DISALLOW_COPY_AND_ASSIGN(JniVideoRenderer); | |
31 }; | 67 }; |
32 | 68 |
33 } // namespace remoting | 69 } // namespace remoting |
34 #endif // REMOTING_CLIENT_JNI_JNI_VIDEO_RENDERER_H_ | 70 |
71 #endif | |
Sergey Ulanov
2016/06/28 17:59:50
add // REMOTING_CLIENT_JNI_JNI_VIDEO_RENDERER_H_
Yuwei
2016/06/28 18:46:06
Done.
| |
OLD | NEW |