eSDK Pro API Reference

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:

  • System → entry point that manages servers and the global pipeline
  • Server → connects to cameras on a machine
  • Camera → controls an individual device
  • Pipeline → coordinates tasks and data flow
  • Task / TaskWorker → units of processing, built-in or plugin
  • Frame → image data passed between tasks

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.

System class

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.

MethodPurposeNotes
static System& GetInstance()Return the global System instance.Singleton accessor. Does not throw.
Server ConnectServer(const std::string& address)Connect to a local or remote server.Use "127.0.0.1" for local. Throws on failure.
Pipeline GetPipeline()Get the global pipeline.One pipeline per system.
void Release()Shut down the SDK and free resources.Call once before exit. Further API calls are invalid.

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

Server class

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.

MethodPurposeNotes
std::vector<CameraInfo> DiscoverCameras()Enumerate cameras on this server.Returns metadata. Throws on errors.
Camera AddCamera(const CameraInfo& info)Add a discovered camera.Throws if invalid or unavailable.
std::vector<Camera> GetCameras()Get all active cameras.Safe to call repeatedly.

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;
}

Camera class

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.

MethodPurposeNotes
void Open(const CameraOpenConfig& config)Open the camera.Throws if already open or config invalid.
void Close()Close the camera.Safe to call if already closed.
void Start()Begin streaming.Typically called by pipeline. Throws if not open.
void Stop()Stop streaming.Safe to call before Close().
template<typename T> CameraParam<T> GetParam(const std::string& name)Access a strongly typed parameter.Throws if name/type invalid for this model.

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();

Pipeline class

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.

MethodPurposeNotes
CameraTask CreateCameraTask(Camera& cam)Add a camera stream.Throws if not attached.
Task CreateTask(const std::string& type)Create a processing task.Throws if type not registered.
void Start()Initialize tasks and start cameras.Throws if invalid or already running.
void Stop()Stop all tasks and cameras.Must be called before modifying tasks.

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;
}

Task class

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.

MethodPurposeNotes
void Connect(Task& downstream)Route this task’s output.Throws if invalid graph.
void Configure(const ParamSet& params)Apply configuration.Throws if parameters missing/invalid.

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);

TaskWorker class

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.

MethodPurposeNotes
virtual void Process(Frame& frame)Override to process frames.Called per frame. May throw on error.
virtual void Configure(const ParamSet& params)Override to accept parameters.Throw on invalid/missing values.

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(); });

Frame class

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.

MemberPurposeNotes
uint64_t TimestampCapture timestamp.Synchronized across cameras.
uint32_t Width, HeightFrame dimensions.Match camera ROI.
PixelFormat FormatPixel format.Matches camera setting.
uint8_t* DataPointer to raw image data.Valid until the frame is released.

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;
}

Error Handling

All API calls may throw ESdkProException, which includes an error code and message. Log both for troubleshooting.

Type Description Example
ESdkProException Base exception type. Includes error code + message. catch (const ESdkProException& ex)

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;
}

CodeCategoryMeaningTypical Cause
1001Invalid parameterParameter value not valid.Wrong type, out-of-range.
1002Missing parameterRequired parameter not provided.Task config incomplete.
2001Server not foundCould not connect to server.Wrong IP, server not running.
2002Network errorConnection dropped.NIC misconfigured, cable unplugged.
3001Camera unavailableCamera not found/in use.Powered off or open in eCapture Pro.
3002Camera errorCamera reported fault.Hardware/firmware issue.
4001Pipeline conflictPipeline already running/invalid.Start called twice, bad graph.
4002Plugin load failurePlugin library failed to load.Wrong build target, missing dependency.
5001GPU failureGPU init/processing failed.Driver mismatch, unsupported GPU.

Versioning

Use the version API to confirm the runtime version of eSDK Pro. Compare against release notes for compatibility.

FunctionPurposeNotes
std::string GetVersion()Return the SDK runtime version string.Validate against release notes.

Example:

This snippet shows how to print the runtime version.

std::cout << "eSDK Pro version: "
          << eSdkPro::GetVersion()
          << std::endl;

See Also

Updated on
August 28, 2025
Questions?


Get in touch with us today and our team of imaging professionals will be pleased to assist you.

Contact Us