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

#include <driver.h>

apollo::drivers::video::CameraDriver 的协作图:

Public 成员函数

 CameraDriver (const CameraH265Config *h265_cfg)
 
 ~CameraDriver ()
 
bool Poll (std::shared_ptr< CompressedImage > h265)
 
void Init ()
 
int Port ()
 
int Record ()
 

Protected 成员函数

bool PollByFrame (std::shared_ptr< CompressedImage > h265)
 

Protected 属性

CameraH265Config config_
 
std::shared_ptr< SocketInputinput_
 

详细描述

在文件 driver.h32 行定义.

构造及析构函数说明

◆ CameraDriver()

apollo::drivers::video::CameraDriver::CameraDriver ( const CameraH265Config h265_cfg)
explicit

在文件 driver.cc26 行定义.

26 {
27 config_ = *h265_cfg;
28}

◆ ~CameraDriver()

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

在文件 driver.h35 行定义.

35{}

成员函数说明

◆ Init()

void apollo::drivers::video::CameraDriver::Init ( )

在文件 driver.cc51 行定义.

51 {
52 input_.reset(new SocketInput());
53 input_->Init(config_.udp_port());
54}
std::shared_ptr< SocketInput > input_
Definition driver.h:44

◆ Poll()

bool apollo::drivers::video::CameraDriver::Poll ( std::shared_ptr< CompressedImage h265)

在文件 driver.cc30 行定义.

30 {
31 return PollByFrame(h265);
32}
bool PollByFrame(std::shared_ptr< CompressedImage > h265)
Definition driver.cc:34

◆ PollByFrame()

bool apollo::drivers::video::CameraDriver::PollByFrame ( std::shared_ptr< CompressedImage h265)
protected

在文件 driver.cc34 行定义.

34 {
35 int ret = input_->GetFramePacket(h265Pb);
36 if (ret < 0) {
37 return false;
38 }
39
40 h265Pb->set_frame_id(config_.frame_id());
41 uint64_t camera_timestamp = h265Pb->mutable_header()->camera_timestamp();
42 uint64_t current_time = cyber::Time().Now().ToNanosecond();
43 AINFO << "Get frame from port: " << config_.udp_port()
44 << ", size: " << h265Pb->data().size() << ", ts: camera/host "
45 << camera_timestamp << "/" << current_time << ", diff: "
46 << static_cast<double>(current_time - camera_timestamp) * 1e-6;
47
48 return true;
49}
#define AINFO
Definition log.h:42

◆ Port()

int apollo::drivers::video::CameraDriver::Port ( )
inline

在文件 driver.h39 行定义.

39{ return config_.udp_port(); }

◆ Record()

int apollo::drivers::video::CameraDriver::Record ( )
inline

在文件 driver.h40 行定义.

类成员变量说明

◆ config_

CameraH265Config apollo::drivers::video::CameraDriver::config_
protected

在文件 driver.h43 行定义.

◆ input_

std::shared_ptr<SocketInput> apollo::drivers::video::CameraDriver::input_
protected

在文件 driver.h44 行定义.


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