liyujie
2025-08-28 d9927380ed7c8366f762049be9f3fee225860833
android/hardware/aw/camera/3_4/v4l2_metadata_factory.cpp
....@@ -16,7 +16,9 @@
1616
1717 #include "v4l2_metadata_factory.h"
1818
19
+#include <iostream>
1920 #include <map>
21
+#include <sstream>
2022 #include <utility>
2123 #include <vector>
2224
....@@ -52,8 +54,32 @@
5254 // but doing it here prevents connecting and disconnecting for each one).
5355 gdevice = device;
5456
57
+ char * s_value;
58
+ s_value = pCameraCfg->supportPictureSizeValue();
59
+ int merge_status = 0;
60
+
61
+ std::string st1 = s_value;
62
+ int pic_width = 0;
63
+ int pic_height = 0;
64
+ std::string tmp;
65
+ std::vector<std::string> s_data;
66
+ std::stringstream input(st1);
67
+
68
+ while (getline(input, tmp, ',')) {
69
+ s_data.push_back(tmp);
70
+ }
71
+ for (auto s : s_data) {
72
+ sscanf(s.c_str(), "%dx%d", &pic_width,&pic_height);
73
+ if (pic_width * pic_height > 4000*3000) {
74
+ merge_status = 1;
75
+ }
76
+ }
77
+
78
+ //V4L2Wrapper::Connection temp_connection =
79
+ // V4L2Wrapper::Connection(device, MAIN_STREAM);
5580 V4L2Wrapper::Connection temp_connection =
56
- V4L2Wrapper::Connection(device, MAIN_STREAM);
81
+ V4L2Wrapper::Connection(device, MAIN_STREAM, merge_status);
82
+
5783 if (temp_connection.status()) {
5884 HAL_LOGE("Failed to connect to device: %d.", temp_connection.status());
5985 return temp_connection.status();