- Change mediastreamer plugins path for Linux and Windows to plugins/mediastreamer

- Update path test with plugins folder
- Add test on Player before closing it
This commit is contained in:
Julien Wadel 2020-06-09 00:47:46 +02:00
parent 244a544e58
commit 0ac9f08b9f
6 changed files with 27 additions and 13 deletions

View file

@ -328,12 +328,12 @@ if(ENABLE_BUILD_VERBOSE)#useful to copy these Paths to QML previewers
endif()
if(APPLE)
if(MS2_PLUGINS_LOCATION)
set(MSPLUGINS_DIR ${MS2_PLUGINS_LOCATION})
set(MSPLUGINS_DIR ${MS2_PLUGINS_LOCATION})
else()
set(MSPLUGINS_DIR "Frameworks/mediastreamer2.framework/Versions/A/Libraries")
set(MSPLUGINS_DIR "Frameworks/mediastreamer2.framework/Versions/A/Libraries")
endif()
else()
set(MSPLUGINS_DIR "${CMAKE_INSTALL_LIBDIR}/mediastreamer/plugins")
set(MSPLUGINS_DIR "plugins/mediastreamer")
endif()
configure_file("${CMAKE_CURRENT_SOURCE_DIR}/src/config.h.cmake" "${CMAKE_CURRENT_BINARY_DIR}/config.h")
# ------------------------------------------------------------------------------

View file

@ -122,9 +122,10 @@ if (WIN32)
file(GLOB PDB_FILES "${LINPHONE_OUTPUT_DIR}/${CMAKE_INSTALL_LIBDIR}/*.pdb")
install(FILES ${PDB_FILES} DESTINATION "${CMAKE_INSTALL_BINDIR}/" PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE)
install(FILES "${CMAKE_CURRENT_BINARY_DIR}/../../${EXECUTABLE_NAME}_app.pdb" DESTINATION ${CMAKE_INSTALL_BINDIR})
endif()
endif()
install(FILES ${EXE_FILES} DESTINATION "${CMAKE_INSTALL_BINDIR}/")
install(DIRECTORY "${LINPHONE_OUTPUT_DIR}/${CMAKE_INSTALL_LIBDIR}/mediastreamer" DESTINATION "${CMAKE_INSTALL_LIBDIR}" USE_SOURCE_PERMISSIONS)
file(GLOB PLUGINS_FILES "${LINPHONE_OUTPUT_DIR}/${CMAKE_INSTALL_LIBDIR}/mediastreamer/plugins/*")
install(FILES ${PLUGINS_FILES} DESTINATION "plugins/mediastreamer/" )
file(GLOB GRAMMAR_FILES "${LINPHONE_OUTPUT_DIR}/${CMAKE_INSTALL_DATAROOTDIR}/Belr/grammars/*")
install(FILES ${GRAMMAR_FILES} DESTINATION "${CMAKE_INSTALL_DATAROOTDIR}/belr/grammars/" )
install(DIRECTORY "${LINPHONE_OUTPUT_DIR}/${CMAKE_INSTALL_DATAROOTDIR}/images" DESTINATION "${CMAKE_INSTALL_DATAROOTDIR}" USE_SOURCE_PERMISSIONS OPTIONAL)
@ -237,7 +238,8 @@ else()# Not Windows and Apple
if(ENABLE_BUILD_VERBOSE)
message("INSTALLATION : ${LINPHONE_OUTPUT_DIR}/${CMAKE_INSTALL_DATAROOTDIR}/" )
endif()
install(DIRECTORY "${LINPHONE_OUTPUT_DIR}/${CMAKE_INSTALL_LIBDIR}/mediastreamer" DESTINATION "${CMAKE_INSTALL_LIBDIR}" USE_SOURCE_PERMISSIONS)
file(GLOB PLUGINS_FILES "${LINPHONE_OUTPUT_DIR}/${CMAKE_INSTALL_LIBDIR}/mediastreamer/plugins/*")
install(FILES ${PLUGINS_FILES} DESTINATION "plugins/mediastreamer/" )
# Install desktop/icon files.
configure_file("${CMAKE_CURRENT_SOURCE_DIR}/../../assets/linphone.desktop.cmake" "${CMAKE_CURRENT_BINARY_DIR}/../../${EXECUTABLE_NAME}.desktop" @ONLY)
install(FILES "${CMAKE_CURRENT_BINARY_DIR}/../../${EXECUTABLE_NAME}.desktop" DESTINATION "${CMAKE_INSTALL_DATADIR}/applications")

View file

@ -106,8 +106,10 @@ static inline string getWritableFilePath (const QString &filename) {
// bin/linphone
// lib/
// lib64/
// plugins/
// share/
// But in some cases, it can be :
// /linphone
// lib/
@ -125,12 +127,11 @@ static inline string getWritableFilePath (const QString &filename) {
static inline QDir getAppPackageDir () {
QDir dir(QCoreApplication::applicationDirPath());
if (dir.dirName() == QLatin1String("MacOS")) {
dir.cdUp();
dir.cdUp();
} else if( !dir.exists("lib") && !dir.exists("lib64")){// Check if these folders are in the current path
dir.cdUp();
if(!dir.exists("lib") && !dir.exists("lib64"))
qWarning() <<"The application's location is not correct: You have to put your 'bin/' folder next to 'lib/' folder.";
if(!dir.exists("lib") && !dir.exists("lib64") && !dir.exists("plugins"))
qWarning() <<"The application's location is not correct: You have to put your 'bin/' folder next to 'lib/' or 'plugins/' folder.";
}
return dir;
}

View file

@ -136,7 +136,7 @@ void FileDownloader::handleDownloadFinished() {
cleanDownloadEnd();
emit downloadFailed();
} else {
qInfo() << QStringLiteral("Download of %1 finished.").arg(mUrl.toString());
qInfo() << QStringLiteral("Download of %1 finished to %2").arg(mUrl.toString(), mDestinationFile.fileName());
mDestinationFile.close();
cleanDownloadEnd();
emit downloadFinished(mDestinationFile.fileName());

View file

@ -73,7 +73,8 @@ SoundPlayer::SoundPlayer (QObject *parent) : QObject(parent) {
SoundPlayer::~SoundPlayer () {
mForceCloseTimer->stop();
mInternalPlayer->close();
if( mInternalPlayer)
mInternalPlayer->close();
}
// -----------------------------------------------------------------------------

View file

@ -41,6 +41,16 @@ rm -rf "${WORK_DIR}/AppDir/usr/Packages"
rm -rf "${WORK_DIR}/AppDir/usr/lib"
rm -rf "${WORK_DIR}/AppDir/usr/lib64"
if [ -d "${BIN_SOURCE_DIR}/lib64/mediastreamer" ]; then
mkdir -p "${WORK_DIR}/AppDir/usr/plugins/"
cp -rf "${BIN_SOURCE_DIR}"/lib64/mediastreamer "${WORK_DIR}/AppDir/usr/plugins/"
fi
if [ -d "${BIN_SOURCE_DIR}/lib/mediastreamer" ]; then
mkdir -p "${WORK_DIR}/AppDir/usr/plugins/"
cp -rf "${BIN_SOURCE_DIR}"/lib/mediastreamer "${WORK_DIR}/AppDir/usr/plugins/"
fi
if [ -f "${WORK_DIR}/AppBin/linuxdeploy-x86_64.AppImage" ]; then
echo "linuxdeploy-x86_64.AppImage exists"
else
@ -71,7 +81,7 @@ else
#./linuxdeploy-x86_64.AppImage --appdir=${WORK_DIR}/ -e ${WORK_DIR}/app/bin/linphone --output appimage --desktop-file=${WORK_DIR}/app/share/applications/linphone.desktop -i ${WORK_DIR}/app/share/icons/hicolor/scalable/apps/linphone.svg
echo "-- Code Signing of AppImage"
if [ -z "$3" ]; then
./${WORK_DIR}/AppBin/appimagetool-x86_64.AppImage ${WORK_DIR}/AppDir --sign --sign-key $2
./${WORK_DIR}/AppBin/appimagetool-x86_64.AppImage ${WORK_DIR}/AppDir --sign --sign-key $2
else
./${WORK_DIR}/AppBin/appimagetool-x86_64.AppImage ${WORK_DIR}/AppDir --sign --sign-key $2 --sign-args "--pinentry-mode loopback --passphrase $3"
fi