liyujie
2025-08-28 d9927380ed7c8366f762049be9f3fee225860833
android/hardware/aw/camera/3_4/stream_manager.cpp
....@@ -57,6 +57,7 @@
5757 HAL_LOG_ENTER();
5858 mDrop_main_buffers = 0;
5959 mDrop_sub_buffers = 0;
60
+ merge_stream_flag = 0;
6061 HAL_LOGD("device.use_count:%ld. camera.use_count:%ld.",
6162 device.use_count(), camera.use_count());
6263 }
....@@ -96,7 +97,8 @@
9697 uint32_t height,
9798 int format,
9899 uint32_t usage,
99
- int isBlob) {
100
+ int isBlob,
101
+ bool mergeStreamFlag) {
100102
101103 HAL_LOG_ENTER();
102104 mMapFrameNumRef.clear();
....@@ -105,7 +107,14 @@
105107 return nullptr;
106108 }
107109
108
- mConnection[ss +isBlob].reset(new V4L2Wrapper::Connection(device_, ss));
110
+ //mConnection[ss +isBlob].reset(new V4L2Wrapper::Connection(device_, ss));
111
+ if (width * height > 4000*3000) {
112
+ merge_stream_flag = 1;
113
+ mConnection[ss + isBlob].reset(new V4L2Wrapper::Connection(device_, ss, merge_stream_flag));
114
+ } else {
115
+ mConnection[ss + isBlob].reset(new V4L2Wrapper::Connection(device_, ss, merge_stream_flag));
116
+ }
117
+
109118 if (mConnection[ss +isBlob]->status()) {
110119 HAL_LOGE("Failed to connect to device: %d.",
111120 mConnection[ss +isBlob]->status());
....@@ -146,7 +155,10 @@
146155 if (isBlob) {
147156 if (mCameraStream[ss] == nullptr) {
148157 if (mCameraStream[ss +isBlob]->initialize(width,
149
- height, format, usage)) {
158
+ height,
159
+ format,
160
+ usage,
161
+ mergeStreamFlag)) {
150162 HAL_LOGE("mCameraStream %d initialize failed.", ss);
151163 mConnection[ss +isBlob].reset();
152164 return nullptr;
....@@ -158,7 +170,10 @@
158170 } else {
159171 if (mCameraStream[ss +1] == nullptr) {
160172 if (mCameraStream[ss +isBlob]->initialize(width,
161
- height, format, usage)) {
173
+ height,
174
+ format,
175
+ usage,
176
+ mergeStreamFlag)) {
162177 HAL_LOGE("mCameraStream %d initialize failed.", ss);
163178 mConnection[ss +isBlob].reset();
164179 return nullptr;