liyujie
2025-08-28 d9927380ed7c8366f762049be9f3fee225860833
android/hardware/aw/camera/3_4/v4l2_camera_hal.cpp
....@@ -31,6 +31,8 @@
3131 #include <memory>
3232 #include <string>
3333 #include <unordered_set>
34
+#include <iostream>
35
+#include <sstream>
3436
3537 #include "camera_config.h"
3638 #include "v4l2_camera.h"
....@@ -68,6 +70,12 @@
6870 HAL_LOGE("Cannot found video node %s. %s", dev_node, strerror(errno));
6971 }
7072
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;
7179 // id == 0 camera facing back;
7280 // id == 1 camera facing front;
7381
....@@ -83,7 +91,25 @@
8391 config->initParameters();
8492 config->dumpParameters();
8593 }
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));
87113 if (cam) {
88114 mCameras.push_back(cam);
89115 } else {