Apollo
10.0
自动驾驶开放平台
driver.h
浏览该文件的文档.
1
/******************************************************************************
2
* Copyright 2019 The Apollo Authors. All Rights Reserved.
3
*
4
* Licensed under the Apache License, Version 2.0 (the "License");
5
* you may not use this file except in compliance with the License.
6
* You may obtain a copy of the License at
7
*
8
* http://www.apache.org/licenses/LICENSE-2.0
9
*
10
* Unless required by applicable law or agreed to in writing, software
11
* distributed under the License is distributed on an "AS IS" BASIS,
12
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
* See the License for the specific language governing permissions and
14
* limitations under the License.
15
*****************************************************************************/
16
17
#pragma once
18
19
#include <memory>
20
#include "
cyber/cyber.h
"
21
#include "modules/common_msgs/sensor_msgs/sensor_image.pb.h"
22
#include "modules/drivers/video/proto/video_h265cfg.pb.h"
23
#include "
modules/drivers/video/socket_input.h
"
24
25
namespace
apollo
{
26
namespace
drivers {
27
namespace
video {
28
29
using
apollo::drivers::CompressedImage
;
30
using
apollo::drivers::video::config::CameraH265Config
;
31
32
class
CameraDriver
{
33
public
:
34
explicit
CameraDriver
(
const
CameraH265Config
*h265_cfg);
35
~CameraDriver
() {}
36
37
bool
Poll
(std::shared_ptr<CompressedImage> h265);
38
void
Init
();
39
int
Port
() {
return
config_
.
udp_port
(); }
40
int
Record
() {
return
config_
.
record
(); }
41
42
protected
:
43
CameraH265Config
config_
;
44
std::shared_ptr<SocketInput>
input_
;
45
bool
PollByFrame
(std::shared_ptr<CompressedImage> h265);
46
};
47
48
}
// namespace video
49
}
// namespace drivers
50
}
// namespace apollo
apollo::drivers::video::CameraDriver
Definition
driver.h:32
apollo::drivers::video::CameraDriver::Init
void Init()
Definition
driver.cc:51
apollo::drivers::video::CameraDriver::Port
int Port()
Definition
driver.h:39
apollo::drivers::video::CameraDriver::Record
int Record()
Definition
driver.h:40
apollo::drivers::video::CameraDriver::input_
std::shared_ptr< SocketInput > input_
Definition
driver.h:44
apollo::drivers::video::CameraDriver::~CameraDriver
~CameraDriver()
Definition
driver.h:35
apollo::drivers::video::CameraDriver::config_
CameraH265Config config_
Definition
driver.h:43
apollo::drivers::video::CameraDriver::PollByFrame
bool PollByFrame(std::shared_ptr< CompressedImage > h265)
Definition
driver.cc:34
apollo::drivers::video::CameraDriver::Poll
bool Poll(std::shared_ptr< CompressedImage > h265)
Definition
driver.cc:30
cyber.h
apollo
class register implement
Definition
arena_queue.h:37
apollo::drivers::CompressedImage
Definition
sensor_image.proto:79
apollo::drivers::video::config::CameraH265Config
Definition
video_h265cfg.proto:4
apollo::drivers::video::config::CameraH265Config::record
required uint32 record
Definition
video_h265cfg.proto:12
apollo::drivers::video::config::CameraH265Config::udp_port
required uint32 udp_port
Definition
video_h265cfg.proto:5
socket_input.h
modules
drivers
video
driver.h