These two tasks (starting the camera device, and starting working thread that pulls frames
from the started camera device) should be clearly separated, and should not be combined in
one method (as it was with the 'startCapturing' method).
Change-Id: I779bee924d99d9a87257c6b76791545b76795e72
Holding an object lock while macking the callbacks cause deadlocks
due to reentrance to the callabck notifier.
Change-Id: I5f2780989798ebf5c5d7aab34ac233bb5952079d
When stopping the camera, the working thread should be stopped before sending
"stop" query to the emulator: we don't want "frame" queries to be floating around
while we're in the process of stopping the camera.
Change-Id: I16dc56ca1c2e304a07a074302001d2e27100f2ac
The code submitted here builds a camera.goldfish.so module that encapsulates a camera HAL.
The major components of the camera HAL implementation are:
* Generic HAL module implemented in emulated_camera_hal.cpp There is nothing much
to it: just exporting the required HAL header.
* EmulatedCameraFactory class that manages emulated cameras, and provides handling for
camera_module_methods_ methods. There is only one object of this class, that is statically
instantiated when camera.goldfish.so module is loaded.
* EmulatedCamera class that implements camera_device_ops_t API. Objects of this class are
instantiated during EmulatedCameraFactory construction, and they interact with objects
of EmulatedCameraDevice class to get frames.
* EmulatedCameraDevice class encapsulates an actual camera device. Objects of this class
are contained in EmulatedCameraDevice objects, and interact with them as required by the
API.
The fake camera implementation is shared between EmulatedFakeCamera, and EmulatedFakeCameraDevice
classes. They are pretty light. In fact, EmulatedFakeCamera is nothing more than just a
placeholder for EmulatedFakeCameraDevice instance, and EmulatedFakeCameraDevice does nothing
more, than just drawing a checker board with a bouncing square.
Other components / routines are minor: helpers, wrappers, etc. The code is heavily commented,
so there will be plenty of explanations between the lines.
Change-Id: I4463e14c255c6e3b1dcca17bed5f4efde32d9879