Remove all GStreamer references from docs, comments, and CI

Delete obsolete GStreamer video backend source files
(VideoUriDecodeBinImpl, VideoV4l2SrcImpl, VideoShmSrcImpl),
the GStreamer macOS URL resource, and clean up all remaining
GStreamer mentions in INSTALL.md, README.md, TODO, CI workflows,
build scripts, and source comments. CHANGELOG entries are preserved
as historical record.
This commit is contained in:
Alexandre Quessy
2026-05-20 00:42:04 -04:00
parent 82eef90960
commit 324a403999
19 changed files with 29 additions and 806 deletions
+7 -22
View File
@@ -20,32 +20,17 @@ jobs:
sudo apt-get update
sudo apt-get install -y \
liblo-dev liblo-tools \
qtbase5-dev \
qttools5-dev-tools \
qtmultimedia5-dev \
libqt5opengl5-dev \
qtwebengine5-dev \
qt5-qmake \
libqt5serialport5-dev \
libqt5xml5 \
libqt5network5 \
libqt5multimedia5-plugins \
libgstreamer1.0-dev \
libgstreamer-plugins-base1.0-dev \
gstreamer1.0-plugins-bad \
gstreamer1.0-libav \
gstreamer1.0-vaapi \
gstreamer1.0-plugins-base \
gstreamer1.0-plugins-base-apps \
gstreamer1.0-plugins-good \
gstreamer1.0-plugins-ugly \
gstreamer1.0-x \
gstreamer1.0-tools \
qt6-base-dev \
qt6-tools-dev \
qt6-multimedia-dev \
libqt6opengl6-dev \
libqt6openglwidgets6 \
qmake6 \
build-essential \
pkg-config
- name: Configure with qmake
run: qmake mapmap.pro
run: qmake6 mapmap.pro
- name: Build
run: make -j$(nproc)
+1 -2
View File
@@ -45,7 +45,6 @@ Makefile*
# Generated by Qt
mapmap
moc_*.cpp
prototypes/gst/
qrc_*.cpp
*.moc
src/*/mocs/*
@@ -77,7 +76,7 @@ MapMap-*.*.*-*.dmg
prototypes/sdl/run
prototypes/wx-01-simple/run
prototypes/wx-03-polyline/run
prototypes/wx-04-gst/run
prototypes/wx-04/run
prototypes/wx-02-input-output/run
prototypes/qgraphicsview
contrib/qtpropertybrowser.new
+1 -1
View File
@@ -26,7 +26,7 @@ We love hearing about bugs! It's how we get them fixed.
- Only if you don't find a relevant issue, open a new issue. A new issue does not generate more exposure/visibility than commenting on an existing one.
- Make sure you give it a good title! A good title explains the core of the problem in about 5-10 words. (It's sometimes easier to write the title after you've written the description.)
- In the description, include the following details:
1. **relevant system information** such as which MapMap version, operating system, Qt version, Gstreamer version and IDE you are using,
1. **relevant system information** such as which MapMap version, operating system, Qt version and IDE you are using,
2. what you were doing when you noticed the bug,
3. what you expected to happen,
4. what actually happened, and how to make it happen again (ie how to reproduce the bug).
+17 -80
View File
@@ -21,36 +21,16 @@ Alternatively:
### Ubuntu
NOTE: Tested on 13.10, 14.04, 15.04 and 16.04
Install basic development tools for Qt projects, plus liblo for OSC support:
Install basic development tools for Qt 6 projects, plus liblo for OSC support:
```
sudo apt-get install -y \
liblo-dev liblo-tools \
qttools5-dev-tools \
qtmultimedia5-dev \
libqt5opengl5-dev \
qtwebengine5-dev \
libqt5multimedia5-plugins \
qt5-default
```
Install GStreamer 1.0 libraries and plugins:
```
sudo apt-get install -y \
libgstreamer1.0-dev \
libgstreamer-plugins-base1.0-dev \
gstreamer1.0-plugins-bad \
gstreamer1.0-libav \
gstreamer1.0-vaapi \
gstreamer1.0-plugins-base \
gstreamer1.0-plugins-base-apps \
gstreamer1.0-plugins-good \
gstreamer1.0-plugins-ugly \
gstreamer1.0-x \
gstreamer1.0-tools
qt6-tools-dev \
qt6-multimedia-dev \
qt6-base-dev \
libqt6opengl6-dev \
libqt6openglwidgets6
```
Install extra packages if you want to build the documentation:
@@ -65,61 +45,29 @@ sudo apt-get install -y \
### Arch Linux
Install basic development tools for Qt projects, GStreamer 1.0 and liblo for OSC support:
Install basic development tools for Qt 6 projects and liblo for OSC support:
```
sudo pacman -S qt5-tools qt5-multimedia qt5-webengine liblo gstreamer
sudo pacman -S qt6-tools qt6-multimedia qt6-base liblo
```
Install GStreamer 1.0 libraries and plugins::
```
sudo pacman -S gst-libav \
gstreamer-vaapi \
gst-plugins-bad \
gst-plugins-base \
gst-plugins-base-libs \
gst-plugins-good \
gst-plugins-ugly
```
Build on Mac OS X
-----------------
NOTE: This has been tested on OS X 10.11 (El Capitan).
Build on macOS
--------------
Install tools and dependencies:
1) Install the Apple Developer Tools
- You need to register with a credit card in the Apple Store in order to download it (no need to pay, but Apple requires your credit card number).
2) Install Qt5
- You can get the open source version from http://www.qt.io/download-open-source/
- Run the installer and choose the default location (which should be ~/Qt).
- Latest tested version: 5.5.1=
3) Install liblo
- Use the following guide: http://macappstore.org/liblo/
- OR compile from the tar.gz - it should install it to /usr/local
4) Install the GStreamer framework. You need the runtime and devel packages to be installed:
- https://gstreamer.freedesktop.org/data/pkg/osx/1.6.0/gstreamer-1.0-1.6.0-x86_64.pkg
- https://gstreamer.freedesktop.org/data/pkg/osx/1.6.0/gstreamer-1.0-devel-1.6.0-x86_64.pkg
- http://gstreamer.freedesktop.org/data/pkg/osx/1.6.0/gstreamer-1.0-1.6.0-x86_64-packages.dmg
Do this:
```
./scripts/build.sh
./scripts/sh_install_deps_macos.sh
```
It will create a .app and a .dmg.
Build:
DMGVERSION.txt should be created automatically with "1" as its contents. Update to "2", and so on, if needed.
```
./scripts/sh_build_macos.sh
```
### Troubleshooting
#### GStreamer header not found
If you have a compilation error saying that file ```<gst/gst.h>``` cannot be found: make sure your GStreamer.framework folder is installed and is _not_ read-protected.
#### Corrupted OSC port
If the appearance of the window of the OSC port number in the preferences seem corrupted, you might want to reset MapMap's preferences:
@@ -128,27 +76,16 @@ If the appearance of the window of the OSC port number in the preferences seem c
rm -f ~/Library/Preferences/info.mapmap.MapMap.plist
```
To print debugging informations, launch it from the Terminal app like this::
```
GSTPLUGIN_PATH=/Library/Frameworks/GStreamer.framework/Libraries GST_DEBUG=2 /Applications/MapMap.app/Contents/MacOS/MapMap
```
Build on Windows
----------------
## Build dynamic version to debug project:
- Download and install gstreamer-x86 [runtime](https://gstreamer.freedesktop.org/data/pkg/windows/1.16.2/gstreamer-1.0-mingw-x86-1.16.2.msi) and [devel](https://gstreamer.freedesktop.org/data/pkg/windows/1.16.2/gstreamer-1.0-devel-mingw-x86-1.16.2.msi)
- Download and install [Qt5 MinGW incl. QtCreator](https://www.qt.io/download-thank-you?os=windows)
- Add the GStreamer bin path (e.g. C:\gstreamer\1.0\x86\bin) to PATH variable into the QtCreator project build enviroment settings
- Download and install [Qt6 MinGW incl. QtCreator](https://www.qt.io/download-open-source/)
- Build and run MapMap project within QtCreator (Ctrl-R)
## Build static version for release:
- Download and install gstreamer-x86 [runtime](https://gstreamer.freedesktop.org/data/pkg/windows/1.16.2/gstreamer-1.0-mingw-x86-1.16.2.msi) and [devel](https://gstreamer.freedesktop.org/data/pkg/windows/1.16.2/gstreamer-1.0-devel-mingw-x86-1.16.2.msi)
- Build a [Qt static environment](https://wiki.qt.io/Building_a_static_Qt_for_Windows_using_MinGW) (This [video](https://www.youtube.com/watch?v=nEQGrBiz2T0) may explain it better)
- Build a [Qt static environment](https://wiki.qt.io/Building_a_static_Qt_for_Windows_using_MinGW)
- Build MapMap using QtCreator (qmake, build release)
- Copy all dll files of the gstreamer's bin folder (e.g. C:\gstreamer\1.0\x86\bin) into the target folder together with MapMap.exe
- Copy all dll files of the gstreamer's plugin folder (e.g. C:\gstreamer\1.0\x86\lib\gstreamer-1.0) into an new folder named 'plugin' in parallel to MapMap.exe.
- Run MapMap.exe
#### For packaging
-3
View File
@@ -38,9 +38,6 @@ Build and installation
----------------------
To build and install it, see the INSTALL file provided with the source code.
To use this software on Mac OS X:
* Install GStreamer using http://gstreamer.freedesktop.org/data/pkg/osx/1.2.4.1/gstreamer-1.0-1.2.4.1-universal.pkg : you should customize the installation and choose to install all components.
To use this software on Gnu/Linux with window managers other than Unity,
make sure that this package is NOT installed: appmenu-qt5
or else the menu will not show.
+2 -2
View File
@@ -6,7 +6,7 @@ TODO before 0.2.0
* change xy position to integers?
* "avec le soutien de l'Organisation internationale de la Francophonie", with the logo.
* integration des icones de mike
* shmsrc???? non... on a plutot autre chose.. c'est a dire, plus de formes.
* plus de formes.
* traduction complete. multilinguisme fonctionnel.
* video upside-down fixed
* manuel de base, bilingue. (en HTML dans le Contents?)
@@ -27,7 +27,7 @@ Code
* MapperGLCanvas has a strange name considering we also have a Mapper class; actually I'm thinking we should rename Mapper to MappingView or something (since a Mapper is actually the View of the Mapping class)
* DONE Override includesPoint() in Mesh
* video gstreamer
Packaging
---------
-1
View File
@@ -53,7 +53,6 @@ system($$QMAKE_LRELEASE mapmap.pro) # Run lrelease
# Linux-specific:
unix:!macx {
QMAKE_CXXFLAGS += -D_GLIBCXX_USE_CXX11_ABI=0
QMAKE_CXXFLAGS += -Wno-expansion-to-defined
}
-3
View File
@@ -1,3 +0,0 @@
[InternetShortcut]
URL=https://gstreamer.freedesktop.org/data/pkg/osx/1.14.0/gstreamer-1.0-1.14.0-x86_64.pkg
IconIndex=0
-8
View File
@@ -26,7 +26,6 @@ do_create_dmg() {
cp -R MapMap.app ${DMGDIR}
cp README.md ${DMGDIR}/README.txt
cp NEWS ${DMGDIR}/NEWS.txt
cp resources/macOS/Get\ GStreamer\ macOS.url ${DMGDIR}/
hdiutil create \
-volname ${DMGDIR} \
-srcfolder ${DMGDIR} \
@@ -68,7 +67,6 @@ if [[ $unamestr == "Darwin" ]]; then
#export QMAKESPEC=macx-xcode
qtbindir=~/Qt/${qtversion}/clang_64/bin/
PATH=$PATH:${qtbindir}
gstreamer="GStreamer.framework/Versions/1.0/lib/GStreamer"
app="MapMap.app"
# XXX
@@ -100,12 +98,6 @@ if [[ $unamestr == "Darwin" ]]; then
sudo killall Finder
sudo killall Dock
# Bundle GStreamer framework in app
#echo "Bundling GStreamer ..."
#cp -R /Library/Frameworks/GStreamer.framework ${app}/Contents/Frameworks/
#install_name_tool -id @executable_path/../Frameworks/${gstreamer} ${app}/Contents/Frameworks/${gstreamer}
#install_name_tool -change /Library/Frameworks/${gstreamer} @executable_path/../Frameworks/${gstreamer} ${app}/Contents/MacOs/MapMap
# do_fix_qt_plugins_in_app
echo "Creating DMG ..."
do_create_dmg
-2
View File
@@ -1,6 +1,4 @@
#!/bin/bash
#export GST_PLUGIN_PATH=/Library/Frameworks/GStreamer.framework/Libraries
#export GST_DEBUG=2
export LANG=C
if [[ `uname` == 'Linux' ]]; then
-1
View File
@@ -2,7 +2,6 @@
# Install build dependencies for MapMap on macOS using Homebrew.
#
# Qt 6 is used as the media backend (QMediaPlayer, QVideoSink, QCamera).
# GStreamer is not required.
#
# Usage:
# chmod +x scripts/sh_install_deps_macos.sh
-4
View File
@@ -370,10 +370,6 @@ protected:
QIcon _icon;
VideoType _videoType;
/**
* Private implementation, so that GStreamer headers don't need
* to be included from every file in the project.
*/
VideoImpl *_impl;
};
+1 -2
View File
@@ -3,8 +3,7 @@
*
* (c) 2024 MapMap contributors
*
* Replaces the GStreamer-based VideoUriDecodeBinImpl with a Qt 6 Multimedia
* implementation using QMediaPlayer + QVideoSink + QAudioOutput.
* Qt 6 Multimedia video playback using QMediaPlayer + QVideoSink + QAudioOutput.
*
* 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
-118
View File
@@ -1,118 +0,0 @@
/*
* VideoShmSrcImpl.cpp
*
* (c) 2016 Vasilis Liaskovitis -- vliaskov@gmail.com
* (c) 2013 Sofian Audry -- info(@)sofianaudry(.)com
* (c) 2013 Alexandre Quessy -- alexandre(@)quessy(.)net
* (c) 2012 Jean-Sebastien Senecal
* (c) 2004 Mathieu Guindon, Julien Keable
* Based on code from Drone http://github.com/sofian/drone
* Based on code from the GStreamer Tutorials http://docs.gstreamer.com/display/GstSDK/Tutorials
*
* 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 3 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, see <http://www.gnu.org/licenses/>.
*/
#include "VideoShmSrcImpl.h"
#include <cstring>
#include <iostream>
namespace mmp {
VideoShmSrcImpl::VideoShmSrcImpl() :
_shmsrc0(NULL),
_gdpdepay0(NULL),
_pollSource(NULL),
_attached(false)
{
}
bool VideoShmSrcImpl::getAttached()
{
return _attached;
}
void VideoShmSrcImpl::setAttached(bool attach)
{
_attached = attach;
}
gboolean
gstPollShmsrc (void *user_data)
{
VideoShmSrcImpl *p = (VideoShmSrcImpl*) user_data;
if (g_file_test(p->getUri().toUtf8().constData(), G_FILE_TEST_EXISTS) &&
! p->getAttached())
{
if (! p->setPlayState(true))
{
qDebug() << "tried to attach, but starting pipeline failed!" << endl;
return false;
}
p->setAttached(true);
}
return true;
}
bool VideoShmSrcImpl::loadMovie(const QString& path) {
VideoImpl::loadMovie(path);
_shmsrc0 = gst_element_factory_make ("shmsrc", "shmsrc0");
_gdpdepay0 = gst_element_factory_make ("gdpdepay", "gdpdepay0");
_pollSource = g_timeout_source_new (500);
g_source_set_callback (_pollSource,
gstPollShmsrc,
this,
NULL);
g_source_attach (_pollSource, g_main_context_default());
g_source_unref (_pollSource);
if (! _shmsrc0 || ! _gdpdepay0)
{
qWarning() << "Not all elements could be created." << endl;
if (! _shmsrc0) g_printerr("_shmsrc0");
if (! _gdpdepay0) g_printerr("_gdpdepay0");
unloadMovie();
return -1;
}
gst_bin_add_many (GST_BIN(_pipeline), _shmsrc0, _gdpdepay0, NULL);
if (! gst_element_link_many (_shmsrc0, _gdpdepay0, _queue0, NULL))
{
qWarning() << "Could not link shmsrc, deserializer and video queue." << endl;
}
QByteArray ba = path.toLocal8Bit();
gchar* uri = (gchar*) path.toUtf8().constData();
uri = (gchar*) ba.data();
//qDebug() << "LIVE mode" << uri;
g_object_set (_shmsrc0, "socket-path", uri, NULL);
g_object_set (_shmsrc0, "is-live", TRUE, NULL);
_videoIsConnected = true;
return TRUE;
}
VideoShmSrcImpl::~VideoShmSrcImpl()
{
// Unref the shmsrc poller.
if (_pollSource)
{
g_source_unref(_pollSource);
_pollSource = NULL;
}
}
}
-73
View File
@@ -1,73 +0,0 @@
/*
* VideoShmSrcImpl.h
*
* (c) 2016 Vasilis Liaskovitis -- vliaskov@gmail.com
* (c) 2013 Sofian Audry -- info(@)sofianaudry(.)com
* (c) 2013 Alexandre Quessy -- alexandre(@)quessy(.)net
* (c) 2012 Jean-Sebastien Senecal
* (c) 2004 Mathieu Guindon, Julien Keable
* Based on code from Drone http://github.com/sofian/drone
* Based on code from the GStreamer Tutorials http://docs.gstreamer.com/display/GstSDK/Tutorials
*
* 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 3 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, see <http://www.gnu.org/licenses/>.
*/
#ifndef VIDEO_SHMSRC_IMPL_H_
#define VIDEO_SHMSRC_IMPL_H_
// GStreamer includes.
#include <gst/gst.h>
#include <gst/app/gstappsink.h>
#include <gst/pbutils/pbutils.h>
// Other includes.
#include "MM.h"
#include <QtOpenGL>
#include <QMutex>
#include <QWaitCondition>
#include <glib.h>
#if __APPLE__
#include <OpenGL/gl.h>
#else
#include <GL/gl.h>
#endif
#include "VideoImpl.h"
namespace mmp {
class VideoShmSrcImpl : public VideoImpl
{
public:
VideoShmSrcImpl();
~VideoShmSrcImpl();
bool loadMovie(const QString& path);
bool isLive() {return true;}
bool getAttached();
void setAttached(bool attach);
private:
GstElement *_shmsrc0;
GstElement *_gdpdepay0;
/**
* shmsrc socket poller.
*/
GSource *_pollSource;
/// Whether or not we are attached to a shmsrc.
bool _attached;
};
}
#endif /* ifndef */
-273
View File
@@ -1,273 +0,0 @@
/*
* VideoUriDecodeBinImpl.cpp
*
* (c) 2016 Vasilis Liaskovitis -- vliaskov@gmail.com
* (c) 2013 Sofian Audry -- info(@)sofianaudry(.)com
* (c) 2013 Alexandre Quessy -- alexandre(@)quessy(.)net
* (c) 2012 Jean-Sebastien Senecal
* (c) 2004 Mathieu Guindon, Julien Keable
* Based on code from Drone http://github.com/sofian/drone
* Based on code from the GStreamer Tutorials http://docs.gstreamer.com/display/GstSDK/Tutorials
*
* 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 3 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, see <http://www.gnu.org/licenses/>.
*/
#include "VideoUriDecodeBinImpl.h"
#include <cstring>
#include <iostream>
namespace mmp {
VideoUriDecodeBinImpl::VideoUriDecodeBinImpl() :
_uridecodebin0(NULL)
{
}
void VideoUriDecodeBinImpl::gstPadAddedCallback(GstElement *src, GstPad *newPad, VideoUriDecodeBinImpl* p)
{
Q_UNUSED(src);
#ifdef VIDEO_IMPL_VERBOSE
#ifndef Q_OS_OSX
// NOTE: This line was causing a problem on Mac OSX: it caused the software to freeze when loading a new movie.
qDebug() << "Received new pad '" << GST_PAD_NAME(newPad) << "' from '" << GST_ELEMENT_NAME (src) << "'." << endl;
#endif
#endif
GstPad *sinkPad = NULL;
// Check the new pad's type.
GstCaps *newPadCaps = gst_pad_query_caps (newPad, NULL);
GstStructure *newPadStruct = gst_caps_get_structure (newPadCaps, 0);
const gchar *newPadType = gst_structure_get_name (newPadStruct);
gchar *newPadStructStr = gst_structure_to_string(newPadStruct);
#ifdef VIDEO_IMPL_VERBOSE
qDebug() << "Structure is " << newPadStructStr << "." << endl;
#endif
g_free(newPadStructStr);
bool isVideoPad = g_str_has_prefix (newPadType, "video/x-raw");
bool isAudioPad = g_str_has_prefix (newPadType, "audio/x-raw");
// Check for video pads.
if (isVideoPad)
{
sinkPad = gst_element_get_static_pad (p->_queue0, "sink");
gst_structure_get_int(newPadStruct, "width", &p->_width);
gst_structure_get_int(newPadStruct, "height", &p->_height);
}
// Check for audio pads.
else if (isAudioPad)
{
if (!p->createAudioComponents())
{
qWarning() << "Problem creating audio components." << endl;
goto exit;
}
sinkPad = gst_element_get_static_pad (p->_audioqueue0, "sink");
}
// Other types: ignore.
else {
qDebug() << " It has type '" << newPadType << "' which is not raw audio/video: ignored." << endl;
goto exit;
}
// If our converter is already linked, we have nothing to do here.
if (gst_pad_is_linked (sinkPad))
{
// Best prefixes.
if (isVideoPad || isAudioPad)
{
qDebug() << " Found a better pad." << endl;
GstPad* oldPad = gst_pad_get_peer(sinkPad);
gst_pad_unlink(oldPad, sinkPad);
g_object_unref(oldPad);
}
else
{
#ifdef VIDEO_IMPL_VERBOSE
qDebug() << " We are already linked: ignoring." << endl;
#endif
goto exit;
}
}
// Attempt the link.
if (GST_PAD_LINK_FAILED (gst_pad_link (newPad, sinkPad)))
{
#ifdef VIDEO_IMPL_VERBOSE
qDebug() << " Type is '" << newPadType << "' but link failed." << endl;
#endif // ifdef
goto exit;
}
else
{
if (isVideoPad)
p->videoConnect();
else if (isAudioPad)
p->audioConnect();
else
qWarning() << "Error: this pad is neither valid audio or video." << endl;
#ifdef VIDEO_IMPL_VERBOSE
qDebug() << " Link succeeded (type '" << newPadType << "')." << endl;
#endif // ifdef
}
exit:
// Unreference the new pad's caps, if we got them.
if (newPadCaps != NULL)
{
gst_caps_unref (newPadCaps);
}
// Unreference the sink pad.
if (sinkPad != NULL)
{
gst_object_unref (sinkPad);
}
}
bool VideoUriDecodeBinImpl::loadMovie(const QString& path) {
VideoImpl::loadMovie(path);
_uridecodebin0 = gst_element_factory_make("uridecodebin", NULL);
if ( !_uridecodebin0)
{
qWarning() << "Not all elements could be created." << endl;
unloadMovie();
return (-1);
}
// Build the pipeline. Note that we are NOT linking the source at this
// point. We will do it later.
gst_bin_add_many (GST_BIN (_pipeline),
_uridecodebin0,
NULL);
// Process URI.
QByteArray ba = path.toLocal8Bit();
gchar *filename_tmp = g_strdup((gchar*) path.toUtf8().constData());
gchar* uri = (gchar*) path.toUtf8().constData();
if (! gst_uri_is_valid(uri))
{
// Try to convert filename to URI.
GError* error = NULL;
qDebug() << "Calling gst_filename_to_uri : " << uri << endl;
uri = gst_filename_to_uri(filename_tmp, &error);
if (error)
{
qDebug() << "Filename to URI error: " << error->message << endl;
g_clear_error(&error);
gst_object_unref (uri);
freeResources();
return false;
}
}
g_free(filename_tmp);
// Connect to the pad-added signal
// Extract meta info.
GError* error = NULL;
GstDiscoverer* discoverer = gst_discoverer_new(5*GST_SECOND, &error);
if (!discoverer)
{
qDebug() << "Error creating discoverer: " << error->message << endl;
g_clear_error (&error);
return false;
}
GstDiscovererInfo* info = gst_discoverer_discover_uri(discoverer, uri, &error);
if (!info)
{
qDebug() << "Error getting discoverer info: " << error->message << endl;
g_clear_error (&error);
return false;
}
GstDiscovererResult result = gst_discoverer_info_get_result(info);
switch (result) {
case GST_DISCOVERER_URI_INVALID:
qDebug()<< "Invalid URI '" << uri << "'" << endl;
break;
case GST_DISCOVERER_ERROR:
qDebug()<< "Discoverer error: " << error->message << endl;
break;
case GST_DISCOVERER_TIMEOUT:
qDebug() << "Timeout" << endl;
break;
case GST_DISCOVERER_BUSY:
qDebug() << "Busy" << endl;
break;
case GST_DISCOVERER_MISSING_PLUGINS:{
const GstStructure *s;
gchar *str;
s = gst_discoverer_info_get_misc (info);
str = gst_structure_to_string (s);
qDebug() << "Missing plugins: " << str << endl;
g_free (str);
break;
}
case GST_DISCOVERER_OK:
qDebug() << "Discovered '" << uri << "'" << endl;
break;
}
g_clear_error (&error);
if (result != GST_DISCOVERER_OK) {
qDebug() << "This URI cannot be played" << endl;
return false;
}
// Gather info from video.
GList *videoStreams = gst_discoverer_info_get_video_streams (info);
if (!videoStreams)
{
qDebug() << "This URI does not contain any video streams" << endl;
return false;
}
// Retrieve meta-info.
_width = gst_discoverer_video_info_get_width((GstDiscovererVideoInfo*)videoStreams->data);
_height = gst_discoverer_video_info_get_height((GstDiscovererVideoInfo*)videoStreams->data);
_duration = gst_discoverer_info_get_duration(info);
_seekEnabled = gst_discoverer_info_get_seekable(info);
// Free everything.
g_object_unref(discoverer);
gst_discoverer_info_unref(info);
gst_discoverer_stream_info_list_free(videoStreams);
// Connect pad signal.
g_signal_connect (_uridecodebin0, "pad-added", G_CALLBACK (VideoUriDecodeBinImpl::gstPadAddedCallback), this);
// Set uri of decoder.
g_object_set (_uridecodebin0, "uri", uri, NULL);
setPlayState(true);
return true;
}
VideoUriDecodeBinImpl::~VideoUriDecodeBinImpl()
{
}
}
-66
View File
@@ -1,66 +0,0 @@
/*
* VideoUriDecodeBinImpl.h
*
* (c) 2013 Sofian Audry -- info(@)sofianaudry(.)com
* (c) 2013 Alexandre Quessy -- alexandre(@)quessy(.)net
* (c) 2012 Jean-Sebastien Senecal
* (c) 2004 Mathieu Guindon, Julien Keable
* Based on code from Drone http://github.com/sofian/drone
* Based on code from the GStreamer Tutorials http://docs.gstreamer.com/display/GstSDK/Tutorials
*
* 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 3 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, see <http://www.gnu.org/licenses/>.
*/
#ifndef VIDEO_URIDECODEBIN_IMPL_H_
#define VIDEO_URIDECODEBIN_IMPL_H_
// GStreamer includes.
#include <gst/gst.h>
#include <gst/app/gstappsink.h>
#include <gst/pbutils/pbutils.h>
// Other includes.
#include "MM.h"
#include <QtOpenGL>
#include <QMutex>
#include <QWaitCondition>
#include <glib.h>
#if __APPLE__
#include <OpenGL/gl.h>
#else
#include <GL/gl.h>
#endif
#include "VideoImpl.h"
namespace mmp {
class VideoUriDecodeBinImpl : public VideoImpl
{
public:
VideoUriDecodeBinImpl();
~VideoUriDecodeBinImpl();
static void gstPadAddedCallback(GstElement *src, GstPad *newPad, VideoUriDecodeBinImpl* p);
bool loadMovie(const QString& path);
bool isLive() {return false;}
private:
GstElement *_uridecodebin0;
//bool _videoIsConnected;
};
}
#endif /* ifndef */
-80
View File
@@ -1,80 +0,0 @@
/*
* VideoV4l2SrcImpl.cpp
*
* (c) 2016 Vasilis Liaskovitis -- vliaskov@gmail.com
* (c) 2013 Sofian Audry -- info(@)sofianaudry(.)com
* (c) 2013 Alexandre Quessy -- alexandre(@)quessy(.)net
* (c) 2012 Jean-Sebastien Senecal
* (c) 2004 Mathieu Guindon, Julien Keable
* Based on code from Drone http://github.com/sofian/drone
* Based on code from the GStreamer Tutorials http://docs.gstreamer.com/display/GstSDK/Tutorials
*
* 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 3 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, see <http://www.gnu.org/licenses/>.
*/
#include "VideoV4l2SrcImpl.h"
#include <cstring>
#include <iostream>
namespace mmp {
VideoV4l2SrcImpl::VideoV4l2SrcImpl() :
_v4l2src0(NULL)
{
}
bool VideoV4l2SrcImpl::loadMovie(const QString& path) {
VideoImpl::loadMovie(path);
_v4l2src0 = gst_element_factory_make("v4l2src", NULL);
if ( !_v4l2src0)
{
qWarning() << "Not all elements could be created." << endl;
unloadMovie();
return (-1);
}
// Build the pipeline. Note that we are NOT linking the source at this
// point. We will do it later.
gst_bin_add_many (GST_BIN (_pipeline),
_v4l2src0,
NULL);
if (! gst_element_link_many (_v4l2src0, _queue0, NULL))
{
qDebug() << "Could not link v4l2src" << endl;
unloadMovie();
return false;
}
// Configure video appsink.
GstCaps *videoCaps = gst_caps_from_string ("video/x-raw,format=RGBA,width=640,height=480");
g_object_set (_capsfilter0, "caps", videoCaps, NULL);
gst_caps_unref (videoCaps);
// Retrieve meta-info.
_width = 640;
_height = 480;
//_duration = ;
_seekEnabled = false;
setPlayState(true);
return TRUE;
}
VideoV4l2SrcImpl::~VideoV4l2SrcImpl()
{
}
}
-65
View File
@@ -1,65 +0,0 @@
/*
* VideoV4l2SrcImpl.h
*
* (c) 2016 Vasilis Liaskovitis -- vliaskov@gmail.com
* (c) 2013 Sofian Audry -- info(@)sofianaudry(.)com
* (c) 2013 Alexandre Quessy -- alexandre(@)quessy(.)net
* (c) 2012 Jean-Sebastien Senecal
* (c) 2004 Mathieu Guindon, Julien Keable
* Based on code from Drone http://github.com/sofian/drone
* Based on code from the GStreamer Tutorials http://docs.gstreamer.com/display/GstSDK/Tutorials
*
* 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 3 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, see <http://www.gnu.org/licenses/>.
*/
#ifndef VIDEO_V4L2SRC_IMPL_H_
#define VIDEO_V4L2SRC_IMPL_H_
// GStreamer includes.
#include <gst/gst.h>
#include <gst/app/gstappsink.h>
#include <gst/pbutils/pbutils.h>
// Other includes.
#include "MM.h"
#include <QtOpenGL>
#include <QMutex>
#include <QWaitCondition>
#include <glib.h>
#if __APPLE__
#include <OpenGL/gl.h>
#else
#include <GL/gl.h>
#endif
#include "VideoImpl.h"
namespace mmp {
class VideoV4l2SrcImpl : public VideoImpl
{
public:
VideoV4l2SrcImpl();
~VideoV4l2SrcImpl();
bool loadMovie(const QString& path);
bool isLive() {return true;}
private:
GstElement *_v4l2src0;
};
}
#endif /* ifndef */