【android 更改三方相机配流size】

news/2024/9/23 19:00:09/

前言

强制修改三方相机配流size, 拍照和预览都可以

声明:
本帖用的是安卓开源代码:
http://aospxref.com/android-14.0.0_r2/xref/frameworks/av/services/camera/libcameraservice/api2/CameraDeviceClient.cpp#867

修改方案

867  binder::Status CameraDeviceClient::createStream(
868          const hardware::camera2::params::OutputConfiguration &outputConfiguration,
869          /*out*/
870          int32_t* newStreamId) {
871      ATRACE_CALL();
872  ... ...
917      OutputStreamInfo streamInfo;//用这个对象可以修改配流size
918      bool isStreamInfoValid = false;
919      const std::vector<int32_t> &sensorPixelModesUsed =
920              outputConfiguration.getSensorPixelModesUsed();
921      for (auto& bufferProducer : bufferProducers) {
922          // Don't create multiple streams for the same target surface
923          sp<IBinder> binder = IInterface::asBinder(bufferProducer);
924          ssize_t index = mStreamMap.indexOfKey(binder);
925          if (index != NAME_NOT_FOUND) {
926              String8 msg = String8::format("Camera %s: Surface already has a stream created for it "
927                      "(ID %zd)", mCameraIdStr.string(), index);
928              ALOGW("%s: %s", __FUNCTION__, msg.string());
929              return STATUS_ERROR(CameraService::ERROR_ALREADY_EXISTS, msg.string());
930          }... ...
983      } else {//if(String8(mClientPackageName) == "com.xxx.xxx")//{//   直接修改streamInfo.width 、streamInfo.height即可//}
984          err = mDevice->createStream(surfaces, deferredConsumer, streamInfo.width,
985                  streamInfo.height, streamInfo.format, streamInfo.dataSpace,
986                  static_cast<camera_stream_rotation_t>... ...
1031  
1032      return res;
1033  }

http://www.ppmy.cn/news/1456509.html

相关文章

什么是视频号小店?为什么这么多人都在做?一文带你轻松入门!

大家好&#xff0c;我是电商花花。 现在电商的快速发展&#xff0c;电商行业在各大电商平台上不断发展&#xff0c;而视频号小店也被更多人看到和入驻&#xff0c;让更多创业者对视频号小店产生兴趣。 知道的人都觉得视频号小店是一个不可多得的创业项目&#xff0c;因为这里…

Golang | Leetcode Golang题解之第67题二进制求和

题目&#xff1a; 题解&#xff1a; func addBinary(a string, b string) string {ans : ""carry : 0lenA, lenB : len(a), len(b)n : max(lenA, lenB)for i : 0; i < n; i {if i < lenA {carry int(a[lenA-i-1] - 0)}if i < lenB {carry int(b[lenB-i-1…

关于openEuler22.03LTS SP3尝试kolla安装容器版openstack(随手记)

遇到的问题太多了…………当然主要还是我自己能力太差了。 首先&#xff0c;官方的文档显示支持的操作系统有penEuler 22.03 LTS版本的&#xff0c;但注意&#xff1a;官方没有提供直接可用的容器镜像 官方仅提供Rocky、Debian、Ubuntu。CentOS可以使用Rocky镜像尝试&#xff0…

力扣刷题--数组--第一天

一、数组 数组特点&#xff1a; 连续内存空间存储得数据元素类型一致数组可以通过下标索引查找数据元素&#xff0c;可以删除、替换、添加元素等 1.1 二分查找 使用二分查找需满足得条件&#xff1a; 数组是有序的&#xff1b;数组中没有重复元素&#xff1b;查找的target…

Docker基本操作 数据卷

数据卷的理解&#xff1a; 数据卷操作的基本语法: docker volume [command]&#xff1b;二级命令 后边跟随 create :创建一个volume&#xff1b; inspect&#xff1a;显示一个或多个volume的信息; ls:列出所有的volume&#xff1b; prune:删除未使用的volume; rm:删除一个或多…

el-select 点击按钮滚动到选择框顶部

主要代码是在visibleChange 在这个 popper 里面找到 .el-select-dropdown__list let popper ref.$refs.popper const ref this.$refs.select let dom popper.querySelector(.el-select-dropdown__list) setTimeout(() > { dom.scrollIntoView() }, 800) <templat…

Python 贪吃蛇

文章目录 效果图&#xff1a;项目目录结构main.pygame/apple.pygame/base.pygame/snake.pyconstant.py 效果图&#xff1a; 项目目录结构 main.py from snake.game.apple import Apple # 导入苹果类 from snake.game.base import * # 导入游戏基类 from snake.game.snake im…

利用生成式AI重新构想ITSM的未来

对注入 AI 的生成式 ITSM 的需求&#xff0c;在 2023 年 Gartner AI 炒作周期中&#xff0c;生成式 AI 达到预期值达到顶峰后&#xff0c;三分之二的企业已经将生成式 AI 集成到其流程中。 你问为什么这种追求&#xff1f;在预定义算法的驱动下&#xff0c;IT 服务交付和管理中…