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;

//

相关推荐
工程师老罗19 小时前
如何在Android工程中配置NDK版本
android
Libraeking1 天前
破壁行动:在旧项目中丝滑嵌入 Compose(混合开发实战)
android·经验分享·android jetpack
市场部需要一个软件开发岗位1 天前
JAVA开发常见安全问题:Cookie 中明文存储用户名、密码
android·java·安全
JMchen1231 天前
Android后台服务与网络保活:WorkManager的实战应用
android·java·网络·kotlin·php·android-studio
crmscs1 天前
剪映永久解锁版/电脑版永久会员VIP/安卓SVIP手机永久版下载
android·智能手机·电脑
localbob1 天前
杀戮尖塔 v6 MOD整合版(Slay the Spire)安卓+PC端免安装中文版分享 卡牌肉鸽神作!杀戮尖塔中文版,电脑和手机都能玩!杀戮尖塔.exe 杀戮尖塔.apk
android·杀戮尖塔apk·杀戮尖塔exe·游戏分享
机建狂魔1 天前
手机秒变电影机:Blackmagic Camera + LUT滤镜包的专业级视频解决方案
android·拍照·摄影·lut滤镜·拍摄·摄像·录像
hudawei9961 天前
flutter和Android动画的对比
android·flutter·动画
lxysbly1 天前
md模拟器安卓版带金手指2026
android
儿歌八万首1 天前
硬核春节:用 Compose 打造“赛博鞭炮”
android·kotlin·compose·春节