Stay organized with collections
Save and categorize content based on your preferences.
camera_device_ops Struct Reference
#include <
camera.h
>
|
int(*
|
set_preview_window
)(struct
camera_device
*, struct
preview_stream_ops
*window)
|
|
void(*
|
set_callbacks
)(struct
camera_device
*,
camera_notify_callback
notify_cb,
camera_data_callback
data_cb,
camera_data_timestamp_callback
data_cb_timestamp,
camera_request_memory
get_memory, void *user)
|
|
void(*
|
enable_msg_type
)(struct
camera_device
*, int32_t msg_type)
|
|
void(*
|
disable_msg_type
)(struct
camera_device
*, int32_t msg_type)
|
|
int(*
|
msg_type_enabled
)(struct
camera_device
*, int32_t msg_type)
|
|
int(*
|
start_preview
)(struct
camera_device
*)
|
|
void(*
|
stop_preview
)(struct
camera_device
*)
|
|
int(*
|
preview_enabled
)(struct
camera_device
*)
|
|
int(*
|
store_meta_data_in_buffers
)(struct
camera_device
*, int enable)
|
|
int(*
|
start_recording
)(struct
camera_device
*)
|
|
void(*
|
stop_recording
)(struct
camera_device
*)
|
|
int(*
|
recording_enabled
)(struct
camera_device
*)
|
|
void(*
|
release_recording_frame
)(struct
camera_device
*, const void *opaque)
|
|
int(*
|
auto_focus
)(struct
camera_device
*)
|
|
int(*
|
cancel_auto_focus
)(struct
camera_device
*)
|
|
int(*
|
take_picture
)(struct
camera_device
*)
|
|
int(*
|
cancel_picture
)(struct
camera_device
*)
|
|
int(*
|
set_parameters
)(struct
camera_device
*, const char *parms)
|
|
char *(*
|
get_parameters
)(struct
camera_device
*)
|
|
void(*
|
put_parameters
)(struct
camera_device
*, char *)
|
|
int(*
|
send_command
)(struct
camera_device
*, int32_t cmd, int32_t arg1, int32_t arg2)
|
|
void(*
|
release
)(struct
camera_device
*)
|
|
int(*
|
dump
)(struct
camera_device
*, int fd)
|
|
Definition at line
99
of file
camera.h
.
Start auto focus, the notification callback routine is called with CAMERA_MSG_FOCUS once when focusing is complete. autoFocus() will be called again if another auto focus is needed.
Definition at line
227
of file
camera.h
.
Cancels auto-focus function. If the auto-focus is still in progress, this function will cancel it. Whether the auto-focus is in progress or not, this function will return the focus position to the default. If the camera does not support auto-focus, this is a no-op.
Definition at line
235
of file
camera.h
.
Cancel a picture that was started with takePicture. Calling this method when no picture is being taken is a no-op.
Definition at line
246
of file
camera.h
.
void(* disable_msg_type)(struct
camera_device
*, int32_t msg_type)
|
Disable a message, or a set of messages.
Once received a call to disableMsgType(CAMERA_MSG_VIDEO_FRAME), camera HAL should not rely on its client to call releaseRecordingFrame() to release video recording frames sent out by the cameral HAL before and after the disableMsgType(CAMERA_MSG_VIDEO_FRAME) call. Camera HAL clients must not modify/access any video recording frame after calling disableMsgType(CAMERA_MSG_VIDEO_FRAME).
Definition at line
132
of file
camera.h
.
Dump state of the camera hardware
Definition at line
282
of file
camera.h
.
void(* enable_msg_type)(struct
camera_device
*, int32_t msg_type)
|
The following three functions all take a msg_type, which is a bitmask of the messages defined in include/ui/Camera.h Enable a message, or set of messages.
Definition at line
120
of file
camera.h
.
Retrieve the camera parameters. The buffer returned by the camera HAL must be returned back to it with put_parameters, if put_parameters is not NULL.
Definition at line
258
of file
camera.h
.
int(* msg_type_enabled)(struct
camera_device
*, int32_t msg_type)
|
Query whether a message, or a set of messages, is enabled. Note that this is operates as an AND, if any of the messages queried are off, this will return false.
Definition at line
139
of file
camera.h
.
Returns true if preview is enabled.
Definition at line
154
of file
camera.h
.
The camera HAL uses its own memory to pass us the parameters when we call get_parameters. Use this function to return the memory back to the camera HAL, if put_parameters is not NULL. If put_parameters is NULL, then you have to use free() to release the memory.
Definition at line
265
of file
camera.h
.
Returns true if recording is enabled.
Definition at line
208
of file
camera.h
.
Release the hardware resources owned by this object. Note that this is
not
done in the destructor.
Definition at line
277
of file
camera.h
.
void(* release_recording_frame)(struct
camera_device
*, const void *opaque)
|
Release a record frame previously returned by CAMERA_MSG_VIDEO_FRAME.
It is camera HAL client's responsibility to release video recording frames sent out by the camera HAL before the camera HAL receives a call to disableMsgType(CAMERA_MSG_VIDEO_FRAME). After it receives the call to disableMsgType(CAMERA_MSG_VIDEO_FRAME), it is the camera HAL's responsibility to manage the life-cycle of the video recording frames.
Definition at line
219
of file
camera.h
.
int(* send_command)(struct
camera_device
*, int32_t cmd, int32_t arg1, int32_t arg2)
|
Send command to camera driver.
Definition at line
270
of file
camera.h
.
Set the notification and data callbacks
Definition at line
105
of file
camera.h
.
Set the camera parameters. This returns BAD_VALUE if any parameter is invalid or not supported.
Definition at line
252
of file
camera.h
.
Set the ANativeWindow to which preview frames are sent
Definition at line
101
of file
camera.h
.
Start preview mode.
Definition at line
144
of file
camera.h
.
Start record mode. When a record image is available, a CAMERA_MSG_VIDEO_FRAME message is sent with the corresponding frame. Every record frame must be released by a camera HAL client via releaseRecordingFrame() before the client calls disableMsgType(CAMERA_MSG_VIDEO_FRAME). After the client calls disableMsgType(CAMERA_MSG_VIDEO_FRAME), it is the camera HAL's responsibility to manage the life-cycle of the video recording frames, and the client must not modify/access any video recording frames.
Definition at line
198
of file
camera.h
.
Stop a previously started preview.
Definition at line
149
of file
camera.h
.
Stop a previously started recording.
Definition at line
203
of file
camera.h
.
int(* store_meta_data_in_buffers)(struct
camera_device
*, int enable)
|
Request the camera HAL to store meta data or real YUV data in the video buffers sent out via CAMERA_MSG_VIDEO_FRAME for a recording session. If it is not called, the default camera HAL behavior is to store real YUV data in the video buffers.
This method should be called before startRecording() in order to be effective.
If meta data is stored in the video buffers, it is up to the receiver of the video buffers to interpret the contents and to find the actual frame data with the help of the meta data in the buffer. How this is done is outside of the scope of this method.
Some camera HALs may not support storing meta data in the video buffers, but all camera HALs should support storing real YUV data in the video buffers. If the camera HAL does not support storing the meta data in the video buffers when it is requested to do do, INVALID_OPERATION must be returned. It is very useful for the camera HAL to pass meta data rather than the actual frame data directly to the video encoder, since the amount of the uncompressed frame data can be very large if video size is large.
-
Parameters
-
enable
|
if true to instruct the camera HAL to store meta data in the video buffers; false to instruct the camera HAL to store real YUV data in the video buffers.
|
-
Returns
-
OK on success.
Definition at line
186
of file
camera.h
.
Take a picture.
Definition at line
240
of file
camera.h
.
The documentation for this struct was generated from the following file:
-
hardware/libhardware/include/hardware/
camera.h
Content and code samples on this page are subject to the licenses described in the Content License. Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.
Last updated 2019-10-02 UTC.
[{
"type": "thumb-down",
"id": "missingTheInformationINeed",
"label":"Missing the information I need"
},{
"type": "thumb-down",
"id": "tooComplicatedTooManySteps",
"label":"Too complicated / too many steps"
},{
"type": "thumb-down",
"id": "outOfDate",
"label":"Out of date"
},{
"type": "thumb-down",
"id": "samplesCodeIssue",
"label":"Samples / code issue"
},{
"type": "thumb-down",
"id": "otherDown",
"label":"Other"
}]
[{
"type": "thumb-up",
"id": "easyToUnderstand",
"label":"Easy to understand"
},{
"type": "thumb-up",
"id": "solvedMyProblem",
"label":"Solved my problem"
},{
"type": "thumb-up",
"id": "otherUp",
"label":"Other"
}]
{"lastModified": "Last updated 2019-10-02 UTC."}
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2019-10-02 UTC."]]