Music Hub ..
A session-wide music playback service
Loading...
Searching...
No Matches
engine.h
Go to the documentation of this file.
1/*
2 * Copyright © 2013-2014 Canonical Ltd.
3 * Copyright © 2022 UBports Foundation.
4 *
5 * Contact: Alberto Mardegan <mardy@users.sourceforge.net>
6 *
7 * This program is free software: you can redistribute it and/or modify it
8 * under the terms of the GNU Lesser General Public License version 3,
9 * as published by the Free Software Foundation.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU Lesser General Public License for more details.
15 *
16 * You should have received a copy of the GNU Lesser General Public License
17 * along with this program. If not, see <http://www.gnu.org/licenses/>.
18 *
19 * Authored by: Thomas Voß <thomas.voss@canonical.com>
20 * Jim Hodapp <jim.hodapp@canonical.com>
21 */
22#ifndef LOMIRI_MEDIAHUBSERVICE_GSTREAMER_ENGINE_H
23#define LOMIRI_MEDIAHUBSERVICE_GSTREAMER_ENGINE_H
24
25#include "../engine.h"
26
27#include <QScopedPointer>
28
29class QUrl;
30
31namespace gstreamer
32{
33class EnginePrivate;
35{
36public:
38 ~Engine();
39
40 const QSharedPointer<MetaDataExtractor>& metaDataExtractor() const;
41
42 bool open_resource_for_uri(const QUrl &uri, bool do_pipeline_reset);
43 bool open_resource_for_uri(const QUrl &uri, const lomiri::MediaHubService::Player::HeadersType& headers);
44 void create_video_sink(uint32_t texture_id);
45
46 // use_main_thread will set the pipeline's new state in the main thread context
47 bool play();
48 bool stop();
49 bool pause();
50 bool seek_to(const std::chrono::microseconds& ts);
51
52 uint64_t position() const;
53 uint64_t duration() const;
54
55 void reset();
56
57protected:
60 void doSetVolume(double volume) override;
61
62private:
63 Q_DECLARE_PRIVATE(Engine)
64 QScopedPointer<EnginePrivate> d_ptr;
65};
66}
67
68#endif // LOMIRI_MEDIAHUBSERVICE_GSTREAMER_ENGINE_H
void doSetAudioStreamRole(lomiri::MediaHubService::Player::AudioStreamRole role) override
Definition engine.cpp:416
uint64_t duration() const
Definition engine.cpp:404
void doSetVolume(double volume) override
Definition engine.cpp:428
Engine(const lomiri::MediaHubService::Player::PlayerKey key)
Definition engine.cpp:296
bool open_resource_for_uri(const QUrl &uri, bool do_pipeline_reset)
Definition engine.cpp:321
void doSetLifetime(lomiri::MediaHubService::Player::Lifetime lifetime) override
Definition engine.cpp:422
const QSharedPointer< MetaDataExtractor > & metaDataExtractor() const
void create_video_sink(uint32_t texture_id)
Definition engine.cpp:337
bool seek_to(const std::chrono::microseconds &ts)
Definition engine.cpp:392
uint64_t position() const
Definition engine.cpp:398
Player::Lifetime lifetime() const
Definition engine.cpp:171
QMap< QString, QString > HeadersType
Definition player.h:57