blob: b29e9f2f76293262d46c71f8f0e8d43aead091d8 [file] [log] [blame]
agsantos796b5af2020-12-22 19:38:27 -05001/**
Sébastien Blincb783e32021-02-12 11:34:10 -05002 * Copyright (C) 2020-2021 Savoir-faire Linux Inc.
agsantos796b5af2020-12-22 19:38:27 -05003 *
4 * Author: Aline Gondim Santos <aline.gondimsantos@savoirfairelinux.com>
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 3 of the License, or
9 * (at your option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
19 */
20
21#include <iostream>
22#include <string.h>
23#include <thread>
24#include <memory>
25
26#include <plugin/jamiplugin.h>
27#include "pluginMediaHandler.h"
28
29#ifdef WIN32
30#define EXPORT_PLUGIN __declspec(dllexport)
31#else
32#define EXPORT_PLUGIN
33#endif
34
35#define TensorflowSegmentation_VERSION_MAJOR 1
36#define TensorflowSegmentation_VERSION_MINOR 0
37#define TensorflowSegmentation_VERSION_PATCH 2
38
39extern "C" {
40void
41pluginExit(void)
42{}
43
44EXPORT_PLUGIN JAMI_PluginExitFunc
45JAMI_dynPluginInit(const JAMI_PluginAPI* api)
46{
agsantos4bb4bc52021-03-08 14:21:45 -050047 std::cout << "******************************" << std::endl;
48 std::cout << "** TensorflowSegmentation **" << std::endl;
49 std::cout << "******************************" << std::endl << std::endl;
50 std::cout << "Version " << TensorflowSegmentation_VERSION_MAJOR << "."
51 << TensorflowSegmentation_VERSION_MINOR << "." << TensorflowSegmentation_VERSION_PATCH
52 << std::endl;
agsantos796b5af2020-12-22 19:38:27 -050053
54 // If invokeService doesn't return an error
55 if (api) {
56 std::map<std::string, std::string> preferences;
57 api->invokeService(api, "getPluginPreferences", &preferences);
58 std::string dataPath;
59 api->invokeService(api, "getPluginDataPath", &dataPath);
agsantos4bb4bc52021-03-08 14:21:45 -050060 auto fmp = std::make_unique<jami::PluginMediaHandler>(std::move(preferences),
61 std::move(dataPath));
agsantos796b5af2020-12-22 19:38:27 -050062
63 if (!api->manageComponent(api, "CallMediaHandlerManager", fmp.release())) {
64 return pluginExit;
65 }
66 }
67 return nullptr;
68}
69}