blob: 083f43afda5d63ddae7b45ecf35437f48baecb23 [file] [log] [blame]
David Warren5f6ca4f2009-04-30 17:11:58 -07001page.title=Camera
2pdk.version=1.0
3@jd:body
4
David Warren5c40a482009-06-05 15:11:21 -07005<div id="qv-wrapper">
6<div id="qv">
7<h2>In this document</h2>
David Warren5f6ca4f2009-04-30 17:11:58 -07008<a name="toc"/>
David Warren5c40a482009-06-05 15:11:21 -07009<ul>
10<li><a href="#androidCameraBuildingDriver">Building a Camera Library</a></li>
11<li><a href="#androidCameraSequenceDiagrams">Sequence Diagrams</a></li>
12<li><a href="#androidCameraInterfaceIntro">Interface</a></li>
13</ul>
14</div>
15</div>
David Warren5f6ca4f2009-04-30 17:11:58 -070016
17<p>Android's camera subsystem connects the camera application to the application framework and user space libraries, which in turn communicate with the camera hardware layer that operates the physical camera.</p>
18<p>The diagram below illustrates the structure of the camera subsystem.</p>
19<p><img src="images/androidCameraArchitecture.gif"></p>
20
21
David Warren5c40a482009-06-05 15:11:21 -070022<a name="androidCameraBuildingDriver"></a><h3>Building a Camera Library</h3>
David Warren5f6ca4f2009-04-30 17:11:58 -070023
Gaurav Mathur3ad1d0e2009-06-12 13:46:38 -070024<p>To implement a camera driver, create a shared library that implements the interface defined in <code>CameraHardwareInterface.h</code>. You must name your shared library <code>libcamera.so</code> so that it will get loaded from <code>/system/lib</code> at runtime. Place libcamera sources and <code>Android.mk</code> in <code>vendor/acme/chipset_or_board/libcamera/</code>.</p>
David Warren5f6ca4f2009-04-30 17:11:58 -070025<p>The following stub <code>Android.mk</code> file ensures that <code>libcamera</code> compiles and links to the appropriate libraries:</p>
26<pre class="prettify">
27LOCAL_PATH := $(call my-dir)
28include $(CLEAR_VARS)
29
30LOCAL_MODULE := libcamera
31
32LOCAL_SHARED_LIBRARIES := \
33 libutils \
34 librpc \
35 liblog
36
37LOCAL_SRC_FILES += MyCameraHardware.cpp
38
39LOCAL_CFLAGS +=
40
41LOCAL_C_INCLUDES +=
42
43LOCAL_STATIC_LIBRARIES += \
44 libcamera-common \
45 libclock-rpc \
46 libcommondefs-rpc
47
48include $(BUILD_SHARED_LIBRARY)
49</pre>
50
51
David Warren5c40a482009-06-05 15:11:21 -070052<a name="androidCameraSequenceDiagrams"></a><h3>Sequence Diagrams</h3>
David Warren5f6ca4f2009-04-30 17:11:58 -070053
54
55
David Warren5c40a482009-06-05 15:11:21 -070056<a name="androidCameraSequenceDiagramsPreview"></a><h4>Preview</h4>
David Warren5f6ca4f2009-04-30 17:11:58 -070057
58<p>The following diagram illustrates the sequence of function calls and actions necessary for your camera to preview.</p>
59<img src="images/cameraPreview.jpg">
60
61
David Warren5c40a482009-06-05 15:11:21 -070062<a name="androidCameraSequenceDiagramsTakePic"></a><h4>Taking a Picture</h4>
David Warren5f6ca4f2009-04-30 17:11:58 -070063
64<p>The following diagram illustrates the sequence of function calls and actions necessary for your camera to take a picture.</p>
65<img src="images/cameraTakePicture.jpg">
66
67
David Warren5c40a482009-06-05 15:11:21 -070068<a name="androidCameraInterfaceIntro"></a><h3>Interface</h3>
David Warren5f6ca4f2009-04-30 17:11:58 -070069
70
71
72<p class="note"><strong>Note</strong>: This document relies on some Doxygen-generated content that appears in an iFrame below. To return to the Doxygen default content for this page, <a href="camera.html">click here</a>.</p>
73
74
75<iframe onLoad="resizeDoxFrameHeight();" src="CameraHardwareInterface_8h.html" scrolling="no" scroll="no" id="doxygen" marginwidth="0" marginheight="0" frameborder="0" style="width:100%;"></iframe>