agsantos | 5aa3965 | 2020-08-11 18:18:04 -0400 | [diff] [blame] | 1 | /** |
| 2 | * Copyright (C) 2020 Savoir-faire Linux Inc. |
| 3 | * |
| 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 |
agsantos | ac1940d | 2020-09-17 10:18:40 -0400 | [diff] [blame] | 18 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 |
| 19 | * USA. |
agsantos | 5aa3965 | 2020-08-11 18:18:04 -0400 | [diff] [blame] | 20 | */ |
| 21 | |
| 22 | #pragma once |
| 23 | |
agsantos | ac1940d | 2020-09-17 10:18:40 -0400 | [diff] [blame] | 24 | // Project |
agsantos | 5aa3965 | 2020-08-11 18:18:04 -0400 | [diff] [blame] | 25 | #include "videoSubscriber.h" |
| 26 | |
| 27 | // Plugin |
| 28 | #include "plugin/jamiplugin.h" |
| 29 | #include "plugin/mediahandler.h" |
| 30 | |
| 31 | using avSubjectPtr = std::weak_ptr<jami::Observable<AVFrame*>>; |
| 32 | |
| 33 | namespace jami { |
| 34 | |
agsantos | ac1940d | 2020-09-17 10:18:40 -0400 | [diff] [blame] | 35 | class PluginMediaHandler : public jami::CallMediaHandler |
| 36 | { |
agsantos | 5aa3965 | 2020-08-11 18:18:04 -0400 | [diff] [blame] | 37 | public: |
agsantos | ac1940d | 2020-09-17 10:18:40 -0400 | [diff] [blame] | 38 | PluginMediaHandler(std::map<std::string, std::string>&& ppm, std::string&& dataPath); |
| 39 | ~PluginMediaHandler() override; |
agsantos | 5aa3965 | 2020-08-11 18:18:04 -0400 | [diff] [blame] | 40 | |
agsantos | ac1940d | 2020-09-17 10:18:40 -0400 | [diff] [blame] | 41 | virtual void notifyAVFrameSubject(const StreamData& data, avSubjectPtr subject) override; |
| 42 | virtual std::map<std::string, std::string> getCallMediaHandlerDetails() override; |
agsantos | 5aa3965 | 2020-08-11 18:18:04 -0400 | [diff] [blame] | 43 | |
agsantos | ac1940d | 2020-09-17 10:18:40 -0400 | [diff] [blame] | 44 | virtual void detach() override; |
| 45 | virtual void setPreferenceAttribute(const std::string& key, const std::string& value) override; |
| 46 | virtual bool preferenceMapHasKey(const std::string& key) override; |
agsantos | 5aa3965 | 2020-08-11 18:18:04 -0400 | [diff] [blame] | 47 | |
agsantos | ac1940d | 2020-09-17 10:18:40 -0400 | [diff] [blame] | 48 | std::shared_ptr<VideoSubscriber> mVS; |
agsantos | 364bbae | 2020-08-17 11:29:56 -0400 | [diff] [blame] | 49 | |
agsantos | ac1940d | 2020-09-17 10:18:40 -0400 | [diff] [blame] | 50 | std::string dataPath() const { return datapath_; } |
agsantos | 5aa3965 | 2020-08-11 18:18:04 -0400 | [diff] [blame] | 51 | |
| 52 | private: |
agsantos | ac1940d | 2020-09-17 10:18:40 -0400 | [diff] [blame] | 53 | const std::string datapath_; |
| 54 | std::map<std::string, std::string> ppm_; |
agsantos | 5aa3965 | 2020-08-11 18:18:04 -0400 | [diff] [blame] | 55 | }; |
agsantos | ac1940d | 2020-09-17 10:18:40 -0400 | [diff] [blame] | 56 | } // namespace jami |