Mir
mir_screencast.h
Go to the documentation of this file.
1 /*
2  * Copyright © 2014 Canonical Ltd.
3  *
4  * This program is free software: you can redistribute it and/or modify it
5  * under the terms of the GNU Lesser General Public License version 3,
6  * as published by the Free Software Foundation.
7  *
8  * This program is distributed in the hope that it will be useful,
9  * but WITHOUT ANY WARRANTY; without even the implied warranty of
10  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11  * GNU Lesser General Public License for more details.
12  *
13  * You should have received a copy of the GNU Lesser General Public License
14  * along with this program. If not, see <http://www.gnu.org/licenses/>.
15  *
16  * Authored by: Alexandros Frantzis <alexandros.frantzis@canonical.com>
17  */
18 
19 #ifndef MIR_CLIENT_MIR_SCREENCAST_H_
20 #define MIR_CLIENT_MIR_SCREENCAST_H_
21 
22 #include "mir_wait_handle.h"
24 #include "mir/geometry/size.h"
25 #include "mir/geometry/rectangle.h"
26 
27 #include <EGL/eglplatform.h>
28 
29 #include <memory>
30 
31 namespace mir
32 {
33 namespace protobuf
34 {
35 class Screencast;
36 class Void;
37 }
38 namespace client
39 {
40 namespace rpc
41 {
42 class DisplayServer;
43 }
44 class ClientBufferStreamFactory;
45 class ClientBufferStream;
46 }
47 }
48 
50 {
51 public:
53  mir::geometry::Rectangle const& region,
55  MirPixelFormat pixel_format,
57  MirConnection* connection,
58  mir_screencast_callback callback, void* context);
59 
60  MirWaitHandle* creation_wait_handle();
61  bool valid();
62 
63  MirWaitHandle* release(
64  mir_screencast_callback callback, void* context);
65 
66  EGLNativeWindowType egl_native_window();
67 
68  void request_and_wait_for_configure(MirSurfaceAttrib a, int value);
69 
70  mir::client::ClientBufferStream* get_buffer_stream();
71 
72 private:
73  void screencast_created(
74  mir_screencast_callback callback, void* context);
75  void released(
76  mir_screencast_callback callback, void* context);
77 
79  MirConnection* connection;
80  mir::geometry::Size const output_size;
81  std::shared_ptr<mir::client::ClientBufferStream> buffer_stream;
82 
83  std::unique_ptr<mir::protobuf::Screencast> protobuf_screencast;
84  std::unique_ptr<mir::protobuf::Void> protobuf_void;
85 
86  MirWaitHandle create_screencast_wait_handle;
87  MirWaitHandle release_wait_handle;
88 };
89 
90 #endif /* MIR_CLIENT_MIR_SCREENCAST_H_ */
Definition: size.h:30
All things Mir.
Definition: atomic_callback.h:25
Definition: mir_wait_handle.h:31
struct MirScreencast MirScreencast
Definition: client_types.h:43
Definition: mir_screencast.h:49
void(* mir_screencast_callback)(MirScreencast *screencast, void *client_context)
Callback to be passed when calling MirScreencast functions.
Definition: client_types.h:405
MirSurfaceAttrib
Attributes of a surface that the client and server/shell may wish to get or set over the wire...
Definition: common.h:34
MirPixelFormat
32-bit pixel formats (8888): The order of components in the enum matches the order of the components ...
Definition: common.h:134
Definition: client_buffer_stream.h:69
Definition: rectangle.h:33
Definition: mir_connection.h:96
#define EGLNativeWindowType
Definition: client_buffer_stream.h:56
int const size
Definition: make_socket_rpc_channel.cpp:51
Definition: mir_display_server.h:33

Copyright © 2012-2015 Canonical Ltd.
Generated on Wed Mar 30 00:29:56 UTC 2016