1 /* 2 * GStreamer Wayland video sink 3 * Copyright (C) 2011 Intel Corporation 4 * Copyright (C) 2011 Sreerenj Balachandran <sreerenj.balachandran@intel.com> 5 * 6 * This library is free software; you can redistribute it and/or 7 * modify it under the terms of the GNU Library General Public 8 * License as published by the Free Software Foundation; either 9 * version 2 of the License, or (at your option) any later version. 10 * 11 * This library is distributed in the hope that it will be useful, 12 * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 14 * Library General Public License for more details. 15 * 16 * You should have received a copy of the GNU Library General Public 17 * License along with this library; if not, write to the Free 18 * Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 19 * Boston, MA 02110-1301 USA. 20 */ 21 22 #ifndef __GST_WAYLAND_VIDEO_SINK_H__ 23 #define __GST_WAYLAND_VIDEO_SINK_H__ 24 25 #include <gst/gst.h> 26 #include <gst/video/video.h> 27 28 #include <wayland-client.h> 29 30 #include "wldisplay.h" 31 #include "wlwindow.h" 32 33 G_BEGIN_DECLS 34 35 #define GST_TYPE_WAYLAND_SINK \ 36 (gst_wayland_sink_get_type()) 37 #define GST_WAYLAND_SINK(obj) \ 38 (G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_WAYLAND_SINK,GstWaylandSink)) 39 #define GST_WAYLAND_SINK_CLASS(klass) \ 40 (G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_WAYLAND_SINK,GstWaylandSinkClass)) 41 #define GST_IS_WAYLAND_SINK(obj) \ 42 (G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_WAYLAND_SINK)) 43 #define GST_IS_WAYLAND_SINK_CLASS(klass) \ 44 (G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_WAYLAND_SINK)) 45 #define GST_WAYLAND_SINK_GET_CLASS(inst) \ 46 (G_TYPE_INSTANCE_GET_CLASS ((inst), GST_TYPE_WAYLAND_SINK, GstWaylandSinkClass)) 47 48 typedef struct _GstWaylandSink GstWaylandSink; 49 typedef struct _GstWaylandSinkClass GstWaylandSinkClass; 50 51 struct _GstWaylandSink 52 { 53 GstVideoSink parent; 54 55 GMutex display_lock; 56 GstWlDisplay *display; 57 GstWlWindow *window; 58 GstBufferPool *pool; 59 gboolean use_dmabuf; 60 61 gboolean video_info_changed; 62 GstVideoInfo video_info; 63 gboolean fullscreen; 64 65 gchar *display_name; 66 67 gboolean redraw_pending; 68 GMutex render_lock; 69 GstBuffer *last_buffer; 70 71 struct wl_callback *callback; 72 }; 73 74 struct _GstWaylandSinkClass 75 { 76 GstVideoSinkClass parent; 77 }; 78 79 GType gst_wayland_sink_get_type (void) G_GNUC_CONST; 80 81 GST_ELEMENT_REGISTER_DECLARE (waylandsink); 82 83 G_END_DECLS 84 85 #endif /* __GST_WAYLAND_VIDEO_SINK_H__ */ 86