From 6b56ca0068321b7688dde0b49c5110295b2edf43 Mon Sep 17 00:00:00 2001 From: gb Date: Thu, 1 Apr 2010 09:47:59 +0000 Subject: [PATCH] Move GST_VAAPI_DISPLAY_VADISPLAY() and GST_VAAPI_DISPLAY_{LOCK,UNLOCK}() to gstvaapidisplay_priv.h. --- gst-libs/gst/vaapi/Makefile.am | 2 + gst-libs/gst/vaapi/gstvaapi_priv.h | 27 +++++++ gst-libs/gst/vaapi/gstvaapidisplay.c | 21 +----- gst-libs/gst/vaapi/gstvaapidisplay.h | 27 ------- gst-libs/gst/vaapi/gstvaapidisplay_glx.c | 1 + gst-libs/gst/vaapi/gstvaapidisplay_priv.h | 85 +++++++++++++++++++++++ gst-libs/gst/vaapi/gstvaapidisplay_x11.c | 1 + gst-libs/gst/vaapi/gstvaapiimage.c | 2 +- gst-libs/gst/vaapi/gstvaapiobject.c | 2 +- gst-libs/gst/vaapi/gstvaapisubpicture.c | 2 +- gst-libs/gst/vaapi/gstvaapisurface.c | 2 +- gst-libs/gst/vaapi/gstvaapitexture.c | 2 +- gst-libs/gst/vaapi/gstvaapiwindow.c | 2 +- gst-libs/gst/vaapi/gstvaapiwindow_glx.c | 2 +- gst-libs/gst/vaapi/gstvaapiwindow_x11.c | 2 +- 15 files changed, 125 insertions(+), 55 deletions(-) create mode 100644 gst-libs/gst/vaapi/gstvaapi_priv.h create mode 100644 gst-libs/gst/vaapi/gstvaapidisplay_priv.h diff --git a/gst-libs/gst/vaapi/Makefile.am b/gst-libs/gst/vaapi/Makefile.am index e650c85882..3a9295bf0c 100644 --- a/gst-libs/gst/vaapi/Makefile.am +++ b/gst-libs/gst/vaapi/Makefile.am @@ -50,8 +50,10 @@ libgstvaapi_source_h = \ libgstvaapi_source_priv_h = \ gstvaapicompat.h \ gstvaapidebug.h \ + gstvaapidisplay_priv.h \ gstvaapiobject_priv.h \ gstvaapiutils.h \ + gstvaapi_priv.h \ $(NULL) libgstvaapi_x11_source_c = \ diff --git a/gst-libs/gst/vaapi/gstvaapi_priv.h b/gst-libs/gst/vaapi/gstvaapi_priv.h new file mode 100644 index 0000000000..fa8ce58514 --- /dev/null +++ b/gst-libs/gst/vaapi/gstvaapi_priv.h @@ -0,0 +1,27 @@ +/* + * gstvaapi_priv.h - Helper to include all private headers + * + * 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_PRIV_H +#define GST_VAAPI_PRIV_H + +#include +#include + +#endif /* GST_VAAPI_PRIV_H */ diff --git a/gst-libs/gst/vaapi/gstvaapidisplay.c b/gst-libs/gst/vaapi/gstvaapidisplay.c index ff10126e8e..d879a18305 100644 --- a/gst-libs/gst/vaapi/gstvaapidisplay.c +++ b/gst-libs/gst/vaapi/gstvaapidisplay.c @@ -26,6 +26,7 @@ #include "config.h" #include "gstvaapiutils.h" #include "gstvaapidisplay.h" +#include "gstvaapidisplay_priv.h" #define DEBUG 1 #include "gstvaapidebug.h" @@ -34,26 +35,6 @@ GST_DEBUG_CATEGORY(gst_debug_vaapi); G_DEFINE_TYPE(GstVaapiDisplay, gst_vaapi_display, G_TYPE_OBJECT); -#define GST_VAAPI_DISPLAY_GET_PRIVATE(obj) \ - (G_TYPE_INSTANCE_GET_PRIVATE((obj), \ - GST_VAAPI_TYPE_DISPLAY, \ - GstVaapiDisplayPrivate)) - -struct _GstVaapiDisplayPrivate { - GStaticMutex mutex; - VADisplay display; - guint width; - guint height; - guint width_mm; - guint height_mm; - guint par_n; - guint par_d; - GArray *profiles; - GArray *image_formats; - GArray *subpicture_formats; - guint create_display : 1; -}; - enum { PROP_0, diff --git a/gst-libs/gst/vaapi/gstvaapidisplay.h b/gst-libs/gst/vaapi/gstvaapidisplay.h index e654be63ee..8f605f8d07 100644 --- a/gst-libs/gst/vaapi/gstvaapidisplay.h +++ b/gst-libs/gst/vaapi/gstvaapidisplay.h @@ -56,33 +56,6 @@ G_BEGIN_DECLS GST_VAAPI_TYPE_DISPLAY, \ GstVaapiDisplayClass)) -/** - * GST_VAAPI_DISPLAY_VADISPLAY: - * @display: a #GstVaapiDisplay - * - * Macro that evaluates to the #VADisplay bound to @display - */ -#define GST_VAAPI_DISPLAY_VADISPLAY(display) \ - gst_vaapi_display_get_display(display) - -/** - * GST_VAAPI_DISPLAY_LOCK: - * @display: a #GstVaapiDisplay - * - * Locks @display - */ -#define GST_VAAPI_DISPLAY_LOCK(display) \ - gst_vaapi_display_lock(display) - -/** - * GST_VAAPI_DISPLAY_UNLOCK: - * @display: a #GstVaapiDisplay - * - * Unlocks @display - */ -#define GST_VAAPI_DISPLAY_UNLOCK(display) \ - gst_vaapi_display_unlock(display) - typedef struct _GstVaapiDisplay GstVaapiDisplay; typedef struct _GstVaapiDisplayPrivate GstVaapiDisplayPrivate; typedef struct _GstVaapiDisplayClass GstVaapiDisplayClass; diff --git a/gst-libs/gst/vaapi/gstvaapidisplay_glx.c b/gst-libs/gst/vaapi/gstvaapidisplay_glx.c index c4722d3081..d6d4e46f4f 100644 --- a/gst-libs/gst/vaapi/gstvaapidisplay_glx.c +++ b/gst-libs/gst/vaapi/gstvaapidisplay_glx.c @@ -27,6 +27,7 @@ #include "gstvaapicompat.h" #include "gstvaapiutils.h" #include "gstvaapidisplay_glx.h" +#include "gstvaapidisplay_priv.h" #define DEBUG 1 #include "gstvaapidebug.h" diff --git a/gst-libs/gst/vaapi/gstvaapidisplay_priv.h b/gst-libs/gst/vaapi/gstvaapidisplay_priv.h new file mode 100644 index 0000000000..7cc40fdfec --- /dev/null +++ b/gst-libs/gst/vaapi/gstvaapidisplay_priv.h @@ -0,0 +1,85 @@ +/* + * gstvaapidisplay_priv.h - Base VA display (private definitions) + * + * 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_DISPLAY_PRIV_H +#define GST_VAAPI_DISPLAY_PRIV_H + +#include + +G_BEGIN_DECLS + +#define GST_VAAPI_DISPLAY_GET_PRIVATE(obj) \ + (G_TYPE_INSTANCE_GET_PRIVATE((obj), \ + GST_VAAPI_TYPE_DISPLAY, \ + GstVaapiDisplayPrivate)) + +#define GST_VAAPI_DISPLAY_CAST(display) ((GstVaapiDisplay *)(display)) + +/** + * GST_VAAPI_DISPLAY_VADISPLAY: + * @display_: a #GstVaapiDisplay + * + * Macro that evaluates to the #VADisplay of @display. + * This is an internal macro that does not do any run-time type check. + */ +#define GST_VAAPI_DISPLAY_VADISPLAY(display_) \ + GST_VAAPI_DISPLAY_CAST(display_)->priv->display + +/** + * GST_VAAPI_DISPLAY_LOCK: + * @display: a #GstVaapiDisplay + * + * Locks @display + */ +#define GST_VAAPI_DISPLAY_LOCK(display) \ + gst_vaapi_display_lock(display) + +/** + * GST_VAAPI_DISPLAY_UNLOCK: + * @display: a #GstVaapiDisplay + * + * Unlocks @display + */ +#define GST_VAAPI_DISPLAY_UNLOCK(display) \ + gst_vaapi_display_unlock(display) + +/** + * GstVaapiDisplayPrivate: + * + * Base class for VA displays. + */ +struct _GstVaapiDisplayPrivate { + GStaticMutex mutex; + VADisplay display; + guint width; + guint height; + guint width_mm; + guint height_mm; + guint par_n; + guint par_d; + GArray *profiles; + GArray *image_formats; + GArray *subpicture_formats; + guint create_display : 1; +}; + +G_END_DECLS + +#endif /* GST_VAAPI_DISPLAY_PRIV_H */ diff --git a/gst-libs/gst/vaapi/gstvaapidisplay_x11.c b/gst-libs/gst/vaapi/gstvaapidisplay_x11.c index ebfa14b70b..b0f6bdfd44 100644 --- a/gst-libs/gst/vaapi/gstvaapidisplay_x11.c +++ b/gst-libs/gst/vaapi/gstvaapidisplay_x11.c @@ -26,6 +26,7 @@ #include "config.h" #include "gstvaapiutils.h" #include "gstvaapidisplay_x11.h" +#include "gstvaapidisplay_priv.h" #define DEBUG 1 #include "gstvaapidebug.h" diff --git a/gst-libs/gst/vaapi/gstvaapiimage.c b/gst-libs/gst/vaapi/gstvaapiimage.c index d21bda2bec..3cc2251238 100644 --- a/gst-libs/gst/vaapi/gstvaapiimage.c +++ b/gst-libs/gst/vaapi/gstvaapiimage.c @@ -28,7 +28,7 @@ #include "gstvaapicompat.h" #include "gstvaapiutils.h" #include "gstvaapiimage.h" -#include "gstvaapiobject_priv.h" +#include "gstvaapi_priv.h" #define DEBUG 1 #include "gstvaapidebug.h" diff --git a/gst-libs/gst/vaapi/gstvaapiobject.c b/gst-libs/gst/vaapi/gstvaapiobject.c index 9c627b8c6c..368166f96d 100644 --- a/gst-libs/gst/vaapi/gstvaapiobject.c +++ b/gst-libs/gst/vaapi/gstvaapiobject.c @@ -25,7 +25,7 @@ #include "config.h" #include "gstvaapiobject.h" -#include "gstvaapiobject_priv.h" +#include "gstvaapi_priv.h" #include "gstvaapiparamspecs.h" #include "gstvaapivalue.h" #include "gstvaapimarshal.h" diff --git a/gst-libs/gst/vaapi/gstvaapisubpicture.c b/gst-libs/gst/vaapi/gstvaapisubpicture.c index 4566a321b2..ae79b7842b 100644 --- a/gst-libs/gst/vaapi/gstvaapisubpicture.c +++ b/gst-libs/gst/vaapi/gstvaapisubpicture.c @@ -28,7 +28,7 @@ #include "gstvaapicompat.h" #include "gstvaapiutils.h" #include "gstvaapisubpicture.h" -#include "gstvaapiobject_priv.h" +#include "gstvaapi_priv.h" #define DEBUG 1 #include "gstvaapidebug.h" diff --git a/gst-libs/gst/vaapi/gstvaapisurface.c b/gst-libs/gst/vaapi/gstvaapisurface.c index 635f111bc8..08269a8040 100644 --- a/gst-libs/gst/vaapi/gstvaapisurface.c +++ b/gst-libs/gst/vaapi/gstvaapisurface.c @@ -28,7 +28,7 @@ #include "gstvaapiutils.h" #include "gstvaapisurface.h" #include "gstvaapiimage.h" -#include "gstvaapiobject_priv.h" +#include "gstvaapi_priv.h" #define DEBUG 1 #include "gstvaapidebug.h" diff --git a/gst-libs/gst/vaapi/gstvaapitexture.c b/gst-libs/gst/vaapi/gstvaapitexture.c index 155d7d4bed..92f9994d14 100644 --- a/gst-libs/gst/vaapi/gstvaapitexture.c +++ b/gst-libs/gst/vaapi/gstvaapitexture.c @@ -29,7 +29,7 @@ #include "gstvaapiutils.h" #include "gstvaapiutils_glx.h" #include "gstvaapidisplay_glx.h" -#include "gstvaapiobject_priv.h" +#include "gstvaapi_priv.h" #define DEBUG 1 #include "gstvaapidebug.h" diff --git a/gst-libs/gst/vaapi/gstvaapiwindow.c b/gst-libs/gst/vaapi/gstvaapiwindow.c index 5f521d4cae..8e5e58b654 100644 --- a/gst-libs/gst/vaapi/gstvaapiwindow.c +++ b/gst-libs/gst/vaapi/gstvaapiwindow.c @@ -25,7 +25,7 @@ #include "config.h" #include "gstvaapiwindow.h" -#include "gstvaapiobject_priv.h" +#include "gstvaapi_priv.h" #define DEBUG 1 #include "gstvaapidebug.h" diff --git a/gst-libs/gst/vaapi/gstvaapiwindow_glx.c b/gst-libs/gst/vaapi/gstvaapiwindow_glx.c index bd905e95c4..d050c4f6f2 100644 --- a/gst-libs/gst/vaapi/gstvaapiwindow_glx.c +++ b/gst-libs/gst/vaapi/gstvaapiwindow_glx.c @@ -28,7 +28,7 @@ #include "gstvaapidisplay_x11.h" #include "gstvaapiutils_x11.h" #include "gstvaapiutils_glx.h" -#include "gstvaapiobject_priv.h" +#include "gstvaapi_priv.h" #define DEBUG 1 #include "gstvaapidebug.h" diff --git a/gst-libs/gst/vaapi/gstvaapiwindow_x11.c b/gst-libs/gst/vaapi/gstvaapiwindow_x11.c index f10860c581..f2ffbefadc 100644 --- a/gst-libs/gst/vaapi/gstvaapiwindow_x11.c +++ b/gst-libs/gst/vaapi/gstvaapiwindow_x11.c @@ -31,7 +31,7 @@ #include "gstvaapidisplay_x11.h" #include "gstvaapiutils.h" #include "gstvaapiutils_x11.h" -#include "gstvaapiobject_priv.h" +#include "gstvaapi_priv.h" #define DEBUG 1 #include "gstvaapidebug.h"