summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGeorge Kiagiadakis <george.kiagiadakis@collabora.co.uk>2011-01-16 18:04:30 +0200
committerGeorge Kiagiadakis <george.kiagiadakis@collabora.co.uk>2011-01-16 20:20:20 +0200
commitdd204c28fca82a4302e158596bc8cf33b8ea68ee (patch)
treeae7a70e6defad710fbe4ac2943d3b64c76b9a133
parentccebff59866cad0938fb2432b8ecb5df02e2b20e (diff)
Add skeleton for the new QtGStreamerUtils library.
-rw-r--r--cmake/modules/FindQtGStreamer.cmake14
-rw-r--r--src/QGst/CMakeLists.txt12
-rw-r--r--src/QGst/QtGStreamerUtils-0.10.pc.in11
-rw-r--r--src/QGst/Utils/global.h37
-rw-r--r--src/main.dox13
-rw-r--r--tests/compilation/CMakeLists.txt1
-rw-r--r--tests/compilation/RunCompilationTests.cmake1
7 files changed, 87 insertions, 2 deletions
diff --git a/cmake/modules/FindQtGStreamer.cmake b/cmake/modules/FindQtGStreamer.cmake
index 4762089..4c7d3f4 100644
--- a/cmake/modules/FindQtGStreamer.cmake
+++ b/cmake/modules/FindQtGStreamer.cmake
@@ -10,6 +10,8 @@
# QTGSTREAMER_LIBRARIES - the libraries needed to use QtGStreamer
# QTGSTREAMER_UI_LIBRARY - the QtGStreamerUi library
# QTGSTREAMER_UI_LIBRARIES - the libraries needed to use QtGStreamerUi
+# QTGSTREAMER_UTILS_LIBRARY - the QtGStreamerUtils library
+# QTGSTREAMER_UTILS_LIBRARIES - the libraries needed to use QtGStreamerUtils
# QTGSTREAMER_DEFINITIONS - definitions recommended for using QtGStreamer
# QTGSTREAMER_FLAGS - extra compiler switches recommended for using QtGStreamer
#
@@ -32,6 +34,7 @@ if(BUILDING_QTGSTREAMER)
set(QTGLIB_LIBRARY QtGLib)
set(QTGSTREAMER_LIBRARY QtGStreamer)
set(QTGSTREAMER_UI_LIBRARY QtGStreamerUi)
+ set(QTGSTREAMER_UTILS_LIBRARY QtGStreamerUtils)
set(QTGSTREAMER_INCLUDE_DIR ${CMAKE_SOURCE_DIR}/src)
else()
# Attempt to find the generated QtGStreamerTargets.cmake in the same directory
@@ -47,11 +50,14 @@ else()
PATHS "${_QTGSTREAMER_CONFIG_DIR}/../../lib")
find_library(QTGSTREAMER_UI_LIBRARY QtGStreamerUi-0.10
PATHS "${_QTGSTREAMER_CONFIG_DIR}/../../lib")
+ find_library(QTGSTREAMER_UTILS_LIBRARY QtGStreamerUtils-0.10
+ PATHS "${_QTGSTREAMER_CONFIG_DIR}/../../lib")
find_path(QTGSTREAMER_INCLUDE_DIR QGst/global.h
PATHS "${_QTGSTREAMER_CONFIG_DIR}/../../include"
PATH_SUFFIXES QtGStreamer)
set(_QTGSTREAMER_LINK_TO_QT_REQUIRED TRUE)
- mark_as_advanced(QTGLIB_LIBRARY QTGSTREAMER_LIBRARY QTGSTREAMER_UI_LIBRARY QTGSTREAMER_INCLUDE_DIR)
+ mark_as_advanced(QTGLIB_LIBRARY QTGSTREAMER_LIBRARY QTGSTREAMER_UI_LIBRARY
+ QTGSTREAMER_UTILS_LIBRARY QTGSTREAMER_INCLUDE_DIR)
else()
# Targets file found. Use imported QtGStreamer target and relative include path.
# We assume that this file has been installed in $PREFIX/lib/QtGStreamer/,
@@ -60,13 +66,15 @@ else()
set(QTGLIB_LIBRARY QtGLib)
set(QTGSTREAMER_LIBRARY QtGStreamer)
set(QTGSTREAMER_UI_LIBRARY QtGStreamerUi)
+ set(QTGSTREAMER_UTILS_LIBRARY QtGStreamerUtils)
get_filename_component(QTGSTREAMER_INCLUDE_DIR "${_QTGSTREAMER_CONFIG_DIR}/../../include/QtGStreamer" ABSOLUTE)
endif()
endif()
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(QtGStreamer DEFAULT_MSG QTGSTREAMER_INCLUDE_DIR QTGLIB_LIBRARY
- QTGSTREAMER_LIBRARY QTGSTREAMER_UI_LIBRARY)
+ QTGSTREAMER_LIBRARY QTGSTREAMER_UI_LIBRARY
+ QTGSTREAMER_UTILS_LIBRARY)
if(QTGSTREAMER_FOUND)
# Find dependencies, if not already found
@@ -88,10 +96,12 @@ if(QTGSTREAMER_FOUND)
set(QTGLIB_LIBRARIES ${QTGLIB_LIBRARY} ${QT_QTCORE_LIBRARY})
set(QTGSTREAMER_LIBRARIES ${QTGSTREAMER_LIBRARY} ${QTGLIB_LIBRARIES})
set(QTGSTREAMER_UI_LIBRARIES ${QTGSTREAMER_UI_LIBRARY} ${QT_QTGUI_LIBRARY} ${QTGSTREAMER_LIBRARIES})
+ set(QTGSTREAMER_UTILS_LIBRARIES ${QTGSTREAMER_UTILS_LIBRARY} ${QTGSTREAMER_LIBRARIES})
else()
set(QTGLIB_LIBRARIES ${QTGLIB_LIBRARY})
set(QTGSTREAMER_LIBRARIES ${QTGSTREAMER_LIBRARY})
set(QTGSTREAMER_UI_LIBRARIES ${QTGSTREAMER_UI_LIBRARY})
+ set(QTGSTREAMER_UTILS_LIBRARIES ${QTGSTREAMER_UTILS_LIBRARY})
endif()
if (CMAKE_COMPILER_IS_GNUCXX)
diff --git a/src/QGst/CMakeLists.txt b/src/QGst/CMakeLists.txt
index 0093cde..5b899b6 100644
--- a/src/QGst/CMakeLists.txt
+++ b/src/QGst/CMakeLists.txt
@@ -37,6 +37,9 @@ set(QtGStreamerUi_SRCS
Ui/videowidget.cpp
)
+set(QtGStreamerUtils_SRCS
+)
+
set(QtGStreamer_INSTALLED_HEADERS
global.h Global
init.h Init
@@ -126,6 +129,7 @@ set(QtGStreamer_CODEGEN_INCLUDES
set(QTGSTREAMER_API_VERSION 0.10)
set(QTGSTREAMER_SOVERSION 0)
set(QTGSTREAMER_UI_SOVERSION 0)
+set(QTGSTREAMER_UTILS_SOVERSION 0)
include_directories(${CMAKE_CURRENT_BINARY_DIR} ${GSTREAMER_INCLUDE_DIR}
${GSTREAMER_INTERFACES_INCLUDE_DIR} ${GLIB2_INCLUDE_DIR})
add_definitions(-DGST_DISABLE_XML -DGST_DISABLE_LOADSAVE)
@@ -149,7 +153,15 @@ set_target_properties(QtGStreamerUi PROPERTIES OUTPUT_NAME QtGStreamerUi-${QTGST
VERSION ${QTGSTREAMER_VERSION})
target_link_libraries(QtGStreamerUi ${QT_QTGUI_LIBRARY} ${QTGSTREAMER_LIBRARY})
+# Build and link QtGStreamerUtils
+automoc4_add_library(QtGStreamerUtils ${SHARED_OR_STATIC} ${QtGStreamerUtils_SRCS})
+set_target_properties(QtGStreamerUtils PROPERTIES OUTPUT_NAME QtGStreamerUtils-${QTGSTREAMER_API_VERSION}
+ SOVERSION ${QTGSTREAMER_UTILS_SOVERSION}
+ VERSION ${QTGSTREAMER_VERSION})
+target_link_libraries(QtGStreamerUtils ${QTGSTREAMER_LIBRARY})
+
# Install
install(TARGETS QtGStreamer DESTINATION ${LIB_INSTALL_DIR} EXPORT ${EXPORT_TARGET_SET})
install(TARGETS QtGStreamerUi DESTINATION ${LIB_INSTALL_DIR} EXPORT ${EXPORT_TARGET_SET})
+install(TARGETS QtGStreamerUtils DESTINATION ${LIB_INSTALL_DIR} EXPORT ${EXPORT_TARGET_SET})
install_headers("QGst" ${QtGStreamer_INSTALLED_HEADERS})
diff --git a/src/QGst/QtGStreamerUtils-0.10.pc.in b/src/QGst/QtGStreamerUtils-0.10.pc.in
new file mode 100644
index 0000000..473de67
--- /dev/null
+++ b/src/QGst/QtGStreamerUtils-0.10.pc.in
@@ -0,0 +1,11 @@
+prefix=@CMAKE_INSTALL_PREFIX@
+exec_prefix=${prefix}
+libdir=@LIB_INSTALL_DIR@
+includedir=@INCLUDES_INSTALL_DIR@
+
+Name: QtGStreamerUtils-0.10
+Description: QtGStreamer's high level utility classes
+Requires: QtGStreamer-0.10
+Version: @QTGSTREAMER_VERSION@
+Cflags: -I${includedir}
+Libs: -L${libdir} -lQtGStreamerUtils-0.10
diff --git a/src/QGst/Utils/global.h b/src/QGst/Utils/global.h
new file mode 100644
index 0000000..ed598e6
--- /dev/null
+++ b/src/QGst/Utils/global.h
@@ -0,0 +1,37 @@
+/*
+ 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 QGST_UTILS_GLOBAL_H
+#define QGST_UTILS_GLOBAL_H
+
+#include <QtCore/QtGlobal>
+
+/* defined by cmake when building this library */
+#if defined(QtGStreamerUtils_EXPORTS)
+# define QTGSTREAMERUTILS_EXPORT Q_DECL_EXPORT
+#else
+# define QTGSTREAMERUTILS_EXPORT Q_DECL_IMPORT
+#endif
+
+#if !defined(Q_OS_WIN) && !defined(Q_CC_NOKIAX86) && \
+ !defined(Q_CC_RVCT) && defined(QT_VISIBILITY_AVAILABLE)
+# define QTGSTREAMERUTILS_NO_EXPORT __attribute__((visibility("hidden")))
+#else
+# define QTGSTREAMERUTILS_NO_EXPORT
+#endif
+
+#endif
diff --git a/src/main.dox b/src/main.dox
index c10b60f..02934c1 100644
--- a/src/main.dox
+++ b/src/main.dox
@@ -31,6 +31,7 @@
* \li QtGStreamer - Library providing C++/Qt bindings for GStreamer
* \li QtGStreamerUi - Library providing integration with QtGui. Currently,
* it only provides a video widget that embeds GStreamer's video sinks.
+ * \li QtGStreamerUtils - Library providing some high level utility classes.
*
* In addition, it provides a "qwidgetvideosink" GStreamer element, an video
* sink element that can draw directly on QWidgets using QPainter.
@@ -66,6 +67,8 @@
* \li QTGSTREAMER_LIBRARIES - the libraries needed to use QtGStreamer
* \li QTGSTREAMER_UI_LIBRARY - the QtGStreamerUi library
* \li QTGSTREAMER_UI_LIBRARIES - the libraries needed to use QtGStreamerUi
+ * \li QTGSTREAMER_UTILS_LIBRARY - the QtGStreamerUtils library
+ * \li QTGSTREAMER_UTILS_LIBRARIES - the libraries needed to use QtGStreamerUtils
* \li QTGSTREAMER_DEFINITIONS - definitions recommended for using QtGStreamer
* \li QTGSTREAMER_FLAGS - extra compiler switches recommended for using QtGStreamer
*
@@ -86,6 +89,7 @@
* \li QtGLib-2.0 - the libraries needed to use QtGLib
* \li QtGStreamer-0.10 - the libraries needed to use QtGStreamer
* \li QtGStreamerUi-0.10 - the libraries needed to use QtGStreamerUi
+ * \li QtGStreamerUtils-0.10 - the libraries needed to use QtGStreamerUtils
*
* \section other_build_systems Other build systems
*
@@ -148,6 +152,15 @@
* \note This namespace is contained in the QtGStreamerUi library.
*/
+/*! \namespace QGst::Utils
+ * \brief High level utility classes
+ *
+ * This namespace provides some high level utility classes for easier usage
+ * of certain GStreamer functionality.
+ *
+ * \note This namespace is contained in the QtGStreamerUtils library.
+ */
+
/*! \page internal_design_details Internal Design Details
*
* This page documents various implementation details for people that are interested
diff --git a/tests/compilation/CMakeLists.txt b/tests/compilation/CMakeLists.txt
index d8e7edb..9fa7ce7 100644
--- a/tests/compilation/CMakeLists.txt
+++ b/tests/compilation/CMakeLists.txt
@@ -3,6 +3,7 @@ add_test(NAME compilation_tests
-DQTGLIB_LIBRARY=$<TARGET_FILE:${QTGLIB_LIBRARY}>
-DQTGSTREAMER_LIBRARY=$<TARGET_FILE:${QTGSTREAMER_LIBRARY}>
-DQTGSTREAMER_UI_LIBRARY=$<TARGET_FILE:${QTGSTREAMER_UI_LIBRARY}>
+ -DQTGSTREAMER_UTILS_LIBRARY=$<TARGET_FILE:${QTGSTREAMER_UTILS_LIBRARY}>
-DQTGSTREAMER_INCLUDE_DIR=${QTGSTREAMER_INCLUDE_DIR}
-DQTGSTREAMER_STATIC=${QTGSTREAMER_STATIC}
-DCMAKE_MODULE_PATH=${CMAKE_MODULE_PATH}
diff --git a/tests/compilation/RunCompilationTests.cmake b/tests/compilation/RunCompilationTests.cmake
index dec959e..904f9a2 100644
--- a/tests/compilation/RunCompilationTests.cmake
+++ b/tests/compilation/RunCompilationTests.cmake
@@ -15,6 +15,7 @@ execute_process(COMMAND ${CMAKE_COMMAND}
-DQTGLIB_LIBRARY=${QTGLIB_LIBRARY}
-DQTGSTREAMER_LIBRARY=${QTGSTREAMER_LIBRARY}
-DQTGSTREAMER_UI_LIBRARY=${QTGSTREAMER_UI_LIBRARY}
+ -DQTGSTREAMER_UTILS_LIBRARY=${QTGSTREAMER_UTILS_LIBRARY}
-DQTGSTREAMER_INCLUDE_DIR=${QTGSTREAMER_INCLUDE_DIR}
-DCMAKE_MODULE_PATH=${CMAKE_MODULE_PATH}
-DQTGSTREAMER_STATIC=${QTGSTREAMER_STATIC}