2 * gstvaapiwindow_drm.c - VA/DRM window abstraction
4 * Copyright (C) 2012 Intel Corporation
6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public License
8 * as published by the Free Software Foundation; either version 2.1
9 * of the License, or (at your option) any later version.
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 * Lesser General Public License for more details.
16 * You should have received a copy of the GNU Lesser 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
23 * SECTION:gstvaapiwindow_drm
24 * @short_description: VA/DRM dummy window abstraction
28 #include "gstvaapiwindow_drm.h"
31 #include "gstvaapidebug.h"
33 G_DEFINE_TYPE(GstVaapiWindowDRM,
35 GST_VAAPI_TYPE_WINDOW);
38 gst_vaapi_window_drm_show(GstVaapiWindow *window)
44 gst_vaapi_window_drm_hide(GstVaapiWindow *window)
50 gst_vaapi_window_drm_create(
51 GstVaapiWindow *window,
60 gst_vaapi_window_drm_destroy(GstVaapiWindow * window)
65 gst_vaapi_window_drm_resize(
66 GstVaapiWindow * window,
75 gst_vaapi_window_drm_render(
76 GstVaapiWindow *window,
77 GstVaapiSurface *surface,
78 const GstVaapiRectangle *src_rect,
79 const GstVaapiRectangle *dst_rect,
87 gst_vaapi_window_drm_finalize(GObject *object)
89 G_OBJECT_CLASS(gst_vaapi_window_drm_parent_class)->finalize(object);
93 gst_vaapi_window_drm_constructed(GObject *object)
95 GObjectClass *parent_class;
97 parent_class = G_OBJECT_CLASS(gst_vaapi_window_drm_parent_class);
98 if (parent_class->constructed)
99 parent_class->constructed(object);
103 gst_vaapi_window_drm_class_init(GstVaapiWindowDRMClass * klass)
105 GObjectClass * const object_class = G_OBJECT_CLASS(klass);
106 GstVaapiWindowClass * const window_class = GST_VAAPI_WINDOW_CLASS(klass);
108 object_class->finalize = gst_vaapi_window_drm_finalize;
109 object_class->constructed = gst_vaapi_window_drm_constructed;
111 window_class->create = gst_vaapi_window_drm_create;
112 window_class->destroy = gst_vaapi_window_drm_destroy;
113 window_class->show = gst_vaapi_window_drm_show;
114 window_class->hide = gst_vaapi_window_drm_hide;
115 window_class->render = gst_vaapi_window_drm_render;
116 window_class->resize = gst_vaapi_window_drm_resize;
120 gst_vaapi_window_drm_init(GstVaapiWindowDRM * window)
125 * gst_vaapi_window_drm_new:
126 * @display: a #GstVaapiDisplay
127 * @width: the requested window width, in pixels (unused)
128 * @height: the requested windo height, in pixels (unused)
130 * Creates a dummy window. The window will be attached to the @display.
131 * All rendering functions will return success since VA/DRM is a
134 * Note: this dummy window object is only necessary to fulfill cases
135 * where the client application wants to automatically determine the
136 * best display to use for the current system. As such, it provides
137 * utility functions with the same API (function arguments) to help
138 * implement uniform function tables.
140 * Return value: the newly allocated #GstVaapiWindow object
143 gst_vaapi_window_drm_new(
144 GstVaapiDisplay *display,
149 GST_DEBUG("new window, size %ux%u", width, height);
151 g_return_val_if_fail(GST_VAAPI_IS_DISPLAY(display), NULL);
152 g_return_val_if_fail(width > 0, NULL);
153 g_return_val_if_fail(height > 0, NULL);
155 return g_object_new(GST_VAAPI_TYPE_WINDOW_DRM,
157 "id", GST_VAAPI_ID(0),