Clara Holoscan v0.3.0
1.0

Program Listing for File emergent_source.hpp

Return to documentation for file (gxf_extensions/emergent/emergent_source.hpp)

Copy
Copied!
            

/* * Copyright (c) 2022, NVIDIA CORPORATION. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifndef NVIDIA_CLARA_HOLOSCAN_GXF_EXTENSIONS_EMERGENT_SOURCE_HPP_ #define NVIDIA_CLARA_HOLOSCAN_GXF_EXTENSIONS_EMERGENT_SOURCE_HPP_ #include <string> #include <vector> #include "gxf/std/codelet.hpp" #include "gxf/std/transmitter.hpp" #include <emergentframe.h> #include <emergenterrors.h> #include <gigevisiondeviceinfo.h> #include <EmergentCamera.h> #include <EmergentCameraAPIs.h> #define FRAMES_BUFFERS 256 using namespace Emergent; namespace nvidia { namespace holoscan { constexpr uint32_t kMaxCameras = 10; constexpr uint32_t kNumBuffers = 10; constexpr uint32_t kDefaultWidth = 4200; constexpr uint32_t kDefaultHeight = 2160; constexpr uint32_t kDefaultFramerate = 240; constexpr bool kDefaultRDMA = false; constexpr PIXEL_FORMAT kDefaultPixelFormat = GVSP_PIX_BAYGB8; class EmergentSource : public gxf::Codelet { public: EmergentSource(); gxf_result_t registerInterface(gxf::Registrar* registrar) override; gxf_result_t start() override; gxf_result_t tick() override; gxf_result_t stop() override; private: EVT_ERROR CheckCameraCapabilities(); EVT_ERROR OpenEVTCamera(); void SetDefaultConfiguration(); gxf::Parameter<gxf::Handle<gxf::Transmitter>> signal_; gxf::Parameter<uint32_t> width_; gxf::Parameter<uint32_t> height_; gxf::Parameter<uint32_t> framerate_; gxf::Parameter<bool> use_rdma_; CEmergentCamera camera_; CEmergentFrame evt_frame_[FRAMES_BUFFERS]; CEmergentFrame evt_frame_recv_; }; } // namespace holoscan } // namespace nvidia #endif// NVIDIA_CLARA_HOLOSCAN_GXF_EXTENSIONS_EMERGENT_SOURCE_HPP_

© Copyright 2022, NVIDIA. Last updated on Jun 28, 2023.