Skip to content

Commit

Permalink
Merge pull request #19 from dcaliste/gstreamer
Browse files Browse the repository at this point in the history
* Add missing QImage includes.

* Adjust calls for GStreamer 1.0 API.

* Remove references to internal taglib
  • Loading branch information
Olf0 authored Dec 5, 2023
2 parents 5401e88 + 52dd4f0 commit c7c795d
Show file tree
Hide file tree
Showing 7 changed files with 49 additions and 64 deletions.
23 changes: 2 additions & 21 deletions FlowPlayer.pro
Original file line number Diff line number Diff line change
Expand Up @@ -4,23 +4,9 @@ QT += core network sql xml


CONFIG += link_pkgconfig
PKGCONFIG += gstreamer-0.10 libresource libresource-glib
PKGCONFIG += gstreamer-1.0 libresource libresource-glib taglib

LIBS += -L"$$_PRO_FILE_PWD_/lib" -lmytaglib

INCLUDEPATH += src/taglib \
src/taglib/taglib \
src/taglib/taglib/toolkit \
src/taglib/taglib/ogg \
src/taglib/taglib/riff \
src/taglib/taglib/mpeg/id3v1 \
src/taglib/taglib/mpeg/id3v2 \
src/taglib/taglib/mpeg/id3v2/frames \
src/taglib/taglib/flac \
src/taglib/taglib/mod \
src/taglib/taglib/xm \

CONFIG += sailfishapp #taglib
CONFIG += sailfishapp

SOURCES += src/FlowPlayer.cpp \
src/utils.cpp \
Expand Down Expand Up @@ -130,8 +116,3 @@ HEADERS += \
src/player.h \
src/audioresource.h \
src/audioresourceqt.h

tag.files = lib/libmytaglib.so.1
tag.path = /usr/share/flowplayer/lib

INSTALLS += tag
5 changes: 3 additions & 2 deletions rpm/flowplayer.spec
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,9 @@ BuildRequires: pkgconfig(sailfishapp) >= 1.0.2
BuildRequires: pkgconfig(Qt5Core)
BuildRequires: pkgconfig(Qt5Qml)
BuildRequires: pkgconfig(Qt5Quick)
#BuildRequires: gstreamer1.0-devel # Something in the build configuration currently wants `gstreamer-devel-0.10`
# and `BuildRequires: pkgconfig(gstreamer1.0)` does not seem to work in contrast to `BuildRequires: gstreamer1.0-devel`
BuildRequires: pkgconfig(gstreamer-1.0)
BuildRequires: pkgconfig(libresource)
BuildRequires: pkgconfig(taglib)
BuildRequires: desktop-file-utils

# This description section includes metadata for SailfishOS:Chum, see
Expand Down
32 changes: 16 additions & 16 deletions src/datareader.cpp
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
#include "datareader.h"

#include "taglib/mpeg/mpegfile.h"
#include "taglib/flac/flacfile.h"
#include "taglib/toolkit/tlist.h"
#include "taglib/ogg/vorbis/vorbisfile.h"
#include "taglib/mp4/mp4file.h"
#include "taglib/riff/wav/wavfile.h"
#include "taglib/ogg/speex/speexfile.h"
#include "taglib/ogg/flac/oggflacfile.h"
#include "taglib/riff/aiff/aifffile.h"
#include "taglib/wavpack/wavpackfile.h"
#include "taglib/trueaudio/trueaudiofile.h"
#include "taglib/asf/asffile.h"
#include "taglib/ape/apefile.h"
#include "taglib/mpc/mpcfile.h"
#include "taglib/mod/modfile.h"
#include "taglib/xm/xmfile.h"
#include <mpegfile.h>
#include <flacfile.h>
#include <tlist.h>
#include <vorbisfile.h>
#include <mp4file.h>
#include <wavfile.h>
#include <speexfile.h>
#include <oggflacfile.h>
#include <aifffile.h>
#include <wavpackfile.h>
#include <trueaudiofile.h>
#include <asffile.h>
#include <apefile.h>
#include <mpcfile.h>
#include <modfile.h>
#include <xmfile.h>


#include <QDir>
Expand Down
1 change: 1 addition & 0 deletions src/lfm.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
#include <QString>
#include <QFileInfo>
#include <QDir>
#include <QImage>
#include <QNetworkConfigurationManager>
//#include <QtMultimediaKit/QMetaDataWriterControl>
//#include <QTextEdit>
Expand Down
32 changes: 16 additions & 16 deletions src/meta.cpp
Original file line number Diff line number Diff line change
@@ -1,22 +1,22 @@
#include "meta.h"
#include <QFileInfo>

#include "taglib/mpeg/mpegfile.h"
#include "taglib/flac/flacfile.h"
#include "taglib/toolkit/tlist.h"
#include "taglib/ogg/vorbis/vorbisfile.h"
#include "taglib/mp4/mp4file.h"
#include "taglib/riff/wav/wavfile.h"
#include "taglib/ogg/speex/speexfile.h"
#include "taglib/ogg/flac/oggflacfile.h"
#include "taglib/riff/aiff/aifffile.h"
#include "taglib/wavpack/wavpackfile.h"
#include "taglib/trueaudio/trueaudiofile.h"
#include "taglib/asf/asffile.h"
#include "taglib/ape/apefile.h"
#include "taglib/mpc/mpcfile.h"
#include "taglib/mod/modfile.h"
#include "taglib/xm/xmfile.h"
#include <mpegfile.h>
#include <flacfile.h>
#include <tlist.h>
#include <vorbisfile.h>
#include <mp4file.h>
#include <wavfile.h>
#include <speexfile.h>
#include <oggflacfile.h>
#include <aifffile.h>
#include <wavpackfile.h>
#include <trueaudiofile.h>
#include <asffile.h>
#include <apefile.h>
#include <mpcfile.h>
#include <modfile.h>
#include <xmfile.h>

Meta::Meta(QQuickItem *parent)
: QQuickItem(parent)
Expand Down
19 changes: 10 additions & 9 deletions src/player.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ static void prepare_next_stream(GstElement *obj, gpointer data) {

}

static void audio_changed(GstElement *obj, gpointer data) {
static void audio_changed(GstElement * playbin, GstElement *obj, gpointer data) {
qDebug() << "AUDIO CHANGED";
Player *self = (Player*) data;

Expand All @@ -67,7 +67,8 @@ static void audio_changed(GstElement *obj, gpointer data) {
self->m_position = 0;
emit self->durationChanged();
emit self->positionChanged();
self->timer->start(1000);
QMetaObject::invokeMethod(self->timer, "start", Qt::QueuedConnection,
Q_ARG(int, 1000));
}

gboolean Player::handleBusMessage (GstBus *, GstMessage *msg)
Expand Down Expand Up @@ -139,7 +140,7 @@ void Player::backend_init (int *argc,

loadEqualizer();

pipeline = gst_element_factory_make ("playbin2", "player");
pipeline = gst_element_factory_make ("playbin3", "player");

equalizer = gst_element_factory_make ("equalizer-10bands", "equalizer");
convert = gst_element_factory_make ("audioconvert", "convert");
Expand All @@ -165,7 +166,7 @@ void Player::backend_init (int *argc,
g_signal_connect(pipeline, "about-to-finish",
G_CALLBACK(prepare_next_stream), this);

g_signal_connect(pipeline, "audio-changed",
g_signal_connect(pipeline, "source-setup",
G_CALLBACK(audio_changed), this);

GstBus *bus;
Expand Down Expand Up @@ -374,7 +375,7 @@ void Player::backend_seek(gint value)
gst_element_seek (pipeline, 1.0,
GST_FORMAT_TIME,
(GstSeekFlags)(GST_SEEK_FLAG_FLUSH | GST_SEEK_FLAG_ACCURATE),
GST_SEEK_TYPE_CUR, value * GST_SECOND,
GST_SEEK_TYPE_SET, (m_position + value) * GST_SECOND,
GST_SEEK_TYPE_NONE, GST_CLOCK_TIME_NONE);
}

Expand All @@ -393,8 +394,8 @@ guint64 Player::backend_query_position()
gint64 cur;
gboolean result;

result = gst_element_query_position (pipeline, &format, &cur);
if (!result || format != GST_FORMAT_TIME)
result = gst_element_query_position (pipeline, format, &cur);
if (!result)
return GST_CLOCK_TIME_NONE;

return cur;
Expand All @@ -406,8 +407,8 @@ guint64 Player::backend_query_duration()
gint64 cur;
gboolean result;

result = gst_element_query_duration (pipeline, &format, &cur);
if (!result || format != GST_FORMAT_TIME)
result = gst_element_query_duration (pipeline, format, &cur);
if (!result)
return GST_CLOCK_TIME_NONE;

return cur;
Expand Down
1 change: 1 addition & 0 deletions src/utils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
#include <QString>
#include <QFileInfo>
#include <QDir>
#include <QImage>
#include <QNetworkConfigurationManager>
#include <QSettings>
//#include <MGConfItem>
Expand Down

0 comments on commit c7c795d

Please sign in to comment.