This tutorial introduces you to the Viewfinder functionality of the Ecam component.
This document describes the various APIs used with Viewfinder.
Introduction
The viewfinder classes provides the support for multiple direct and client viewfinder. The image adjustment features such as histograms, image processing and direct snapshot can be used specifically for a given direct viewfinder. Client can get specific histogram or image processing object for client viewfinder.
The viewfinder can directly transfer frames from a camera to the display memory. If supported, the client can also implement viewfinder functionality by itself using image data returned in call-backs.
Enabling mirroring flips the image horizontally. Devices that allow the user to view themself can then be used as a virtual mirror. The viewfinder should be able to run simultaneously with video or image capture.
Setup and Configuration Requirements
If video or image capture preparation puts the camera into a mode that has an effect on the viewfinder aspect ratio and size, then the recent successful prepare should determine the context for viewfinder operation.
It is expected that the viewfinder aspect and size follow the settings in the last image or video prepare call. Multiple viewfinders may run at the same time by the use of new extension classes: CcameraV2DirectViewFinder and CcameraClientViewFinder.
A new instance of these classes needs to be created for every new viewfinder. Dedicated observers: MdirectViewFinderObserver and MclientViewFinderObserver provide viewfinder related call-backs to the client. Client should implement these observers.
Types of Viewfinder
The client starts a viewfinder, when the camera is powered-on. There are two types of viewfinder.
Direct viewfinder
The viewfinder frames are displayed directly to the screen.
If the client uses class CCamera::CCameraV2DirectViewFinder to start the direct viewfinder, it must implement the observer MDirectViewFinderObserver to receive relevant callbacks. For example, a client can identify when the first direct viewfinder frame has been displayed on the screen through callback MDirectViewFinderObserver::DirectViewFinderFirstFrameDisplayed().
Client viewfinder
The viewfinder frames are sent back to the client through McameraOberver2 notification. Client is responsible for displaying the images to the screen.
If the client uses class CCamera::CCameraClientViewFinder to start client viewfinder, it must implement the observer MClientViewFinderObserver and get the viewfinder data through related callbacks, such as MClientViewFinderObserver::ViewFinderBufferReady().