2 * Copyright (c) 2022 Samsung Electronics Co., Ltd All Rights Reserved
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
19 #include <AittDiscovery.h>
20 #include <AittStreamModule.h>
27 #include "StreamManager.h"
29 using AittDiscovery = aitt::AittDiscovery;
30 using AittStreamModule = aitt::AittStreamModule;
32 #define MODULE_NAMESPACE AittWebRTCNamespace
33 namespace AittWebRTCNamespace {
35 class Module : public AittStreamModule {
37 explicit Module(AittDiscovery &discovery, const std::string &topic, AittStreamRole role);
38 virtual ~Module(void);
40 void SetConfig(const std::string &key, const std::string &value) override;
41 void SetConfig(const std::string &key, void *obj) override;
42 void Start(void) override;
43 void Stop(void) override;
44 void SetStateCallback(StateCallback cb, void *user_data) override;
45 void SetReceiveCallback(ReceiveCallback cb, void *user_data) override;
48 // TODO: Update Ice Candidates when stream add candidates.
49 void OnIceCandidateAdded(void);
50 void OnStreamStarted(void);
51 void OnStreamStopped(void);
52 void DiscoveryMessageCallback(const std::string &clientId, const std::string &status,
53 const void *msg, const int szmsg);
56 AittDiscovery &discovery_;
59 // TODO: What if user copies the module?
60 // Think about that case with destructor
61 StreamManager *stream_manager_;
62 StateCallback state_callback_;
63 void *state_cb_user_data_;
64 ReceiveCallback receive_callback_;
65 void *receive_cb_user_data_;
67 } // namespace AittWebRTCNamespace