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;

//

相关推荐
非专业程序员Ping6 小时前
HarfBuzz 实战:五大核心API 实例详解【附iOS/Swift实战示例】
android·ios·swift
流星魂小七6 小时前
颜色选择器
android·着色器·环形颜色选择器·圆形颜色选择器·colorpicker·colorwheelview
cdming7 小时前
LIUNX 与手机安卓的文件互传 的常用方法
android·智能手机
雨白8 小时前
Flow 的异常处理与执行控制
android·kotlin
00后程序员张9 小时前
Web 前端工具全流程指南 从开发到调试的完整生态体系
android·前端·ios·小程序·uni-app·iphone·webview
ClassOps9 小时前
Gradle Groovy 和 Kotlin kts 语法对比
android·kotlin·gradle·groovy
消失的旧时光-194310 小时前
Android ble和经典蓝牙
android
李少兄11 小时前
IntelliJ IDEA 如何全局配置 Maven?避免每次打开新项目重新配置 (适用于 2024~2025 版本)
android·maven·intellij-idea
小蜜蜂嗡嗡11 小时前
【flutter报错:Build failed due to use of deprecated Android v1 embedding.】
android·flutter·embedding