1 Star 0 Fork 4.9K

丛林 / docs

forked from OpenHarmony / docs 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
subsys-multimedia-camera-preview-guide.md 1.21 KB
一键复制 编辑 原始数据 按行查看 历史
wusongqing 提交于 2022-05-18 17:42 . updated readme

Previewing Development

When to Use

Use the camera module APIs to generate and play video streams.

Available APIs

For details, see the available APIs described in development guidelines on photographing.

Limitations and Constraints

None

How to Develop

  1. Perform step 1 through step 4 described in development guidelines on photographing.

  2. Set the preview area.

    Surface *surface = Surface::CreateSurface();
    /* Set the display area. */
    surface->SetUserData("region_position_x", "480"); // X-coordinate of the upper left corner of the rectangle
    surface->SetUserData("region_position_y", "270"); // Y-coordinate of the upper left corner of the rectangle
    surface->SetUserData("region_width", "960"); // Width
    surface->SetUserData("region_height", "540"); // Height
    
    fc->AddSurface(*surface);
  3. Start and stop previewing.

    stateCallback->camera_->TriggerLoopingCapture(*fc); // Start previewing.
    stateCallback->camera_->StopLoopingCapture(); // Stop previewing.
1
https://gitee.com/jungle8023/docs.git
git@gitee.com:jungle8023/docs.git
jungle8023
docs
docs
master

搜索帮助