Apollo 10.0
自动驾驶开放平台
apollo::drivers::video::CompCameraH265Compressed类 参考

#include <video_driver_component.h>

类 apollo::drivers::video::CompCameraH265Compressed 继承关系图:
apollo::drivers::video::CompCameraH265Compressed 的协作图:

Public 成员函数

 ~CompCameraH265Compressed ()
 
bool Init ()
 
- Public 成员函数 继承自 apollo::cyber::Component< M0, M1, M2, M3 >
 Component ()
 
 ~Component () override
 
bool Initialize (const ComponentConfig &config) override
 init the component by protobuf object.
 
bool Process (const std::shared_ptr< M0 > &msg0, const std::shared_ptr< M1 > &msg1, const std::shared_ptr< M2 > &msg2, const std::shared_ptr< M3 > &msg3)
 
- Public 成员函数 继承自 apollo::cyber::ComponentBase
virtual ~ComponentBase ()
 
virtual bool Initialize (const TimerComponentConfig &config)
 
virtual void Shutdown ()
 
template<typename T >
bool GetProtoConfig (T *config) const
 

额外继承的成员函数

- Public 类型 继承自 apollo::cyber::ComponentBase
template<typename M >
using Reader = cyber::Reader< M >
 
- Protected 成员函数 继承自 apollo::cyber::ComponentBase
virtual void Clear ()
 
const std::string & ConfigFilePath () const
 
void LoadConfigFiles (const ComponentConfig &config)
 
void LoadConfigFiles (const TimerComponentConfig &config)
 
- Protected 属性 继承自 apollo::cyber::ComponentBase
std::atomic< bool > is_shutdown_ = {false}
 
std::shared_ptr< Nodenode_ = nullptr
 
std::string config_file_path_ = ""
 
std::vector< std::shared_ptr< ReaderBase > > readers_
 

详细描述

在文件 video_driver_component.h38 行定义.

构造及析构函数说明

◆ ~CompCameraH265Compressed()

apollo::drivers::video::CompCameraH265Compressed::~CompCameraH265Compressed ( )
inline

在文件 video_driver_component.h40 行定义.

40 {
41 if (video_thread_->joinable()) {
42 video_thread_->join();
43 }
44 }

成员函数说明

◆ Init()

bool apollo::drivers::video::CompCameraH265Compressed::Init ( )
virtual

实现了 apollo::cyber::ComponentBase.

在文件 video_driver_component.cc27 行定义.

27 {
28 AINFO << "Initialize video driver component.";
29
30 CameraH265Config video_config;
31 if (!GetProtoConfig(&video_config)) {
32 return false;
33 }
34
35 AINFO << "Velodyne config: " << video_config.DebugString();
36
37 camera_deivce_.reset(new CameraDriver(&video_config));
38 camera_deivce_->Init();
39
40 if (camera_deivce_->Record()) {
41 // Use current directory to save record file if H265_SAVE_FOLDER environment
42 // is not set.
43 record_folder_ = cyber::common::GetEnv("H265_SAVE_FOLDER", ".");
44 AINFO << "Record folder: " << record_folder_;
45
46 struct stat st;
47 if (stat(record_folder_.c_str(), &st) < 0) {
48 bool ret = EnsureDirectory(record_folder_);
49 AINFO_IF(ret) << "Record folder is created successfully.";
50 }
51 }
52 pb_image_.reset(new CompressedImage);
53 pb_image_->mutable_data()->reserve(1920 * 1080 * 4);
54
55 writer_ = node_->CreateWriter<CompressedImage>(
56 video_config.compress_conf().output_channel());
57
58 runing_ = true;
59 video_thread_ = std::shared_ptr<std::thread>(
60 new std::thread(std::bind(&CompCameraH265Compressed::VideoPoll, this)));
61 video_thread_->detach();
62
63 return true;
64}
bool GetProtoConfig(T *config) const
std::shared_ptr< Node > node_
#define AINFO_IF(cond)
Definition log.h:72
#define AINFO
Definition log.h:42
std::string GetEnv(const std::string &var_name, const std::string &default_value="")
Definition environment.h:29
bool EnsureDirectory(const std::string &directory_path)
Check if a specified directory specified by directory_path exists.
Definition file.cc:299

该类的文档由以下文件生成: