My knowledge of Android camera will be written all over again, gradually perfecting the camera network in the brain.
2 separate processes for 1.Android camera
Android Camera is the C/s architecture has been said to be rotten, but I still want to write down this article, because I often have a short head, on the client side do some useless labor hope to solve the problem, then this hope is really wishful thinking.
Core nature Needless to say, is the service end. The service process is always responsible for receiving the data from the underlying camera drive and then passing it to surface for display.
The client side is not eating ganfan. The client process does not have any real camera data, but the service provides a rich interface for it to easily obtain the address of the camera data and then process the data.
Finally make up a nonsense, client and service is through binder communication.
2.Camera and Icamera
Just beginning to contact camera, suffering from camera work flow, when I looked at the camera, press CTRL + "jump to jump, jump to Icamera appear, immediately the heart only a feeling, this is not a pit dad!"
In fact, calm down, careful analysis, is not very pit dad >_< ...
Icamera,icameraclient,icameraservice all belong to the client side of the Android Camera, whose task is to communicate with the service end of the Android Camera.
Well... To make this figure, please note that we have been active on the client side of the Android Camera.
According to the process of the above diagram, all the way bang bang down, to the Camera.cpp, finally and Icamera on the relationship. For upper-level applications, Camera.cpp is the most direct function invocation and implementation. Inherits from the Icameraclient class, a typical client-side interface instance.
Do not be afraid dizzy, the fact is such: sp<camera> Camera = Camera::connect ();
The camera class invokes a function by sp<icamera> the Mcamera object.
The effect that is achieved is as if it were directly calling Cameraservice::client's mclient functions.