Russian Qt Forum
Апрель 16, 2024, 16:27 *
Добро пожаловать, Гость. Пожалуйста, войдите или зарегистрируйтесь.
Вам не пришло письмо с кодом активации?

Войти
 
  Начало   Форум  WIKI (Вики)FAQ Помощь Поиск Войти Регистрация  

Страниц: [1]   Вниз
  Печать  
Автор Тема: Сказ про то как нуб gstreamer к qt проекту под виндой прикручивал  (Прочитано 3386 раз)
ibnz
Гость
« : Октябрь 24, 2014, 15:12 »

Вводная.
WinXP + QtSDK 5.3.1 (MSVC2010)  + QtCreator 3.2.1
Цель: скомпилить и пощупать пример VOIP
http://gstreamer.freedesktop.org/data/doc/gstreamer/head/qt-gstreamer/html/examples_2voip_2main_8cpp-example.html
СКАЗ
Соблазнившись прелестями gstreamer и, вдохновившись наличием биндингов к Qt, кроссплатформенностью и вроде как даже примера именно того что мне требовалось (VOIP), я потирая руки полез установливать:
•   Сам gstreamer
http://gstreamer.freedesktop.org/data/pkg/windows/1.4.3/ gstreamer-1.0-devel-x86-1.4.3.msi
Ставим в папочку c:\gstreamer , отметив все галочки в мастере установки.
•   qt-gstreamer
Рядышком в папочке c:\gstreamer создаем подпапочку qt-gstreamer куда делаем git clone
http://anongit.freedesktop.org/git/gstreamer/qt-gstreamer.git
содержащий qt классы и собственно заветный пример.
Лезем в папочку c:\gstreamer\qt-gstreamer\examples\voip\ и умиляясь лаконичности  и миниатюрности всего лишь 3 файликов проекта, открываем voip.pro.  Отмечая подробные комментарии и радующую глаз простоту и стройность кода, еще раз внутренне воздаем хвалу написавшему сие. Ничтоже сумняшеся, и уже, почти уверовав в благополучное и быстрое завершение начинания, рука сама потянулась и сделать Ctrl+B и тут же получила ответ от qmake в виде  сообщения
Цитировать
14:09:06: Запускается: «C:\Qt\Qt5.3.1\5.3\msvc2010_opengl\bin\qmake.exe» C:\gstreamer\qt-gstreamer\examples\voip\voip.pro -r -spec win32-msvc2010 "CONFIG+=debug
Project ERROR: Qt5GStreamer-1.0 development package not found"
Чтож, лезем в профайл и открываем для себя кое-что из мира линуха.
Код:
# Tell qmake to use pkg-config to find QtGStreamer.
CONFIG += link_pkgconfig

# Now tell qmake to link to QtGStreamer and also use its include path and Cflags.
contains(QT_VERSION, ^4\\..*) {
  PKGCONFIG += QtGStreamer-1.0 QtGStreamerUi-1.0
}
contains(QT_VERSION, ^5\\..*) {
  PKGCONFIG += Qt5GStreamer-1.0 Qt5GStreamerUi-1.0
  QT += widgets
}
Почитав, покурив, пощупав этот pkg-config, я так и не понял как оно должно работать под виндой и ко мне пришло волевое решение, что проще будет руками прописать нужные INCLUDEPATH и LIBS в профайле.
Сказано сделано – комментим все вышеперечисленное, оставив токмо QT += widgets
Проблемы с не найденными инклудами решаются строчками
Код:
INCLUDEPATH +=  c:/gstreamer/qt-gstreamer/src \
                c:/boost_1.56
Далее ругань на неразрешенные символы.
Решение – добавить все cpp файлы из папки src
Далее опять ругань на включение glib
Лечим добавлением еще пары строчек к INCLUDEPATH
   
Код:
INCLUDEPATH += c:/gstreamer/1.0/x86/include/glib-2.0 \
      c:/gstreamer/1.0/x86/include/glib-2.0/include
Далее я почувствовал что что-то идет совсем не так:
В глубине сырцов qt-gstreamer в файле graphicsvideosurface.cpp нашлась пара необъявленных идентификаторов  QTGLVIDEOSINK_NAME и QTVIDEOSINK_NAME
Объявление нашлось в файле CMakeLists.txt
Пролечилось
Код:
#define QTVIDEOSINK_NAME “qt5videosink”
#define QTGLVIDEOSINK_NAME “qt5glvideosink”
Далее еще несколько ненайденных включений
Код:
INCLUDEPATH +=  c:/gstreamer/1.0/x86/lib/glib-2.0/include \
c:/gstreamer/1.0/x86/include/gstreamer-1.0
Далее пошло уж совсем нехорошее в plugin.moc (!) не нашлось объявления QDeclarativeExtensionPlugin…
От безысходности я дрожащей лапкой все же прописал в moc файле.
Код:
#include <QtDeclarative/qdeclarativeextensionplugin.h>
И получил контрольный в голову в виде:
Цитировать
C:\gstreamer\qt-gstreamer\examples\build-voip-5_3_1-Debug\debug\plugin.moc:80: ошибка: C2352: QDeclarativeExtensionPlugin::qt_metacast: недопустимый вызов нестатической функции-члена
C:\Qt\Qt5.3.1\5.3\msvc2010_opengl\include\QtDeclarative/qdeclarativeextensionplugin.h(57): см. объявление "QDeclarativeExtensionPlugin::qt_metacast"
Далее попробовал собрать qt-gstreamer cmake и обломился со следующей простынкой:
[spoiler]
Цитировать
The C compiler identification is MSVC 16.0.30319.1
The CXX compiler identification is MSVC 16.0.30319.1
Check for working C compiler using: Visual Studio 10 2010
Check for working C compiler using: Visual Studio 10 2010 -- works
Detecting C compiler ABI info
Detecting C compiler ABI info - done
Check for working CXX compiler using: Visual Studio 10 2010
Check for working CXX compiler using: Visual Studio 10 2010 -- works
Detecting CXX compiler ABI info
Detecting CXX compiler ABI info - done
CMake Warning (dev) at CMakeLists.txt:49 (add_definitions):
Policy CMP0005 is not set: Preprocessor definition values are now escaped
automatically. Run "cmake --help-policy CMP0005" for policy details. Use
the cmake_policy command to set the policy and suppress this warning.
This warning is for project developers. Use -Wno-dev to suppress it.
CMake Warning (dev) at CMakeLists.txt:49 (add_definitions):
Policy CMP0005 is not set: Preprocessor definition values are now escaped
automatically. Run "cmake --help-policy CMP0005" for policy details. Use
the cmake_policy command to set the policy and suppress this warning.
This warning is for project developers. Use -Wno-dev to suppress it.
CMake Warning (dev) at CMakeLists.txt:49 (add_definitions):
Policy CMP0005 is not set: Preprocessor definition values are now escaped
automatically. Run "cmake --help-policy CMP0005" for policy details. Use
the cmake_policy command to set the policy and suppress this warning.
This warning is for project developers. Use -Wno-dev to suppress it.
CMake Error at QGlib/CMakeLists.txt:49 (set_target_properties):
set_target_properties called with incorrect number of arguments.
CMake Warning (dev) at QGlib/CMakeLists.txt:52 (target_link_libraries):
Cannot specify link libraries for target "LINK_PRIVATE" which is not built
by this project.

CMake does not support this but it used to work accidentally and is being
allowed for compatibility.

Policy CMP0016 is not set: target_link_libraries() reports error if its
only argument is not a target. Run "cmake --help-policy CMP0016" for
policy details. Use the cmake_policy command to set the policy and
suppress this warning.
This warning is for project developers. Use -Wno-dev to suppress it.
CMake Error at QGlib/CMakeLists.txt:53 (qt4or5_use_modules):
Unknown CMake command "qt4or5_use_modules".
CMake Warning (dev) in CMakeLists.txt:
No cmake_minimum_required command is present. A line of code such as

cmake_minimum_required(VERSION 3.0)

should be added at the top of the file. The version specified may be lower
if you wish to support older CMake versions for this project. For more
information run "cmake --help-policy CMP0000".
This warning is for project developers. Use -Wno-dev to suppress it.
Configuring incomplete, errors occurred!
See also "C:/gstreamer/qt-gstreamer/build/CMakeFiles/CMakeOutput.log".
[/spoiler]

Цитировать
...Make Error at QGlib/CMakeLists.txt:49 (set_target_properties):
set_target_properties called with incorrect number of arguments.
...CMake Error at QGlib/CMakeLists.txt:53 (qt4or5_use_modules):
Unknown CMake command "qt4or5_use_modules".
Записан
Страниц: [1]   Вверх
  Печать  
 
Перейти в:  


Страница сгенерирована за 0.046 секунд. Запросов: 20.