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/optional_value.h"
25 #include "mir/geometry/size.h"
26 #include "mir/geometry/rectangle.h"
27 
28 #include <EGL/eglplatform.h>
29 
30 #include <memory>
31 
32 namespace mir
33 {
34 namespace protobuf
35 {
36 class Screencast;
37 class Void;
38 }
39 namespace client
40 {
41 namespace rpc
42 {
43 class DisplayServer;
44 }
45 class ClientBufferStreamFactory;
46 class ClientBufferStream;
47 }
48 }
49 
51 {
53  MirScreencastSpec(MirConnection* connection);
54  MirScreencastSpec(MirConnection* connection, MirScreencastParameters const& params);
55 
56  // Required parameters
57  MirConnection* connection{nullptr};
58 
59  // Optional parameters
64 
67 };
68 
70 {
71 public:
74  MirScreencastSpec const& spec,
76  mir_screencast_callback callback, void* context);
77 
78  MirWaitHandle* creation_wait_handle();
79  bool valid();
80  char const* get_error_message();
81 
82  MirWaitHandle* release(
83  mir_screencast_callback callback, void* context);
84 
85  EGLNativeWindowType egl_native_window();
86 
87  mir::client::ClientBufferStream* get_buffer_stream();
88 
89 private:
90  void screencast_created(
91  mir_screencast_callback callback, void* context);
92  void released(
93  mir_screencast_callback callback, void* context);
94 
95  std::mutex mutable mutex;
96  mir::client::rpc::DisplayServer* const server{nullptr};
97  MirConnection* const connection{nullptr};
98  std::shared_ptr<mir::client::ClientBufferStream> buffer_stream;
99 
100  std::unique_ptr<mir::protobuf::Screencast> const protobuf_screencast;
101  std::unique_ptr<mir::protobuf::Void> const protobuf_void;
102 
103  MirWaitHandle create_screencast_wait_handle;
104  MirWaitHandle release_wait_handle;
105 
106  std::string const empty_error_message;
107 };
108 
109 #endif /* MIR_CLIENT_MIR_SCREENCAST_H_ */
Definition: mir_screencast.h:50
All things Mir.
Definition: atomic_callback.h:25
MirScreencastParameters is the structure of required information that you must provide to Mir in orde...
Definition: client_types.h:388
Definition: mir_wait_handle.h:31
struct MirScreencast MirScreencast
Definition: client_types.h:43
Definition: mir_screencast.h:69
struct MirScreencastSpec MirScreencastSpec
Definition: client_types.h:44
mir::optional_value< unsigned int > width
Definition: mir_screencast.h:60
mir::optional_value< unsigned int > num_buffers
Definition: mir_screencast.h:66
mir::optional_value< MirRectangle > capture_region
Definition: mir_screencast.h:63
void(* mir_screencast_callback)(MirScreencast *screencast, void *client_context)
Callback to be passed when calling MirScreencast functions.
Definition: client_types.h:411
mir::optional_value< MirMirrorMode > mirror_mode
Definition: mir_screencast.h:65
mir::optional_value< unsigned int > height
Definition: mir_screencast.h:61
mir::optional_value< MirPixelFormat > pixel_format
Definition: mir_screencast.h:62
Definition: client_buffer_stream.h:68
error
Definition: connector_report_tp.h:56
Definition: mir_connection.h:96
#define EGLNativeWindowType
Definition: client_buffer_stream.h:55
Definition: mir_display_server.h:33

Copyright © 2012-2015 Canonical Ltd.
Generated on Thu Sep 8 14:50:19 UTC 2016