For AI agents: a documentation index is available at the root level at /llms.txt and /llms-full.txt. Append /llms.txt to any URL for a page-level index, or .md for the markdown version of any page.
  • Introduction
    • Overview
    • Relevant Technologies
    • Getting Started
  • Setup
    • SDK Installation
    • Additional Setup
    • Third Party Hardware Setup
  • Using the SDK
    • Holoscan Core
    • GPU Resident Execution
    • Holoscan by Example
    • Create an Application
    • Create a Distributed Application
    • Create an Operator
    • Create an Operator via Decorator
    • Create a Condition
    • Dynamic Flow Control
    • CUDA Stream Handling
    • Logging
    • Data Logging
    • Debugging
    • Python Operator Bindings
  • Operators
    • Operators and Extensions
    • Visualization
    • Inference
    • Testing
    • Video I/O Vendor Implementation Guide
  • Components
    • Schedulers
    • Conditions
    • Resources
    • Analytics
  • AI Skills
    • Ai Skills
  • API reference
              • AsyncPingRxOp
              • AsyncPingTxOp
              • BayerDemosaicGpuResidentOp
              • BayerDemosaicOp
              • DataTypeRxTestOp
              • DataTypeTxTestOp
              • FormatConverterOp
              • ForwardOp
              • GPUResidentInferenceOp
              • GXFCodeletOp
              • GXFOperator
              • HolovizOp
              • InferenceOp
              • InferenceProcessorOp
              • OperatorRunner
              • PingRxOp
              • PingTensorRxOp
              • PingTensorTxOp
              • PingTxOp
              • PoseTreeManagerLookupOp
              • RawImageProcessorOp
              • SegmentationPostprocessorOp
              • V4L2VideoCaptureOp
              • VideoAcquisitionOperator
              • VideoStreamRecorderOp
              • VideoStreamReplayerOp
              • VideoTransmissionOperator
              • VirtualOperator
              • VirtualReceiverOp
              • VirtualTransmitterOp
  • Performance
    • Performance Considerations
    • Flow Tracking
    • GXF Job Statistics
    • Nsight Profiling
  • HoloHub
    • HoloHub Overview
  • FAQ
    • FAQ
NVIDIANVIDIA
Developer-friendly docs for your API
Privacy Policy | Your Privacy Choices | Terms of Service | Accessibility | Corporate Policies | Product Security | Contact

Copyright © 2026, NVIDIA Corporation.

LogoLogoDocumentation
On this page
  • Constructors
  • VideoStreamRecorderOp
  • Destructor
  • ~VideoStreamRecorderOp
  • Methods
  • setup
  • initialize
  • compute
  • stop
  • operator_type
  • id
  • name
  • fragment
  • spec
  • spec_shared
  • condition
  • conditions
  • resource
  • resources
  • add_arg
  • is_root
  • is_user_defined_root
  • is_leaf
  • qualified_name
  • start
  • to_yaml_node
  • graph_entity
  • get_data_flow_tracking_label
  • metadata
  • is_metadata_enabled
  • enable_metadata
  • metadata_policy
  • receiver
  • transmitter
  • bind_input_topic
  • bind_output_topic
  • input_topic
  • output_topic
  • input_qos
  • output_qos
  • queue_policy
  • input_exec_spec
  • output_exec_spec
  • dynamic_flow_func
  • self_shared
  • next_flows
  • add_dynamic_flow
  • dynamic_flows
  • find_flow_info
  • find_all_flow_info
  • async_condition
  • stop_execution
  • execution_context
  • ensure_contexts
  • release_internal_resources
  • operator
  • defaults
  • is_gxf_compatible_operator_type
  • operator std::shared_ptr< Executor > executor
  • has_pubsub_connector
  • has_network_connector
  • args
  • description
  • service
  • get_service_by_type_info
  • reset_backend_objects
  • initialize_graph_entity
  • initialize_async_condition
  • add_codelet_to_graph_entity
  • initialize_conditions
  • initialize_resources
  • update_params_from_args
  • update_connector_arguments
  • find_ports_used_by_condition_args
  • get_consolidated_input_label
  • update_input_message_label
  • delete_input_message_label
  • reset_input_message_labels
  • has_input_message_labels
  • num_published_messages_map
  • update_published_messages
  • operator.void initialize_next_flows
  • non_default_input_ports
  • non_default_output_ports
  • set_input_exec_spec
  • set_output_exec_spec
  • set_dynamic_flows
  • set_self_shared
  • initialize_execution_context
  • service_provider
  • Static methods
  • is_all_operator_successor_virtual
  • is_all_operator_predecessor_virtual
  • parse_port_name
  • parse_operator_port_key
  • register_codec
  • validate_operator_name
  • register_converter
  • register_argument_setter
  • Types
  • OperatorType
  • Member variables
API referenceC++ APIHoloscanNamespacesOpsClasses

holoscan::ops::VideoStreamRecorderOp

Beta
||View as Markdown|
Previous

holoscan::ops::VideoAcquisitionOperator

Next

holoscan::ops::VideoStreamReplayerOp

Operator class to record a video stream to a file.

==Named Inputs==

  • input : nvidia::gxf::Tensor A message containing a video frame to serialize to disk. The input tensor can be on either the CPU or GPU. This data location will be recorded as part of the metadata serialized to disk and if the data is later read back in via VideoStreamReplayerOp, the tensor output of that operator will be on the same device (CPU or GPU).
    • A message containing a video frame to serialize to disk. The input tensor can be on either the CPU or GPU. This data location will be recorded as part of the metadata serialized to disk and if the data is later read back in via VideoStreamReplayerOp, the tensor output of that operator will be on the same device (CPU or GPU).

==Parameters==

  • directory: Directory path for storing files.
  • basename: User specified file name without extension.
  • flush_on_tick: Flushes output buffer on every tick when true. Optional (default: false).
#include <holoscan/ops/video_stream_recorder.hpp>

Inherits from: holoscan::Operator (public)


Constructors

VideoStreamRecorderOp

holoscan::ops::VideoStreamRecorderOp::VideoStreamRecorderOp() = defaultholoscan::ops::VideoStreamRecorderOp::VideoStreamRecorderOp() = default

Destructor

~VideoStreamRecorderOp

holoscan::ops::VideoStreamRecorderOp::~VideoStreamRecorderOp() overrideholoscan::ops::VideoStreamRecorderOp::~VideoStreamRecorderOp() override

Methods

setup

void holoscan::ops::VideoStreamRecorderOp::setup(
OperatorSpec &spec
) override

Define the operator specification.

Parameters

spec
OperatorSpec &

The reference to the operator specification.

initialize

void holoscan::ops::VideoStreamRecorderOp::initialize() override

Initialize the operator.

This function is called when the fragment is initialized by Executor::initialize_fragment().

compute

void holoscan::ops::VideoStreamRecorderOp::compute(
InputContext &op_input,
OutputContext &op_output,
ExecutionContext &context
) override

Implement the compute method.

This method is called by the runtime multiple times. The runtime calls this method until the operator is stopped.

Parameters

op_input
InputContext &

The input context of the operator.

op_output
OutputContext &

The output context of the operator.

context
ExecutionContext &

The execution context of the operator.

stop

void holoscan::ops::VideoStreamRecorderOp::stop() override

Implement the shutdown logic of the operator.

This method is called multiple times over the lifecycle of the operator according to the order defined in the lifecycle, and used for heavy deinitialization tasks such as deallocation of all resources previously assigned in start.

operator_type

OperatorType holoscan::ops::VideoStreamRecorderOp::operator_type() constOperatorType holoscan::ops::VideoStreamRecorderOp::operator_type() const

Get the operator type.

Returns: The operator type.

id

Mutable
Const
Operator & holoscan::ops::VideoStreamRecorderOp::id(Operator & holoscan::ops::VideoStreamRecorderOp::id(
int64_t id
)

Set the Operator ID.

Returns: The reference to this operator.

Parameters

id
int64_t

The ID of the operator.

name

Mutable
Const
Operator & holoscan::ops::VideoStreamRecorderOp::name(Operator & holoscan::ops::VideoStreamRecorderOp::name(
const std::string &name
)

Set the name of the operator.

Returns: The reference to this operator.

Parameters

name
const std::string &

The name of the operator.

fragment

Set the fragment of the operator
Overload 2
Const
Operator & holoscan::ops::VideoStreamRecorderOp::fragment(Operator & holoscan::ops::VideoStreamRecorderOp::fragment(
Fragment *fragment
)

Set the fragment of the operator.

Returns: The reference to this operator.

Parameters

fragment
Fragment *

The pointer to the fragment of the operator.

spec

Set the operator spec
Get the operator spec
Operator & holoscan::ops::VideoStreamRecorderOp::spec(Operator & holoscan::ops::VideoStreamRecorderOp::spec(
const std::shared_ptr<OperatorSpec> &spec
)

Set the operator spec.

Returns: The reference to this operator.

Parameters

spec
const std::shared_ptr<OperatorSpec> &

The operator spec.

spec_shared

std::shared_ptr<OperatorSpec> holoscan::ops::VideoStreamRecorderOp::spec_shared()std::shared_ptr<OperatorSpec> holoscan::ops::VideoStreamRecorderOp::spec_shared()

Get the shared pointer to the operator spec.

Returns: The shared pointer to the operator spec.

condition

template <typename ConditionT>
std::shared_ptr<ConditionT> holoscan::ops::VideoStreamRecorderOp::condition(
const std::string &name
)

Get a shared pointer to the Condition object.

Returns: The reference to the Condition object. If the condition does not exist, return the nullptr.

Parameters

name
const std::string &

The name of the condition.

conditions

std::unordered_map<std::string, std::shared_ptr<Condition>> & holoscan::ops::VideoStreamRecorderOp::conditions()std::unordered_map<std::string, std::shared_ptr<Condition>> & holoscan::ops::VideoStreamRecorderOp::conditions()

Get the conditions of the operator.

Returns: The conditions of the operator.

resource

template <typename ResourceT>
std::shared_ptr<ResourceT> holoscan::ops::VideoStreamRecorderOp::resource(
const std::string &name
)

Get a shared pointer to the Resource object.

Returns: The reference to the Resource object. If the resource does not exist, returns the nullptr.

Parameters

name
const std::string &

The name of the resource.

resources

std::unordered_map<std::string, std::shared_ptr<Resource>> & holoscan::ops::VideoStreamRecorderOp::resources()std::unordered_map<std::string, std::shared_ptr<Resource>> & holoscan::ops::VideoStreamRecorderOp::resources()

Get the resources of the operator.

Returns: The resources of the operator.

add_arg

Add a condition to the operator (1)
Add a condition to the operator (2)
Add a resource to the operator (1)
Add a resource to the operator (2)
Add an argument to the component (1)
Add an argument to the component (2)
Add a list of arguments to the component (1)
Add a list of arguments to the component (2)
void holoscan::ops::VideoStreamRecorderOp::add_arg(
const std::shared_ptr<Condition> &arg
)

Add a condition to the operator.

Parameters

arg
const std::shared_ptr<Condition> &

The condition to add.

is_root

bool holoscan::ops::VideoStreamRecorderOp::is_root()

Returns whether the operator is a root operator based on its fragment’s graph.

Returns: True, if the operator is a root operator; false, otherwise

is_user_defined_root

bool holoscan::ops::VideoStreamRecorderOp::is_user_defined_root()

Returns whether the operator is a user-defined root operator i.e., the first operator added to the graph.

Returns: True, if the operator is a user-defined root operator; false, otherwise

is_leaf

bool holoscan::ops::VideoStreamRecorderOp::is_leaf()

Returns whether the operator is a leaf operator based on its fragment’s graph.

Returns: True, if the operator is a leaf operator; false, otherwise

qualified_name

std::string holoscan::ops::VideoStreamRecorderOp::qualified_name() const

Returns the fully qualified name of the operator including the name of the fragment.

Returns: std::string fully qualified name of the operator in the format: “<fragment_name>.<operator_name>“

start

virtual void holoscan::ops::VideoStreamRecorderOp::start()

Implement the startup logic of the operator.

This method is called multiple times over the lifecycle of the operator according to the order defined in the lifecycle, and used for heavy initialization tasks such as allocating memory resources.

to_yaml_node

YAML::Node holoscan::ops::VideoStreamRecorderOp::to_yaml_node() const override

Get a YAML representation of the operator.

Returns: YAML node including type, specs, conditions and resources of the operator in addition to the base component properties.

graph_entity

std::shared_ptr<nvidia::gxf::GraphEntity> holoscan::ops::VideoStreamRecorderOp::graph_entity()

Get the GXF GraphEntity object corresponding to this operator.

Returns: graph entity corresponding to the operator

get_data_flow_tracking_label

MessageLabel holoscan::ops::VideoStreamRecorderOp::get_data_flow_tracking_label(MessageLabel holoscan::ops::VideoStreamRecorderOp::get_data_flow_tracking_label(
const std::string &input_port_name
)

Get the current message label for a given input port.

This method retrieves the MessageLabel associated with data received on the specified input port. The MessageLabel contains timing and path information for data flow tracking.

This method should ideally be called after receiving data on the input port.

If the input_port_name is invalid (not found in the operator’s input ports), an error is logged and an empty MessageLabel is returned.

Returns: MessageLabel The current message label for the input port. Returns an empty MessageLabel if the port does not have a message label or if the port does not exist (logs an error in the latter case as well).

Throws: std::runtime_error If the operator backend is not GXF-compatible.

Throws: std::runtime_error If fragment is not set.

Throws: std::runtime_error If operator spec is not set.

Throws: std::runtime_error If fragment flow tracking is not enabled.

Parameters

input_port_name
const std::string &

The name of the input port.

metadata

std::shared_ptr<MetadataDictionary> holoscan::ops::VideoStreamRecorderOp::metadata()std::shared_ptr<MetadataDictionary> holoscan::ops::VideoStreamRecorderOp::metadata()

Get a shared pointer to the dynamic metadata of this operator.

Note: currently this metadata dictionary is only active if explicitly enabled for the application by setting Fragment::is_metadata_enabled(true). When metadata is disabled the dictionary will not be populated by receive calls and will not be emitted on emit calls.

This metadata dictionary is always empty at the start of each compute call. It is populated by metadata received on input ports during InputContext::receive() calls and can be modified as desired by the operator during the compute call. Any metadata corresponding to this object will be sent on the output ports by any OutputContext::emit() calls.

Returns: The metadata dictionary for this operator.

is_metadata_enabled

bool holoscan::ops::VideoStreamRecorderOp::is_metadata_enabled() const

Determine if metadata is enabled for this operator.

Returns: Boolean indicating if metadata is enabled (returns fragment()``->``is_metadata_enabled() if enable_metadata was not explicitly called for the operator.

enable_metadata

void holoscan::ops::VideoStreamRecorderOp::enable_metadata(
bool enable
)

Enable or disable metadata for this operator.

If this method has not been used to explicitly enable or disable metadata, the value for is_metadata_enabled() will be determined by Fragment::is_metadata_enabled() when the operator is initialized.

Parameters

enable
bool

Boolean indicating if metadata should be enabled.

metadata_policy

Mutable
Const
void holoscan::ops::VideoStreamRecorderOp::metadata_policy(
MetadataPolicy policy
)

Set the metadata update policy used by this operator.

The metadata policy determines how metadata is merged across multiple receive calls:

  • MetadataPolicy::kUpdate: Update the existing value when a key already exists.
  • MetadataPolicy::kInplaceUpdate: Update the existing MetadataObject’s value in-place when a key already exists.
  • MetadataPolicy::kReject: Do not modify the existing value if a key already exists.
  • MetadataPolicy::kRaise: Raise an exception if a key already exists (default).

Parameters

policy
MetadataPolicy

The metadata update policy to be used by this operator.

receiver

std::optional<std::shared_ptr<Receiver>> holoscan::ops::VideoStreamRecorderOp::receiver(std::optional<std::shared_ptr<Receiver>> holoscan::ops::VideoStreamRecorderOp::receiver(
const std::string &port_name
)

If no CudaStreamPool parameter or argument already exists, add a default one.

This method is available to be called by derived classes to add a default CudaStreamPool in This method is available to be called by derived classes to add a default CudaStreamPool inthe case that the user did not pass one in as an argument tomake_operator`.

This function will not add an additional CUDA stream pool if one was already passed in as an argument to make_operator (i.e. it is in resources_) or if a “cuda_stream_pool” parameter already exists in the operator spec.

/** Return the Receiver corresponding to a specific input port.

Returns: The Receiver corresponding to the input port, if it exists. Otherwise, return nullopt.

Parameters

port_name
const std::string &

The name of the input port.

transmitter

std::optional<std::shared_ptr<Transmitter>> holoscan::ops::VideoStreamRecorderOp::transmitter(std::optional<std::shared_ptr<Transmitter>> holoscan::ops::VideoStreamRecorderOp::transmitter(
const std::string &port_name
)

Return the Transmitter corresponding to a specific output port.

Returns: The Transmitter corresponding to the output port, if it exists. Otherwise, return nullopt.

Parameters

port_name
const std::string &

The name of the output port.

bind_input_topic

void holoscan::ops::VideoStreamRecorderOp::bind_input_topic(
const std::string &port_name,
const std::string &topic,
const std::optional<nvidia::gxf::QoSProfile> &qos = std::nullopt,
bool replace_connector = false
)

Bind an input port to a Pub/Sub topic.

This is the programmatic override path for topic-mapped ports and takes precedence over any lower-priority IOSpec::topic() default configured in setup().

Parameters

port_name
const std::string &

The input port to bind.

topic
const std::string &

The topic name to subscribe to.

qos
const std::optional<nvidia::gxf::QoSProfile> &Defaults to std::nullopt

Optional QoS profile override. When nullopt, any QoS already configured on the port (e.g. in setup()) is preserved.

replace_connector
boolDefaults to false

If true, replace an explicitly non-PubSub connector on this port with a Pub/Sub connector.

bind_output_topic

void holoscan::ops::VideoStreamRecorderOp::bind_output_topic(
const std::string &port_name,
const std::string &topic,
const std::optional<nvidia::gxf::QoSProfile> &qos = std::nullopt,
bool replace_connector = false
)

Bind an output port to a Pub/Sub topic.

This is the programmatic override path for topic-mapped ports and takes precedence over any lower-priority IOSpec::topic() default configured in setup().

Parameters

port_name
const std::string &

The output port to bind.

topic
const std::string &

The topic name to publish to.

qos
const std::optional<nvidia::gxf::QoSProfile> &Defaults to std::nullopt

Optional QoS profile override. When nullopt, any QoS already configured on the port (e.g. in setup()) is preserved.

replace_connector
boolDefaults to false

If true, replace an explicitly non-PubSub connector on this port with a Pub/Sub connector.

input_topic

std::optional<std::string> holoscan::ops::VideoStreamRecorderOp::input_topic(
const std::string &port_name
) const

Get the configured topic name for an input port, if any.

output_topic

std::optional<std::string> holoscan::ops::VideoStreamRecorderOp::output_topic(
const std::string &port_name
) const

Get the configured topic name for an output port, if any.

input_qos

std::optional<nvidia::gxf::QoSProfile> holoscan::ops::VideoStreamRecorderOp::input_qos(
const std::string &port_name
) const

Get the effective QoS profile for an input port, if it is topic-mapped.

output_qos

std::optional<nvidia::gxf::QoSProfile> holoscan::ops::VideoStreamRecorderOp::output_qos(
const std::string &port_name
) const

Get the effective QoS profile for an output port, if it is topic-mapped.

queue_policy

void holoscan::ops::VideoStreamRecorderOp::queue_policy(
const std::string &port_name,
IOSpec::IOType port_type = IOSpec::IOType::kInput,
IOSpec::QueuePolicy policy = IOSpec::QueuePolicy::kFault
)

Set the queue policy to be used by an input or output port.

The following IOSpec::QueuePolicy values are supported:

  • QueuePolicy::kPop - If the queue is full, pop the oldest item, then add the new one.
  • QueuePolicy::kReject - If the queue is full, reject (discard) the new item.
  • QueuePolicy::kFault - If the queue is full, log a warning and reject the new item.

Parameters

port_name
const std::string &

The name of the port.

port_type
IOSpec::IOTypeDefaults to IOSpec::IOType::kInput

Enum flag indicating whether port_name specifies an input or output port.

policy
IOSpec::QueuePolicyDefaults to IOSpec::QueuePolicy::kFault

The queue policy to set for the port.

input_exec_spec

const std::shared_ptr<IOSpec> & holoscan::ops::VideoStreamRecorderOp::input_exec_spec()const std::shared_ptr<IOSpec> & holoscan::ops::VideoStreamRecorderOp::input_exec_spec()

output_exec_spec

const std::shared_ptr<IOSpec> & holoscan::ops::VideoStreamRecorderOp::output_exec_spec()const std::shared_ptr<IOSpec> & holoscan::ops::VideoStreamRecorderOp::output_exec_spec()

dynamic_flow_func

const std::function<void(
const std::shared_ptr<Operator> &
)

self_shared

std::shared_ptr<Operator> holoscan::ops::VideoStreamRecorderOp::self_shared()std::shared_ptr<Operator> holoscan::ops::VideoStreamRecorderOp::self_shared()

next_flows

const std::vector<std::shared_ptr<FlowInfo>> & holoscan::ops::VideoStreamRecorderOp::next_flows()const std::vector<std::shared_ptr<FlowInfo>> & holoscan::ops::VideoStreamRecorderOp::next_flows()

Get the list of next flows connected to this operator.

Returns: A vector of FlowInfo objects representing the flows to downstream operators.

add_dynamic_flow

Overload 1
Overload 2
Overload 3
Overload 4
void holoscan::ops::VideoStreamRecorderOp::add_dynamic_flow(
const std::shared_ptr<FlowInfo> &flow
)

Add a dynamic flow from this operator to another operator using a FlowInfo object.

Parameters

flow
const std::shared_ptr<FlowInfo> &

The flow information object describing the connection between operators.

dynamic_flows

const std::shared_ptr<std::vector<std::shared_ptr<FlowInfo>>> & holoscan::ops::VideoStreamRecorderOp::dynamic_flows()const std::shared_ptr<std::vector<std::shared_ptr<FlowInfo>>> & holoscan::ops::VideoStreamRecorderOp::dynamic_flows()

Get the list of dynamic flows that have been added to this operator.

Returns: A shared pointer to a vector of FlowInfo objects representing the dynamic flows.

find_flow_info

const std::shared_ptr<Operator::FlowInfo> & holoscan::ops::VideoStreamRecorderOp::find_flow_info(const std::shared_ptr<Operator::FlowInfo> & holoscan::ops::VideoStreamRecorderOp::find_flow_info(const std::shared_ptr<Operator::FlowInfo> & holoscan::ops::VideoStreamRecorderOp::find_flow_info(
const std::function<bool(const std::shared_ptr<Operator::FlowInfo> &)> &predicate const std::function<bool(const std::shared_ptr<Operator::FlowInfo> &)> &predicate
)

Locate a flow info in the operator’s next flows based on a given predicate.

Returns: Shared pointer to the matching FlowInfo, or nullptr if not found.

Parameters

predicate
const std::function<bool(const std::shared_ptr<Operator::FlowInfo> &)> &

Lambda function that takes a FlowInfo shared pointer and returns a boolean.

find_all_flow_info

std::vector<std::shared_ptr<Operator::FlowInfo>> holoscan::ops::VideoStreamRecorderOp::find_all_flow_info(std::vector<std::shared_ptr<Operator::FlowInfo>> holoscan::ops::VideoStreamRecorderOp::find_all_flow_info(std::vector<std::shared_ptr<Operator::FlowInfo>> holoscan::ops::VideoStreamRecorderOp::find_all_flow_info(
const std::function<bool(const std::shared_ptr<Operator::FlowInfo> &)> &predicate const std::function<bool(const std::shared_ptr<Operator::FlowInfo> &)> &predicate
)

Find all FlowInfo objects in the operator’s next flows that match a given condition.

Returns: A vector of shared pointers to the matching FlowInfo objects.

Parameters

predicate
const std::function<bool(const std::shared_ptr<Operator::FlowInfo> &)> &

A lambda function that takes a shared pointer to a FlowInfo object and returns a boolean.

async_condition

std::shared_ptr<holoscan::AsynchronousCondition> holoscan::ops::VideoStreamRecorderOp::async_condition()std::shared_ptr<holoscan::AsynchronousCondition> holoscan::ops::VideoStreamRecorderOp::async_condition()

Get the internal asynchronous condition for the operator.

Note: This object is only accessible after the executor has called Operator::initialize() via run() or run_async(). If accessed during Application::compose(), it will return nullptr.

Returns: A shared pointer to the internal asynchronous condition.

stop_execution

void holoscan::ops::VideoStreamRecorderOp::stop_execution()

Stop the execution of the operator.

This method is used to stop the execution of the operator by setting the internal async condition to EVENT_NEVER state, which sets the scheduling condition to NEVER. Once stopped, the operator will not be scheduled for execution (the compute() method will not be called).

Note that executing this method does not trigger the operator’s stop() method. The stop() method is called only when the scheduler deactivates all operators together.

execution_context

virtual std::shared_ptr<holoscan::ExecutionContext> holoscan::ops::VideoStreamRecorderOp::execution_context() constvirtual std::shared_ptr<holoscan::ExecutionContext> holoscan::ops::VideoStreamRecorderOp::execution_context() const

Get the ExecutionContext object.

Returns: The shared pointer to the ExecutionContext object.

ensure_contexts

void holoscan::ops::VideoStreamRecorderOp::ensure_contexts()

Ensure the contexts (input/output/execution) for the operator.

This method is called by the GXFExecutor when the operator is initialized.

release_internal_resources

virtual void holoscan::ops::VideoStreamRecorderOp::release_internal_resources()

Internal method to clean up operator resources and prevent circular references.

This is an internal method called automatically by the GXFWrapper during operator shutdown (in GXFWrapper::stop() method). It resets std::shared_ptr fields and std::function objects such as input_exec_spec_, output_exec_spec_, next_flows_, dynamic_flows_, and dynamic_flow_func_ to break potential circular references between connected Operator objects.

This is an internal method that should never be called directly by user code. Improper use can lead to undefined behavior.

operator

*List of restricted substrings that cannot be used in holoscan::ops::VideoStreamRecorderOp::operator(
e.g. GXF GraphEntity
) override

defaults

*Set the parameters based on holoscan::ops::VideoStreamRecorderOp::defaults(
sets GXF parameters for GXF operators
)

is_gxf_compatible_operator_type

bool holoscan::ops::VideoStreamRecorderOp::is_gxf_compatible_operator_type() const

Check if the operator is a GXF compatible operator type.

This checks the OperatorType and returns true if it is one of {kNative, kGXF, kVirtual}.

Returns: True if the operator is a GXF compatible operator type, false otherwise.

operator std::shared_ptr< Executor > executor

*Get the executor of the holoscan::ops::VideoStreamRecorderOp::operator std::shared_ptr<Executor> executor()

has_pubsub_connector

*name Connector type queries *bool holoscan::ops::VideoStreamRecorderOp::has_pubsub_connector()

Check if the operator has any UCX connectors.

Check if the operator has any PubSub connectors.

has_network_connector

bool holoscan::ops::VideoStreamRecorderOp::has_network_connector()

Check if the operator has any network (UCX or PubSub) connectors.

args

std::vector<Arg> & holoscan::ComponentBase::args()

Get the list of arguments.

Returns: The vector of arguments.

description

std::string holoscan::ComponentBase::description() const

Get a description of the component.

Returns: YAML string.

See also: to_yaml_node()

service

template <typename ServiceT = DefaultFragmentService>
std::shared_ptr<ServiceT> holoscan::ComponentBase::service(
std::string_view id = ""
) const

Retrieve a registered fragment service or resource.

Retrieves a previously registered fragment service or resource by its type and optional identifier. Returns nullptr if no service/resource is found with the specified type and identifier.

Note that any changes to the service retrieval logic in this method should be synchronized with the implementation in Fragment::service() method to maintain consistency.

Returns: The shared pointer to the service/resource, or nullptr if not found or if type casting fails.

Template parameters

ServiceT
typename

The type of the service/resource to retrieve. Must inherit from either Resource or FragmentService. Defaults to DefaultFragmentService if not specified.

Parameters

id
std::string_viewDefaults to ""

The identifier of the service/resource. If empty, retrieves by type only.

get_service_by_type_info

std::shared_ptr<FragmentService> holoscan::ComponentBase::get_service_by_type_info(
const std::type_info &service_type,
std::string_view id = ""
) const

Retrieve a registered fragment service or resource for Python bindings.

This is a helper method for Python bindings to retrieve a service by its C++ type info.

Returns: The shared pointer to the base service, or nullptr if not found.

Parameters

service_type
const std::type_info &

The type info of the service/resource to retrieve.

id
std::string_viewDefaults to ""

The identifier of the service/resource. If empty, retrieves by type only.

reset_backend_objects

virtual void holoscan::ComponentBase::reset_backend_objects()

Reset any backend-specific objects (e.g. GXF GraphEntity).

initialize_graph_entity

gxf_uid_t holoscan::ops::VideoStreamRecorderOp::initialize_graph_entity(
void *context,
const std::string &entity_prefix = ""
)

This function creates a GraphEntity corresponding to the operator.

Returns: The GXF entity eid corresponding to the graph entity.

Parameters

context
void *

The GXF context.

entity_prefix
const std::string &Defaults to ""

Prefix to add to the operator’s name when creating the GraphEntity.

initialize_async_condition

void holoscan::ops::VideoStreamRecorderOp::initialize_async_condition()

Initialize the internal asynchronous condition to control the operator execution.

This method is called by the GXFExecutor when the operator is initialized.

add_codelet_to_graph_entity

virtual gxf_uid_t holoscan::ops::VideoStreamRecorderOp::add_codelet_to_graph_entity()

Add this operator as the codelet in the GXF GraphEntity.

Returns: The codelet component id corresponding to GXF codelet.

initialize_conditions

*Initialize conditions and add GXF conditions to graph_entity_ void holoscan::ops::VideoStreamRecorderOp::initialize_conditions()

initialize_resources

*Initialize resources and add GXF resources to graph_entity_ void holoscan::ops::VideoStreamRecorderOp::initialize_resources()

update_params_from_args

Overload 1
Update parameters based on the specified arguments
*Update parameters based on the specified arguments void holoscan::ops::VideoStreamRecorderOp::update_params_from_args()

update_connector_arguments

void holoscan::ops::VideoStreamRecorderOp::update_connector_arguments()

Replace any “receiver” supplied as a string with the actual receiver of that name.

Can only be called after GXFExecutor::create_input_port so the input ports (receivers) exist.

find_ports_used_by_condition_args

void holoscan::ops::VideoStreamRecorderOp::find_ports_used_by_condition_args()

Determine ports whose transmitter or receiver are associated with an Arg for a Condition.

Should be called before GXFExecutor::create_input_port or GXFExecutor::create_output_port.

get_consolidated_input_label

MessageLabel holoscan::ops::VideoStreamRecorderOp::get_consolidated_input_label()MessageLabel holoscan::ops::VideoStreamRecorderOp::get_consolidated_input_label()

This function returns a consolidated MessageLabel for all the input ports of an Operator.

If there is no input port (root Operator), then a new MessageLabel with the current Operator and default receive timestamp is returned.

Returns: The consolidated MessageLabel

update_input_message_label

void holoscan::ops::VideoStreamRecorderOp::update_input_message_label(
std::string input_name,
MessageLabel m
)

Update the input_message_labels map with the given MessageLabel a corresponding input_name.

Parameters

input_name
std::string

The input port name for which the MessageLabel is updated

m
MessageLabel

The new MessageLabel that will be set for the input port

delete_input_message_label

void holoscan::ops::VideoStreamRecorderOp::delete_input_message_label(
const std::string &input_name
)

Delete the input_message_labels map entry for the given input_name.

Parameters

input_name
const std::string &

The input port name for which the MessageLabel is deleted

reset_input_message_labels

void holoscan::ops::VideoStreamRecorderOp::reset_input_message_labels()

Reset the input message labels to clear all its contents.

This is done for a leaf operator when it finishes its execution as it is assumed that all its inputs are processed.

has_input_message_labels

bool holoscan::ops::VideoStreamRecorderOp::has_input_message_labels()

Check if the operator has any input message labels.

num_published_messages_map

std::map<std::string, uint64_t> holoscan::ops::VideoStreamRecorderOp::num_published_messages_map()

Get the number of published messages for each output port indexed by the output port name.

The function is utilized by the DFFTCollector to update the DataFlowTracker with the number of published messages for root operators.

Returns: The map of the number of published messages for every output name.

update_published_messages

void holoscan::ops::VideoStreamRecorderOp::update_published_messages(
const std::string &output_name
)

This function updates the number of published messages for a given output port.

Parameters

output_name
const std::string &

The name of the output port

operator.void initialize_next_flows

*Initialize the next flows for the holoscan::ops::VideoStreamRecorderOp::operator.void initialize_next_flows()

non_default_input_ports

std::vector<std::string> & holoscan::ops::VideoStreamRecorderOp::non_default_input_ports()

non_default_output_ports

std::vector<std::string> & holoscan::ops::VideoStreamRecorderOp::non_default_output_ports()

set_input_exec_spec

void holoscan::ops::VideoStreamRecorderOp::set_input_exec_spec(
const std::shared_ptr<IOSpec> &input_exec_spec
)

set_output_exec_spec

void holoscan::ops::VideoStreamRecorderOp::set_output_exec_spec(
const std::shared_ptr<IOSpec> &output_exec_spec
)

set_dynamic_flows

void holoscan::ops::VideoStreamRecorderOp::set_dynamic_flows(
const std::function<void(const std::shared_ptr<Operator> &)> &dynamic_flow_func
)

set_self_shared

void holoscan::ops::VideoStreamRecorderOp::set_self_shared(
const std::shared_ptr<Operator> &this_op
)

initialize_execution_context

virtual std::shared_ptr<ExecutionContext> holoscan::ops::VideoStreamRecorderOp::initialize_execution_context()virtual std::shared_ptr<ExecutionContext> holoscan::ops::VideoStreamRecorderOp::initialize_execution_context()

service_provider

void holoscan::ComponentBase::service_provider(
FragmentServiceProvider *provider
)

Set the service provider that owns this component.


Static methods

is_all_operator_successor_virtual

static bool holoscan::ops::VideoStreamRecorderOp::is_all_operator_successor_virtual(
const OperatorNodeType &op,
OperatorFlowGraph &graph
)

Returns whether all the successors of an operator are virtual operators.

Returns: true if the operator has all virtual operator successors, false otherwise

Parameters

op
const OperatorNodeType &

The shared_ptr to the operator for which the check is to be performed

graph
OperatorFlowGraph &

The graph of operators. fragment()->graph() can usually be used to get this graph.

is_all_operator_predecessor_virtual

static bool holoscan::ops::VideoStreamRecorderOp::is_all_operator_predecessor_virtual(
const OperatorNodeType &op,
OperatorFlowGraph &graph
)

Returns whether all the predecessors of an operator are virtual operators.

Returns: true if the operator has all virtual operator predecessors, false otherwise

Parameters

op
const OperatorNodeType &

The shared_ptr to the operator for which the check is to be performed

graph
OperatorFlowGraph &

The graph of operators. fragment()->graph() can usually be used to get this graph.

parse_port_name

static std::pair<std::string, std::string> holoscan::ops::VideoStreamRecorderOp::parse_port_name(
const std::string &op_port_name
)

Return operator name and port name from a string in the format of “<op_name>[.<port_name>]“.

parse_operator_port_key

static std::pair<std::string, std::string> holoscan::ops::VideoStreamRecorderOp::parse_operator_port_key(
const std::string &operator_port_key
)

Return operator name and port name from a string in the format of “<op_name>-<port_name>“.

register_codec

template <typename typeT>
static void holoscan::ops::VideoStreamRecorderOp::register_codec(
const std::string &codec_name,
bool overwrite = true
)

Register the codec for serialization/deserialization of a custom type.

Deprecated

Use holoscan::gxf::GXFExecutor::register_codec instead.

validate_operator_name

static void holoscan::ops::VideoStreamRecorderOp::validate_operator_name(
const std::string &name
)

Validate operator name against restricted keywords and patterns.

Throws: std::invalid_argument if the name contains restricted patterns.

Parameters

name
const std::string &

The name to validate.

register_converter

template <typename typeT>
static void holoscan::ComponentBase::register_converter()

Register the argument setter for the given type.

If an operator or resource has an argument with a custom type, the argument setter must be registered using this method.

The argument setter is used to set the value of the argument from the YAML configuration.

This method can be called in the initialization phase of the operator/resource (e.g., initialize()). The example below shows how to register the argument setter for the custom type (Vec3):

It is assumed that YAML::convert<T>::encode and YAML::convert<T>::decode are implemented for the given type. You need to specialize the YAML::convert<> template class.

For example, suppose that you had a Vec3 class with the following members:

You can define the YAML::convert<Vec3> as follows in a ‘.cpp’ file:

Please refer to the yaml-cpp documentation for more details.

Template parameters

typeT
typename

The type of the argument to register.

Example

void MyOp::initialize() {
register_converter<Vec3>();
}

Example

struct Vec3 {
// make sure you have overloaded operator==() for the comparison
double x, y, z;
};

Example

namespace YAML {
template<>
struct convert<Vec3> {
static Node encode(const Vec3& rhs) {
Node node;
node.push_back(rhs.x);
node.push_back(rhs.y);
node.push_back(rhs.z);
return node;
}
static bool decode(const Node& node, Vec3& rhs) {
if(!node.IsSequence() || node.size() != 3) {
return false;
}
rhs.x = node[0].as<double>();
rhs.y = node[1].as<double>();
rhs.z = node[2].as<double>();
return true;
}
};
}

register_argument_setter

template <typename typeT>
void holoscan::ComponentBase::register_argument_setter()

Register the argument setter for the given type.

Please refer to the documentation of register_converter() for more details.

Template parameters

typeT
typename

The type of the argument to register.


Types

OperatorType

Operator type used by the executor.

NameValueDescription
kNativeNative operator.
kGXFGXF operator.
kVirtualVirtual operator.
kGPUResidentGPU-resident operator.
kUnknownPlaceholder for unknown operator type.

Member variables

NameTypeDescription
receiver_Parameter< holoscan::IOSpec * >
entity_serializer_Parameter< std::shared_ptr< holoscan::Resource > >
directory_Parameter< std::string >
basename_Parameter< std::string >
flush_on_tick_Parameter< bool >
index_file_stream_nvidia::gxf::FileStream
binary_file_stream_nvidia::gxf::FileStream
binary_file_offset_size_t
kInputExecPortName static constexprconst char *Default input execution port name.
kOutputExecPortName static constexprconst char *Default output execution port name.
is_initialized_boolWhether the operator is initialized.
operator_type_OperatorTypeThe type of the operator.
spec_std::shared_ptr< OperatorSpec >The operator spec of the operator.
conditions_std::unordered_map< std::string, std::shared_ptr< Condition > >The conditions of the operator.
resources_std::unordered_map< std::string, std::shared_ptr< Resource > >The resources used by the operator.
graph_entity_std::shared_ptr< nvidia::gxf::GraphEntity >GXF graph entity corresponding to.
internal_async_condition_*< the Operator *The asynchronous condition to control the operator execution. std::shared_ptr< holoscan::AsynchronousCondition >
dynamic_metadata_std::shared_ptr< MetadataDictionary >The metadata dictionary for the operator.
is_metadata_enabled_std::optional< bool >Flag to enable or disable metadata for the operator.
input_exec_spec_*< If not set, the value from the Fragment is used. std::shared_ptr< IOSpec >The input execution port specification.
output_exec_spec_std::shared_ptr< IOSpec >The output execution port specification.
dynamic_flow_func_std::function< void(const std::shared_ptr< Operator > &)>
self_shared_std::weak_ptr< Operator >
next_flows_std::shared_ptr< std::vector< std::shared_ptr< FlowInfo > > >
dynamic_flows_std::shared_ptr< std::vector< std::shared_ptr< FlowInfo > > >
id_int64_tThe ID of the component.
name_std::stringName of the component.
fragment_Fragment *Pointer to the fragment that owns this component.
args_std::vector< Arg >List of arguments.
service_provider_FragmentServiceProvider *Pointer to the service provider.