58 Commits

Author SHA1 Message Date
Steve Block
6215d3ff4b Rename (IF_)LOGI(_IF) to (IF_)ALOGI(_IF) DO NOT MERGE
See https://android-git.corp.google.com/g/156801

Bug: 5449033
Change-Id: Ib08fe86d23db91ee153e9f91a99a35c42b9208ea
2012-01-04 20:05:49 +00:00
Steve Block
5baa3a62a9 Rename (IF_)LOGD(_IF) to (IF_)ALOGD(_IF) DO NOT MERGE
See https://android-git.corp.google.com/g/156016

Bug: 5449033
Change-Id: I4c4e33bb9df3e39e11cd985e193e6fbab4635298
2012-01-03 22:38:27 +00:00
Wu-cheng Li
9d062cfe94 Add camera focus move callback.
bug:5534973
Change-Id: Iaadcb2738ad040f94849be30ee531326f6199431
2011-11-29 14:28:05 +08:00
Steve Block
71f2cf116a Rename (IF_)LOGV(_IF) to (IF_)ALOGV(_IF) DO NOT MERGE
See https://android-git.corp.google.com/g/#/c/143865

Bug: 5449033
Change-Id: I0122812ed6ff6f5b59fe4a43ab8bff0577adde0a
2011-10-26 09:57:54 +01:00
Chih-Chung Chang
f806871f30 Fix 5487571: Make sure shutter sound is played when it's enforced
Change-Id: I0c7adf452217b8308243836b40b1fba8f2029240
2011-10-20 10:48:21 +08:00
Chih-Chung Chang
4091f0ba08 Fix 5468644: Use the proper audio stream type to play sound.
Change-Id: I80dd37da277b1810959a2dbdd852078b26f70cf5
2011-10-17 19:04:00 +08:00
Tyler Luu
7b6da3c7a2 Add initialize method to CameraHardwareInterface
Add intialize() method to CameraHardwareInterface so we can
return a proper error value to CameraService if open of camera
hardware module fails.

b/5405235

Change-Id: I09c627034ddd22a5753c5163392c4fcff301e0b9
Signed-off-by: Tyler Luu <tluu@ti.com>
Signed-off-by: Iliyan Malchev <malchev@google.com>
2011-10-07 09:24:05 -07:00
Chih-Chung Chang
17f254105b Merge "Allow shutter/recording sound to be adjusted unless it's forced." 2011-10-07 03:20:26 -07:00
Wu-cheng Li
d303362ac2 Allow Camera.setDisplayOrientation to be called when preview is active.
bug:5422679

Change-Id: I4c936ab00428fc158b5947fe8f10b1028869bbdb
2011-10-07 18:01:09 +08:00
Chih-Chung Chang
9143aaafee Allow shutter/recording sound to be adjusted unless it's forced.
Change-Id: I7080d5f50a87f92c8e9395d4cf8f927a6760fa70
2011-10-07 13:39:18 +08:00
Wu-cheng Li
98bb251c8b Add video snapshot camera parameter.
The API is still hidden.

bug:5187868

Change-Id: I59e1b5774ca32be049723d1a0887faa90d8884bb
2011-09-01 13:37:14 +08:00
Wu-cheng Li
bb1e275c0e Pass camera frame metadata from camera service to Java.
bug:4460717
Change-Id: I2fae6e1dfca6b8f3a5ee5716fc7817f5417bf657
2011-08-02 15:48:41 +08:00
Mathias Agopian
982d2da4ee connect/disconnect is now called from our EGL wrapper
the original connect/disconnect hooks are deprecated
and replace by api_connect/api_disconnect. the original
hooks are no no-ops.
api_connect/api_disconnect is now only called from the
android framework.

Bug: 5057915
Change-Id: I8ca64cd1acd6cabf915bf54689ec2e5f6dfa495a
2011-08-01 14:06:20 -07:00
Wu-cheng Li
f0d6a48c6a Add frame metadata parameter to camera data_callback.
bug:4460717
Change-Id: Ib47d7d7df20af8155a719f3dabefe030893bfebc
2011-07-29 07:14:38 +08:00
Iliyan Malchev
f7b3e2e215 libcameraservice: call put_parameters on camera HAL
Change-Id: I492d1034ade50f9e157141debaa9783a90a04a91
Signed-off-by: Iliyan Malchev <malchev@google.com>
2011-07-27 10:03:43 -07:00
Wu-cheng Li
eb12309583 Merge "Disconnect the native window in CameraService::Client::disconnect." 2011-07-19 14:47:20 -07:00
Wu-cheng Li
13528f78f9 Disconnect the native window in CameraService::Client::disconnect.
bug:5048372
Change-Id: I6886907a672ddf5580b988ca5bc13e3dc26d4385
2011-07-20 05:35:02 +08:00
Mathias Agopian
ff86f37b95 use SurfaceTexture new scaling mode in SF
SF now obeys SurfaceTexture's scaling mode instead
of inferring it from the buffer's size

Change-Id: I4d50e9851abedd7e64bfcfc8af9eefb9fb668529
2011-07-19 13:05:12 -07:00
Jamie Gennis
a97eba3d48 Merge "CameraService: (dis)connect from preview windows" 2011-07-18 15:19:20 -07:00
Jamie Gennis
f10720093b CameraService: (dis)connect from preview windows
This change makes CameraService connect and disconnect from preview
windows (Surfaces and SurfaceTextures) that get set.

Change-Id: I726971688367d5ce0d9aa90c44168037bce33deb
2011-07-14 17:48:33 -07:00
Mathias Agopian
6e62dba519 get rid of overlay HAL
Change-Id: I461f633d172ab10e05326ef10544c67dea664c0e
2011-07-12 16:04:12 -07:00
Jeff Brown
10e8971286 Eliminate single-process mode.
Bug: 5010576

Change-Id: Id450dc83efed4897d1e4ff451530fed14457aace
2011-07-08 19:54:07 -07:00
Sundar Raman
ed9bbf27ba CameraService: Decouple dequeue and lock
Decouple lockBuffer from dequeueBuffer. Add lock_buffer to preview_stream_ops,
so HALs will be fully in charge of managing buffers.

Change-Id: I7b53487d618bdf08ba904c5a0f41af462a7ca773
Signed-off-by: Iliyan Malchev <malchev@google.com>
2011-06-27 13:48:50 -07:00
Wu-cheng Li
42419ce28a Add framework support for camcorder zoom.
The purpose of ICameraRecordingProxy and ICameraRecordingProxyListener is to
allow applications using the camera during recording.

Camera service allows only one client at a time. Since camcorder application
needs to own the camera to do things like zoom, the media recorder cannot
access the camera directly during recording. So ICameraRecordingProxy is a proxy
of ICamera, which allows the media recorder to start/stop the recording and
release recording frames. ICameraRecordingProxyListener is an interface that
allows the recorder to receive video frames during recording.

ICameraRecordingProxy
  startRecording()
  stopRecording()
  releaseRecordingFrame()

ICameraRecordingProxyListener
  dataCallbackTimestamp()

The camcorder app opens the camera and starts the preview. The app passes
ICamera and ICameraRecordingProxy to the media recorder by
MediaRecorder::setCamera(). The recorder uses ICamera to setup the camera in
MediaRecorder::start(). After setup, the recorder disconnects from camera
service. The recorder calls ICameraRecordingProxy::startRecording() and
passes a ICameraRecordingProxyListener to the app. The app connects back to
camera service and starts the recording. The app owns the camera and can do
things like zoom. The media recorder receives the video frames from the
listener and releases them by ICameraRecordingProxy::releaseRecordingFrame.
The recorder calls ICameraRecordingProxy::stopRecording() to stop the
recording.

The call sequences are as follows:
1. The app: Camera.unlock().
2. The app: MediaRecorder.setCamera().
3. Start recording
   (1) The app: MediaRecorder.start().
   (2) The recorder: ICamera.unlock() and ICamera.disconnect().
   (3) The recorder: ICameraRecordingProxy.startRecording().
   (4) The app: ICamera.reconnect().
   (5) The app: ICamera.startRecording().
4. During recording
   (1) The recorder: receive frames from ICameraRecordingProxyListener.dataCallbackTimestamp()
   (2) The recorder: release frames by ICameraRecordingProxy.releaseRecordingFrame().
5. Stop recording
   (1) The app: MediaRecorder.stop()
   (2) The recorder: ICameraRecordingProxy.stopRecording().
   (3) The app: ICamera.stopRecording().

bug:2644213

Change-Id: I15269397defc25cbbcae16abc071c8349c123122
2011-06-27 15:44:57 +08:00
Wu-cheng Li
beb9ecf372 Merge "Allow camera to be disabled via Device Policy Manager" 2011-06-16 01:05:43 -07:00
Iliyan Malchev
13010be779 CameraService: return stide when dequeueing a buffer
Change-Id: I11c7f0b57f7d619cdc392b2d34c538ae898de7ac
Signed-off-by: Iliyan Malchev <malchev@google.com>
2011-06-11 11:02:38 -07:00
Iliyan Malchev
5c54f4b3cb frameworks/base: updates for camera HAL memory management
-- when the camera HAL allocates memory
	-- it requests is as N buffers by S bytes each
	-- it may specify a file descriptor to get mmapped; if -1, then we use ashmem
-- when issuing data and data-timestamp callbacks, the camera HAL specifies a
   buffer index
-- range checking is performed on the buffer indices
-- memory requested by a camera HAL is not incStrong'ed, and needs to be
   expliciftly released by the camera HAL (by calling the release method on the
   camera_memory_t handle)

Change-Id: I0f09603aa786c238590e7288388ab673787e6032
Signed-off-by: Iliyan Malchev <malchev@google.com>
2011-06-07 11:43:20 -07:00
Wu-cheng Li
04c453dcca Allow camera to be disabled via Device Policy Manager
bug:4185309

Change-Id: I8be89d892b8f540fd05913c93f97b92346a0a282
2011-05-30 20:05:38 +08:00
Iliyan Malchev
b2a153adc9 frameworks/base: android_native_buffer_t -> ANativeWindowBuffer
Change-Id: Idc2eabaa805bb6d308ebb315872623f28d428417
Signed-off-by: Iliyan Malchev <malchev@google.com>
2011-05-03 16:40:14 -07:00
Iliyan Malchev
a269b87bd7 frameworks/base: switch CameraService to a HAL module
This patch changes CameraService to load a camera HAL module, instead of
linking directly against a library that implements the CameraHardwareInterface
class.

CameraHardwareInterface no longer defines the API to the camera HAL.  Instead,
this is now in HAL header hardware/camera.h.  We keep CamerHardwareInterface as
a class local to CameraService, which wraps around the new HAL calls.  In the
future, we may remove this class entirely and have CameraService call the HAL
methods directly.

Change-Id: I5c61ac40078fc0b50bbac5881a556fe6c8837641
Signed-off-by: Iliyan Malchev <malchev@google.com>
2011-05-03 15:49:40 -07:00
Iliyan Malchev
9c7ac0d142 frameworks/base: include system/core header camera.h in Camera.h
We define struct CameraInfo in this camera/Camera.h, even though an identical
struct camera_info is defined in hardware/camera.h (but not in
hardware/camera_defs.h).  We may not export struct definitions from the HAL
into headers which may find their way into the NDK.

This commit also renames FRAME_CALLBACK_FLAG_xxx to CAMERA_FRAME_CALLBACK_xxx.

Change-Id: I3e2ddd01d61bf5371ff2fc1a397995e0f1ee11f8
Signed-off-by: Iliyan Malchev <malchev@google.com>
2011-05-03 15:49:39 -07:00
Dima Zavin
24fc2fb1c5 audio/media: convert to using the audio HAL and new audio defs
Change-Id: Ibc637918637329e4f2b62f4ac7781102fbc269f5
Signed-off-by: Dima Zavin <dima@android.com>
2011-04-27 13:10:10 -07:00
Mathias Agopian
c8a04b536b remove more unused references to ISurface
Change-Id: I2201f1ca2bb8f203a081d94a0134f798778dfbef
2011-04-05 20:11:55 -07:00
Iliyan Malchev
40c364136f frameworks/base: some camera-interface cleanup
Methods getNumberOfVideoBuffers() and getVideoBuffer() as well as struct
image_rect_struct are no longer used (instead, the necessary information is
passed through ANativeWindow.)

Change-Id: If4b11446fc9ccbde1f6b45bc70c0d0b8e54376eb
Signed-off-by: Iliyan Malchev <malchev@google.com>
2011-03-28 16:28:57 -07:00
Mathias Agopian
696257ccf3 merge libsurfaceflinger_client into libgui
this is the first step in unifying surfacetexture and surface.
for this reason the header files were not moved, as most of them
will eventually go away.

NOTE: currently we keep libsurfaceflinger_client.so as an empty
library to workaround prebuilt binaries wrongly linking against
it.

Change-Id: I130f0de2428e8579033dc41394d093f4e1431a00
2011-03-25 18:42:40 -07:00
James Dong
199d1c131d Fix missing AOSP copyright headers for more files
o Update the copyright date on InputDispatcher_test.cpp and InputReader_test.cpp
  because these two files were moved from other places to the current location,
  and were actually created in 2010.

bug - 4119349

Change-Id: Ic93b81ddafb58e9e72a2e9e02ca3d9f173d6dca7
2011-03-17 14:43:12 -07:00
James Dong
e00cab707d Application-managed callback buffer support for raw image
bug - 3292153

Change-Id: I9789f7c5cde3a3889d7375e881181e9152d95fc2
2011-02-22 20:48:15 -08:00
Jamie Gennis
ff2dc46c12 Add camera service support for SurfaceTexture.
This change enables the use of a SurfaceTexture in place of a Surface as
the destination of camera preview frames.

Change-Id: Ic70d404c8fe261e9d5da6f1de93d6babb5b191cb
2011-01-06 13:31:53 -08:00
James Dong
74920cb1a8 We requires camera hal's implementation should not track the ref count of any outstanding video frames and ignore
releaseRecordingFrame() call after it receives disableMsgType(CAMERA_MSG_VIDEO_FRAME).

Change-Id: I2ecb9b3b11dab6bf868ccf8effda1b8df5bcde3c
2010-12-10 07:19:13 -08:00
Mathias Agopian
d211230633 remove support for PUSH_BUFFER surfaces and overlays
the same functionality is now supported through
the h/w composer HAL, and YUV support in the GPU.

Change-Id: I8146605449954b8e8fd7f78810b7d873c2d8f5bf
2010-12-08 16:13:59 -08:00
James Dong
2db9044563 Don't drop video frames but to release them.
bug - 3259009

Change-Id: Ib7634f10a7fe7b7ce7014b79b07957d194bae1a7
2010-12-06 19:53:01 -08:00
Eric Laurent
214835773f Revert "Temporary workaround for issue 3187563"
This reverts commit 065299b58d1c00cd24e442fa192561decf7b1fec.

The work around for issue 3187563 is not needed any more since the new kernel
DMA driver implementation (commit 7953250be7c9a1c3417e21b20032b571d495d218)
fixes the root cause.

Change-Id: Ibaac2826b63c8e5825ae2e5cab2fb2f0e51ab7b4
2010-11-24 13:35:31 -08:00
Eric Laurent
065299b58d Temporary workaround for issue 3187563
The audio HAL does not always handle properly simultaneous input and output stream
state changes. This happens in particular when starting video record because output
stream starts and stops while input is active.

Temporary disable the video record jingle the time the audio HAL issues are solved.

Change-Id: I3b923d81af543a335deae9e22d7f396bb5791d91
2010-11-11 16:47:38 -08:00
Wu-cheng Li
d55f7e56b9 Mirror the camera preview if the camera is front-facing.
bug:3095272
Change-Id: Ib1c1d1edc06a33e9d4d2dcb42bc1dd2c25b1310c
2010-10-25 15:02:44 +08:00
James Dong
38311859e8 Camera framework change required for 0-memcpy recording
bug - 3042125

Change-Id: I46eb7a10b5394086b353fd73e4503beceeed76f1
2010-10-19 23:07:08 -07:00
Wu-cheng Li
b0f7d95bf8 Fix camera display orientation.
bug:3036262
Change-Id: I6fc3dc381fcfaceba09fd5bd14afb85045b3d676
2010-10-12 15:52:44 +08:00
Wu-cheng Li
de8652cbc1 resolved conflicts for merge of 191a25e1 to master
Change-Id: I6f4940e337a992bf84e50bc1d22432593937499c
2010-09-27 20:50:22 -07:00
Wu-cheng Li
b3347bc6d7 The old overlay should be destroyed if orientation changes.
Previously the orientation was wrong after suspend and resume.
When the camera app is resumed behide the lock screen, it
orinteation is portrait. When users slide to unlock the screen,
surfaceChanged is called and the orientation is landscape.
The camera app stops the preview, sets the display orientation,
and starts the preview. Overlay should be destroyed if the
orientation has changed.

bug:3031640
Change-Id: I38b527f9ea78c91b538463292152c023383b4695
2010-09-27 11:49:56 -07:00
Nipun Kwatra
4e94c30ed5 Added command type to play recording sound.
Added CAMERA_CMD_PLAY_RECORDING_SOUND command type to play recording
sound through sendCommand. This is currently needed by time lapse
recording using still mode capture, which disables the shutter sound
but needs to play the recording sound.

Change-Id: I376aa40f45b6064fd862abc065456b06fc338020
2010-09-14 16:49:08 -07:00
Nipun Kwatra
088146a421 Adding enable/disable option for sendCommand()
- Added enum CAMERA_CMD_ENABLE_SHUTTER_SOUND which corresponds to
  command type for enabling/disabling shutter sound.
- The implementation checks if it is legal to disable shutter sound.
  If it is, then any process can disable the sound. If not, then only
  the mediaserver process is allowed to do this. Currently time lapse
  capture needs this functionality to disable shutter sound when still
  mode is used to capture time lapse video.

Change-Id: Id147a3bcc6a345c2c6a6d52bf98fd8292386bb19
2010-09-14 13:57:59 -07:00