.. | .. |
---|
57 | 57 | HAL_LOG_ENTER(); |
---|
58 | 58 | mDrop_main_buffers = 0; |
---|
59 | 59 | mDrop_sub_buffers = 0; |
---|
| 60 | + merge_stream_flag = 0; |
---|
60 | 61 | HAL_LOGD("device.use_count:%ld. camera.use_count:%ld.", |
---|
61 | 62 | device.use_count(), camera.use_count()); |
---|
62 | 63 | } |
---|
.. | .. |
---|
96 | 97 | uint32_t height, |
---|
97 | 98 | int format, |
---|
98 | 99 | uint32_t usage, |
---|
99 | | - int isBlob) { |
---|
| 100 | + int isBlob, |
---|
| 101 | + bool mergeStreamFlag) { |
---|
100 | 102 | |
---|
101 | 103 | HAL_LOG_ENTER(); |
---|
102 | 104 | mMapFrameNumRef.clear(); |
---|
.. | .. |
---|
105 | 107 | return nullptr; |
---|
106 | 108 | } |
---|
107 | 109 | |
---|
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 | + |
---|
109 | 118 | if (mConnection[ss +isBlob]->status()) { |
---|
110 | 119 | HAL_LOGE("Failed to connect to device: %d.", |
---|
111 | 120 | mConnection[ss +isBlob]->status()); |
---|
.. | .. |
---|
146 | 155 | if (isBlob) { |
---|
147 | 156 | if (mCameraStream[ss] == nullptr) { |
---|
148 | 157 | if (mCameraStream[ss +isBlob]->initialize(width, |
---|
149 | | - height, format, usage)) { |
---|
| 158 | + height, |
---|
| 159 | + format, |
---|
| 160 | + usage, |
---|
| 161 | + mergeStreamFlag)) { |
---|
150 | 162 | HAL_LOGE("mCameraStream %d initialize failed.", ss); |
---|
151 | 163 | mConnection[ss +isBlob].reset(); |
---|
152 | 164 | return nullptr; |
---|
.. | .. |
---|
158 | 170 | } else { |
---|
159 | 171 | if (mCameraStream[ss +1] == nullptr) { |
---|
160 | 172 | if (mCameraStream[ss +isBlob]->initialize(width, |
---|
161 | | - height, format, usage)) { |
---|
| 173 | + height, |
---|
| 174 | + format, |
---|
| 175 | + usage, |
---|
| 176 | + mergeStreamFlag)) { |
---|
162 | 177 | HAL_LOGE("mCameraStream %d initialize failed.", ss); |
---|
163 | 178 | mConnection[ss +isBlob].reset(); |
---|
164 | 179 | return nullptr; |
---|