diff options
author | Jacques Samain <jsamain+fdio@cisco.com> | 2018-01-03 14:21:23 +0100 |
---|---|---|
committer | Jacques Samain <jsamain+fdio@cisco.com> | 2018-01-03 14:21:23 +0100 |
commit | aff4155325a95f0e1dce85426c18592b22062cfa (patch) | |
tree | aa8ad157fb1acecede747c1489864a430bc25317 /qml | |
parent | 3abd95a2501be987eca0fa5c59f01e84a98cf202 (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 'qml')
-rwxr-xr-x | qml/Viper/ControlPanel.qml | 7 | ||||
-rwxr-xr-x | qml/Viper/OpenMpd.qml | 123 | ||||
-rwxr-xr-x | qml/Viper/Options.qml | 122 | ||||
-rwxr-xr-x | qml/Viper/main.qml | 69 |
4 files changed, 19 insertions, 302 deletions
diff --git a/qml/Viper/ControlPanel.qml b/qml/Viper/ControlPanel.qml index 4f5848d7..d54bd67a 100755 --- a/qml/Viper/ControlPanel.qml +++ b/qml/Viper/ControlPanel.qml @@ -199,8 +199,7 @@ Rectangle { onClicked: { if (checked === true) { console.log(adaptationLogic) - console.log(lastPlayed) - dashPlayer.downloadMPD(lastPlayed, adaptationLogic, icn) + dashPlayer.downloadMPD(adaptationLogic, icn) } else { dashPlayer.pause(); } @@ -309,7 +308,7 @@ Rectangle { } } - Button { + /* Button { id: openBtn bgColor: "transparent" bgColorSelected: "transparent" @@ -322,7 +321,7 @@ Rectangle { if(checked) openMpd() } - } + } */ Button { id: repeatBtn bgColor: "transparent" diff --git a/qml/Viper/OpenMpd.qml b/qml/Viper/OpenMpd.qml deleted file mode 100755 index c32fb7d7..00000000 --- a/qml/Viper/OpenMpd.qml +++ /dev/null @@ -1,123 +0,0 @@ -/* - * Copyright (c) 2017 Cisco and/or its affiliates. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at: - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import QtQuick 2.5 -import QtQuick.Extras 1.4 -import QtQuick.Controls.Styles 1.4 -import QtQuick.Controls 2.0 -import QtQuick.Layouts 1.3 -import "utils.js" as Utils -Rectangle { - signal closeOpenMpd - signal saveAndPlayMpd(string newOpenMpd) - - id: root - color: "#88445566" - - opacity: 0 - radius: Utils.scaled(10) - height: Utils.scaled(100) - width: Utils.scaled(300) - enabled: false; - GridLayout { - id : grid - z: parent.z + 1 - anchors.fill: parent - rows : 2 - columns : 2 - anchors.leftMargin: Utils.scaled(12) - - anchors.rightMargin: Utils.scaled(12) - anchors.topMargin: Utils.scaled(12) - anchors.bottomMargin: Utils.scaled(12) - property double colMulti : grid.width / grid.columns - property double rowMulti : grid.height / grid.rows - - function prefWidth(item) - { - return colMulti * item.Layout.columnSpan - } - - function prefHeight(item) - { - return rowMulti * item.Layout.rowSpan - } - - TextInput { - - id: sourceTextInput - text: lastPlayed - Layout.rowSpan : 1 - Layout.columnSpan : 2 - Layout.preferredWidth : parent.colMulti * 2 + Utils.scaled(5) //grid.prefWidth(this) - Layout.preferredHeight : parent.rowMulti//grid.prefHeight(this) - color: "white" - } - // ComboBox { - // z: parent.z + 1 - // id: comboBoxList - // Layout.rowSpan : 1 - // Layout.columnSpan : 2 - // Layout.preferredWidth : parent.colMulti * 2 + Utils.scaled(5) //grid.prefWidth(this) - // Layout.preferredHeight : parent.rowMulti//grid.prefHeight(this) - // - // onCurrentIndexChanged: { - // } - - // model: ListModel { - // id: mpdItems - // ListElement { text: "gastown"; } - // ListElement { text: "sintel"; } - // } - // currentIndex: find(lastPlayed) - //} - - Button { - id: cancelBtn - z: parent.z + 1 - - text: "Cancel" - Layout.rowSpan : 1 - Layout.columnSpan: 1 - Layout.preferredWidth : grid.prefWidth(this) - Layout.preferredHeight : grid.prefHeight(this) - onClicked: { - - closeOpenMpd(); - } - } - - Button { - id: downloadBtn - z: parent.z + 1 - Layout.rowSpan : 1 - Layout.columnSpan: 1 - Layout.preferredWidth : grid.prefWidth(this) - Layout.preferredHeight : grid.prefHeight(this) - text: "Download" - onClicked: { - saveAndPlayMpd(sourceTextInput.text) - closeOpenMpd(); - } - - - } - - - - } - -} - diff --git a/qml/Viper/Options.qml b/qml/Viper/Options.qml index 82d3e3e7..f8ed0909 100755 --- a/qml/Viper/Options.qml +++ b/qml/Viper/Options.qml @@ -24,10 +24,7 @@ Rectangle { signal closeOptions signal saveAdaptationLogic(string selectedAdaptationLogic, int adaptationLogicKey) signal saveIcn(bool selectedIcn) - signal saveIcnPrefix(string selectedIcnPrefix) - signal saveHttpPrefix(string selectedHttpPrefix) - signal saveIcnSuffix(string selectedIcnSuffix) - signal saveHttpSuffix(string selectedHttpSuffix) + signal saveVideoURI(string selectedVideoURI) signal saveSegmentBufferSize(real selectedSegmentBufferSize) signal saveRateAlpha(real selectedRateAlpha) signal saveBufferReservoirThreshold(real selectedBufferReservoirThreshold) @@ -107,7 +104,7 @@ Rectangle { ListElement { text: "Always Lowest"; } ListElement { text: "Rate Based"; } ListElement { text: "Buffer Based"; } - ListElement { text: "Buffer Rate Based"; } + ListElement { text: "AdapTech"; } ListElement { text: "Buffer Based Three Threshold"; } ListElement { text: "Panda"; } ListElement { text: "Bola"; } @@ -407,128 +404,34 @@ Rectangle { } Item { - id: itemIcnPrefix + id: itemVideoURI anchors.top: parent.top anchors.left: parent.left anchors.right: parent.right anchors.rightMargin: parent.width/2 - anchors.topMargin: Utils.scaled(12) + heightRow + anchors.topMargin: Utils.scaled(18) + heightRow Label { - text: "ICN Prefix:" - id: labelIcnPrefix + text: "Video URI:" + id: labelVideoURI color: " white" anchors.top: parent.top - anchors.right: textInputIcnPrefix.left + anchors.right: textInputVideoURI.left anchors.rightMargin: Utils.scaled(5) - anchors.topMargin: (textInputIcnPrefix.height - height)/2 + anchors.topMargin: (textInputVideoURI.height - height)/2 font.bold: true font.pixelSize: Utils.scaled(10); } TextInput { width: parent.width/4*3 - id: textInputIcnPrefix + id: textInputVideoURI anchors.top: parent.top anchors.left: parent.left anchors.leftMargin: Utils.scaled(200) font.pixelSize: Utils.scaled(20) color: "white" - text: icnPrefix - } - } - - Item { - id: itemIcnSuffix - anchors.top: parent.top - anchors.left: parent.left - anchors.right: parent.right - anchors.leftMargin: parent.width/2 - anchors.topMargin: Utils.scaled(12) + heightRow - - Label { - text: "ICN Suffix:" - id: labelIcnSuffix - color: " white" - anchors.top: parent.top - anchors.right: textInputIcnSuffix.left - anchors.rightMargin: Utils.scaled(5) - anchors.topMargin: (textInputIcnSuffix.height - height)/2 - font.bold: true - font.pixelSize: Utils.scaled(10); - } - - TextInput { - width: parent.width/4*3 - id: textInputIcnSuffix - anchors.top: parent.top - anchors.right: parent.right - font.pixelSize: Utils.scaled(20) - color: "white" - text: icnSuffix - } - } - - Item { - id: itemHttpPrefix - anchors.top: parent.top - anchors.left: parent.left - anchors.right: parent.right - anchors.rightMargin: parent.width/2 - anchors.topMargin: Utils.scaled(12) + 2*heightRow - - Label { - text: "TCP Prefix:" - id: labelHttpPrefix - color: " white" - anchors.top: parent.top - anchors.right: textInputHttpPrefix.left - anchors.rightMargin: Utils.scaled(5) - anchors.topMargin: (textInputHttpPrefix.height - height)/2 - font.bold: true - font.pixelSize: Utils.scaled(10); - } - - TextInput { - width: parent.width/4*3 - id: textInputHttpPrefix - anchors.top: parent.top - anchors.left: parent.left - anchors.leftMargin: Utils.scaled(200) - font.pixelSize: Utils.scaled(20) - color: "white" - text: httpPrefix - } - } - - Item { - id: itemHttpSuffix - anchors.top: parent.top - anchors.left: parent.left - anchors.right: parent.right - anchors.leftMargin: parent.width/2 - anchors.topMargin: Utils.scaled(12) + 2*heightRow - - Label { - text: "TCP Suffix:" - id: labelHttpSuffix - color: " white" - anchors.top: parent.top - anchors.right: textInputHttpSuffix.left - anchors.rightMargin: Utils.scaled(5) - anchors.topMargin: (textInputHttpSuffix.height - height)/2 - font.bold: true - font.pixelSize: Utils.scaled(10); - } - - TextInput { - width: parent.width/4*3 - id: textInputHttpSuffix - anchors.top: parent.top - anchors.right: parent.right - font.pixelSize: Utils.scaled(20) - color: "white" - text: httpSuffix + text: videoURI } } @@ -1678,10 +1581,7 @@ Rectangle { onClicked: { saveAdaptationLogic(adaptationLogicModel.get(comboAdaptationSetList.currentIndex).text, comboAdaptationSetList.currentIndex); saveIcn(switchIcn.checked) - saveIcnPrefix(textInputIcnPrefix.text) - saveHttpPrefix(textInputHttpPrefix.text) - saveIcnSuffix(textInputIcnSuffix.text) - saveHttpSuffix(textInputHttpSuffix.text) + saveVideoURI(textInputVideoURI.text) saveSegmentBufferSize(spinboxSegmentBufferSize.value/100) saveRateAlpha(spinboxRateAlpha.value/100) saveBufferReservoirThreshold(spinboxBufferReservoirThreshold.value/100) diff --git a/qml/Viper/main.qml b/qml/Viper/main.qml index bd90103a..e170931b 100755 --- a/qml/Viper/main.qml +++ b/qml/Viper/main.qml @@ -35,12 +35,8 @@ Rectangle { property bool pause: false property bool stop: true property bool buffering: false - property string lastPlayed: "" property string adaptationLogic: "" - property string icnPrefix: "" - property string httpPrefix: "" - property string icnSuffix: "" - property string httpSuffix: "" + property string videoURI: "" property real alpha: 0 property real segmentBufferSize: 0 property bool icn: false @@ -122,11 +118,6 @@ Rectangle { buffering = false } - function setLastPlayed(initLastPlayed) - { - lastPlayed = initLastPlayed - } - function setAdaptationLogic(initAdaptationLogic) { adaptationLogic = initAdaptationLogic @@ -416,23 +407,11 @@ Rectangle { onPauseGraph:graphPanel.pauseTimer() onDownloadMPD: mpdList.downloadMpd() - onOpenMpd: { - lastPlayed = dashPlayer.getLastPlayed() - icn = dashPlayer.getIcn() - adaptationLogic = dashPlayer.getAdaptationLogic() - openMpd.enabled = true; - openMpd.opacity = 0.9 - enabled = false - } onOpenOptions: { - lastPlayed = dashPlayer.getLastPlayed() icn = dashPlayer.getIcn() adaptationLogic = dashPlayer.getAdaptationLogic() - icnPrefix = dashPlayer.getIcnPrefix() - httpPrefix = dashPlayer.getHttpPrefix() - icnSuffix = dashPlayer.getIcnSuffix() - httpSuffix = dashPlayer.getHttpSuffix() + videoURI = dashPlayer.getVideoURI() segmentBufferSize = dashPlayer.getSegmentBufferSize() rateAlpha = dashPlayer.getRateAlpha() bufferReservoirThreshold = dashPlayer.getBufferReservoirThreshold() @@ -555,30 +534,6 @@ Rectangle { } } - OpenMpd { - id: openMpd - enabled: false - objectName: "openMpd" - - - anchors.centerIn: root - - onCloseOpenMpd: { - control.uncheckOpenBtn(); - control.enabled = true; - enabled = false; - opacity = 0 - } - - onSaveAndPlayMpd: { - dashPlayer.setLastPlayed(newOpenMpd) - lastPlayed = newOpenMpd - console.log("SAVE AND PLAY THE MPD QUEEN\n") - console.log(adaptationLogic) - dashPlayer.downloadMPD(newOpenMpd, adaptationLogic, icn) - } - } - Options { id: options enabled: false @@ -614,23 +569,9 @@ Rectangle { icn = selectedIcn } - onSaveIcnPrefix: { - dashPlayer.setIcnPrefix(selectedIcnPrefix) - icnPrefix = selectedIcnPrefix - } - - onSaveHttpPrefix: { - dashPlayer.setHttpPrefix(selectedHttpPrefix) - httpPrefix = selectedHttpPrefix - } - onSaveIcnSuffix: { - dashPlayer.setIcnSuffix(selectedIcnSuffix) - icnSuffix = selectedIcnSuffix - } - - onSaveHttpSuffix: { - dashPlayer.setHttpSuffix(selectedHttpSuffix) - httpSuffix = selectedHttpSuffix + onSaveVideoURI: { + dashPlayer.setVideoURI(selectedVideoURI) + videoURI = selectedVideoURI } onSaveSegmentBufferSize: { |