/usr/include/libdmr/player_backend.h is in libdmr-dev 3.2.3-2.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 | /*
* (c) 2017, Deepin Technology Co., Ltd. <support@deepin.org>
*
* 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
* is provided AS IS, WITHOUT ANY WARRANTY; without even the implied
* warranty of MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, and
* NON-INFRINGEMENT. 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/>.
*
* In addition, as a special exception, the copyright holders give
* permission to link the code of portions of this program with the
* OpenSSL library under certain conditions as described in each
* individual source file, and distribute linked combinations
* including the two.
* You must obey the GNU General Public License in all respects
* for all of the code used other than OpenSSL. If you modify
* file(s) with this exception, you may extend this exception to your
* version of the file(s), but you are not obligated to do so. If you
* do not wish to do so, delete this exception statement from your
* version. If you delete this exception statement from all source
* files in the program, then also delete it here.
*/
#ifndef _DMR_PLAYER_BACKEND_H
#define _DMR_PLAYER_BACKEND_H
#include <QtWidgets>
namespace dmr {
class PlayingMovieInfo;
// Player backend base class
// There are only two backends: mpv and vpu
// mpv is the only and default on all platform except Sunway
// vpu is default for Sunway if media file can be hardware-decoded by coda vpu
class Backend: public QWidget {
Q_OBJECT
Q_PROPERTY(qint64 duration READ duration)
Q_PROPERTY(qint64 elapsed READ elapsed NOTIFY elapsedChanged)
Q_PROPERTY(QSize videoSize READ videoSize NOTIFY videoSizeChanged)
Q_PROPERTY(bool paused READ paused)
Q_PROPERTY(PlayState state READ state NOTIFY stateChanged)
public:
enum PlayState {
Playing,
Paused,
Stopped
};
Q_ENUM(PlayState)
enum SoundMode {
Stereo,
Left,
Right
};
Q_ENUM(SoundMode)
enum DebugLevel {
Info,
Debug, // some normal debug info
Verbose // very verbosed output from backend
};
Q_ENUM(DebugLevel)
Backend(QWidget *parent = 0) {}
virtual ~Backend() {}
virtual void setPlayFile(const QUrl& url) { _file = url; }
virtual void setDVDDevice(const QString& path) { _dvdDevice = path; }
// NOTE: need to check if file is playable by this backend,
// this is important especially for vpu
virtual bool isPlayable() const = 0;
virtual qint64 duration() const { return 0; }
virtual qint64 elapsed() const { return 0; }
virtual QSize videoSize() const = 0;
virtual bool paused() { return _state == PlayState::Paused; }
virtual PlayState state() const { return _state; }
virtual const PlayingMovieInfo& playingMovieInfo() = 0;
virtual void setPlaySpeed(double times) = 0;
virtual void savePlaybackPosition() = 0;
virtual void updateSubStyle(const QString& font, int sz) = 0;
virtual void setSubCodepage(const QString& cp) = 0;
virtual QString subCodepage() = 0;
virtual void addSubSearchPath(const QString& path) = 0;
virtual bool loadSubtitle(const QFileInfo& fi) = 0;
virtual void toggleSubtitle() = 0;
virtual bool isSubVisible() = 0;
virtual void selectSubtitle(int id) = 0;
virtual void selectTrack(int id) = 0;
virtual void setSubDelay(double secs) = 0;
virtual double subDelay() const = 0;
virtual int aid() const = 0;
virtual int sid() const = 0;
virtual void changeSoundMode(SoundMode sm) {}
virtual int volume() const = 0;
virtual bool muted() const = 0;
virtual void setVideoAspect(double r) = 0;
virtual double videoAspect() const = 0;
virtual int videoRotation() const = 0;
virtual void setVideoRotation(int degree) = 0;
virtual QImage takeScreenshot() = 0;
virtual void burstScreenshot() = 0; //initial the start of burst screenshotting
virtual void stopBurstScreenshot() = 0;
// hack: used to access backend internal states
virtual QVariant getProperty(const QString&) = 0;
virtual void setProperty(const QString&, const QVariant&) = 0;
static void setDebugLevel(DebugLevel lvl) { _debugLevel = lvl; }
Q_SIGNALS:
void tracksChanged();
void elapsedChanged();
void videoSizeChanged();
void stateChanged();
void fileLoaded();
void muteChanged();
void volumeChanged();
void sidChanged();
void aidChanged();
//emit during burst screenshotting
void notifyScreenshot(const QImage& frame, qint64 time);
public slots:
virtual void play() = 0;
virtual void pauseResume() = 0;
virtual void stop() = 0;
virtual void seekForward(int secs) = 0;
virtual void seekBackward(int secs) = 0;
virtual void seekAbsolute(int) = 0;
virtual void volumeUp() = 0;
virtual void volumeDown() = 0;
virtual void changeVolume(int val) = 0;
virtual void toggleMute() = 0;
protected:
PlayState _state { PlayState::Stopped };
QString _dvdDevice {"/dev/sr0"};
QUrl _file;
static DebugLevel _debugLevel;
};
}
#endif /* ifndef _DMR_PLAYER_BACKEND_H */
|