KPipewire

dmabufhandler.h
1/*
2 SPDX-FileCopyrightText: 2022 Aleix Pol i Gonzalez <aleixpol@kde.org>
3
4 SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL
5*/
6
7#ifndef DMABUFHANDLER_H
8#define DMABUFHANDLER_H
9
10#include "kpipewiredmabuf_export.h"
11#include "pipewiresourcestream.h"
12#include <QImage>
13#include <epoxy/egl.h>
14
15class KPIPEWIREDMABUF_EXPORT DmaBufHandler
16{
17public:
18 DmaBufHandler();
19 ~DmaBufHandler();
20
21 bool downloadFrame(QImage &image, const PipeWireFrame &frame);
22
23private:
24 void setupEgl();
25 bool m_eglInitialized = false;
26 qint32 m_drmFd = 0; // for GBM buffer mmap
27 gbm_device *m_gbmDevice = nullptr; // for passed GBM buffer retrieval
28
29 struct EGLStruct {
30 EGLDisplay display = EGL_NO_DISPLAY;
31 EGLContext context = EGL_NO_CONTEXT;
32 };
33 EGLStruct m_egl;
34};
35
36#endif // DMABUFHANDLER_H
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Mon Nov 18 2024 12:15:17 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.