16 #ifndef ANDROID_HARDWARE_CAMERA_HARDWARE_INTERFACE_H
17 #define ANDROID_HARDWARE_CAMERA_HARDWARE_INTERFACE_H
18 #include <binder/IMemory.h>
19 #include <utils/RefBase.h>
20 #include <surfaceflinger/ISurface.h>
21 #include <camera/Camera.h>
22 #include <camera/CameraParameters.h>
38 const sp<IMemory>& dataPtr,
42 const sp<IMemory>& dataPtr,
81 virtual sp<IMemoryHeap>
getRawHeap()
const = 0;
114 virtual status_t
setOverlay(
const sp<Overlay> &overlay) {
return BAD_VALUE;}
166 virtual status_t
setParameters(
const CameraParameters& params) = 0;
172 virtual status_t
sendCommand(int32_t cmd, int32_t arg1, int32_t arg2) = 0;
181 virtual status_t
dump(
int fd,
const Vector<String16>& args)
const = 0;
virtual void stopPreview()=0
Stop a previously started preview.
virtual status_t takePicture()=0
Take a picture.
struct android::image_rect_struct image_rect_type
The size of image for display.
virtual status_t setOverlay(const sp< Overlay > &overlay)
virtual status_t cancelPicture()=0
Cancel a picture that was started with takePicture.
int HAL_getNumberOfCameras()
The functions need to be provided by the camera HAL.
virtual status_t cancelAutoFocus()=0
Cancels auto-focus function.
virtual bool recordingEnabled()=0
Returns true if recording is enabled.
sp< CameraHardwareInterface > HAL_openCameraHardware(int cameraId)
virtual status_t sendCommand(int32_t cmd, int32_t arg1, int32_t arg2)=0
Send command to camera driver.
virtual void release()=0
Release the hardware resources owned by this object.
CameraHardwareInterface.h defines the interface to the camera hardware abstraction layer...
virtual bool previewEnabled()=0
Returns true if preview is enabled.
virtual void enableMsgType(int32_t msgType)=0
The following three functions all take a msgtype, which is a bitmask of the messages defined in inclu...
virtual bool msgTypeEnabled(int32_t msgType)=0
Query whether a message, or a set of messages, is enabled.
virtual ~CameraHardwareInterface()
virtual status_t startPreview()=0
Start preview mode.
virtual status_t setParameters(const CameraParameters ¶ms)=0
Set the camera parameters.
virtual sp< IMemoryHeap > getPreviewHeap() const =0
Return the IMemoryHeap for the preview image heap.
virtual sp< IMemoryHeap > getRawHeap() const =0
Return the IMemoryHeap for the raw image heap.
virtual status_t dump(int fd, const Vector< String16 > &args) const =0
Dump state of the camera hardware.
virtual void releaseRecordingFrame(const sp< IMemory > &mem)=0
Release a record frame previously returned by CAMERA_MSG_VIDEO_FRAME.
void(* data_callback)(int32_t msgType, const sp< IMemory > &dataPtr, void *user)
void(* notify_callback)(int32_t msgType, int32_t ext1, int32_t ext2, void *user)
virtual status_t startRecording()=0
Start record mode.
void(* data_callback_timestamp)(nsecs_t timestamp, int32_t msgType, const sp< IMemory > &dataPtr, void *user)
virtual void disableMsgType(int32_t msgType)=0
Disable a message, or a set of messages.
virtual bool useOverlay()
Only used if overlays are used for camera preview.
virtual CameraParameters getParameters() const =0
Return the camera parameters.
virtual status_t autoFocus()=0
Start auto focus, the notification callback routine is called with CAMERA_MSG_FOCUS once when focusin...
virtual void stopRecording()=0
Stop a previously started recording.
void HAL_getCameraInfo(int cameraId, struct CameraInfo *cameraInfo)
virtual void setCallbacks(notify_callback notify_cb, data_callback data_cb, data_callback_timestamp data_cb_timestamp, void *user)=0
Set the notification and data callbacks.
The size of image for display.