Add GstVaapiPoint & GstVaapiRectangle data structures.
authorgb <gb@5584edef-b1fe-4b99-b61b-dd2bab72e969>
Mon, 22 Mar 2010 12:16:47 +0000 (12:16 +0000)
committergb <gb@5584edef-b1fe-4b99-b61b-dd2bab72e969>
Mon, 22 Mar 2010 12:16:47 +0000 (12:16 +0000)
docs/reference/libs/libs-docs.xml.in
docs/reference/libs/libs-sections.txt
gst-libs/gst/vaapi/Makefile.am
gst-libs/gst/vaapi/gstvaapitypes.h [new file with mode: 0644]
gst-libs/gst/vaapi/gstvaapiwindow.c
gst-libs/gst/vaapi/gstvaapiwindow.h
gst-libs/gst/vaapi/gstvaapiwindow_x11.c
sys/vaapisink/gstvaapisink.c
sys/vaapisink/gstvaapisink.h

index c9683ac..48fccf2 100644 (file)
@@ -11,6 +11,7 @@
 
   <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"/>
index a6b14a3..852bd32 100644 (file)
@@ -155,6 +155,13 @@ GST_VAAPI_VIDEO_BUFFER_GET_CLASS
 </SECTION>
 
 <SECTION>
+<FILE>gstvaapitypes</FILE>
+<TITLE>Basic data structures</TITLE>
+GstVaapiPoint
+GstVaapiRectangle
+</SECTION>
+
+<SECTION>
 <FILE>gstvaapiwindow</FILE>
 <TITLE>GstVaapiWindow</TITLE>
 GstVaapiWindow
index 25386c6..e9e47de 100644 (file)
@@ -29,6 +29,7 @@ libgstvaapi_source_h =                                \
        gstvaapisubpicture.h                    \
        gstvaapisurface.h                       \
        gstvaapisurfacepool.h                   \
+       gstvaapitypes.h                         \
        gstvaapivideobuffer.h                   \
        gstvaapivideopool.h                     \
        gstvaapivideosink.h                     \
diff --git a/gst-libs/gst/vaapi/gstvaapitypes.h b/gst-libs/gst/vaapi/gstvaapitypes.h
new file mode 100644 (file)
index 0000000..97dd598
--- /dev/null
@@ -0,0 +1,60 @@
+/*
+ *  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 */
index 58121ac..2348540 100644 (file)
@@ -349,27 +349,27 @@ gst_vaapi_window_set_size(GstVaapiWindow *window, guint width, guint height)
 }
 
 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;
 }
 
 /**
@@ -394,12 +394,12 @@ gboolean
 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);
index 804b035..d1db986 100644 (file)
@@ -22,6 +22,7 @@
 #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>
 
@@ -92,8 +93,8 @@ struct _GstVaapiWindowClass {
     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);
 };
 
@@ -131,8 +132,8 @@ gboolean
 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
 );
 
index c0b1f0c..c7474e8 100644 (file)
@@ -279,8 +279,8 @@ static gboolean
 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
 )
 {
@@ -303,12 +303,12 @@ gst_vaapi_window_x11_render(
         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)
     );
index 8a6d1d6..a89dce8 100644 (file)
@@ -141,7 +141,7 @@ gst_vaapisink_set_caps(GstBaseSink *base_sink, GstCaps *caps)
 {
     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;
@@ -202,15 +202,15 @@ gst_vaapisink_set_caps(GstBaseSink *base_sink, GstCaps *caps)
     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);
index 8f27191..d6ff8f3 100644 (file)
@@ -62,7 +62,7 @@ struct _GstVaapiSink {
     gchar              *display_name;
     GstVaapiDisplay    *display;
     GstVaapiWindow     *window;
-    GstVideoRectangle   window_rect;
+    GstVaapiRectangle   window_rect;
     guint               fullscreen      : 1;
 };