Skip to main content

Camera Media Route

Introduction

These functions are setting media device active routes for the camera device.

warning

On Linux, I2C access may require elevated privileges. See I2C permission troubleshooting.

VxResetActiveRoutes

Function:

int VxResetActiveRoutes()

Function Description:

  • This function is for erasing the activate routes in the media device.

Parameter Description:

  • This function does not take any input parameters.

Example:

VxResetActiveRoutes();

VxLoadRouteYaml

Function:

std::shared_ptr<VxRoute> VxLoadRouteYaml(std::string yamlPath)

Function Description:

  • This function is for loading the YAML file from the path.
info
  • C# : The returned VxRoute object can be used directly in C# without manually managing memory.
  • C : The returned vx_route object need to release by vx_release_yaml_route function.

Parameter Description:

  • yamlPath : A string specifying the path to the YAML file.
  • Return:
    • returns a shared pointer to a VxRoute object containing the routes and links loaded from the YAML file, or nullptr on failure.

Example:

std::string yamlPath = "routes.yaml";
std::shared_ptr<VxRoute> yamlRoutes = VxLoadRouteYaml(yamlPath);

VxActivateYamlRoutes

Function:

int VxActivateYamlRoutes(std::shared_ptr<VxRoute> yamlRoutes)

Function Description:

  • This function is for activating the routes from the YAML file.

Parameter Description:

  • yamlRoutes : A shared pointer to a VxRoute object obtained from the VxLoadRouteYaml().
  • return 0 = PASS, return -1 = FAIL.

Example:

std::string yamlPath = "routes.yaml";
std::shared_ptr<VxRoute> yamlRoutes = VxLoadRouteYaml(yamlPath);
if(yamlRoutes != nullptr) {
VxActivateYamlRoutes(yamlRoutes);
}

vx_release_yaml_route

warning

This function is only supported in C.

Function:

void vx_release_yaml_route(vx_route yaml_route)

Function Description:

  • This function release the vx_route class pointer object retrieved from vx_load_route_yaml().

Parameter Description:

  • yaml_route : A shared pointer to a vx_route object obtained from vx_load_route_yaml().

Example:

char* yaml_path = "route.yaml";
vx_route yaml_route = vx_load_route_yaml(yaml_path);
if(yaml_route != NULL){
vx_activate_yaml_routes(yaml_route);
}
vx_release_yaml_route(yaml_route);