Ring Daemon
Loading...
Searching...
No Matches
streamdata.h
Go to the documentation of this file.
1/*
2 * Copyright (C) 2004-2026 Savoir-faire Linux Inc.
3 *
4 * This program is free software: you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation, either version 3 of the License, or
7 * (at your option) any later version.
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License
15 * along with this program. If not, see <https://www.gnu.org/licenses/>.
16 */
17#pragma once
18#include <string>
19#include <map>
20#include <cstdint>
21
22enum class StreamType : uint8_t { audio, video };
23
30{
38 StreamData(const std::string& callId,
39 bool isReceived,
40 const StreamType& mediaType,
41 const std::string& conversationId,
42 const std::string& accountId)
43 : id {std::move(callId)}
44 , direction {isReceived}
45 , type {mediaType}
46 , source {std::move(accountId)}
47 , conversation {std::move(conversationId)}
48 {}
49 // callId
50 const std::string id;
51 // False if local audio/video.
52 const bool direction;
53 // StreamType -> audio or video.
55 // accountId
56 const std::string source;
57 // conversationId
58 const std::string conversation;
59};
60
67{
75 JamiMessage(const std::string& accId,
76 const std::string& pId,
77 bool isReceived,
78 const std::map<std::string, std::string>& dataMap,
79 bool pPlugin)
80 : accountId {accId}
81 , peerId {pId}
82 , direction {isReceived}
83 , data {dataMap}
84 , fromPlugin {pPlugin}
85 {}
86
87 std::string accountId;
88 std::string peerId;
89 // True if it's a received message.
90 const bool direction;
91 std::map<std::string, std::string> data;
92 // True if message is originated from Plugin code.
94 bool isSwarm {false};
95 bool fromHistory {false};
96};
StreamType
Definition streamdata.h:22
Contains information about an exchanged message.
Definition streamdata.h:67
bool fromHistory
Definition streamdata.h:95
JamiMessage(const std::string &accId, const std::string &pId, bool isReceived, const std::map< std::string, std::string > &dataMap, bool pPlugin)
Definition streamdata.h:75
std::map< std::string, std::string > data
Definition streamdata.h:91
const bool direction
Definition streamdata.h:90
std::string accountId
Definition streamdata.h:87
bool fromPlugin
Definition streamdata.h:93
std::string peerId
Definition streamdata.h:88
Contains information about an AV subject.
Definition streamdata.h:30
const std::string source
Definition streamdata.h:56
const bool direction
Definition streamdata.h:52
const std::string conversation
Definition streamdata.h:58
const std::string id
Definition streamdata.h:50
const StreamType type
Definition streamdata.h:54
StreamData(const std::string &callId, bool isReceived, const StreamType &mediaType, const std::string &conversationId, const std::string &accountId)
Definition streamdata.h:38