Apollo  6.0
Open source self driving car software
driver.h
Go to the documentation of this file.
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/drivers/proto/sensor_image.pb.h"
22 #include "modules/drivers/video/proto/video_h265cfg.pb.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);
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
PlanningContext is the runtime context in planning. It is persistent across multiple frames...
Definition: atomic_hash_map.h:25
bool PollByFrame(std::shared_ptr< CompressedImage > h265)
int Port()
Definition: driver.h:39
bool Poll(std::shared_ptr< CompressedImage > h265)
CameraDriver(const CameraH265Config *h265_cfg)
std::shared_ptr< SocketInput > input_
Definition: driver.h:44
CameraH265Config config_
Definition: driver.h:43
~CameraDriver()
Definition: driver.h:35
int Record()
Definition: driver.h:40