aboutsummaryrefslogtreecommitdiffstats
path: root/Common
diff options
context:
space:
mode:
authorJacques Samain <jsamain+fdio@cisco.com>2018-01-03 14:21:23 +0100
committerJacques Samain <jsamain+fdio@cisco.com>2018-01-03 14:21:23 +0100
commitaff4155325a95f0e1dce85426c18592b22062cfa (patch)
treeaa8ad157fb1acecede747c1489864a430bc25317 /Common
parent3abd95a2501be987eca0fa5c59f01e84a98cf202 (diff)
Refactoring adaptation logic
Refactoring GUI: removed prefix/suffix to have only one video URI Change-Id: Ie0add7c1d8ace89410917ab7cc414c668c528394 Signed-off-by: Jacques Samain <jsamain+fdio@cisco.com>
Diffstat (limited to 'Common')
-rw-r--r--Common/Config.cpp88
-rw-r--r--Common/Config.h24
2 files changed, 13 insertions, 99 deletions
diff --git a/Common/Config.cpp b/Common/Config.cpp
index 85278251..70b67765 100644
--- a/Common/Config.cpp
+++ b/Common/Config.cpp
@@ -157,10 +157,7 @@ public:
settings.endGroup();
settings.beginGroup(QString::fromLatin1("backend"));
- settings.setValue(QString::fromLatin1("icn_prefix"), icn_prefix);
- settings.setValue(QString::fromLatin1("http_prefix"), http_prefix);
- settings.setValue(QString::fromLatin1("icn_suffix"), icn_suffix);
- settings.setValue(QString::fromLatin1("http_suffix"), http_suffix);
+ settings.setValue(QString::fromLatin1("video_uri"), video_uri);
settings.setValue(QString::fromLatin1("segment_buffer_size"), segment_buffer_size);
settings.endGroup();
@@ -285,10 +282,7 @@ public:
QString frag_header;
QString frag_sample;
QString frag_pp;
- QString icn_prefix;
- QString http_prefix;
- QString icn_suffix;
- QString http_suffix;
+ QString video_uri;
qreal segment_buffer_size;
QString last_played;
QString adaptation_logic;
@@ -527,16 +521,12 @@ void Config::reload()
settings.endGroup();
settings.beginGroup(QString::fromLatin1("backend"));
- setIcnPrefix(settings.value(QString::fromLatin1("icn_prefix"), QString::fromLatin1("http://webserver/")).toString());
- setHttpPrefix(settings.value(QString::fromLatin1("http_prefix"), QString::fromLatin1("http://10.60.17.153:8080/")).toString());
- setIcnSuffix(settings.value(QString::fromLatin1("icn_suffix"), QString::fromLatin1("/mpd")).toString());
- setHttpSuffix(settings.value(QString::fromLatin1("http_suffix"), QString::fromLatin1("/mpd")).toString());
+ setVideoURI(settings.value(QString::fromLatin1("video_uri"), QString::fromLatin1("http://webserver/sintel/mpd")).toString());
setSegmentBufferSize(settings.value(QString::fromLatin1("segment_buffer_size"), 20).toReal());
settings.endGroup();
settings.beginGroup(QString::fromLatin1("playback"));
- setLastPlayed(settings.value(QString::fromLatin1("last_played"), QString::fromLatin1("sintel")).toString());
setAdaptationLogic(settings.value(QString::fromLatin1("adaptation_logic"), QString::fromLatin1("Buffer Based")).toString());
setIcn(settings.value(QString::fromLatin1("icn"), true).toBool());
settings.endGroup();
@@ -1297,62 +1287,17 @@ Config& Config::setAbortOnTimeout(bool value)
return *this;
}
-QString Config::icnPrefix() const
+QString Config::videoURI() const
{
- return mpData->icn_prefix;
+ return mpData->video_uri;
}
-Config& Config::setIcnPrefix(const QString &text)
+Config& Config::setVideoURI(const QString &text)
{
- if (mpData->icn_prefix == text)
+ if (mpData->video_uri == text)
return *this;
- mpData->icn_prefix = text;
- Q_EMIT icnPrefixChanged();
- Q_EMIT changed();
- return *this;
-}
-
-QString Config::icnSuffix() const
-{
- return mpData->icn_suffix;
-}
-
-Config& Config::setIcnSuffix(const QString &text)
-{
- if (mpData->icn_suffix == text)
- return *this;
- mpData->icn_suffix = text;
- Q_EMIT icnSuffixChanged();
- Q_EMIT changed();
- return *this;
-}
-
-QString Config::httpPrefix() const
-{
- return mpData->http_prefix;
-}
-
-Config& Config::setHttpPrefix(const QString &text)
-{
- if (mpData->http_prefix == text)
- return *this;
- mpData->http_prefix = text;
- Q_EMIT httpPrefixChanged();
- Q_EMIT changed();
- return *this;
-}
-
-QString Config::httpSuffix() const
-{
- return mpData->http_suffix;
-}
-
-Config& Config::setHttpSuffix(const QString &text)
-{
- if (mpData->http_suffix == text)
- return *this;
- mpData->http_suffix = text;
- Q_EMIT httpSuffixChanged();
+ mpData->video_uri = text;
+ Q_EMIT videoURIChanged();
Q_EMIT changed();
return *this;
}
@@ -1372,21 +1317,6 @@ Config& Config::setSegmentBufferSize(qreal value)
return *this;
}
-QString Config::lastPlayed() const
-{
- return mpData->last_played;
-}
-
-Config& Config::setLastPlayed(const QString &text)
-{
- if (mpData->last_played == text)
- return *this;
- mpData->last_played = text;
- Q_EMIT lastPlayedChanged();
- Q_EMIT changed();
- return *this;
-}
-
QString Config::adaptationLogic() const
{
return mpData->adaptation_logic;
diff --git a/Common/Config.h b/Common/Config.h
index 018b757f..059c6771 100644
--- a/Common/Config.h
+++ b/Common/Config.h
@@ -69,13 +69,9 @@ class COMMON_EXPORT Config : public QObject
Q_PROPERTY(QString fragHeader READ fragHeader WRITE setFragHeader NOTIFY fragHeaderChanged)
Q_PROPERTY(QString fragSample READ fragSample WRITE setFragSample NOTIFY fragSampleChanged)
Q_PROPERTY(QString fragPostProcess READ fragPostProcess WRITE setFragPostProcess NOTIFY fragPostProcessChanged)
- Q_PROPERTY(QString icnPrefix READ icnPrefix WRITE setIcnPrefix NOTIFY icnPrefixChanged)
- Q_PROPERTY(QString httpPrefix READ httpPrefix WRITE setHttpPrefix NOTIFY httpPrefixChanged)
- Q_PROPERTY(QString icnSuffix READ icnSuffix WRITE setIcnSuffix NOTIFY icnSuffixChanged)
- Q_PROPERTY(QString httpSuffix READ httpSuffix WRITE setHttpSuffix NOTIFY httpSuffixChanged)
+ Q_PROPERTY(QString videoURI READ videoURI WRITE setVideoURI NOTIFY videoURIChanged)
Q_PROPERTY(qreal segmentBufferSize READ segmentBufferSize WRITE setSegmentBufferSize NOTIFY segmentBufferSizeChanged)
- Q_PROPERTY(QString lastPlayed READ lastPlayed WRITE setLastPlayed NOTIFY lastPlayedChanged)
Q_PROPERTY(QString adaptationLogic READ adaptationLogic WRITE setAdaptationLogic NOTIFY adaptationLogicChanged)
Q_PROPERTY(bool icn READ icn WRITE setIcn NOTIFY icnChanged)
Q_PROPERTY(qreal rateAlpha READ rateAlpha WRITE setRateAlpha NOTIFY rateAlphaChanged)
@@ -268,18 +264,10 @@ public:
QString fragSample() const;
Config& setFragPostProcess(const QString& text);
QString fragPostProcess() const;
- Config& setIcnPrefix(const QString &value);
- QString icnPrefix() const;
- Config& setIcnSuffix(const QString &value);
- QString icnSuffix() const;
- Config& setHttpPrefix(const QString &value);
- QString httpPrefix() const;
- Config& setHttpSuffix(const QString &value);
- QString httpSuffix() const;
+ Config& setVideoURI(const QString &value);
+ QString videoURI() const;
Config& setSegmentBufferSize(qreal value);
qreal segmentBufferSize() const;
- Config& setLastPlayed(const QString &value);
- QString lastPlayed() const;
Config& setAdaptationLogic(const QString &value);
QString adaptationLogic() const;
Config& setIcn(bool value);
@@ -403,12 +391,8 @@ public:
Q_SIGNAL void logLevelChanged();
Q_SIGNAL void languageChanged();
Q_SIGNAL void historyChanged();
- Q_SIGNAL void icnSuffixChanged();
- Q_SIGNAL void httpSuffixChanged();
- Q_SIGNAL void icnPrefixChanged();
- Q_SIGNAL void httpPrefixChanged();
+ Q_SIGNAL void videoURIChanged();
Q_SIGNAL void segmentBufferSizeChanged();
- Q_SIGNAL void lastPlayedChanged();
Q_SIGNAL void adaptationLogicChanged();
Q_SIGNAL void icnChanged();
Q_SIGNAL void rateAlphaChanged();