<chapter>
<title>GStreamer VA-API Plugins Library</title>
+ <xi:include href="xml/gstvaapitypes.xml"/>
<xi:include href="xml/gstvaapidisplay.xml"/>
<xi:include href="xml/gstvaapidisplay_x11.xml"/>
<xi:include href="xml/gstvaapiwindow.xml"/>
</SECTION>
<SECTION>
+<FILE>gstvaapitypes</FILE>
+<TITLE>Basic data structures</TITLE>
+GstVaapiPoint
+GstVaapiRectangle
+</SECTION>
+
+<SECTION>
<FILE>gstvaapiwindow</FILE>
<TITLE>GstVaapiWindow</TITLE>
GstVaapiWindow
gstvaapisubpicture.h \
gstvaapisurface.h \
gstvaapisurfacepool.h \
+ gstvaapitypes.h \
gstvaapivideobuffer.h \
gstvaapivideopool.h \
gstvaapivideosink.h \
--- /dev/null
+/*
+ * gstvaapitypes.h - Misc types
+ *
+ * gstreamer-vaapi (C) 2010 Splitted-Desktop Systems
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+#ifndef GST_VAAPI_TYPES_H
+#define GST_VAAPI_TYPES_H
+
+#include <glib/gtypes.h>
+
+G_BEGIN_DECLS
+
+/**
+ * GstVaapiPoint:
+ * @x: X coordinate
+ * @y: Y coordinate
+ *
+ * A location within a surface.
+ */
+typedef struct _GstVaapiPoint GstVaapiPoint;
+struct _GstVaapiPoint {
+ guint32 x;
+ guint32 y;
+};
+
+/**
+ * GstVaapiRectangle:
+ * @x: X coordinate
+ * @y: Y coordinate
+ * @width: region width
+ * @height: region height
+ *
+ * A rectangle region within a surface.
+ */
+typedef struct _GstVaapiRectangle GstVaapiRectangle;
+struct _GstVaapiRectangle {
+ guint32 x;
+ guint32 y;
+ guint32 width;
+ guint32 height;
+};
+
+G_END_DECLS
+
+#endif /* GST_VAAPI_TYPES_H */
}
static inline void
-get_surface_rect(GstVaapiSurface *surface, GstVideoRectangle *rect)
+get_surface_rect(GstVaapiSurface *surface, GstVaapiRectangle *rect)
{
guint width, height;
gst_vaapi_surface_get_size(surface, &width, &height);
- rect->x = 0;
- rect->y = 0;
- rect->w = width;
- rect->h = height;
+ rect->x = 0;
+ rect->y = 0;
+ rect->width = width;
+ rect->height = height;
}
static inline void
-get_window_rect(GstVaapiWindow *window, GstVideoRectangle *rect)
+get_window_rect(GstVaapiWindow *window, GstVaapiRectangle *rect)
{
guint width, height;
gst_vaapi_window_get_size(window, &width, &height);
- rect->x = 0;
- rect->y = 0;
- rect->w = width;
- rect->h = height;
+ rect->x = 0;
+ rect->y = 0;
+ rect->width = width;
+ rect->height = height;
}
/**
gst_vaapi_window_put_surface(
GstVaapiWindow *window,
GstVaapiSurface *surface,
- const GstVideoRectangle *src_rect,
- const GstVideoRectangle *dst_rect,
+ const GstVaapiRectangle *src_rect,
+ const GstVaapiRectangle *dst_rect,
guint flags
)
{
- GstVideoRectangle src_rect_default, dst_rect_default;
+ GstVaapiRectangle src_rect_default, dst_rect_default;
g_return_val_if_fail(GST_VAAPI_IS_WINDOW(window), FALSE);
g_return_val_if_fail(window->priv->is_constructed, FALSE);
#define GST_VAAPI_WINDOW_H
#include <gst/video/gstvideosink.h>
+#include <gst/vaapi/gstvaapitypes.h>
#include <gst/vaapi/gstvaapidisplay.h>
#include <gst/vaapi/gstvaapisurface.h>
gboolean (*resize) (GstVaapiWindow *window, guint width, guint height);
gboolean (*render) (GstVaapiWindow *window,
GstVaapiSurface *surface,
- const GstVideoRectangle *src_rect,
- const GstVideoRectangle *dst_rect,
+ const GstVaapiRectangle *src_rect,
+ const GstVaapiRectangle *dst_rect,
guint flags);
};
gst_vaapi_window_put_surface(
GstVaapiWindow *window,
GstVaapiSurface *surface,
- const GstVideoRectangle *src_rect,
- const GstVideoRectangle *dst_rect,
+ const GstVaapiRectangle *src_rect,
+ const GstVaapiRectangle *dst_rect,
guint flags
);
gst_vaapi_window_x11_render(
GstVaapiWindow *window,
GstVaapiSurface *surface,
- const GstVideoRectangle *src_rect,
- const GstVideoRectangle *dst_rect,
+ const GstVaapiRectangle *src_rect,
+ const GstVaapiRectangle *dst_rect,
guint flags
)
{
GST_VAAPI_WINDOW_X11(window)->priv->xid,
src_rect->x,
src_rect->y,
- src_rect->w,
- src_rect->h,
+ src_rect->width,
+ src_rect->height,
dst_rect->x,
dst_rect->y,
- dst_rect->w,
- dst_rect->h,
+ dst_rect->width,
+ dst_rect->height,
NULL, 0,
get_PutSurface_flags_from_GstVaapiSurfaceRenderFlags(flags)
);
{
GstVaapiSink * const sink = GST_VAAPISINK(base_sink);
GstStructure * const structure = gst_caps_get_structure(caps, 0);
- GstVideoRectangle * const win_rect = &sink->window_rect;
+ GstVaapiRectangle * const win_rect = &sink->window_rect;
guint num, den;
guint win_width, win_height;
guint display_width, display_height, display_par_n, display_par_d;
GST_DEBUG("window size %ux%u", win_width, win_height);
if (sink->fullscreen) {
- win_rect->x = (display_width - win_width) / 2;
- win_rect->y = (display_height - win_height) / 2;
+ win_rect->x = (display_width - win_width) / 2;
+ win_rect->y = (display_height - win_height) / 2;
}
else {
- win_rect->x = 0;
- win_rect->y = 0;
+ win_rect->x = 0;
+ win_rect->y = 0;
}
- win_rect->w = win_width;
- win_rect->h = win_height;
+ win_rect->width = win_width;
+ win_rect->height = win_height;
if (sink->window)
gst_vaapi_window_set_size(sink->window, win_width, win_height);
gchar *display_name;
GstVaapiDisplay *display;
GstVaapiWindow *window;
- GstVideoRectangle window_rect;
+ GstVaapiRectangle window_rect;
guint fullscreen : 1;
};