From dd204c28fca82a4302e158596bc8cf33b8ea68ee Mon Sep 17 00:00:00 2001 From: George Kiagiadakis Date: Sun, 16 Jan 2011 18:04:30 +0200 Subject: Add skeleton for the new QtGStreamerUtils library. --- cmake/modules/FindQtGStreamer.cmake | 14 +++++++++-- src/QGst/CMakeLists.txt | 12 ++++++++++ src/QGst/QtGStreamerUtils-0.10.pc.in | 11 +++++++++ src/QGst/Utils/global.h | 37 +++++++++++++++++++++++++++++ src/main.dox | 13 ++++++++++ tests/compilation/CMakeLists.txt | 1 + tests/compilation/RunCompilationTests.cmake | 1 + 7 files changed, 87 insertions(+), 2 deletions(-) create mode 100644 src/QGst/QtGStreamerUtils-0.10.pc.in create mode 100644 src/QGst/Utils/global.h 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 + + 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 . +*/ +#ifndef QGST_UTILS_GLOBAL_H +#define QGST_UTILS_GLOBAL_H + +#include + +/* 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=$ -DQTGSTREAMER_LIBRARY=$ -DQTGSTREAMER_UI_LIBRARY=$ + -DQTGSTREAMER_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} -- cgit v1.2.3