2014-02-12 10:28:40 +00:00
|
|
|
/* GStreamer Wayland video sink
|
|
|
|
*
|
|
|
|
* Copyright (C) 2014 Collabora Ltd.
|
|
|
|
*
|
|
|
|
* This library is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU Library General Public
|
|
|
|
* License as published by the Free Software Foundation; either
|
|
|
|
* version 2 of the License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This library is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
* Library General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU Library General Public
|
|
|
|
* License along with this library; if not, write to the Free
|
|
|
|
* Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
|
|
|
* Boston, MA 02110-1301 USA.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef __GST_WL_DISPLAY_H__
|
|
|
|
#define __GST_WL_DISPLAY_H__
|
|
|
|
|
|
|
|
#include <gst/gst.h>
|
2016-09-29 20:30:33 +00:00
|
|
|
#include <gst/video/video.h>
|
2014-02-12 10:28:40 +00:00
|
|
|
#include <wayland-client.h>
|
2016-06-14 23:34:35 +00:00
|
|
|
#include "viewporter-client-protocol.h"
|
2016-09-22 09:10:47 +00:00
|
|
|
#include "linux-dmabuf-unstable-v1-client-protocol.h"
|
2014-02-12 10:28:40 +00:00
|
|
|
|
2014-05-22 07:10:51 +00:00
|
|
|
G_BEGIN_DECLS
|
|
|
|
|
2014-02-12 10:28:40 +00:00
|
|
|
#define GST_TYPE_WL_DISPLAY (gst_wl_display_get_type ())
|
|
|
|
#define GST_WL_DISPLAY(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GST_TYPE_WL_DISPLAY, GstWlDisplay))
|
|
|
|
#define GST_IS_WL_DISPLAY(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GST_TYPE_WL_DISPLAY))
|
|
|
|
#define GST_WL_DISPLAY_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GST_TYPE_WL_DISPLAY, GstWlDisplayClass))
|
|
|
|
#define GST_IS_WL_DISPLAY_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GST_TYPE_WL_DISPLAY))
|
|
|
|
#define GST_WL_DISPLAY_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GST_TYPE_WL_DISPLAY, GstWlDisplayClass))
|
|
|
|
|
|
|
|
typedef struct _GstWlDisplay GstWlDisplay;
|
|
|
|
typedef struct _GstWlDisplayClass GstWlDisplayClass;
|
|
|
|
|
|
|
|
struct _GstWlDisplay
|
|
|
|
{
|
|
|
|
GObject parent_instance;
|
|
|
|
|
|
|
|
/* public objects */
|
|
|
|
struct wl_display *display;
|
|
|
|
struct wl_event_queue *queue;
|
|
|
|
|
|
|
|
/* globals */
|
|
|
|
struct wl_registry *registry;
|
|
|
|
struct wl_compositor *compositor;
|
2014-05-23 15:18:32 +00:00
|
|
|
struct wl_subcompositor *subcompositor;
|
2014-02-12 10:28:40 +00:00
|
|
|
struct wl_shell *shell;
|
|
|
|
struct wl_shm *shm;
|
2016-06-14 23:34:35 +00:00
|
|
|
struct wp_viewporter *viewporter;
|
2016-09-22 09:10:47 +00:00
|
|
|
struct zwp_linux_dmabuf_v1 *dmabuf;
|
2015-08-30 12:55:11 +00:00
|
|
|
GArray *shm_formats;
|
2016-09-22 09:10:47 +00:00
|
|
|
GArray *dmabuf_formats;
|
2014-02-12 10:28:40 +00:00
|
|
|
|
|
|
|
/* private */
|
|
|
|
gboolean own_display;
|
|
|
|
GThread *thread;
|
|
|
|
GstPoll *wl_fd_poll;
|
2014-06-20 11:47:57 +00:00
|
|
|
|
2014-07-02 10:29:55 +00:00
|
|
|
GMutex buffers_mutex;
|
2014-06-20 11:47:57 +00:00
|
|
|
GHashTable *buffers;
|
2014-07-02 10:29:55 +00:00
|
|
|
gboolean shutting_down;
|
2014-02-12 10:28:40 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
struct _GstWlDisplayClass
|
|
|
|
{
|
|
|
|
GObjectClass parent_class;
|
|
|
|
};
|
|
|
|
|
|
|
|
GType gst_wl_display_get_type (void);
|
|
|
|
|
|
|
|
GstWlDisplay *gst_wl_display_new (const gchar * name, GError ** error);
|
|
|
|
GstWlDisplay *gst_wl_display_new_existing (struct wl_display * display,
|
|
|
|
gboolean take_ownership, GError ** error);
|
|
|
|
|
2014-06-20 11:47:57 +00:00
|
|
|
/* see wlbuffer.c for explanation */
|
|
|
|
void gst_wl_display_register_buffer (GstWlDisplay * self, gpointer buf);
|
|
|
|
void gst_wl_display_unregister_buffer (GstWlDisplay * self, gpointer buf);
|
|
|
|
|
2016-09-29 20:30:33 +00:00
|
|
|
gboolean gst_wl_display_check_format_for_shm (GstWlDisplay * display,
|
|
|
|
GstVideoFormat format);
|
|
|
|
gboolean gst_wl_display_check_format_for_dmabuf (GstWlDisplay * display,
|
|
|
|
GstVideoFormat format);
|
2016-09-22 09:10:47 +00:00
|
|
|
|
2014-05-22 07:10:51 +00:00
|
|
|
G_END_DECLS
|
|
|
|
|
2014-02-12 10:28:40 +00:00
|
|
|
#endif /* __GST_WL_DISPLAY_H__ */
|