Compute Graph Framework SDK Reference  5.10
ChannelParameters.hpp
Go to the documentation of this file.
1
2//
3// Notice
4// ALL NVIDIA DESIGN SPECIFICATIONS AND CODE ("MATERIALS") ARE PROVIDED "AS IS" NVIDIA MAKES
5// NO REPRESENTATIONS, WARRANTIES, EXPRESSED, IMPLIED, STATUTORY, OR OTHERWISE WITH RESPECT TO
6// THE MATERIALS, AND EXPRESSLY DISCLAIMS ANY IMPLIED WARRANTIES OF NONINFRINGEMENT,
7// MERCHANTABILITY, OR FITNESS FOR A PARTICULAR PURPOSE.
8//
9// NVIDIA CORPORATION & AFFILIATES assumes no responsibility for the consequences of use of such
10// information or for any infringement of patents or other rights of third parties that may
11// result from its use. No license is granted by implication or otherwise under any patent
12// or patent rights of NVIDIA CORPORATION & AFFILIATES. No third party distribution is allowed unless
13// expressly authorized by NVIDIA. Details are subject to change without notice.
14// This code supersedes and replaces all information previously supplied.
15// NVIDIA CORPORATION & AFFILIATES products are not authorized for use as critical
16// components in life support devices or systems without express written approval of
17// NVIDIA CORPORATION & AFFILIATES.
18//
19// SPDX-FileCopyrightText: Copyright (c) 2018-2022 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
20// SPDX-License-Identifier: LicenseRef-NvidiaProprietary
21//
22// NVIDIA CORPORATION, its affiliates and licensors retain all intellectual
23// property and proprietary rights in and to this material, related
24// documentation and any modifications thereto. Any use, reproduction,
25// disclosure or distribution of this material and related documentation
26// without an express license agreement from NVIDIA CORPORATION or
27// its affiliates is strictly prohibited.
28//
30
31#ifndef DW_FRAMEWORK_CHANNEL_PARAMETERS_HPP_
32#define DW_FRAMEWORK_CHANNEL_PARAMETERS_HPP_
33
34#include <dw/core/base/Exception.hpp>
35#include <dw/core/container/BaseString.hpp>
36#include <dw/core/container/VectorFixed.hpp>
37#include <dw/core/system/NvMediaExt.h>
39#include <sstream>
40#include <limits>
41
42namespace dw
43{
44namespace framework
45{
46
48
51using ChannelType = enum ChannelType : uint8_t {
52 DW_CHANNEL_TYPE_SHMEM_LOCAL = 0,
53 DW_CHANNEL_TYPE_SHMEM_REMOTE = 1,
54 DW_CHANNEL_TYPE_EGLSTREAM = 2,
55 DW_CHANNEL_TYPE_SOCKET = 3,
56 DW_CHANNEL_TYPE_DDS = 4,
57 DW_CHANNEL_TYPE_NVSCI = 5,
58};
59
60static inline const char* ToParam(ChannelType channelType)
61{
62 const char* result;
63 switch (channelType)
64 {
65 case DW_CHANNEL_TYPE_SHMEM_LOCAL:
66 result = "type=SHMEM_LOCAL";
67 break;
68 case DW_CHANNEL_TYPE_SHMEM_REMOTE:
69 result = "type=SHMEM_REMOTE";
70 break;
71 case DW_CHANNEL_TYPE_EGLSTREAM:
72 result = "type=EGLSTREAM";
73 break;
74 case DW_CHANNEL_TYPE_SOCKET:
75 result = "type=SOCKET";
76 break;
77 case DW_CHANNEL_TYPE_DDS:
78 result = "type=DDS";
79 break;
80 case DW_CHANNEL_TYPE_NVSCI:
81 result = "type=NVSCI";
82 break;
83 default:
84 result = "";
85 break;
86 }
87 return result;
88}
89
93enum class ChannelRole : uint8_t
94{
98};
99
100inline constexpr bool IsProducer(ChannelRole role)
101{
102 return static_cast<uint8_t>(role) & static_cast<uint8_t>(ChannelRole::DW_CHANNEL_ROLE_PRODUCER);
103}
104
105inline constexpr bool IsConsumer(ChannelRole role)
106{
107 return static_cast<uint8_t>(role) & static_cast<uint8_t>(ChannelRole::DW_CHANNEL_ROLE_CONSUMER);
108}
109
110static constexpr uint16_t MAX_CHANNEL_PARAM_SIZE = 1024;
111static constexpr uint16_t MAX_CHANNEL_ALL_PARAMS_SIZE = 1024;
112static constexpr uint16_t MAX_CHANNEL_PRODUCERS_COUNT = 2048;
113static constexpr uint16_t MAX_CHANNEL_CONSUMERS_COUNT = 256;
114
115using ChannelParamStr = dw::core::FixedString<MAX_CHANNEL_PARAM_SIZE>;
116
117enum class ChannelMode
118{
119 FIFO,
120 MAILBOX,
122};
123
124// NOTE(eklein): This is slightly awkward. I would much prefer to put this in
125// the ChannelNvSciStreamParams class directly, but I need access to the
126// operator overloads inside ChannelNvSciStreamParams.
127// I cannot forward declare the operators inside the class, and I cannot put the
128// operators inside the enum class (as you would ideally do). The best compromise
129// I could think of was to put this enum class here outside.
131{
132 COMPONENT_NONE = 0,
133
134 COMPONENT_CPU = 1 << 0,
135 COMPONENT_EGL = 1 << 1,
136 COMPONENT_CUDA = 1 << 2,
137 COMPONENT_PVA = 1 << 3,
138 COMPONENT_DLA = 1 << 4,
139 COMPONENT_NVMEDIA = 1 << 5,
140};
141
142// whether the channel is created statically, or dynamically at runtime
144{
148};
149
150// the farthest reach this channel can achieve
151// shorter reach is faster, so if topology is known upfront,
152// use the shortest matching reach for maximum performance
153enum class ChannelReach
154{
155 REACH_NONE = 0,
158 REACH_VM,
160};
161
164{
165 return static_cast<ChannelNvSciStreamEnabledComponents>(static_cast<uint32_t>(a) & static_cast<uint32_t>(b));
166}
167
170{
171 return static_cast<ChannelNvSciStreamEnabledComponents>(static_cast<uint32_t>(a) | static_cast<uint32_t>(b));
172}
173
174template <typename T>
175static inline T ParseChannelParameter(const ChannelParamStr& value);
176
177template <>
179{
180 auto translatedSize = strtol(value.c_str(), nullptr, 10);
181 return translatedSize;
182}
183
184template <>
186{
187 auto translatedSize = ParseChannelParameter<int64_t>(value);
188 if (translatedSize < 0)
189 {
190 throw ExceptionWithStatus(DW_INVALID_ARGUMENT, "ParseChannelParameter: size_t is negative");
191 }
192 size_t result = static_cast<size_t>(translatedSize);
193 return result;
194}
195
196template <>
198{
199 auto translatedSize = ParseChannelParameter<size_t>(value);
200 uint32_t result = static_cast<uint32_t>(translatedSize);
201 return result;
202}
203
204template <>
206{
207 auto translatedSize = ParseChannelParameter<size_t>(value);
208 if (translatedSize > 0xFFFF)
209 {
210 throw ExceptionWithStatus(DW_INVALID_ARGUMENT, "ChannelSocketParams: port is larger than uint16_t allows!");
211 }
212 uint16_t result = static_cast<uint16_t>(translatedSize);
213 return result;
214}
215
216template <>
218{
219 bool result;
220 if ((value == "true") || (value == "1"))
221 {
222 result = true;
223 }
224 else if ((value == "false") || (value == "0"))
225 {
226 result = false;
227 }
228 else
229 {
230 throw ExceptionWithStatus(DW_INVALID_ARGUMENT, "ParseChannelParameter: needs to be 'true' or 'false' or 1/0");
231 }
232 return result;
233}
234
235template <>
237{
238 ChannelRole result{};
239 if (value == "producer")
240 {
242 }
243 else if (value == "consumer")
244 {
246 }
247 else if (value == "composite")
248 {
250 }
251 else
252 {
253 throw ExceptionWithStatus(DW_INVALID_ARGUMENT, "ParseChannelParameter: role unknown!");
254 }
255 return result;
256}
257
258template <>
260{
261 ChannelType result{};
262 if (value == "SHMEM_LOCAL")
263 {
264 result = ChannelType::DW_CHANNEL_TYPE_SHMEM_LOCAL;
265 }
266 else if (value == "SHMEM_REMOTE")
267 {
268 result = ChannelType::DW_CHANNEL_TYPE_SHMEM_REMOTE;
269 }
270 else if (value == "EGLSTREAM")
271 {
272 result = ChannelType::DW_CHANNEL_TYPE_EGLSTREAM;
273 }
274 else if (value == "SOCKET")
275 {
276 result = ChannelType::DW_CHANNEL_TYPE_SOCKET;
277 }
278 else if (value == "DDS")
279 {
280 result = ChannelType::DW_CHANNEL_TYPE_DDS;
281 }
282 else if (value == "NVSCI")
283 {
284 result = ChannelType::DW_CHANNEL_TYPE_NVSCI;
285 }
286 else
287 {
288 throw ExceptionWithStatus(DW_INVALID_ARGUMENT, "ParseChannelParameter: type unknown!");
289 }
290
291 return result;
292}
293
294template <>
296{
297 ChannelMode result;
298 if (value == "mailbox")
299 {
300 result = ChannelMode::MAILBOX;
301 }
302 else if (value == "singleton")
303 {
304 result = ChannelMode::SINGLETON;
305 }
306 else
307 {
308 throw ExceptionWithStatus(DW_INVALID_ARGUMENT, "ParseChannelParameter: ChannelMode unknown!");
309 }
310 return result;
311}
312
313template <typename T>
314void ParseChannelParameter(const ChannelParamStr& value, T& result)
315{
316 result = ParseChannelParameter<T>(value);
317}
318
319template <size_t Size>
320void ParseChannelParameter(const ChannelParamStr& value, dw::core::FixedString<Size>& result)
321{
322 result = value;
323}
324
325template <typename T, size_t N>
326void ParseChannelParameter(const ChannelParamStr& value, dw::core::VectorFixed<T, N>& result)
327{
328 size_t pos = 0U;
329 size_t endpos = 0U;
330 bool done = false;
331 while (!done)
332 {
333 endpos = value.find(":", pos);
334 done = endpos == dw::core::FixedString<1>::NPOS;
335 size_t count = done ? endpos : endpos - pos;
336 T entry{};
337 ParseChannelParameter(value.substr(pos, count), entry);
338 result.push_back(entry);
339 pos = endpos + 1;
340 }
341}
342
344{
345 return;
346}
347
348template <typename T, typename... Others>
349static inline void ParseChannelParameters(const ChannelParamStr& key, const ChannelParamStr& value, const char* staticKey, T& result, Others&&... others)
350{
351 if (key == staticKey)
352 {
353 ParseChannelParameter(value, result);
354 return;
355 }
356 ParseChannelParameters(key, value, std::forward<Others>(others)...);
357}
358
359template <typename... Others>
360static inline void ParseAllChannelParameters(const ChannelParamStr& channelParams, Others&&... others)
361{
362 std::size_t key = 0;
363 std::size_t pos = channelParams.find("=");
364 std::size_t value = 0;
365 std::size_t valueEnd = 0;
366
367 ChannelParamStr keyString;
368 ChannelParamStr valueString;
369 while (pos != dw::core::FixedString<1>::NPOS && value != dw::core::FixedString<1>::NPOS)
370 {
371 keyString = channelParams.substr(key, pos - key);
372 value = channelParams.find(",", pos);
373 valueEnd = (value == dw::core::FixedString<1>::NPOS) ? (channelParams.length() - (pos + 1)) : (value - pos - 1);
374 valueString = channelParams.substr(pos + 1, valueEnd);
375 ParseChannelParameters(keyString, valueString, std::forward<Others>(others)...);
376
377 key = value + 1;
378 pos = channelParams.find("=", key);
379 }
380}
381
383{
384public:
385 static inline ChannelParamStr getParamStr(const char* serverIP,
386 uint16_t port,
387 bool producerFifo = false,
388 uint16_t numBlockingConnections = 1)
389 {
390 std::stringstream ss;
391 ss.flags(std::ios::dec);
392 ss << "type=SOCKET";
393 if (serverIP != nullptr)
394 {
395 ss << ",ip=";
396 ss << serverIP;
397 }
398 ss << ",id=";
399 ss << port;
400 ss << ",producer-fifo=";
401 ss << static_cast<uint32_t>(producerFifo);
402 ss << ",num-clients=";
403 ss << numBlockingConnections;
404 ChannelParamStr result(ss.str().c_str());
405 return result;
406 }
407
409 explicit ChannelSocketParams(const char* params)
410 {
411 dw::core::FixedString<MAX_CHANNEL_ALL_PARAMS_SIZE> channelParams(params);
412 ParseAllChannelParameters(channelParams,
413 "ip", m_serverIP,
414 "producer-fifo", m_producerFifo,
415 "id", m_port,
416 "connect-timeout", m_connectTimeout);
417 }
418
420
422
423 ChannelParamStr getServerIP() const { return m_serverIP; }
424 uint16_t getPort() const { return m_port; }
425 bool hasProducerFifo() const { return m_producerFifo; }
426 dwTime_t getConnectTimeout() const { return m_connectTimeout; }
427
428private:
429 ChannelParamStr m_serverIP; // needed for socket client connection
430 uint16_t m_port = 0;
431 bool m_producerFifo = false; // Allow the socket producer to have its own fifo to queue up work
432 dwTime_t m_connectTimeout = DW_TIME_INVALID;
433};
434
436
438{
439public:
441
442 explicit ChannelNvSciStreamParams(const char* params)
444 {
445 dw::core::FixedString<MAX_CHANNEL_ALL_PARAMS_SIZE> channelParams(params);
446 ParseAllChannelParameters(channelParams,
447 "streamName", m_streamNames,
448 "limits", m_limits,
449 "num-clients", m_localClientCount);
450 }
451
453
455
456 uint16_t getNumOutputs() const
457 {
458 static_assert(decltype(m_streamNames)::CAPACITY_AT_COMPILE_TIME < std::numeric_limits<uint16_t>::max(), "ChannelNvSciStreamParams: number of outputs over limit");
459 return static_cast<uint16_t>(m_streamNames.size());
460 }
461
462 uint32_t getLocalClientCount() const { return m_localClientCount; }
463
464 const char* getStreamName(uint16_t index = 0) const
465 {
466 if (index >= m_streamNames.size())
467 {
468 throw ExceptionWithStatus(DW_INVALID_ARGUMENT, "ChannelNvSciStreamParams: stream name index out of range");
469 }
470 return m_streamNames[index].c_str();
471 }
472
473 int64_t getLimiterMaxPackets(uint16_t index = 0) const
474 {
475 // Note: if no limits are denoted, return -1 and make inquirers not create limiter blocks.
476 // If not, it can lead to out of range when querying
477 if (m_limits.empty())
478 {
479 return -1;
480 }
481
482 if (index >= m_limits.size())
483 {
484 throw ExceptionWithStatus(DW_INVALID_ARGUMENT, "ChannelNvSciStreamParams: limiter maxPackets index out of range");
485 }
486 return m_limits[index];
487 }
488
489protected:
490 dw::core::VectorFixed<dw::core::FixedString<64>, 8> m_streamNames{};
491 dw::core::VectorFixed<int64_t, 8> m_limits{};
493};
494
499{
500public:
501 explicit ChannelParams(const char* params)
502 : m_str(params)
503 {
505 "fifo-size", m_fifoSize,
506 "id", m_id,
507 "singleton-id", m_singletonId,
508 "mode", m_mode,
509 "reuse", m_reuseEnabled,
510 "debug-port", m_debugPort,
511 "num-clients", m_clientsCount,
512 "debug-num-clients", m_debugClientsCount,
513 "role", m_role,
514 "type", m_type,
515 "data-offset", m_dataOffset,
516 "strict", m_strictFifo,
517 "sync-enabled", m_syncEnabled);
518
519 adjustPoolCapacity();
520
521 if (m_clientsCount == 0)
522 {
523 m_clientsCount = 1;
524 }
525
526 if (!m_singletonId.empty())
527 {
528 m_mode = ChannelMode::SINGLETON;
529 }
530
531 if (m_mode == ChannelMode::MAILBOX)
532 {
533 m_mailboxMode = true;
534 }
535 else if (m_mode == ChannelMode::SINGLETON)
536 {
537 m_singletonMode = true;
538
539 // Assign singletonId with id
540 if (!m_id.empty() && m_singletonId.empty())
541 {
542 m_singletonId = m_id;
543 }
544 }
545
546 // Why break this up like this? Code complexity.
547 // Without this, we fail the code complexity analysis.
548 ValidateMailbox();
549 ValidateSingleton();
550
551 switch (m_type)
552 {
553 case DW_CHANNEL_TYPE_SHMEM_LOCAL:
554 break;
555 case DW_CHANNEL_TYPE_SOCKET:
556 m_socketParams = ChannelSocketParams(params);
557 break;
558 case DW_CHANNEL_TYPE_NVSCI:
559 m_nvSciStreamParams = ChannelNvSciStreamParams(params);
560 break;
561 case DW_CHANNEL_TYPE_SHMEM_REMOTE:
562 case DW_CHANNEL_TYPE_EGLSTREAM:
563 case DW_CHANNEL_TYPE_DDS:
564 default:
565 throw ExceptionWithStatus(DW_NOT_IMPLEMENTED, "ChannelParams: no parameters for channel type");
566 break;
567 }
568 }
569
571 {
572 *this = other;
573 }
574
575 ChannelParams& operator=(const ChannelParams& other) = default;
576 ~ChannelParams() = default;
577
578 const char* getStr() const { return m_str.c_str(); }
579 ChannelParamStr getId() const { return m_id; }
580 ChannelParamStr getSingletonId() const { return m_singletonId; }
581 uint16_t getDebugPort() const { return m_debugPort; }
582 size_t getFifoSize() const { return m_fifoSize; }
583 // Note(chale): Normally the fifo length governs whether a consumer
584 // will receive packet. The actual packet pool's size may be larger
585 // than the fifo length. non-strict mode allows consumers to receive
586 // up to the entire pool size instead of just their fifo length.
587 bool isStrictFifo() const { return m_strictFifo; }
588 void setStrictFifo(bool strictFifo)
589 {
590 m_strictFifo = strictFifo;
591 }
592 size_t getPoolCapacity() const { return m_poolCapacity; }
593 bool getMailboxMode() const { return m_mailboxMode; }
594 // Note (ajayawardane): The data-offset parameter is used to describe
595 // the consumption offset between the producer and the consumer
596 // in the sync packet use-case. For example, if a packet is produced with the
597 // sync count x, and is inteneded to be consumed when the sync count is x + 1,
598 // the data-offset would be 1. This parameter is also used to identify whether
599 // to use sync packets to transfer data, so needs to be included in both the
600 // producer and the consumer params.
601 uint32_t getDataOffset() const { return m_dataOffset; }
602 bool getSyncEnabled() const { return m_syncEnabled; }
603 void setMailboxMode(bool mailboxEnabled) { m_mailboxMode = mailboxEnabled; }
604 bool getSingletonMode() const { return m_singletonMode; }
605 bool getReuseEnabled() const { return m_reuseEnabled; }
606 bool getDebugMode() const { return m_debugPort > 0; }
607 uint16_t getExpectedConnectionsCount() const { return m_clientsCount; }
608 uint16_t getExpectedDebugConnectionsCount() const { return m_debugClientsCount; }
609 ChannelRole getRole() const { return m_role; }
610 ChannelType getType() const { return m_type; }
611
613 {
614 if (m_type != ChannelType::DW_CHANNEL_TYPE_SOCKET)
615 {
616 throw ExceptionWithStatus(DW_CALL_NOT_ALLOWED, "ChannelParams: getSocketParams: channel is not of type SOCKET");
617 }
618 return m_socketParams;
619 }
620
622 {
623 if (m_type != ChannelType::DW_CHANNEL_TYPE_NVSCI)
624 {
625 throw ExceptionWithStatus(DW_CALL_NOT_ALLOWED, "ChannelParams: getNvSciStreamParams: channel is not of type NVSCI");
626 }
627 return m_nvSciStreamParams;
628 }
629
630private:
631 void ValidateMailbox()
632 {
633 if (m_singletonMode)
634 {
635 if (m_fifoSize != 1)
636 {
637 throw ExceptionWithStatus(DW_INVALID_ARGUMENT, "ChannelParams: Singleton and mailbox modes are incompatible with a fifo setting other than 1");
638 }
639 }
640 if (!m_mailboxMode && m_reuseEnabled)
641 {
642 throw ExceptionWithStatus(DW_INVALID_ARGUMENT, "ChannelParams: reuse=true specified when mode!=mailbox. Not valid");
643 }
644 if (m_mailboxMode && m_singletonMode)
645 {
646 throw ExceptionWithStatus(DW_INVALID_ARGUMENT, "ChannelParams: Singleton mode is incompatible mailbox mode");
647 }
648 }
649
650 void ValidateSingleton()
651 {
652 // Assign singletonId with id in singleton mode
653 if (m_singletonMode && m_singletonId.empty())
654 {
655 m_singletonId = m_id;
656 }
657 if (!m_singletonMode && !m_singletonId.empty())
658 {
659 throw ExceptionWithStatus(DW_INVALID_ARGUMENT, "ChannelParams: Singleton mode requires both the mode set AND singletonId set");
660 }
661 if (m_singletonMode && (m_type != ChannelType::DW_CHANNEL_TYPE_SHMEM_LOCAL))
662 {
663 throw ExceptionWithStatus(DW_INVALID_ARGUMENT, "ChannelParams: Singleton mode is only valid for SHMEM_LOCAL channels");
664 }
665 }
666
667 void adjustPoolCapacity()
668 {
669 // This deserves a comment. The LocalShmem pools (in the fifo-case)
670 // need the following number of slots, in the worst case:
671 // 1 for getImpl to return at any time
672 // 1 per consumer for in-flight data
673 // fifo-size to store a full fifo worth of packets
674 // So assuming max consumers, we'd need fifo-size + MAX_CHANNEL_CONSUMERS_COUNT + 1
675 if (m_fifoSize + MAX_CHANNEL_CONSUMERS_COUNT + 1 > m_poolCapacity)
676 {
677 m_poolCapacity = m_fifoSize + MAX_CHANNEL_CONSUMERS_COUNT + 1;
678 }
679 }
680
681private:
682 ChannelParamStr m_str{};
683 ChannelParamStr m_id{};
684 ChannelParamStr m_singletonId{};
685
686 // fifo size of the socket client that implies the maximum number of packets
687 // a client can hold simultaneously
688 size_t m_fifoSize = 1;
689 // This deserves a comment. The LocalShmem pools (in the fifo-case)
690 // need the following number of slots, in the worst case:
691 // 1 for getImpl to return at any time
692 // 1 per consumer for in-flight data
693 // fifo-size to store a full fifo worth of packets
694 // So assuming a fifo-size of 1 and max consumers, we'd need MAX_CHANNEL_CONSUMERS_COUNT + 2
695 size_t m_poolCapacity = MAX_CHANNEL_CONSUMERS_COUNT + 2;
697 uint32_t m_dataOffset = 0;
698 bool m_syncEnabled = false;
699 bool m_mailboxMode = false;
700 bool m_singletonMode = false;
701 bool m_reuseEnabled = false;
703 ChannelType m_type = ChannelType::DW_CHANNEL_TYPE_SHMEM_LOCAL;
704 bool m_strictFifo = true;
705
706 uint16_t m_clientsCount = 1; // number of clients for blocking mode for socket
707 uint16_t m_debugClientsCount = 1; // number of debug clients for blocking mode for socket
708
709 uint16_t m_debugPort = 0;
710
711 ChannelSocketParams m_socketParams{};
712 ChannelNvSciStreamParams m_nvSciStreamParams{};
713};
714
715} // namespace framework
716} // namespace dw
717
718#endif // DW_FRAMEWORK_CHANNEL_HPP_
int64_t getLimiterMaxPackets(uint16_t index=0) const
ChannelNvSciStreamParams & operator=(const ChannelNvSciStreamParams &other)=default
ChannelNvSciStreamParams(const ChannelNvSciStreamParams &other)=default
const char * getStreamName(uint16_t index=0) const
dw::core::VectorFixed< dw::core::FixedString< 64 >, 8 > m_streamNames
dw::core::VectorFixed< int64_t, 8 > m_limits
void setMailboxMode(bool mailboxEnabled)
uint16_t getExpectedConnectionsCount() const
uint16_t getExpectedDebugConnectionsCount() const
ChannelParams & operator=(const ChannelParams &other)=default
const ChannelSocketParams & getSocketParams() const
const ChannelNvSciStreamParams & getNvSciStreamParams() const
ChannelParamStr getSingletonId() const
void setStrictFifo(bool strictFifo)
ChannelParams(const ChannelParams &other)
ChannelParamStr getId() const
static ChannelParamStr getParamStr(const char *serverIP, uint16_t port, bool producerFifo=false, uint16_t numBlockingConnections=1)
ChannelSocketParams & operator=(const ChannelSocketParams &other)=default
ChannelSocketParams(const ChannelSocketParams &other)=default
static const char * ToParam(ChannelType channelType)
static constexpr uint16_t MAX_CHANNEL_ALL_PARAMS_SIZE
dw::core::FixedString< MAX_CHANNEL_PARAM_SIZE > ChannelParamStr
@ DW_CHANNEL_ROLE_PRODUCER
allows producer only
@ DW_CHANNEL_ROLE_CONSUMER
allows consumer only
@ DW_CHANNEL_ROLE_COMPOSITE
allows both producer and consumer
static void ParseChannelParameters(const ChannelParamStr &, const ChannelParamStr &)
constexpr bool IsProducer(ChannelRole role)
static T ParseChannelParameter(const ChannelParamStr &value)
enum ChannelType :uint8_t { DW_CHANNEL_TYPE_SHMEM_LOCAL=0, DW_CHANNEL_TYPE_SHMEM_REMOTE=1, DW_CHANNEL_TYPE_EGLSTREAM=2, DW_CHANNEL_TYPE_SOCKET=3, DW_CHANNEL_TYPE_DDS=4, DW_CHANNEL_TYPE_NVSCI=5, } ChannelType
constexpr ChannelNvSciStreamEnabledComponents operator&(ChannelNvSciStreamEnabledComponents a, ChannelNvSciStreamEnabledComponents b)
constexpr ChannelNvSciStreamEnabledComponents operator|(ChannelNvSciStreamEnabledComponents a, ChannelNvSciStreamEnabledComponents b)
static void ParseAllChannelParameters(const ChannelParamStr &channelParams, Others &&... others)
static constexpr uint16_t MAX_CHANNEL_PARAM_SIZE
constexpr bool IsConsumer(ChannelRole role)
static constexpr uint16_t MAX_CHANNEL_PRODUCERS_COUNT
static constexpr uint16_t MAX_CHANNEL_CONSUMERS_COUNT
Definition: Buffer.hpp:40