提交 afc6cd4e 编写于 作者: O openharmony_ci 提交者: Gitee

!36 修改camera问题

Merge pull request !36 from harmony_zhangjian/master
......@@ -503,9 +503,7 @@ void CameraAbilitySlice::OnStart(const Want &want)
SetHead();
SetBottom();
#ifndef __LINUX__
scroll->Add(bttnLeft);
#endif
scroll->Add(bttnMidle);
scroll->Add(bttnRight);
scroll->Add(bttnRecord);
......
......@@ -455,7 +455,7 @@ void SampleCameraStateMng::StartRecord(Surface *mSurface)
}
}
Surface *surface = (recorder_->GetSurface(0)).get();
auto surface = recorder_->GetSurface(0);
if (surface == nullptr) {
return;
}
......@@ -597,16 +597,8 @@ int SampleCameraManager::SampleCameraCreate()
list<string> camList = camKit->GetCameraIds();
for (auto &cam : camList) {
cout << "camera name:" << cam << endl;
const CameraAbility *ability = camKit->GetCameraAbility(cam);
/* find camera which fits user's ability */
list<CameraPicSize> sizeList = ability->GetSupportedSizes(0);
for (auto &pic : sizeList) {
if (pic.width == PIC_WIDTH && pic.height == PIC_HEIGHT) {
camId = cam;
break;
}
}
camId = cam;
break;
}
if (camId.empty()) {
......
......@@ -255,7 +255,7 @@ public:
return;
}
FrameConfig *fc = new FrameConfig(FRAME_CONFIG_RECORD);
Surface *surface = (recorder_->GetSurface(0)).get();
auto surface = recorder_->GetSurface(0);
surface->SetWidthAndHeight(1920, 1080);
surface->SetQueueSize(3);
surface->SetSize(1024 * 1024);
......@@ -300,7 +300,6 @@ public:
cout << "camera start preview failed. ret=" << ret << endl;
return;
}
delete surface;
previewState_ = STATE_RUNNING;
cout << "camera start preview succeed." << endl;
}
......@@ -372,16 +371,8 @@ int main()
list<string> camList = camKit->GetCameraIds();
string camId;
for (auto &cam : camList) {
cout << "camera name:" << cam << endl;
const CameraAbility *ability = camKit->GetCameraAbility(cam);
/* find camera which fits user's ability */
list<CameraPicSize> sizeList = ability->GetSupportedSizes(0);
for (auto &pic : sizeList) {
if (pic.width == 1920 && pic.height == 1080) {
camId = cam;
break;
}
}
camId = cam;
break;
}
if (camId.empty()) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册