.. | .. |
---|
31 | 31 | #include <memory> |
---|
32 | 32 | #include <string> |
---|
33 | 33 | #include <unordered_set> |
---|
| 34 | +#include <iostream> |
---|
| 35 | +#include <sstream> |
---|
34 | 36 | |
---|
35 | 37 | #include "camera_config.h" |
---|
36 | 38 | #include "v4l2_camera.h" |
---|
.. | .. |
---|
68 | 70 | HAL_LOGE("Cannot found video node %s. %s", dev_node, strerror(errno)); |
---|
69 | 71 | } |
---|
70 | 72 | |
---|
| 73 | + hal_merge_stream_flag = false; |
---|
| 74 | + char * s_value; |
---|
| 75 | + int pic_width = 0; |
---|
| 76 | + int pic_height = 0; |
---|
| 77 | + std::string tmp; |
---|
| 78 | + std::vector<std::string> s_data; |
---|
71 | 79 | // id == 0 camera facing back; |
---|
72 | 80 | // id == 1 camera facing front; |
---|
73 | 81 | |
---|
.. | .. |
---|
83 | 91 | config->initParameters(); |
---|
84 | 92 | config->dumpParameters(); |
---|
85 | 93 | } |
---|
86 | | - V4L2Camera* cam(V4L2Camera::NewV4L2Camera(id, config)); |
---|
| 94 | + mCameraConfig.push_back(config); |
---|
| 95 | + |
---|
| 96 | + s_value = config->supportPictureSizeValue(); |
---|
| 97 | + std::string st1 = s_value; |
---|
| 98 | + std::stringstream input(st1); |
---|
| 99 | + |
---|
| 100 | + while (getline(input, tmp, ',')) { |
---|
| 101 | + s_data.push_back(tmp); |
---|
| 102 | + } |
---|
| 103 | + for(auto s : s_data) { |
---|
| 104 | + sscanf(s.c_str(), "%dx%d", &pic_width,&pic_height); |
---|
| 105 | + if(pic_width * pic_height > 4000*3000) { |
---|
| 106 | + hal_merge_stream_flag = true; |
---|
| 107 | + } |
---|
| 108 | + } |
---|
| 109 | + |
---|
| 110 | + V4L2Camera* cam(V4L2Camera::NewV4L2Camera(id, |
---|
| 111 | + config, |
---|
| 112 | + hal_merge_stream_flag)); |
---|
87 | 113 | if (cam) { |
---|
88 | 114 | mCameras.push_back(cam); |
---|
89 | 115 | } else { |
---|