.. | .. |
---|
67 | 67 | // to "new V4L2Stream", except that it may return nullptr in case of failure. |
---|
68 | 68 | static V4L2Stream* NewV4L2Stream(const int id, |
---|
69 | 69 | const std::string device_path, |
---|
70 | | - std::shared_ptr<CCameraConfig> pCameraCfg); |
---|
| 70 | + std::shared_ptr<CCameraConfig> pCameraCfg, |
---|
| 71 | + int merge_status |
---|
| 72 | + ); |
---|
71 | 73 | virtual ~V4L2Stream(); |
---|
72 | 74 | |
---|
73 | 75 | // Turn the stream on or off. |
---|
.. | .. |
---|
91 | 93 | virtual int SetAutoFocusRegions(cam_rect_t cam_regions); |
---|
92 | 94 | virtual int SetCropRect(cam_crop_rect_t cam_crop_rect); |
---|
93 | 95 | virtual int SetJpegCropRect(cam_crop_rect_t cam_crop_rect); |
---|
94 | | - virtual int SetParm(int mCapturemode); |
---|
| 96 | + virtual int SetParm(int mCapturemode, uint32_t width, uint32_t height); |
---|
95 | 97 | // Manage format. |
---|
96 | 98 | virtual int GetFormats(std::set<uint32_t>* v4l2_formats); |
---|
97 | 99 | virtual int GetFormatFrameSizes(uint32_t v4l2_format, |
---|
.. | .. |
---|
104 | 106 | const std::array<int32_t, 2>& size, |
---|
105 | 107 | std::array<int64_t, 2>* duration_range); |
---|
106 | 108 | virtual int SetFormat(const StreamFormat& desired_format, |
---|
107 | | - uint32_t* result_max_buffers); |
---|
| 109 | + uint32_t* result_max_buffers, bool merge_stream_flag); |
---|
108 | 110 | // Manage buffers. |
---|
109 | 111 | virtual int PrepareBuffer(); |
---|
110 | 112 | virtual int WaitCameraReady(); |
---|
.. | .. |
---|
132 | 134 | // Use NewV4L2Stream instead. |
---|
133 | 135 | V4L2Stream(const int id, |
---|
134 | 136 | const std::string device_path, |
---|
135 | | - std::shared_ptr<CCameraConfig> pCameraCfg); |
---|
| 137 | + std::shared_ptr<CCameraConfig> pCameraCfg, |
---|
| 138 | + int merge_status |
---|
| 139 | + ); |
---|
136 | 140 | |
---|
137 | 141 | // Connect or disconnect to the device. Access by creating/destroying |
---|
138 | 142 | // a V4L2Wrapper::Connection object. |
---|
139 | | - int Connect(); |
---|
| 143 | + int Connect(int merge_status); |
---|
140 | 144 | void Disconnect(); |
---|
141 | 145 | // Perform an ioctl call in a thread-safe fashion. |
---|
142 | 146 | template <typename T> |
---|
.. | .. |
---|
167 | 171 | epoll_event *pEvents; |
---|
168 | 172 | // The open camera facing. |
---|
169 | 173 | const int device_id_; |
---|
| 174 | + |
---|
| 175 | + int reduce_call_num; |
---|
| 176 | + uint32_t reducecallnum_dst_width; |
---|
| 177 | + uint32_t reducecallnum_dst_height; |
---|
| 178 | + uint32_t reducecallnum_src_width; |
---|
| 179 | + uint32_t reducecallnum_src_height; |
---|
170 | 180 | |
---|
171 | 181 | // Whether or not the device supports the extended control query. |
---|
172 | 182 | bool extended_query_supported_; |
---|
.. | .. |
---|
257 | 267 | class ConnectionStream { |
---|
258 | 268 | friend class V4L2Stream; |
---|
259 | 269 | public: |
---|
260 | | - explicit ConnectionStream(std::shared_ptr<V4L2Stream> device) |
---|
| 270 | + ConnectionStream(std::shared_ptr<V4L2Stream> device, int merge_status) |
---|
261 | 271 | : device_(std::move(device)) { |
---|
262 | | - connect_result_ = device_->Connect(); |
---|
| 272 | + connect_result_ = device_->Connect(merge_status); |
---|
263 | 273 | } |
---|
264 | 274 | ~ConnectionStream() { |
---|
265 | 275 | if (connect_result_ == 0) { |
---|