Apollo 10.0
自动驾驶开放平台
video_driver_component.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 <string>
21#include <thread>
22
24#include "cyber/cyber.h"
25#include "modules/common_msgs/sensor_msgs/sensor_image.pb.h"
27#include "modules/drivers/video/proto/video_h265cfg.pb.h"
28
29namespace apollo {
30namespace drivers {
31namespace video {
32
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
#define CYBER_REGISTER_COMPONENT(name)
Definition component.h:656
class register implement
Definition arena_queue.h:37