NVIDIA DeepStream SDK API Reference
8.0 Release
source_manager.hpp
Go to the documentation of this file.
1
/*
2
* SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
3
* SPDX-License-Identifier: LicenseRef-NvidiaProprietary
4
*
5
* NVIDIA CORPORATION, its affiliates and licensors retain all intellectual
6
* property and proprietary rights in and to this material, related
7
* documentation and any modifications thereto. Any use, reproduction,
8
* disclosure or distribution of this material and related documentation
9
* without an express license agreement from NVIDIA CORPORATION or
10
* its affiliates is strictly prohibited.
11
*/
12
19
#ifndef NVIDIA_DEEPSTREAM_SOURCE_MANAGER
20
#define NVIDIA_DEEPSTREAM_SOURCE_MANAGER
21
22
#include "
signal_emitter.hpp
"
23
#include <mutex>
24
namespace
deepstream
{
25
26
class
DefaultActionOwner
:
public
SignalEmitter::IActionOwner
{
27
public
:
28
std::vector<std::string>
list
()
override
{
29
std::vector<std::string> actions = {
"add-source"
,
"remove-source"
,
"terminate"
};
30
return
actions;
31
}
32
33
void
onAttached
(
SignalEmitter
* emitter,
const
std::string& action,
const
std::string&
object
)
override
{
34
object_
= object;
35
return
;
36
}
37
38
std::string
getObject
() {
39
return
object_
;
40
}
41
42
protected
:
43
std::string
object_
;
44
};
45
46
class
SourceManager
:
public
SignalEmitter
{
47
public
:
55
SourceManager
(
const
std::string& name)
56
:
SignalEmitter
(name, new
DefaultActionOwner
()) {}
57
64
int
addSource
(
const
std::string& source_name);
65
71
void
removeSource
(
int
source_id);
72
76
void
terminate
();
77
78
protected
:
79
static
int
gen_number_
;
80
static
std::mutex
gen_number_mutex_
;
81
};;
82
83
}
// namespace deepstream
84
85
#endif
deepstream::SourceManager
Definition:
source_manager.hpp:46
deepstream::DefaultActionOwner::getObject
std::string getObject()
Definition:
source_manager.hpp:38
deepstream::SourceManager::removeSource
void removeSource(int source_id)
Remove a source from the manager.
deepstream::SourceManager::addSource
int addSource(const std::string &source_name)
Add a source to the manager.
deepstream::DefaultActionOwner::list
std::vector< std::string > list() override
Definition:
source_manager.hpp:28
deepstream::SourceManager::gen_number_mutex_
static std::mutex gen_number_mutex_
Definition:
source_manager.hpp:80
deepstream::DefaultActionOwner::onAttached
void onAttached(SignalEmitter *emitter, const std::string &action, const std::string &object) override
Definition:
source_manager.hpp:33
deepstream::DefaultActionOwner
Definition:
source_manager.hpp:26
deepstream::SourceManager::gen_number_
static int gen_number_
Definition:
source_manager.hpp:79
deepstream::SourceManager::terminate
void terminate()
Terminate the pipeline.
deepstream
Definition:
buffer.hpp:33
deepstream::SignalEmitter::IActionOwner
required interface for a signal emitter
Definition:
signal_emitter.hpp:45
deepstream::DefaultActionOwner::object_
std::string object_
Definition:
source_manager.hpp:43
deepstream::SourceManager::SourceManager
SourceManager(const std::string &name)
Constructor.
Definition:
source_manager.hpp:55
signal_emitter.hpp
deepstream::SignalEmitter
SignalEmitter class.
Definition:
signal_emitter.hpp:42
Privacy Policy
|
Manage My Privacy
|
Do Not Sell or Share My Data
|
Terms of Service
|
Accessibility
|
Corporate Policies
|
Product Security
|
Contact
© 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
NVIDIA Confidential | Subject to Change | For test and development only.
Tue Sep 9 2025 11:36:24 | PR-09318-R32