NVIDIA DeepStream SDK API Reference
9.1 Release
service-maker/includes/source_manager.hpp
Go to the documentation of this file.
1
/*
2
* SPDX-FileCopyrightText: Copyright (c) 2025-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
3
* SPDX-License-Identifier: Apache-2.0
4
*
5
* Licensed under the Apache License, Version 2.0 (the "License");
6
* you may not use this file except in compliance with the License.
7
* You may obtain a copy of the License at
8
*
9
* http://www.apache.org/licenses/LICENSE-2.0
10
*
11
* Unless required by applicable law or agreed to in writing, software
12
* distributed under the License is distributed on an "AS IS" BASIS,
13
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
* See the License for the specific language governing permissions and
15
* limitations under the License.
16
*/
17
24
#ifndef NVIDIA_DEEPSTREAM_SOURCE_MANAGER
25
#define NVIDIA_DEEPSTREAM_SOURCE_MANAGER
26
27
#include "
signal_emitter.hpp
"
28
#include <mutex>
29
namespace
deepstream
{
30
31
class
DefaultActionOwner
:
public
SignalEmitter::IActionOwner
{
32
public
:
33
std::vector<std::string>
list
()
override
{
34
std::vector<std::string> actions = {
"add-source"
,
"remove-source"
,
"terminate"
};
35
return
actions;
36
}
37
38
void
onAttached
(
SignalEmitter
* emitter,
const
std::string& action,
const
std::string&
object
)
override
{
39
object_
= object;
40
return
;
41
}
42
43
std::string
getObject
() {
44
return
object_
;
45
}
46
47
protected
:
48
std::string
object_
;
49
};
50
51
class
SourceManager
:
public
SignalEmitter
{
52
public
:
60
SourceManager
(
const
std::string& name)
61
:
SignalEmitter
(name, new
DefaultActionOwner
()) {}
62
69
int
addSource
(
const
std::string& source_name);
70
76
void
removeSource
(
int
source_id);
77
81
void
terminate
();
82
83
protected
:
84
static
int
gen_number_
;
85
static
std::mutex
gen_number_mutex_
;
86
};;
87
88
}
// namespace deepstream
89
90
#endif
deepstream::SourceManager
Definition:
service-maker/includes/source_manager.hpp:51
signal_emitter.hpp
deepstream::DefaultActionOwner::getObject
std::string getObject()
Definition:
service-maker/includes/source_manager.hpp:43
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:
service-maker/includes/source_manager.hpp:33
deepstream::DefaultActionOwner::onAttached
void onAttached(SignalEmitter *emitter, const std::string &action, const std::string &object) override
Definition:
service-maker/includes/source_manager.hpp:38
deepstream::SourceManager::gen_number_mutex_
static std::mutex gen_number_mutex_
Definition:
service-maker/includes/source_manager.hpp:85
deepstream::DefaultActionOwner
Definition:
service-maker/includes/source_manager.hpp:31
deepstream::SourceManager::gen_number_
static int gen_number_
Definition:
service-maker/includes/source_manager.hpp:84
deepstream::SourceManager::terminate
void terminate()
Terminate the pipeline.
deepstream
Definition:
service-maker/includes/buffer.hpp:38
deepstream::SignalEmitter::IActionOwner
required interface for a signal emitter
Definition:
service-maker/includes/signal_emitter.hpp:50
deepstream::DefaultActionOwner::object_
std::string object_
Definition:
service-maker/includes/source_manager.hpp:48
deepstream::SourceManager::SourceManager
SourceManager(const std::string &name)
Constructor.
Definition:
service-maker/includes/source_manager.hpp:60
deepstream::SignalEmitter
SignalEmitter class.
Definition:
service-maker/includes/signal_emitter.hpp:47
Privacy Policy
|
Manage My Privacy
|
Do Not Sell or Share My Data
|
Terms of Service
|
Accessibility
|
Corporate Policies
|
Product Security
|
Contact
© 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
NVIDIA Confidential | Subject to Change | For test and development only.
Thu Jul 9 2026 11:48:21 | PR-09318-R32