FAQ20472:相机录像镜像功能实现

描述:Camera默认不支持录像镜像,如果要实现,需要做客制化改动。

解决:客制化修改可以参考如下DIFF文件

Platform: MT6763

Branch: N1.MP16

--- a/mtkcam/middleware/v1/client/CamClient/Record/RecordClient.BufOps.cpp

+++ b/mtkcam/middleware/v1/client/CamClient/Record/RecordClient.BufOps.cpp

@@ -290,9 +290,18 @@ prepareAllTodoBuffers(sp<IImgBufQueue>const& rpBufQueue, sp<RecBufManager>const& (MUINTPTR)(pCameraImgBuf->getVirAddr()), (MUINTPTR)(pCameraImgBuf->getPhyAddr()), (MUINTPTR)(rpBufMgr->getBuf(i)->get_camera_memory_virAddr()));

  • int32_t i4FrontFlip = mpParamsMgr->getInt(CameraParameters::CAMSHOT_MIRROR_FRONT);

  • ImgBufQueNode node = ImgBufQueNode(pCameraImgBuf, ImgBufQueNode::eSTATUS_TODO);

  • if (i4FrontFlip == 1) {

  • if (mi4Rotation == 90 || mi4Rotation == 270)

  • node.setRotation(eTransform_FLIP_V);

  • else

  • node.setRotation(eTransform_FLIP_H);

  • }

//MY_LOGD("i4FrontFlip(%d),rotation(%d),mi4Rotation(%d)",i4FrontFlip,node.getRotation(),mi4Rotation);

//

  • ret = rpBufQueue->enqueProcessor(

  • ImgBufQueNode(pCameraImgBuf, ImgBufQueNode::eSTATUS_TODO));

  • ret = rpBufQueue->enqueProcessor(node);

//

if(!ret)

{

diff --git a/mtkcam/middleware/v1/client/CamClient/Record/RecordClient.cpp

b/mtkcam/middleware/v1/client/CamClient/Record/RecordClient.cpp

old mode 100644

new mode 100755

index d3ee740..8f74f43

--- a/mtkcam/middleware/v1/client/CamClient/Record/RecordClient.cpp

+++ b/mtkcam/middleware/v1/client/CamClient/Record/RecordClient.cpp

@@ -130,6 +130,7 @@ RecordClient(sp<IParamsManager> pParamsMgr), mIsWaitBufBack(0), mpExtImgProc(NULL)

//

  • , mi4Rotation(0)

//

{

MY_LOGD("+ this(%p)", this);

@@ -460,6 +461,13 @@ startRecording()

//MY_LOGD("+ current mIsRecStarted=%d", mIsRecStarted);

::android_atomic_write(1, &mIsRecStarted);

//

  • mi4Rotation = mpParamsMgr->getInt(CameraParameters::KEY_ROTATION);

  • if(mi4Rotation != 90 && mi4Rotation != 180 && mi4Rotation != 270 && mi4Rotation != 0)

{

  • MY_LOGE("wrong rotation(%d)",mi4Rotation);

  • mi4Rotation = 0;

  • }

  • //

mpParamsMgr->getVideoSize(&mi4RecWidth, &mi4RecHeight);

//

mTimeStart = systemTime();

diff --git a/mtkcam/middleware/v1/client/CamClient/Record/RecordClient.h

b/mtkcam/middleware/v1/client/CamClient/Record/RecordClient.h

old mode 100644

new mode 100755

index b85becc..b00d3ad

--- a/mtkcam/middleware/v1/client/CamClient/Record/RecordClient.h

+++ b/mtkcam/middleware/v1/client/CamClient/Record/RecordClient.h

@@ -194,6 +194,7 @@ protected: //// Callback.

//

int32_t mi4CallbackRefCount; // Record callback reference count.

int64_t mi8CallbackTimeInMs; // The timestamp in millisecond of last preview callback.

  • int32_t mi4Rotation;

//

相关推荐
晚霞的不甘5 小时前
Flutter for OpenHarmony从零到一:构建《冰火人》双人合作闯关游戏
android·flutter·游戏·前端框架·全文检索·交互
2601_949833395 小时前
flutter_for_openharmony口腔护理app实战+饮食记录实现
android·javascript·flutter
独自破碎E5 小时前
【滑动窗口+字符计数数组】LCR_014_字符串的排列
android·java·开发语言
stevenzqzq6 小时前
compose 中 align和Arrangement的区别
android·compose
VincentWei956 小时前
Compose:MutableState 和 mutableStateOf
android
jian110586 小时前
Android studio配置flutter,mac Android studio 发现苹果手机设备
android·flutter·android studio
2501_940007897 小时前
Flutter for OpenHarmony三国杀攻略App实战 - 性能优化与最佳实践
android·flutter·性能优化
Rysxt_7 小时前
UniApp获取安卓系统权限教程
android·uni-app
毕设源码-朱学姐8 小时前
【开题答辩全过程】以 基于安卓的教师上课辅助系统为例,包含答辩的问题和答案
android
诸神黄昏EX9 小时前
Android Safety 系列专题【篇二:AVB签名】
android