1 /*
2  * GStreamer
3  * Copyright (C) 2018 Carlos Rafael Giani <dv@pseudoterminal.org>
4  *
5  * This library is free software; you can redistribute it and/or
6  * modify it under the terms of the GNU Library General Public
7  * License as published by the Free Software Foundation; either
8  * version 2 of the License, or (at your option) any later version.
9  *
10  * This library is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
13  * Library General Public License for more details.
14  *
15  * You should have received a copy of the GNU Library General Public
16  * License along with this library; if not, write to the
17  * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
18  * Boston, MA 02110-1301, USA.
19  */
20 
21 #ifndef __GST_GL_GBM_PRIVATE_H__
22 #define __GST_GL_GBM_PRIVATE_H__
23 
24 #include <gbm.h>
25 #include <xf86drm.h>
26 #include <xf86drmMode.h>
27 #include <gst/gst.h>
28 
29 
30 typedef struct _GstGLDRMFramebuffer GstGLDRMFramebuffer;
31 
32 struct _GstGLDRMFramebuffer
33 {
34   struct gbm_bo *bo;
35   guint32 fb_id;
36 };
37 
38 const gchar* gst_gl_gbm_get_name_for_drm_connector (drmModeConnector * connector);
39 const gchar* gst_gl_gbm_get_name_for_drm_encoder (drmModeEncoder * encoder);
40 const gchar* gst_gl_gbm_format_to_string (guint32 format);
41 int gst_gl_gbm_depth_from_format (guint32 format);
42 int gst_gl_gbm_bpp_from_format (guint32 format);
43 
44 GstGLDRMFramebuffer* gst_gl_gbm_drm_fb_get_from_bo (struct gbm_bo *bo);
45 
46 int gst_gl_gbm_find_and_open_drm_node (void);
47 
48 
49 #endif /* __GST_GL_DISPLAY_GBM_UTILS_H__ */
50