2014-02-13 10:59:45 +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_WINDOW_H__
|
|
|
|
#define __GST_WL_WINDOW_H__
|
|
|
|
|
|
|
|
#include "wldisplay.h"
|
2014-07-01 08:43:20 +00:00
|
|
|
#include "wlbuffer.h"
|
2014-06-13 13:58:08 +00:00
|
|
|
#include <gst/video/video.h>
|
2014-02-13 10:59:45 +00:00
|
|
|
|
2014-05-22 07:10:51 +00:00
|
|
|
G_BEGIN_DECLS
|
|
|
|
|
2014-02-13 10:59:45 +00:00
|
|
|
#define GST_TYPE_WL_WINDOW (gst_wl_window_get_type ())
|
|
|
|
#define GST_WL_WINDOW(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GST_TYPE_WL_WINDOW, GstWlWindow))
|
|
|
|
#define GST_IS_WL_WINDOW(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GST_TYPE_WL_WINDOW))
|
|
|
|
#define GST_WL_WINDOW_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GST_TYPE_WL_WINDOW, GstWlWindowClass))
|
|
|
|
#define GST_IS_WL_WINDOW_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GST_TYPE_WL_WINDOW))
|
|
|
|
#define GST_WL_WINDOW_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GST_TYPE_WL_WINDOW, GstWlWindowClass))
|
|
|
|
|
|
|
|
typedef struct _GstWlWindow GstWlWindow;
|
|
|
|
typedef struct _GstWlWindowClass GstWlWindowClass;
|
|
|
|
|
|
|
|
struct _GstWlWindow
|
|
|
|
{
|
|
|
|
GObject parent_instance;
|
|
|
|
|
2016-09-22 22:55:23 +00:00
|
|
|
GMutex *render_lock;
|
|
|
|
|
2014-02-13 10:59:45 +00:00
|
|
|
GstWlDisplay *display;
|
2014-07-01 08:43:20 +00:00
|
|
|
struct wl_surface *area_surface;
|
2018-12-03 07:18:32 +00:00
|
|
|
struct wl_surface *area_surface_wrapper;
|
2014-07-01 08:43:20 +00:00
|
|
|
struct wl_subsurface *area_subsurface;
|
2016-06-14 23:34:35 +00:00
|
|
|
struct wp_viewport *area_viewport;
|
2014-07-01 08:43:20 +00:00
|
|
|
struct wl_surface *video_surface;
|
2018-12-03 07:18:32 +00:00
|
|
|
struct wl_surface *video_surface_wrapper;
|
2014-07-01 08:43:20 +00:00
|
|
|
struct wl_subsurface *video_subsurface;
|
2016-06-14 23:34:35 +00:00
|
|
|
struct wp_viewport *video_viewport;
|
2014-02-13 10:59:45 +00:00
|
|
|
struct wl_shell_surface *shell_surface;
|
2014-05-26 11:13:56 +00:00
|
|
|
|
2014-07-01 08:43:20 +00:00
|
|
|
/* the size and position of the area_(sub)surface */
|
2014-05-26 11:13:56 +00:00
|
|
|
GstVideoRectangle render_rectangle;
|
2016-09-22 19:35:44 +00:00
|
|
|
|
|
|
|
/* the size and position of the video_subsurface */
|
|
|
|
GstVideoRectangle video_rectangle;
|
|
|
|
|
2014-05-26 11:13:56 +00:00
|
|
|
/* the size of the video in the buffers */
|
|
|
|
gint video_width, video_height;
|
2016-09-22 19:35:44 +00:00
|
|
|
|
|
|
|
/* this will be set when viewporter is available and black background has
|
|
|
|
* already been set on the area_subsurface */
|
|
|
|
gboolean no_border_update;
|
2016-09-22 22:55:23 +00:00
|
|
|
|
2014-02-13 10:59:45 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
struct _GstWlWindowClass
|
|
|
|
{
|
|
|
|
GObjectClass parent_class;
|
|
|
|
};
|
|
|
|
|
|
|
|
GType gst_wl_window_get_type (void);
|
|
|
|
|
2017-02-23 10:48:13 +00:00
|
|
|
void gst_wl_window_ensure_fullscreen (GstWlWindow * window,
|
|
|
|
gboolean fullscreen);
|
2014-02-13 10:59:45 +00:00
|
|
|
GstWlWindow *gst_wl_window_new_toplevel (GstWlDisplay * display,
|
2017-02-23 10:48:13 +00:00
|
|
|
const GstVideoInfo * info, gboolean fullscreen, GMutex * render_lock);
|
2014-05-23 15:18:32 +00:00
|
|
|
GstWlWindow *gst_wl_window_new_in_surface (GstWlDisplay * display,
|
2016-09-22 22:55:23 +00:00
|
|
|
struct wl_surface * parent, GMutex * render_lock);
|
2014-02-13 10:59:45 +00:00
|
|
|
|
|
|
|
GstWlDisplay *gst_wl_window_get_display (GstWlWindow * window);
|
|
|
|
struct wl_surface *gst_wl_window_get_wl_surface (GstWlWindow * window);
|
2014-02-28 09:48:30 +00:00
|
|
|
gboolean gst_wl_window_is_toplevel (GstWlWindow *window);
|
2014-02-13 10:59:45 +00:00
|
|
|
|
2014-07-01 08:43:20 +00:00
|
|
|
void gst_wl_window_render (GstWlWindow * window, GstWlBuffer * buffer,
|
|
|
|
const GstVideoInfo * info);
|
2014-05-26 11:13:56 +00:00
|
|
|
void gst_wl_window_set_render_rectangle (GstWlWindow * window, gint x, gint y,
|
|
|
|
gint w, gint h);
|
2014-02-13 10:59:45 +00:00
|
|
|
|
2014-05-22 07:10:51 +00:00
|
|
|
G_END_DECLS
|
|
|
|
|
2014-02-13 10:59:45 +00:00
|
|
|
#endif /* __GST_WL_WINDOW_H__ */
|