Skip to content
Snippets Groups Projects
Commit 7c9c8ffb authored by Alexandre Eberhardt's avatar Alexandre Eberhardt Committed by Alexandre Eberhardt
Browse files

SDK: fix path issues and atributs name

Ask for the name and fix the icon and background path name.
Fix lib path in cpp file
Fix cmakelist copy

Change-Id: I6fc7a6a85c6ed99efee9e0e36528e698d4846e9d

SDK: mediaHandler fix declaration conflict

avSubjectPtr already defined as shared_ptr in daemon/src/plugin/mediahandler.h:36:7: causing conflict
(in the same namespace: jami)

Change-Id: I14f96e20ecad7b8b6b0b0c99e82d962f17d39cf5

SDK: fix CMakeList copy and parsing

This file is editer by the SDK, it uses functions to parse and replace using '---' as split marker
It targets words as FFMPEG.
VIDEO_FFMPEG and AUDIO_FFMPEG outside --- areas were causing the whole part (form start to the first ---) to be replace by '' by fillBuildFile in SDK/skeletonSrcProfile.py
To fix, I added some '---' to delimit areas and protecting the file

Change-Id: Ib85c4aa0a7ed3cdccba204313470d37e136e3077
parent 983f01a4
No related branches found
No related tags found
No related merge requests found
......@@ -6,8 +6,10 @@ set (Version MANIFESTVERSION)
project(${ProjectName} VERSION ${Version})
--- # start FFMPEG Options
option(VIDEO_FFMPEG "Include Video FFMPEG Dependency" OFF)
option(AUDIO_FFMPEG "Include Audio FFMPEG Dependency" OFF)
# end FFMPEG Options ---
set (DAEMON ${PROJECT_SOURCE_DIR}/../daemon)
set (JPL_FILE_NAME ${ProjectName}.jpl)
......@@ -51,16 +53,17 @@ set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} /DMSGPACK_NO_BOOST /MTd")
set(SOURCES "")
file(GLOB CPP_SOURCES "*.cpp")
list(APPEND SOURCES ${CPP_SOURCES})
--- # if VIDEO_FFMPEG
if(VIDEO_FFMPEG)
list(APPEND SOURCES "./../lib/accel.cpp")
list(APPEND SOURCES "./../lib/frameUtils.cpp")
endif()
# endif VIDEO_FFMPEG ---
--- # if AUDIO_FFMPEG
if(AUDIO_FFMPEG)
list(APPEND SOURCES "./../lib/frameUtils.cpp")
endif()
# endif AUDIO_FFMPEG ---
add_library(${ProjectName} SHARED ${SOURCES})
target_include_directories(${ProjectName} PUBLIC ${PROJECT_BINARY_DIR}
......@@ -101,7 +104,6 @@ add_custom_command(
COMMENT "Assembling Plugin files"
)
if(WIN32)
# Windows-specific file copying
add_custom_command(
......
HEADER
#include "GENERICChatSubscriber.h"
#include "pluglog.h"
#include "../lib/pluglog.h"
const std::string TAG = "GENERIC";
......@@ -22,7 +22,7 @@ void
GENERICChatSubscriber::update(Observable<pluginMessagePtr>*, const pluginMessagePtr& message)
{
if (isAttached) {
if (message->direction == "0") { // "0" for input message; "1" for output message
if (message->direction == 0) { // 0 for input message; 1 for output message
for (auto& pair : message->data) {
// READ THE MESSAGE
}
......
......@@ -9,8 +9,6 @@ HEADER
namespace jami {
using avSubjectPtr = std::weak_ptr<Observable<AVFrame*>>;
class GENERICMediaHandler : public CallMediaHandler
{
public:
......
......@@ -54,10 +54,14 @@ class Manifest(PluginStructure):
def createManifest(self):
print(
f"\nDefining a manifest for \"{self.pluginId}\" plugin, we will need more information..")
f"\nDefining a manifest for \"{self.pluginId}\" plugin.")
print(colored("\nPress 'q' to quit this option.", "yellow"))
pluginDescription = input("\nTell us a description: ")
pluginName = input("\nEnter the plugin name (as displayed to users, may contain spaces): ")
if (pluginName == 'q'):
return False
self.pluginName = pluginName
pluginDescription = input("\nEnter a description for the plugin: ")
if (pluginDescription == 'q'):
return False
self.description = pluginDescription
......@@ -75,8 +79,8 @@ class Manifest(PluginStructure):
self.manifest["name"] = self.pluginName
self.manifest["description"] = self.description
self.manifest["version"] = self.version
self.manifest["iconPath"] = self.iconPath
self.manifest["backgroundPath"] = self.backgroundPath
self.manifest["iconPath"] = self.pluginIcon
self.manifest["backgroundPath"] = self.pluginBackground
self.saveManifest(self.manifest)
return True
......
......@@ -47,8 +47,8 @@ class PluginStructure(UserInfos):
self.pluginDataDirectory = f"{self.pluginDirectory}/data"
# Wrong! These 2 should adapt to iconPath and backgroundPath. But it's not getting passed in this function
# Only pluginId is getting passed.
self.pluginIcon = f"{self.pluginDataDirectory}/icon.svg"
self.pluginBackground = f"{self.pluginDataDirectory}/background.jpg"
self.pluginIcon = "icon.svg"
self.pluginBackground = "background.jpg"
self.preferencesFile = f"{self.pluginDataDirectory}/preferences.json"
self.packageFile = f"{self.pluginDirectory}/package.json"
self.cmakelistsFile = f"{self.pluginDirectory}/CMakeLists.txt"
......@@ -57,20 +57,20 @@ class PluginStructure(UserInfos):
plugins = os.listdir("../")
print(colored("\nLeave Empty or Press 'q' to quit this option.", "yellow"))
if (action == ACTIONS["CREATE"]):
print("\nNow, you need to specify how you want your plugin to be called.")
print("\nNow, enter the plugin unique identifier you want to create.")
pluginId = "SDK"
while (pluginId in plugins):
pluginId = input("\nChoose a cool name for your plugin: ")
pluginId = input("\nChoose a unique identifier for your plugin: ")
if (pluginId == 'q' or not pluginId):
self.reInitialize('')
break
if (pluginId in plugins):
print(colored("This name is invalid!", "red"))
print(colored("This plugin identifier is already used!", "red"))
else:
self.reInitialize(pattern.sub('', pluginId))
if (self.pluginId):
coloredTitle = colored(self.pluginId, "green")
print(f"\nNice! Your {coloredTitle} will be awesome!")
print(f"\nYour plugin identifier is {coloredTitle}")
elif (action == ACTIONS["DELETE"] or action == ACTIONS["DELETE_PREFERENCES"] \
or action == ACTIONS["DELETE_MANIFEST"]):
......@@ -108,9 +108,9 @@ class PluginStructure(UserInfos):
if (not os.path.exists(self.pluginDataDirectory)):
os.mkdir(self.pluginDataDirectory)
if (not os.path.exists(self.pluginIcon)):
shutil.copyfile("./Templates/icon.svg", self.pluginIcon)
shutil.copyfile("./Templates/icon.svg", f"{self.pluginDataDirectory}/{self.pluginIcon}")
if (not os.path.exists(self.pluginBackground)):
shutil.copyfile("./Templates/background.jpg", self.pluginBackground)
shutil.copyfile("./Templates/background.jpg", f"{self.pluginDataDirectory}/{self.pluginBackground}")
def saveManifest(self, manifestTxt):
with open(self.manifestFile, 'w') as f:
......
......@@ -450,8 +450,8 @@ class SkeletonSourceFiles(Preferences):
self.package["id"] = self.pluginId
self.package["name"] = self.pluginName
self.package["version"] = self.version
self.package["iconPath"] = self.iconPath
self.package["backgroundPath"] = self.backgroundPath
self.package["iconPath"] = self.pluginIcon
self.package["backgroundPath"] = self.pluginBackground
if (not self.checkVersionFormat(self.version)):
self.package["version"] = '0.0.0'
f.close()
......@@ -524,6 +524,5 @@ class SkeletonSourceFiles(Preferences):
with open(self.cmakelistsFile, 'w') as f:
f.write(cmakelists)
f.close()
print("\nCMakeLists.txt ok.")
return
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment