liyujie
2025-08-28 d9927380ed7c8366f762049be9f3fee225860833
android/hardware/aw/camera/3_4/camera_stream.cpp
....@@ -397,7 +397,8 @@
397397 int CameraStream::initialize(uint32_t width,
398398 uint32_t height,
399399 int format,
400
- uint32_t usage) {
400
+ uint32_t usage,
401
+ bool mergeStreamFlag) {
401402 int res = -1;
402403 HAL_LOGD("%s: %d x %d, format:%d(%s), usage:%d.",
403404 mStreamType.c_str(),
....@@ -407,7 +408,7 @@
407408 getHalPixelFormatString(format).c_str(),
408409 usage);
409410
410
- res = stream_->SetParm(V4L2_MODE_VIDEO);
411
+ res = stream_->SetParm(V4L2_MODE_VIDEO, width, height);
411412 if (res) {
412413 HAL_LOGE("%s: Failed to SetParm.", mStreamType.c_str());
413414 }
....@@ -417,7 +418,7 @@
417418 format = HAL_PIXEL_FORMAT_IMPLEMENTATION_DEFINED;
418419 }
419420 StreamFormat stream_format(format, width, height);
420
- res = stream_->SetFormat(stream_format, &max_buffers);
421
+ res = stream_->SetFormat(stream_format, &max_buffers, mergeStreamFlag);
421422 if (res) {
422423 HAL_LOGE("%s: Failed to set stream to correct format for stream: %d.",
423424 mStreamType.c_str(), res);
....@@ -543,9 +544,14 @@
543544
544545 int CameraMainStream::initialize(uint32_t width,
545546 uint32_t height,
546
- int format,
547
- uint32_t usage) {
548
- return CameraStream::initialize(width, height, format, usage);
547
+ int format,
548
+ uint32_t usage,
549
+ bool mergeStreamFlag) {
550
+ return CameraStream::initialize(width,
551
+ height,
552
+ format,
553
+ usage,
554
+ mergeStreamFlag);
549555 }
550556
551557 int CameraMainStream::setFormat(uint32_t width,
....@@ -680,8 +686,14 @@
680686 int CameraSubStream::initialize(uint32_t width,
681687 uint32_t height,
682688 int format,
683
- uint32_t usage) {
684
- return CameraStream::initialize(width, height, format, usage);
689
+ uint32_t usage,
690
+ bool mergeStreamFlag) {
691
+ return CameraStream::initialize(width,
692
+ height,
693
+ format,
694
+ usage,
695
+ mergeStreamFlag);
696
+
685697 }
686698
687699 int CameraSubStream::setFormat(uint32_t width,
....@@ -803,7 +815,8 @@
803815 int CameraMainMirrorStream::initialize(uint32_t /*width*/,
804816 uint32_t /*height*/,
805817 int /*format*/,
806
- uint32_t /*usage*/) {
818
+ uint32_t /*usage*/,
819
+ bool /*mergeStreamFlag*/) {
807820 initialized = true;
808821 return 0;
809822 }
....@@ -935,7 +948,8 @@
935948 int CameraSubMirrorStream::initialize(uint32_t /*width*/,
936949 uint32_t /*height*/,
937950 int /*format*/,
938
- uint32_t /*usage*/) {
951
+ uint32_t /*usage*/,
952
+ bool /*mergeStreamFlag*/) {
939953 int res = 0;
940954 initialized = true;
941955 return res;