From 6fe18f6a466dbae611bbe1e4fa33b352cc4ef6df Mon Sep 17 00:00:00 2001 From: Angelo Mantellini Date: Wed, 12 Jun 2019 18:02:19 +0200 Subject: Correct android issues for libdash and viper Change-Id: Ia5b95bda6336b6544c881c416f852069662f5e3f Signed-off-by: Angelo Mantellini --- Input/ICNConnectionConsumerApi.cpp | 4 +- Managers/MultimediaManager.cpp | 5 +-- UI/DASHPlayer.cpp | 2 +- android/AndroidManifest.xml | 6 +-- android/gradle.properties | 4 +- android/res/drawable-hdpi/icon.png | Bin 2449 -> 127864 bytes android/res/drawable-ldpi/icon.png | Bin 1285 -> 127864 bytes android/res/drawable-mdpi/icon.png | Bin 1777 -> 114093 bytes android/src/io/fd/viper/ViperActivity.java | 51 ++++++++++++++++++++++++ android/src/org/player/viper/ViperActivity.java | 51 ------------------------ libdash/CMakeLists.txt | 44 ++++++++------------ main.cpp | 19 +++++++-- qml/Viper/Options.qml | 1 - viper.pro | 17 +++++--- 14 files changed, 106 insertions(+), 98 deletions(-) mode change 100755 => 100644 android/res/drawable-hdpi/icon.png mode change 100755 => 100644 android/res/drawable-ldpi/icon.png mode change 100755 => 100644 android/res/drawable-mdpi/icon.png create mode 100755 android/src/io/fd/viper/ViperActivity.java delete mode 100755 android/src/org/player/viper/ViperActivity.java diff --git a/Input/ICNConnectionConsumerApi.cpp b/Input/ICNConnectionConsumerApi.cpp index c93e9ed4..59330852 100644 --- a/Input/ICNConnectionConsumerApi.cpp +++ b/Input/ICNConnectionConsumerApi.cpp @@ -160,8 +160,8 @@ int ICNConnectionConsumerApi::Read(uint8_t *data, size_t len) } else { memcpy(data, (char*)response.getPayload().data() + this->dataPos, response.getPayload().size() - this->dataPos); - int length = response.getPayload().size() - this->dataPos; - if (length == 0) + int length = response.getPayload().size() - this->dataPos; + if (length == 0) { this->res = false; } diff --git a/Managers/MultimediaManager.cpp b/Managers/MultimediaManager.cpp index 81c5514e..1bbb2c65 100644 --- a/Managers/MultimediaManager.cpp +++ b/Managers/MultimediaManager.cpp @@ -112,7 +112,6 @@ bool MultimediaManager::initICN(const std::string& url) { pos = pos + 1; } - std::string downloadFile(this->downloadPath + url.substr(pos).c_str()); FILE *fp; fp = fopen(downloadFile.c_str(), "w"); @@ -131,6 +130,7 @@ bool MultimediaManager::initICN(const std::string& url) } fclose(fp); IMPD* mpd = this->manager->Open(const_cast(downloadFile.c_str()), url); + qDebug("downloadFile %s", downloadFile.c_str()); remove(downloadFile.c_str()); free(data); if(mpd == NULL) @@ -143,11 +143,10 @@ bool MultimediaManager::initICN(const std::string& url) this->mpdWrapper->updateMPD(mpd); for (size_t i = 0; i < this->managerObservers.size(); i++) this->managerObservers.at(i)->setMPDWrapper(this->mpdWrapper); - if( !strcmp(this->mpdWrapper->getType().c_str(), "static") ) + if( this->mpdWrapper->getType().compare("static") ) { delete icnConn; } - LeaveCriticalSection(&this->monitorMutex); return true; } diff --git a/UI/DASHPlayer.cpp b/UI/DASHPlayer.cpp index c53cbed7..63debc12 100644 --- a/UI/DASHPlayer.cpp +++ b/UI/DASHPlayer.cpp @@ -216,7 +216,7 @@ bool DASHPlayer::downloadMPD(const QString &adaptationLogic, bool icn) this->segmentDuration = this->mpdWrapper->onFirstDownloadMPD(this->gui); this->multimediaManager->setSegmentDuration(this->segmentDuration); - this->parametersAdaptation->segmentDuration = this->segmentDuration / 1000.0; //to have it in seconds + this->parametersAdaptation->segmentDuration = this->segmentDuration / 1000.0; //to have it in seconds this->onSettingsChanged(0,0,0,0,0); int j =0; std::string temp = adaptationLogic.toStdString(); diff --git a/android/AndroidManifest.xml b/android/AndroidManifest.xml index aaac206d..f8e00c3a 100644 --- a/android/AndroidManifest.xml +++ b/android/AndroidManifest.xml @@ -1,7 +1,7 @@ - + - + @@ -69,7 +69,7 @@ - +