2012-08-01 13:44:02 +00:00
|
|
|
/*
|
|
|
|
* gstvaapiwindow_drm.c - VA/DRM window abstraction
|
|
|
|
*
|
2013-11-22 05:37:12 +00:00
|
|
|
* Copyright (C) 2012-2013 Intel Corporation
|
2013-11-22 04:57:18 +00:00
|
|
|
* Author: Gwenole Beauchesne <gwenole.beauchesne@intel.com>
|
2012-08-01 13:44:02 +00:00
|
|
|
*
|
|
|
|
* This library is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU Lesser General Public License
|
|
|
|
* as published by the Free Software Foundation; either version 2.1
|
|
|
|
* 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
|
|
|
|
* Lesser General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU Lesser 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
|
|
|
|
*/
|
|
|
|
|
|
|
|
/**
|
|
|
|
* SECTION:gstvaapiwindow_drm
|
|
|
|
* @short_description: VA/DRM dummy window abstraction
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include "sysdeps.h"
|
|
|
|
#include "gstvaapiwindow_drm.h"
|
2013-04-30 15:20:14 +00:00
|
|
|
#include "gstvaapiwindow_priv.h"
|
2013-05-27 15:18:40 +00:00
|
|
|
#include "gstvaapidisplay_drm_priv.h"
|
2012-08-01 13:44:02 +00:00
|
|
|
|
2018-12-22 12:25:09 +00:00
|
|
|
GST_DEBUG_CATEGORY_EXTERN (gst_debug_vaapi_window);
|
|
|
|
#define GST_CAT_DEFAULT gst_debug_vaapi_window
|
2012-08-01 13:44:02 +00:00
|
|
|
|
2014-07-25 14:53:41 +00:00
|
|
|
typedef struct _GstVaapiWindowDRMClass GstVaapiWindowDRMClass;
|
2013-04-30 15:20:14 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* GstVaapiWindowDRM:
|
|
|
|
*
|
|
|
|
* A dummy DRM window abstraction.
|
|
|
|
*/
|
2014-07-25 14:53:41 +00:00
|
|
|
struct _GstVaapiWindowDRM
|
|
|
|
{
|
2016-02-02 16:50:19 +00:00
|
|
|
/*< private > */
|
2014-07-25 14:53:41 +00:00
|
|
|
GstVaapiWindow parent_instance;
|
2013-04-30 15:20:14 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
/**
|
|
|
|
* GstVaapiWindowDRMClass:
|
|
|
|
*
|
|
|
|
* A dummy DRM window abstraction class.
|
|
|
|
*/
|
2014-07-25 14:53:41 +00:00
|
|
|
struct _GstVaapiWindowDRMClass
|
|
|
|
{
|
2016-02-02 16:50:19 +00:00
|
|
|
/*< private > */
|
2014-07-25 14:53:41 +00:00
|
|
|
GstVaapiWindowClass parent_instance;
|
2013-04-30 15:20:14 +00:00
|
|
|
};
|
2012-08-01 13:44:02 +00:00
|
|
|
|
2018-12-22 17:02:38 +00:00
|
|
|
G_DEFINE_TYPE (GstVaapiWindowDRM, gst_vaapi_window_drm, GST_TYPE_VAAPI_WINDOW);
|
|
|
|
|
2012-08-01 13:44:02 +00:00
|
|
|
static gboolean
|
2014-07-25 14:53:41 +00:00
|
|
|
gst_vaapi_window_drm_show (GstVaapiWindow * window)
|
2012-08-01 13:44:02 +00:00
|
|
|
{
|
2014-07-25 14:53:41 +00:00
|
|
|
return TRUE;
|
2012-08-01 13:44:02 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static gboolean
|
2014-07-25 14:53:41 +00:00
|
|
|
gst_vaapi_window_drm_hide (GstVaapiWindow * window)
|
2012-08-01 13:44:02 +00:00
|
|
|
{
|
2014-07-25 14:53:41 +00:00
|
|
|
return TRUE;
|
2012-08-01 13:44:02 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static gboolean
|
2014-07-25 14:53:41 +00:00
|
|
|
gst_vaapi_window_drm_create (GstVaapiWindow * window,
|
|
|
|
guint * width, guint * height)
|
2012-08-01 13:44:02 +00:00
|
|
|
{
|
2014-07-25 14:53:41 +00:00
|
|
|
return TRUE;
|
2012-08-01 13:44:02 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static gboolean
|
2014-07-25 14:53:41 +00:00
|
|
|
gst_vaapi_window_drm_resize (GstVaapiWindow * window, guint width, guint height)
|
2012-08-01 13:44:02 +00:00
|
|
|
{
|
2014-07-25 14:53:41 +00:00
|
|
|
return TRUE;
|
2012-08-01 13:44:02 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static gboolean
|
2014-07-25 14:53:41 +00:00
|
|
|
gst_vaapi_window_drm_render (GstVaapiWindow * window,
|
|
|
|
GstVaapiSurface * surface,
|
|
|
|
const GstVaapiRectangle * src_rect,
|
|
|
|
const GstVaapiRectangle * dst_rect, guint flags)
|
2012-08-01 13:44:02 +00:00
|
|
|
{
|
2014-07-25 14:53:41 +00:00
|
|
|
return TRUE;
|
2012-08-01 13:44:02 +00:00
|
|
|
}
|
|
|
|
|
2018-12-22 17:02:38 +00:00
|
|
|
static void
|
2014-07-25 14:53:41 +00:00
|
|
|
gst_vaapi_window_drm_class_init (GstVaapiWindowDRMClass * klass)
|
2012-08-01 13:44:02 +00:00
|
|
|
{
|
2014-07-25 14:53:41 +00:00
|
|
|
GstVaapiWindowClass *const window_class = GST_VAAPI_WINDOW_CLASS (klass);
|
|
|
|
|
|
|
|
window_class->create = gst_vaapi_window_drm_create;
|
|
|
|
window_class->show = gst_vaapi_window_drm_show;
|
|
|
|
window_class->hide = gst_vaapi_window_drm_hide;
|
|
|
|
window_class->resize = gst_vaapi_window_drm_resize;
|
|
|
|
window_class->render = gst_vaapi_window_drm_render;
|
2012-08-01 13:44:02 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2018-12-22 17:02:38 +00:00
|
|
|
gst_vaapi_window_drm_init (GstVaapiWindowDRM * window)
|
2012-08-01 13:44:02 +00:00
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* gst_vaapi_window_drm_new:
|
|
|
|
* @display: a #GstVaapiDisplay
|
|
|
|
* @width: the requested window width, in pixels (unused)
|
|
|
|
* @height: the requested windo height, in pixels (unused)
|
|
|
|
*
|
|
|
|
* Creates a dummy window. The window will be attached to the @display.
|
|
|
|
* All rendering functions will return success since VA/DRM is a
|
|
|
|
* renderless API.
|
|
|
|
*
|
|
|
|
* Note: this dummy window object is only necessary to fulfill cases
|
|
|
|
* where the client application wants to automatically determine the
|
|
|
|
* best display to use for the current system. As such, it provides
|
|
|
|
* utility functions with the same API (function arguments) to help
|
|
|
|
* implement uniform function tables.
|
|
|
|
*
|
|
|
|
* Return value: the newly allocated #GstVaapiWindow object
|
|
|
|
*/
|
|
|
|
GstVaapiWindow *
|
2014-07-25 14:53:41 +00:00
|
|
|
gst_vaapi_window_drm_new (GstVaapiDisplay * display, guint width, guint height)
|
2012-08-01 13:44:02 +00:00
|
|
|
{
|
2014-07-25 14:53:41 +00:00
|
|
|
g_return_val_if_fail (GST_VAAPI_IS_DISPLAY_DRM (display), NULL);
|
2013-05-27 15:18:40 +00:00
|
|
|
|
2018-12-22 17:02:38 +00:00
|
|
|
return gst_vaapi_window_new_internal (GST_TYPE_VAAPI_WINDOW_DRM, display,
|
|
|
|
GST_VAAPI_ID_INVALID, width, height);
|
2012-08-01 13:44:02 +00:00
|
|
|
}
|