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_DISPLAY_GBM_H__ 22 #define __GST_GL_DISPLAY_GBM_H__ 23 24 #include <gbm.h> 25 #include <xf86drm.h> 26 #include <xf86drmMode.h> 27 #include <gst/gst.h> 28 #include <gst/gl/gstgldisplay.h> 29 #include <gst/gl/egl/gstegl.h> 30 31 G_BEGIN_DECLS 32 33 GType gst_gl_display_gbm_get_type (void); 34 35 #define GST_TYPE_GL_DISPLAY_GBM (gst_gl_display_gbm_get_type()) 36 #define GST_GL_DISPLAY_GBM(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_GL_DISPLAY_GBM,GstGLDisplayGBM)) 37 #define GST_GL_DISPLAY_GBM_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), GST_TYPE_GL_DISPLAY_GBM,GstGLDisplayGBMClass)) 38 #define GST_IS_GL_DISPLAY_GBM(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_GL_DISPLAY_GBM)) 39 #define GST_IS_GL_DISPLAY_GBM_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass), GST_TYPE_GL_DISPLAY_GBM)) 40 #define GST_GL_DISPLAY_GBM_CAST(obj) ((GstGLDisplayGBM*)(obj)) 41 42 #define GST_GL_DISPLAY_GBM_PRIVATE(obj) (((GstGLDisplayGBM*)(obj))->priv) 43 44 typedef struct _GstGLDisplayGBM GstGLDisplayGBM; 45 typedef struct _GstGLDisplayGBMClass GstGLDisplayGBMClass; 46 47 struct _GstGLDisplayGBM 48 { 49 GstGLDisplay parent; 50 51 /*< private >*/ 52 53 int drm_fd; 54 drmModeRes *drm_mode_resources; 55 drmModeConnector *drm_mode_connector; 56 drmModeModeInfo *drm_mode_info; 57 int crtc_index; 58 guint32 crtc_id; 59 60 struct gbm_device *gbm_dev; 61 62 gpointer _reserved[GST_PADDING]; 63 }; 64 65 struct _GstGLDisplayGBMClass 66 { 67 GstGLDisplayClass object_class; 68 69 /*< private >*/ 70 gpointer _reserved[GST_PADDING_LARGE]; 71 }; 72 73 GstGLDisplayGBM *gst_gl_display_gbm_new (void); 74 75 G_END_DECLS 76 77 #endif /* __GST_GL_DISPLAY_GBM_H__ */ 78