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;

//

相关推荐
耶叶1 小时前
Android 新权限申请模型(Activity Result API)
android
阿拉斯攀登1 小时前
【RK3576 安卓 JNI/NDK 系列 04】JNI 核心语法(下):字符串、数组与对象操作
android·驱动开发·rk3568·瑞芯微·rk安卓驱动·jni字符串操作
2501_915909061 小时前
不用越狱就看不到 iOS App 内部文件?使用 Keymob 查看和导出应用数据目录
android·ios·小程序·https·uni-app·iphone·webview
llxxyy卢1 小时前
web部分中等题目
android·前端
轩情吖1 小时前
MySQL之事务管理
android·后端·mysql·adb·事务·隔离性·原子性
万物得其道者成1 小时前
uni-app Android 离线打包:多环境(prod/dev)配置
android·opencv·uni-app
符哥20082 小时前
Firebase 官方提供的Quick Start-Android 库的功能集讲解
android
koeda2 小时前
android17系统兼容
android·安卓
进击的cc3 小时前
面试官:Handler 没消息时为啥不卡死?带你从源码到底层内核彻底整明白!
android·面试
Yang-Never3 小时前
OpenGL ES ->YUV图像基础知识
android·java·开发语言·kotlin·android studio