Apollo  6.0
Open source self driving car software
video_driver_component.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 <string>
21 #include <thread>
22 
24 #include "cyber/cyber.h"
25 #include "modules/drivers/proto/sensor_image.pb.h"
27 #include "modules/drivers/video/proto/video_h265cfg.pb.h"
28 
29 namespace apollo {
30 namespace drivers {
31 namespace video {
32 
36 using apollo::drivers::video::config::CameraH265Config;
37 
39  public:
41  if (video_thread_->joinable()) {
42  video_thread_->join();
43  }
44  }
45  bool Init();
46 
47  private:
48  void VideoPoll();
49 
50  std::shared_ptr<apollo::cyber::Writer<CompressedImage>> writer_;
51  std::shared_ptr<std::thread> video_thread_;
52  volatile bool runing_;
53  std::unique_ptr<CameraDriver> camera_deivce_;
54  std::string record_folder_;
55  std::shared_ptr<CompressedImage> pb_image_ = nullptr;
56 };
57 
59 
60 } // namespace video
61 } // namespace drivers
62 } // namespace apollo
PlanningContext is the runtime context in planning. It is persistent across multiple frames...
Definition: atomic_hash_map.h:25
CYBER_REGISTER_COMPONENT(CompCameraH265Compressed)
Definition: concurrent_object_pool.h:36
Definition: video_driver_component.h:38
~CompCameraH265Compressed()
Definition: video_driver_component.h:40
The Component can process up to four channels of messages. The message type is specified when the com...
Definition: component.h:58
apollo::cyber::Writer< T > Writer
Definition: sensor_canbus.h:67