Table of Contents

Workflow_FrameSource_CameraDevice sample details

Workflow_FrameSource_CameraDevice is a sample scene focused on low-level control of the frame input source (Frame Source). It shows how to use CameraDeviceFrameSource to obtain the raw camera image stream and perform some basic controls.

Usage

1. Open the scene

In Unity Editor, open the Workflow_FrameSource_CameraDevice scene located in the Assets/ directory.

2. Build and run

  • Click Play in the editor to view the effect on PC (some features are limited).
  • You must build to a real device to fully experience the basic camera control capabilities.

After the app starts, the rear camera is opened automatically.

Expected effect

When the camera points at the surrounding environment:

  1. The real-time camera image is displayed on the screen.
  2. A 3D animated panda model is rendered at this time.
  3. The UI displays the current camera status (such as resolution and FPS).
  4. Click the Loop Size button to switch the output frame resolution supported by the current camera.
  5. Click the Flash Torch button to turn off/on the flash.
  6. Click HorizontalFlip to switch the mirrored display of the current image.
  7. Click CaptureIamge to switch whether the model captures the current environment image as its own texture.
  8. Click CameraImage to switch whether the current camera image is displayed.
  9. Click Camera to turn off/on the current camera. After it is turned off, the image remains in the state before it was turned off.
  10. Dynamically switch between the front/rear camera with the NextCamera button.

Through Workflow_FrameSource_CameraDevice, you can gain a deeper understanding of EasyAR's ability to control low-level camera resources, laying a solid foundation for building high-performance and highly customized AR applications.