Mir
client_buffer_stream.h
Go to the documentation of this file.
1 /*
2  * Copyright © 2015 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: Robert Carr <robert.carr@canonical.com>
17  */
18 
19 #ifndef MIR_CLIENT_CLIENT_BUFFER_STREAM_H_
20 #define MIR_CLIENT_CLIENT_BUFFER_STREAM_H_
21 
23 #include "mir/geometry/size.h"
24 
27 #include "mir_wait_handle.h"
28 
29 #include <EGL/eglplatform.h>
30 
31 #include <memory>
32 #include <functional>
33 
34 namespace mir
35 {
36 namespace protobuf
37 {
38 class Buffer;
39 }
40 namespace client
41 {
42 class ClientBuffer;
43 class MemoryRegion;
44 
46 {
47 public:
48  virtual ~ClientBufferStream() = default;
49 
51 
52  virtual MirSurfaceParameters get_parameters() const = 0;
53  virtual std::shared_ptr<ClientBuffer> get_current_buffer() = 0;
54  virtual uint32_t get_current_buffer_id() = 0;
55  virtual EGLNativeWindowType egl_native_window() = 0;
56  virtual MirWaitHandle* next_buffer(std::function<void()> const& done) = 0;
57 
58  virtual std::shared_ptr<MemoryRegion> secure_for_cpu_write() = 0;
59 
60  virtual int swap_interval() const = 0;
61  virtual MirWaitHandle* set_swap_interval(int interval) = 0;
62 
64  virtual MirPlatformType platform_type() = 0;
65 
66  virtual frontend::BufferStreamId rpc_id() const = 0;
67 
68  virtual MirWaitHandle* release(mir_buffer_stream_callback callback, void* context) = 0;
69 
70  virtual bool valid() const = 0;
71  virtual void buffer_available(mir::protobuf::Buffer const& buffer) = 0;
72  virtual void buffer_unavailable() = 0;
73  virtual void set_size(geometry::Size) = 0;
74  virtual MirWaitHandle* set_scale(float) = 0;
75 protected:
76  ClientBufferStream() = default;
77  ClientBufferStream(const ClientBufferStream&) = delete;
79 };
80 
81 }
82 }
83 
84 #endif /* MIR_CLIENT_CLIENT_BUFFER_STREAM_H_ */
Definition: size.h:30
All things Mir.
Definition: atomic_callback.h:25
Definition: mir_wait_handle.h:31
void(* mir_buffer_stream_callback)(MirBufferStream *stream, void *client_context)
Callback to be passed when calling:
Definition: client_types.h:84
ClientBufferStream & operator=(const ClientBufferStream &)=delete
virtual void buffer_available(mir::protobuf::Buffer const &buffer)=0
Definition: mir_native_buffer.h:30
virtual MirWaitHandle * set_swap_interval(int interval)=0
virtual MirWaitHandle * next_buffer(std::function< void()> const &done)=0
virtual frontend::BufferStreamId rpc_id() const =0
virtual uint32_t get_current_buffer_id()=0
virtual bool valid() const =0
virtual MirWaitHandle * get_create_wait_handle()=0
virtual MirWaitHandle * set_scale(float)=0
virtual MirSurfaceParameters get_parameters() const =0
virtual std::shared_ptr< MemoryRegion > secure_for_cpu_write()=0
virtual MirNativeBuffer * get_current_buffer_package()=0
virtual std::shared_ptr< ClientBuffer > get_current_buffer()=0
virtual void set_size(geometry::Size)=0
virtual int swap_interval() const =0
Definition: client_buffer_stream.h:45
virtual ~ClientBufferStream()=default
virtual void buffer_unavailable()=0
virtual MirPlatformType platform_type()=0
virtual EGLNativeWindowType egl_native_window()=0
MirPlatformType
The native buffer type for the system the client is connected on.
Definition: client_types.h:180
MirSurfaceParameters is the structure of minimum required information that you must provide to Mir in...
Definition: client_types.h:157
virtual MirWaitHandle * release(mir_buffer_stream_callback callback, void *context)=0

Copyright © 2012-2015 Canonical Ltd.
Generated on Thu Oct 8 16:20:16 UTC 2015