2
* Copyright © 2017 Canonical Ltd.
4
* This program is free software: you can redistribute it and/or modify it
5
* under the terms of the GNU General Public License version 3,
6
* as published by the Free Software Foundation.
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 General Public License for more details.
13
* You should have received a copy of the GNU General Public License
14
* along with this program. If not, see <http://www.gnu.org/licenses/>.
16
* Authored by: Kevin DuBois <kevin.dubois@canonical.com>
19
#ifndef MIR_CLIENT_EXTENSIONS_HARDWARE_BUFFER_STREAM_H_
20
#define MIR_CLIENT_EXTENSIONS_HARDWARE_BUFFER_STREAM_H_
22
#include "mir_toolkit/rs/mir_render_surface.h"
23
#include "mir_toolkit/mir_buffer_stream.h"
24
#include "mir_toolkit/mir_extension_core.h"
30
//This extension should probably not be published.
31
//Android can allocate a hardware-capable ANativeWindow from the AndroidEgl extension,
32
//and mesa's egl will use MirPresentationChain + MirBuffer, so there's no need
33
//for a 'hardware' buffer stream publicly.
34
//Internally, its useful in playground/ and the nested server until we switch upstream
35
//driver stacks to the mir egl platform.
37
#pragma GCC diagnostic push
38
#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
39
typedef MirBufferStream* (*MirExtensionGetHardwareBufferStream)(
41
int width, int height,
42
MirPixelFormat format);
43
#pragma GCC diagnostic pop
45
typedef struct MirExtensionHardwareBufferStreamV1
47
MirExtensionGetHardwareBufferStream get_hardware_buffer_stream;
48
} MirExtensionHardwareBufferStreamV1;
50
static inline MirExtensionHardwareBufferStreamV1 const* mir_extension_hardware_buffer_stream_v1(
51
MirConnection* connection)
53
return (MirExtensionHardwareBufferStreamV1 const*) mir_connection_request_extension(
54
connection, "mir_extension_hardware_buffer_stream", 1);
60
#endif /* MIR_CLIENT_EXTENSIONS_HARDWARE_BUFFER_STREAM_H_ */