Use this section to look up the public C++ API for eSDK Pro while building applications. Each class entry lists its main methods, their purpose, and usage notes, with short examples for common tasks.
This reference covers the core API used in all applications:
For camera-specific features (such as exposure controls or pixel formats), see the Camera Features reference.
All API methods may throw ESdkProException
. See Error Handling for codes and usage patterns, and use Versioning to confirm runtime compatibility.
The System is the SDK entry point. It owns the global Pipeline and manages connections to one or more Server instances. All other objects (Server, Camera, Tasks) are reached through System
.
Example:
The following example shows how to connect to both a local server and a remote server.
System sys = System::GetInstance();
Server local = sys.ConnectServer("127.0.0.1");
Server remote = sys.ConnectServer("10.0.0.42");
Example:
This snippet shows how to cleanly release SDK resources at program exit.
// At the end of main()
sys.Release(); // clean shutdown of SDK resources
A Server represents one machine (local or remote) that hosts Emergent cameras. The System creates/connects Servers; each Server discovers and owns its Camera objects that later feed the Pipeline.
Example:
This snippet discovers connected cameras and adds each to the server.
System sys = System::GetInstance();
Server server = sys.ConnectServer("127.0.0.1");
std::vector<CameraInfo> infos = server.DiscoverCameras();
for (const auto& info : infos) {
std::cout << "Found camera " << info.m_serialNumber << "\n";
Camera cam = server.AddCamera(info);
}
Example:
Example of iterating over active cameras after they have been added to the server.
for (auto& cam : server.GetCameras()) {
std::cout << "Active camera ready: "
<< cam.GetParam<std::string>("DeviceID").GetValue()
<< std::endl;
}
A Camera encapsulates one physical device owned by a Server. It does not expose frames directly; frames enter the Pipeline via a CameraTask
created from the Pipeline that references this Camera.
Note: Camera parameters, ranges, and valid values are documented in the Camera Features reference.
Example:
Example of reading and modifying a numeric camera parameter.
Camera cam = server.AddCamera(server.DiscoverCameras().front());
cam.Open(CameraOpenConfig{});
auto exposure = cam.GetParam<int>("ExposureTime");
int current = exposure.GetValue();
exposure.SetValue(current + 500);
cam.Close();
Example:
This snippet shows the full camera lifecycle when controlled directly.
cam.Open(CameraOpenConfig{});
cam.Start();
// frames flow once pipeline runs
cam.Stop();
cam.Close();
The Pipeline is a directed graph that orchestrates dataflow. It ingests frames from Cameras via CameraTask nodes and processes them through Task nodes implemented by TaskWorkers (built-in or plugin). The System owns a single Pipeline.
Built-in Task Types
RawWriter
: Save raw frames to disk.NvEncCompressor
: Compress video with NVIDIA NVENC.FileSink
: Write processed data to file.NullTask
: Discard frames (benchmark/throughput testing).
Example:
This example builds a simple pipeline that records raw frames and runs it for five seconds.
Pipeline pipe = sys.GetPipeline();
for (auto& cam : server.GetCameras()) {
CameraTask camTask = pipe.CreateCameraTask(cam);
Task raw = pipe.CreateTask("RawWriter");
raw.Configure({{"OutputPath", "/data/captures"}});
camTask.Connect(raw);
}
pipe.Start();
std::this_thread::sleep_for(std::chrono::seconds(5));
pipe.Stop();
Example:
This example shows how to catch and log pipeline errors using ESdkProException
.
try {
pipeline.Start();
} catch (const ESdkProException& ex) {
std::cerr << "Pipeline error " << ex.code()
<< ": " << ex.what() << std::endl;
}
A Task is a node in the Pipeline graph. It’s the configurable front-end that connects to other Tasks (Connect
) and delegates actual work to its associated TaskWorker implementation.
Example:
Here, a camera stream is branched to two processing tasks: a raw file writer and an NVENC compressor.
Task writer = pipeline.CreateTask("RawWriter");
writer.Configure({{"OutputPath", "/data/captures"}});
Task compressor = pipeline.CreateTask("NvEncCompressor");
compressor.Configure({{"Codec", "H264"}, {"Bitrate", "20Mbps"}});
cameraTask.Connect(writer);
cameraTask.Connect(compressor);
Example:
This snippet demonstrates how to configure parameters for a plugin task.
Task plugin = pipeline.CreateTask("MyPlugin");
plugin.Configure({
{"Threshold", "0.9"},
{"EnableLogging", "true"}
});
cameraTask.Connect(plugin);
A TaskWorker provides the processing logic behind a Task. Built-in tasks ship with TaskWorkers. Custom functionality is added by subclassing TaskWorker and registering it as a plugin so it can be created by the Pipeline.
Example:
Example of creating and registering a minimal plugin that reads frame timestamps.
class MyWorker : public TaskWorker {
public:
void Process(Frame& frame) override {
volatile uint64_t ts = frame.Timestamp;
(void)ts;
}
};
RegisterTaskPlugin("MyPlugin", []() { return new MyWorker(); });
A Frame is the data unit that flows through the Pipeline from CameraTask
into downstream Task/TaskWorker nodes. Tasks read and transform Frames; lifetime/ownership is managed by the pipeline runtime.
Example:
This snippet logs frame metadata for debugging.
TaskWorker::Process(Frame& frame) {
std::cout << "Frame " << frame.Width << "x" << frame.Height
<< " format " << frame.Format
<< " ts " << frame.Timestamp << std::endl;
}
All API calls may throw ESdkProException
, which includes an error code and message. Log both for troubleshooting.
Example:
This example shows how to catch SDK exceptions at the call site.
try {
pipeline.Start();
} catch (const ESdkProException& ex) {
std::cerr << "Error " << ex.code()
<< ": " << ex.what() << std::endl;
}
Use the version API to confirm the runtime version of eSDK Pro. Compare against release notes for compatibility.
Example:
This snippet shows how to print the runtime version.
std::cout << "eSDK Pro version: "
<< eSdkPro::GetVersion()
<< std::endl;