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;

//

相关推荐
zgyhc20508 小时前
【Android Audio】dumpsys media.metrics分析
android
nono牛8 小时前
Android Binder 详解与实践指南
android·binder
小镇学者8 小时前
【PHP】PHP WebShell(网页木马)分析
android·开发语言·php
2501_916007479 小时前
iOS 压力测试的工程化体系,构建高强度、多维度、跨工具协同的真实负载测试流程
android·ios·小程序·uni-app·cocoa·压力测试·iphone
毕设源码-钟学长11 小时前
【开题答辩全过程】以 浮生馆汉服租赁管理系统为例,包含答辩的问题和答案
android·java·tomcat
louisgeek11 小时前
Android NDK 开发中的崩溃排查
android
2501_9159214312 小时前
iOS 开发者工具推荐,构建从调试到性能优化的多维度生产力工具链(2025 深度工程向)
android·ios·性能优化·小程序·uni-app·iphone·webview
Chrison_mu13 小时前
Android项目背景动效-Kotlin
android·开发语言·kotlin
曾经的三心草14 小时前
JavaEE初阶-多线程2
android·java·java-ee
v***56515 小时前
Spring Cloud Gateway
android·前端·后端