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/egl_native_surface.h"
23 #include "mir_wait_handle.h"
25 #include "mir_protobuf.pb.h"
26 #include "mir/geometry/size.h"
27 #include "mir/geometry/rectangle.h"
28 
29 #include <EGL/eglplatform.h>
30 
31 namespace mir
32 {
33 namespace protobuf { class DisplayServer; }
34 namespace client
35 {
36 class ClientBufferStreamFactory;
37 class ClientBufferStream;
38 }
39 }
40 
42 {
43 public:
45  mir::geometry::Rectangle const& region,
47  MirPixelFormat pixel_format,
48  mir::protobuf::DisplayServer& server,
49  std::shared_ptr<mir::client::ClientBufferStreamFactory> const& buffer_stream_factory,
50  mir_screencast_callback callback, void* context);
51 
53  bool valid();
54 
56  mir_screencast_callback callback, void* context);
57 
59  mir_screencast_callback callback, void* context);
60 
61  EGLNativeWindowType egl_native_window();
62 
63  /* mir::client::EGLNativeSurface */
65  std::shared_ptr<mir::client::ClientBuffer> get_current_buffer();
68 
69 private:
70  void screencast_created(
71  mir_screencast_callback callback, void* context);
72  void released(
73  mir_screencast_callback callback, void* context);
74 
75  mir::protobuf::DisplayServer& server;
76  mir::geometry::Size const output_size;
77  std::shared_ptr<mir::client::ClientBufferStreamFactory> const buffer_stream_factory;
78 
79  std::shared_ptr<mir::client::ClientBufferStream> buffer_stream;
80 
81  mir::protobuf::Screencast protobuf_screencast;
82  mir::protobuf::Void protobuf_void;
83 
84  MirWaitHandle create_screencast_wait_handle;
85  MirWaitHandle release_wait_handle;
86 };
87 
88 #endif /* MIR_CLIENT_MIR_SCREENCAST_H_ */
Definition: size.h:30
All things Mir.
Definition: buffer_stream.h:37
Definition: mir_wait_handle.h:31
MirWaitHandle * release(mir_screencast_callback callback, void *context)
Definition: mir_screencast.cpp:100
void request_and_wait_for_next_buffer()
Definition: mir_screencast.cpp:131
bool valid()
Definition: mir_screencast.cpp:85
std::shared_ptr< mir::client::ClientBuffer > get_current_buffer()
Definition: mir_screencast.cpp:95
Definition: mir_screencast.h:41
void request_and_wait_for_configure(MirSurfaceAttrib a, int value)
Definition: mir_screencast.cpp:136
EGLNativeWindowType egl_native_window()
Definition: mir_screencast.cpp:126
void(* mir_screencast_callback)(MirScreencast *screencast, void *client_context)
Callback to be passed when calling MirScreencast functions.
Definition: client_types.h:325
Definition: egl_native_surface.h:31
MirSurfaceAttrib
Attributes of a surface that the client and server/shell may wish to get or set over the wire...
Definition: common.h:36
MirPixelFormat
The order of components in a format enum matches the order of the components as they would be written...
Definition: common.h:127
MirScreencast(mir::geometry::Rectangle const &region, mir::geometry::Size const &size, MirPixelFormat pixel_format, mir::protobuf::DisplayServer &server, std::shared_ptr< mir::client::ClientBufferStreamFactory > const &buffer_stream_factory, mir_screencast_callback callback, void *context)
Definition: mir_screencast.cpp:39
MirWaitHandle * creation_wait_handle()
Definition: mir_screencast.cpp:80
Definition: rectangle.h:33
MirWaitHandle * next_buffer(mir_screencast_callback callback, void *context)
Definition: mir_screencast.cpp:117
Definition: display_server.h:31
MirSurfaceParameters get_parameters() const
Definition: mir_screencast.cpp:90
int const size
Definition: make_socket_rpc_channel.cpp:51
MirSurfaceParameters is the structure of minimum required information that you must provide to Mir in...
Definition: client_types.h:138

Copyright © 2012,2013 Canonical Ltd.
Generated on Tue Mar 24 16:15:19 UTC 2015