Linux: Depend on liberation-fonts package for RPMs.
[chromium-blink-merge.git] / remoting / client / jni / jni_frame_consumer.h
blob5a9f7e6394071142f7447245b9397547a1e7040c
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
3 // found in the LICENSE file.
5 #ifndef REMOTING_CLIENT_JNI_JNI_FRAME_CONSUMER_H_
6 #define REMOTING_CLIENT_JNI_JNI_FRAME_CONSUMER_H_
8 #include <list>
10 #include "base/compiler_specific.h"
11 #include "base/memory/scoped_ptr.h"
12 #include "base/memory/weak_ptr.h"
13 #include "remoting/client/frame_consumer.h"
14 #include "third_party/webrtc/modules/desktop_capture/desktop_geometry.h"
16 namespace remoting {
18 class ChromotingJniRuntime;
20 // FrameConsumer implementation that draws onto a JNI direct byte buffer.
21 class JniFrameConsumer : public FrameConsumer {
22 public:
23 // Does not take ownership of |jni_runtime|.
24 explicit JniFrameConsumer(ChromotingJniRuntime* jni_runtime);
26 ~JniFrameConsumer() override;
28 // FrameConsumer implementation.
29 scoped_ptr<webrtc::DesktopFrame> AllocateFrame(
30 const webrtc::DesktopSize& size) override;
31 void DrawFrame(scoped_ptr<webrtc::DesktopFrame> frame,
32 const base::Closure& done) override;
33 PixelFormat GetPixelFormat() override;
35 private:
36 class Renderer;
38 void OnFrameRendered(const base::Closure& done);
40 // Used to obtain task runner references and make calls to Java methods.
41 ChromotingJniRuntime* jni_runtime_;
43 // Renderer object used to render the frames on the display thread.
44 scoped_ptr<Renderer> renderer_;
46 base::WeakPtrFactory<JniFrameConsumer> weak_factory_;
48 DISALLOW_COPY_AND_ASSIGN(JniFrameConsumer);
51 } // namespace remoting
53 #endif