summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGeorge Kiagiadakis <george.kiagiadakis@collabora.co.uk>2011-01-08 20:32:58 +0200
committerGeorge Kiagiadakis <george.kiagiadakis@collabora.co.uk>2011-01-08 20:32:58 +0200
commitc1d12fd108fe8a48ec2c697deffc47c648a65d55 (patch)
treed6874804177264ebd26ed00b8ac28bd20cd8a6fc
parent9e8a84eb130a601b0b0621f75138884b50daf319 (diff)
Move the init functions in separate init{.h, .cpp} files in both libs and add capitalized headers for Init and Global where needed.
-rw-r--r--examples/echo/main.cpp2
-rw-r--r--examples/player/main.cpp2
-rw-r--r--src/QGlib/CMakeLists.txt3
-rw-r--r--src/QGlib/Global1
-rw-r--r--src/QGlib/Init1
-rw-r--r--src/QGlib/global.h4
-rw-r--r--src/QGlib/init.cpp2
-rw-r--r--src/QGlib/init.h31
-rw-r--r--src/QGst/CMakeLists.txt3
-rw-r--r--src/QGst/Init1
-rw-r--r--src/QGst/global.h25
-rw-r--r--src/QGst/init.cpp (renamed from src/QGst/global.cpp)3
-rw-r--r--src/QGst/init.h49
-rw-r--r--tests/auto/qgsttest.h2
-rw-r--r--tests/manual/qwidgetvideosinktest.cpp1
-rw-r--r--tests/manual/videoorientationtest.cpp1
-rw-r--r--tests/manual/videowidgettest.cpp1
17 files changed, 96 insertions, 36 deletions
diff --git a/examples/echo/main.cpp b/examples/echo/main.cpp
index 794e991..de5fbae 100644
--- a/examples/echo/main.cpp
+++ b/examples/echo/main.cpp
@@ -16,7 +16,7 @@
*/
#include <QGst/Pipeline>
#include <QGst/ElementFactory>
-#include <QGst/Global>
+#include <QGst/Init>
#include <QtCore/QCoreApplication>
#include <QtCore/QFile>
#include <signal.h>
diff --git a/examples/player/main.cpp b/examples/player/main.cpp
index 3fff254..492691f 100644
--- a/examples/player/main.cpp
+++ b/examples/player/main.cpp
@@ -20,7 +20,7 @@
#include <QtCore/QFile>
#include <QtCore/QTime>
#include <QGlib/Connect>
-#include <QGst/Global>
+#include <QGst/Init>
#include <QGst/Pipeline>
#include <QGst/ElementFactory>
#include <QGst/GhostPad>
diff --git a/src/QGlib/CMakeLists.txt b/src/QGlib/CMakeLists.txt
index 02b59b6..b440924 100644
--- a/src/QGlib/CMakeLists.txt
+++ b/src/QGlib/CMakeLists.txt
@@ -13,7 +13,8 @@ set(QtGLib_SRCS
)
set(QtGLib_INSTALLED_HEADERS
- global.h
+ global.h Global
+ init.h Init
quark.h Quark
type.h Type
refpointer.h RefPointer
diff --git a/src/QGlib/Global b/src/QGlib/Global
new file mode 100644
index 0000000..dc4f98a
--- /dev/null
+++ b/src/QGlib/Global
@@ -0,0 +1 @@
+#include "global.h"
diff --git a/src/QGlib/Init b/src/QGlib/Init
new file mode 100644
index 0000000..49ed94a
--- /dev/null
+++ b/src/QGlib/Init
@@ -0,0 +1 @@
+#include "init.h"
diff --git a/src/QGlib/global.h b/src/QGlib/global.h
index dacf421..314ed02 100644
--- a/src/QGlib/global.h
+++ b/src/QGlib/global.h
@@ -54,10 +54,6 @@ typedef RefPointer<ParamSpec> ParamSpecPtr;
class Object;
typedef RefPointer<Object> ObjectPtr;
-/*! Initializes the type system. You must call
- * this function before using any QtGLib API. */
-QTGLIB_EXPORT void init();
-
} //namespace QGlib
diff --git a/src/QGlib/init.cpp b/src/QGlib/init.cpp
index 016a82e..ab0cb7c 100644
--- a/src/QGlib/init.cpp
+++ b/src/QGlib/init.cpp
@@ -15,7 +15,7 @@
You should have received a copy of the GNU Lesser General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-#include "global.h"
+#include "init.h"
#include <glib-object.h>
namespace QGlib {
diff --git a/src/QGlib/init.h b/src/QGlib/init.h
new file mode 100644
index 0000000..de234b6
--- /dev/null
+++ b/src/QGlib/init.h
@@ -0,0 +1,31 @@
+/*
+ Copyright (C) 2011 Collabora Ltd.
+ @author George Kiagiadakis <george.kiagiadakis@collabora.co.uk>
+
+ 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 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 Lesser General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>.
+*/
+#ifndef QGLIB_INIT_H
+#define QGLIB_INIT_H
+
+#include "global.h"
+
+namespace QGlib {
+
+ /*! Initializes the type system. You must call
+ * this function before using any QtGLib API. */
+ QTGLIB_EXPORT void init();
+
+} //namespace QGlib
+
+#endif //QGLIB_INIT_H
diff --git a/src/QGst/CMakeLists.txt b/src/QGst/CMakeLists.txt
index 9e0822b..5f51d5a 100644
--- a/src/QGst/CMakeLists.txt
+++ b/src/QGst/CMakeLists.txt
@@ -1,5 +1,5 @@
set(QtGStreamer_SRCS
- global.cpp
+ init.cpp
objectstore.cpp
value.cpp
structure.cpp
@@ -36,6 +36,7 @@ set(QtGStreamerUi_SRCS
set(QtGStreamer_INSTALLED_HEADERS
global.h Global
+ init.h Init
enums.h
structs.h Fourcc
Fraction
diff --git a/src/QGst/Init b/src/QGst/Init
new file mode 100644
index 0000000..49ed94a
--- /dev/null
+++ b/src/QGst/Init
@@ -0,0 +1 @@
+#include "init.h"
diff --git a/src/QGst/global.h b/src/QGst/global.h
index a1437cf..cb25c7a 100644
--- a/src/QGst/global.h
+++ b/src/QGst/global.h
@@ -178,29 +178,4 @@ namespace QGst {
typedef qint64 ClockTimeDiff;
}
-namespace QGst {
- /*! \overload */
- QTGSTREAMER_EXPORT void init();
-
- /*! Initializes the GStreamer library, setting up internal path lists,
- * registering built-in elements, and loading standard plugins.
- * \note This function also calls QGlib::init(),
- * so there is no need to call it explicitly.
- * \param argc pointer to the application's argc
- * \param argv pointer to the application's argv
- * \throws QGlib::Error when initialization fails
- */
- QTGSTREAMER_EXPORT void init(int *argc, char **argv[]);
-
- /*! Clean up any resources created by GStreamer in init().
- *
- * It is normally not needed to call this function in a normal application as the resources
- * will automatically be freed when the program terminates. This function is therefore mostly
- * used by testsuites and other memory profiling tools.
- *
- * After this call GStreamer (including this method) should not be used anymore.
- */
- QTGSTREAMER_EXPORT void cleanup();
-}
-
#endif
diff --git a/src/QGst/global.cpp b/src/QGst/init.cpp
index 9299db0..aa17d3d 100644
--- a/src/QGst/global.cpp
+++ b/src/QGst/init.cpp
@@ -14,7 +14,8 @@
You should have received a copy of the GNU Lesser General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-#include "global.h"
+#include "init.h"
+#include "../QGlib/init.h"
#include "../QGlib/error.h"
#include <gst/gst.h>
diff --git a/src/QGst/init.h b/src/QGst/init.h
new file mode 100644
index 0000000..3ec4d90
--- /dev/null
+++ b/src/QGst/init.h
@@ -0,0 +1,49 @@
+/*
+ Copyright (C) 2010 George Kiagiadakis <kiagiadakis.george@gmail.com>
+
+ 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 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 Lesser General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>.
+*/
+#ifndef QGST_INIT_H
+#define QGST_INIT_H
+
+#include "global.h"
+
+namespace QGst {
+
+ /*! \overload */
+ QTGSTREAMER_EXPORT void init();
+
+ /*! Initializes the GStreamer library, setting up internal path lists,
+ * registering built-in elements, and loading standard plugins.
+ * \note This function also calls QGlib::init(),
+ * so there is no need to call it explicitly.
+ * \param argc pointer to the application's argc
+ * \param argv pointer to the application's argv
+ * \throws QGlib::Error when initialization fails
+ */
+ QTGSTREAMER_EXPORT void init(int *argc, char **argv[]);
+
+ /*! Clean up any resources created by GStreamer in init().
+ *
+ * It is normally not needed to call this function in a normal application as the resources
+ * will automatically be freed when the program terminates. This function is therefore mostly
+ * used by testsuites and other memory profiling tools.
+ *
+ * After this call GStreamer (including this method) should not be used anymore.
+ */
+ QTGSTREAMER_EXPORT void cleanup();
+
+} //namespace QGst
+
+#endif //QGST_INIT_H
diff --git a/tests/auto/qgsttest.h b/tests/auto/qgsttest.h
index 27652cb..99a82d4 100644
--- a/tests/auto/qgsttest.h
+++ b/tests/auto/qgsttest.h
@@ -18,7 +18,7 @@
#define QGSTTEST_H
#include <QtTest/QtTest>
-#include <QGst/Global>
+#include <QGst/Init>
#include <gst/gst.h>
class QGstTest : public QObject
diff --git a/tests/manual/qwidgetvideosinktest.cpp b/tests/manual/qwidgetvideosinktest.cpp
index 2a95d36..d0da26f 100644
--- a/tests/manual/qwidgetvideosinktest.cpp
+++ b/tests/manual/qwidgetvideosinktest.cpp
@@ -15,6 +15,7 @@
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "ui_qwidgetvideosinktest.h"
+#include <QGst/Init>
#include <QGst/Pipeline>
#include <QGst/ElementFactory>
#include <QtGui/QApplication>
diff --git a/tests/manual/videoorientationtest.cpp b/tests/manual/videoorientationtest.cpp
index a71dfc3..51542db 100644
--- a/tests/manual/videoorientationtest.cpp
+++ b/tests/manual/videoorientationtest.cpp
@@ -16,6 +16,7 @@
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "ui_videoorientationtest.h"
+#include <QGst/Init>
#include <QGst/Pipeline>
#include <QGst/ElementFactory>
#include <QGst/VideoOrientation>
diff --git a/tests/manual/videowidgettest.cpp b/tests/manual/videowidgettest.cpp
index 747e1da..cd830a3 100644
--- a/tests/manual/videowidgettest.cpp
+++ b/tests/manual/videowidgettest.cpp
@@ -15,6 +15,7 @@
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "ui_videowidgettest.h"
+#include <QGst/Init>
#include <QGst/Pipeline>
#include <QGst/ElementFactory>
#include <QtGui/QApplication>