17f47f6bd7178f8bf54cf78a003a52c3f4585158cZhijun He/* Copyright (c) 2011-2012, The Linux Foundation. All rights reserved.
27f47f6bd7178f8bf54cf78a003a52c3f4585158cZhijun He *
37f47f6bd7178f8bf54cf78a003a52c3f4585158cZhijun He * Redistribution and use in source and binary forms, with or without
47f47f6bd7178f8bf54cf78a003a52c3f4585158cZhijun He * modification, are permitted provided that the following conditions are
57f47f6bd7178f8bf54cf78a003a52c3f4585158cZhijun He * met:
67f47f6bd7178f8bf54cf78a003a52c3f4585158cZhijun He *     * Redistributions of source code must retain the above copyright
77f47f6bd7178f8bf54cf78a003a52c3f4585158cZhijun He *       notice, this list of conditions and the following disclaimer.
87f47f6bd7178f8bf54cf78a003a52c3f4585158cZhijun He *     * Redistributions in binary form must reproduce the above
97f47f6bd7178f8bf54cf78a003a52c3f4585158cZhijun He *       copyright notice, this list of conditions and the following
107f47f6bd7178f8bf54cf78a003a52c3f4585158cZhijun He *       disclaimer in the documentation and/or other materials provided
117f47f6bd7178f8bf54cf78a003a52c3f4585158cZhijun He *       with the distribution.
127f47f6bd7178f8bf54cf78a003a52c3f4585158cZhijun He *     * Neither the name of The Linux Foundation nor the names of its
137f47f6bd7178f8bf54cf78a003a52c3f4585158cZhijun He *       contributors may be used to endorse or promote products derived
147f47f6bd7178f8bf54cf78a003a52c3f4585158cZhijun He *       from this software without specific prior written permission.
157f47f6bd7178f8bf54cf78a003a52c3f4585158cZhijun He *
167f47f6bd7178f8bf54cf78a003a52c3f4585158cZhijun He * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
177f47f6bd7178f8bf54cf78a003a52c3f4585158cZhijun He * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
187f47f6bd7178f8bf54cf78a003a52c3f4585158cZhijun He * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
197f47f6bd7178f8bf54cf78a003a52c3f4585158cZhijun He * ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
207f47f6bd7178f8bf54cf78a003a52c3f4585158cZhijun He * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
217f47f6bd7178f8bf54cf78a003a52c3f4585158cZhijun He * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
227f47f6bd7178f8bf54cf78a003a52c3f4585158cZhijun He * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
237f47f6bd7178f8bf54cf78a003a52c3f4585158cZhijun He * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
247f47f6bd7178f8bf54cf78a003a52c3f4585158cZhijun He * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
257f47f6bd7178f8bf54cf78a003a52c3f4585158cZhijun He * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
267f47f6bd7178f8bf54cf78a003a52c3f4585158cZhijun He * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
277f47f6bd7178f8bf54cf78a003a52c3f4585158cZhijun He */
287f47f6bd7178f8bf54cf78a003a52c3f4585158cZhijun He
297f47f6bd7178f8bf54cf78a003a52c3f4585158cZhijun He#ifndef ANDROID_HARDWARE_QUALCOMM_CAMERA_USBCAM_H
307f47f6bd7178f8bf54cf78a003a52c3f4585158cZhijun He#define ANDROID_HARDWARE_QUALCOMM_CAMERA_USBCAM_H
317f47f6bd7178f8bf54cf78a003a52c3f4585158cZhijun He
327f47f6bd7178f8bf54cf78a003a52c3f4585158cZhijun Heextern "C" {
337f47f6bd7178f8bf54cf78a003a52c3f4585158cZhijun He#include <sys/time.h>
347f47f6bd7178f8bf54cf78a003a52c3f4585158cZhijun He}
357f47f6bd7178f8bf54cf78a003a52c3f4585158cZhijun He
367f47f6bd7178f8bf54cf78a003a52c3f4585158cZhijun He#include "QCameraHWI.h"
377f47f6bd7178f8bf54cf78a003a52c3f4585158cZhijun He
387f47f6bd7178f8bf54cf78a003a52c3f4585158cZhijun Heextern "C" {
397f47f6bd7178f8bf54cf78a003a52c3f4585158cZhijun He
407f47f6bd7178f8bf54cf78a003a52c3f4585158cZhijun He/*#include <hardware/camera.h>*/
417f47f6bd7178f8bf54cf78a003a52c3f4585158cZhijun He
427f47f6bd7178f8bf54cf78a003a52c3f4585158cZhijun He    int usbcam_get_number_of_cameras();
437f47f6bd7178f8bf54cf78a003a52c3f4585158cZhijun He    int usbcam_get_camera_info(int camera_id, struct camera_info *info);
447f47f6bd7178f8bf54cf78a003a52c3f4585158cZhijun He
457f47f6bd7178f8bf54cf78a003a52c3f4585158cZhijun He    int usbcam_camera_device_open(const struct hw_module_t* module, const char* id,
467f47f6bd7178f8bf54cf78a003a52c3f4585158cZhijun He          struct hw_device_t** device);
477f47f6bd7178f8bf54cf78a003a52c3f4585158cZhijun He
487f47f6bd7178f8bf54cf78a003a52c3f4585158cZhijun He    hw_device_t * usbcam_open_camera_device(int cameraId);
497f47f6bd7178f8bf54cf78a003a52c3f4585158cZhijun He
507f47f6bd7178f8bf54cf78a003a52c3f4585158cZhijun He    int usbcam_close_camera_device( hw_device_t *);
517f47f6bd7178f8bf54cf78a003a52c3f4585158cZhijun He
527f47f6bd7178f8bf54cf78a003a52c3f4585158cZhijun Henamespace android {
537f47f6bd7178f8bf54cf78a003a52c3f4585158cZhijun He
547f47f6bd7178f8bf54cf78a003a52c3f4585158cZhijun He    /** Set the ANativeWindow to which preview frames are sent */
557f47f6bd7178f8bf54cf78a003a52c3f4585158cZhijun He    int usbcam_set_preview_window(struct camera_device *,
567f47f6bd7178f8bf54cf78a003a52c3f4585158cZhijun He          struct preview_stream_ops *window);
577f47f6bd7178f8bf54cf78a003a52c3f4585158cZhijun He
587f47f6bd7178f8bf54cf78a003a52c3f4585158cZhijun He    /** Set the notification and data callbacks */
597f47f6bd7178f8bf54cf78a003a52c3f4585158cZhijun He    void usbcam_set_CallBacks(struct camera_device *,
607f47f6bd7178f8bf54cf78a003a52c3f4585158cZhijun He          camera_notify_callback notify_cb,
617f47f6bd7178f8bf54cf78a003a52c3f4585158cZhijun He          camera_data_callback data_cb,
627f47f6bd7178f8bf54cf78a003a52c3f4585158cZhijun He          camera_data_timestamp_callback data_cb_timestamp,
637f47f6bd7178f8bf54cf78a003a52c3f4585158cZhijun He          camera_request_memory get_memory,
647f47f6bd7178f8bf54cf78a003a52c3f4585158cZhijun He          void *user);
657f47f6bd7178f8bf54cf78a003a52c3f4585158cZhijun He
667f47f6bd7178f8bf54cf78a003a52c3f4585158cZhijun He    /**
677f47f6bd7178f8bf54cf78a003a52c3f4585158cZhijun He     * The following three functions all take a msg_type, which is a bitmask of
687f47f6bd7178f8bf54cf78a003a52c3f4585158cZhijun He     * the messages defined in include/ui/Camera.h
697f47f6bd7178f8bf54cf78a003a52c3f4585158cZhijun He     */
707f47f6bd7178f8bf54cf78a003a52c3f4585158cZhijun He
717f47f6bd7178f8bf54cf78a003a52c3f4585158cZhijun He    /**
727f47f6bd7178f8bf54cf78a003a52c3f4585158cZhijun He     * Enable a message, or set of messages.
737f47f6bd7178f8bf54cf78a003a52c3f4585158cZhijun He     */
747f47f6bd7178f8bf54cf78a003a52c3f4585158cZhijun He    void usbcam_enable_msg_type(struct camera_device *, int32_t msg_type);
757f47f6bd7178f8bf54cf78a003a52c3f4585158cZhijun He
767f47f6bd7178f8bf54cf78a003a52c3f4585158cZhijun He    /**
777f47f6bd7178f8bf54cf78a003a52c3f4585158cZhijun He     * Disable a message, or a set of messages.
787f47f6bd7178f8bf54cf78a003a52c3f4585158cZhijun He     *
797f47f6bd7178f8bf54cf78a003a52c3f4585158cZhijun He     * Once received a call to disableMsgType(CAMERA_MSG_VIDEO_FRAME), camera
807f47f6bd7178f8bf54cf78a003a52c3f4585158cZhijun He     * HAL should not rely on its client to call releaseRecordingFrame() to
817f47f6bd7178f8bf54cf78a003a52c3f4585158cZhijun He     * release video recording frames sent out by the cameral HAL before and
827f47f6bd7178f8bf54cf78a003a52c3f4585158cZhijun He     * after the disableMsgType(CAMERA_MSG_VIDEO_FRAME) call. Camera HAL
837f47f6bd7178f8bf54cf78a003a52c3f4585158cZhijun He     * clients must not modify/access any video recording frame after calling
847f47f6bd7178f8bf54cf78a003a52c3f4585158cZhijun He     * disableMsgType(CAMERA_MSG_VIDEO_FRAME).
857f47f6bd7178f8bf54cf78a003a52c3f4585158cZhijun He     */
867f47f6bd7178f8bf54cf78a003a52c3f4585158cZhijun He    void usbcam_disable_msg_type(struct camera_device *, int32_t msg_type);
877f47f6bd7178f8bf54cf78a003a52c3f4585158cZhijun He
887f47f6bd7178f8bf54cf78a003a52c3f4585158cZhijun He    /**
897f47f6bd7178f8bf54cf78a003a52c3f4585158cZhijun He     * Query whether a message, or a set of messages, is enabled.  Note that
907f47f6bd7178f8bf54cf78a003a52c3f4585158cZhijun He     * this is operates as an AND, if any of the messages queried are off, this
917f47f6bd7178f8bf54cf78a003a52c3f4585158cZhijun He     * will return false.
927f47f6bd7178f8bf54cf78a003a52c3f4585158cZhijun He     */
937f47f6bd7178f8bf54cf78a003a52c3f4585158cZhijun He    int usbcam_msg_type_enabled(struct camera_device *, int32_t msg_type);
947f47f6bd7178f8bf54cf78a003a52c3f4585158cZhijun He
957f47f6bd7178f8bf54cf78a003a52c3f4585158cZhijun He    /**
967f47f6bd7178f8bf54cf78a003a52c3f4585158cZhijun He     * Start preview mode.
977f47f6bd7178f8bf54cf78a003a52c3f4585158cZhijun He     */
987f47f6bd7178f8bf54cf78a003a52c3f4585158cZhijun He    int usbcam_start_preview(struct camera_device *);
997f47f6bd7178f8bf54cf78a003a52c3f4585158cZhijun He
1007f47f6bd7178f8bf54cf78a003a52c3f4585158cZhijun He    /**
1017f47f6bd7178f8bf54cf78a003a52c3f4585158cZhijun He     * Stop a previously started preview.
1027f47f6bd7178f8bf54cf78a003a52c3f4585158cZhijun He     */
1037f47f6bd7178f8bf54cf78a003a52c3f4585158cZhijun He    void usbcam_stop_preview(struct camera_device *);
1047f47f6bd7178f8bf54cf78a003a52c3f4585158cZhijun He
1057f47f6bd7178f8bf54cf78a003a52c3f4585158cZhijun He    /**
1067f47f6bd7178f8bf54cf78a003a52c3f4585158cZhijun He     * Returns true if preview is enabled.
1077f47f6bd7178f8bf54cf78a003a52c3f4585158cZhijun He     */
1087f47f6bd7178f8bf54cf78a003a52c3f4585158cZhijun He    int usbcam_preview_enabled(struct camera_device *);
1097f47f6bd7178f8bf54cf78a003a52c3f4585158cZhijun He
1107f47f6bd7178f8bf54cf78a003a52c3f4585158cZhijun He    /**
1117f47f6bd7178f8bf54cf78a003a52c3f4585158cZhijun He     * Request the camera HAL to store meta data or real YUV data in the video
1127f47f6bd7178f8bf54cf78a003a52c3f4585158cZhijun He     * buffers sent out via CAMERA_MSG_VIDEO_FRAME for a recording session. If
1137f47f6bd7178f8bf54cf78a003a52c3f4585158cZhijun He     * it is not called, the default camera HAL behavior is to store real YUV
1147f47f6bd7178f8bf54cf78a003a52c3f4585158cZhijun He     * data in the video buffers.
1157f47f6bd7178f8bf54cf78a003a52c3f4585158cZhijun He     *
1167f47f6bd7178f8bf54cf78a003a52c3f4585158cZhijun He     * This method should be called before startRecording() in order to be
1177f47f6bd7178f8bf54cf78a003a52c3f4585158cZhijun He     * effective.
1187f47f6bd7178f8bf54cf78a003a52c3f4585158cZhijun He     *
1197f47f6bd7178f8bf54cf78a003a52c3f4585158cZhijun He     * If meta data is stored in the video buffers, it is up to the receiver of
1207f47f6bd7178f8bf54cf78a003a52c3f4585158cZhijun He     * the video buffers to interpret the contents and to find the actual frame
1217f47f6bd7178f8bf54cf78a003a52c3f4585158cZhijun He     * data with the help of the meta data in the buffer. How this is done is
1227f47f6bd7178f8bf54cf78a003a52c3f4585158cZhijun He     * outside of the scope of this method.
1237f47f6bd7178f8bf54cf78a003a52c3f4585158cZhijun He     *
1247f47f6bd7178f8bf54cf78a003a52c3f4585158cZhijun He     * Some camera HALs may not support storing meta data in the video buffers,
1257f47f6bd7178f8bf54cf78a003a52c3f4585158cZhijun He     * but all camera HALs should support storing real YUV data in the video
1267f47f6bd7178f8bf54cf78a003a52c3f4585158cZhijun He     * buffers. If the camera HAL does not support storing the meta data in the
1277f47f6bd7178f8bf54cf78a003a52c3f4585158cZhijun He     * video buffers when it is requested to do do, INVALID_OPERATION must be
1287f47f6bd7178f8bf54cf78a003a52c3f4585158cZhijun He     * returned. It is very useful for the camera HAL to pass meta data rather
1297f47f6bd7178f8bf54cf78a003a52c3f4585158cZhijun He     * than the actual frame data directly to the video encoder, since the
1307f47f6bd7178f8bf54cf78a003a52c3f4585158cZhijun He     * amount of the uncompressed frame data can be very large if video size is
1317f47f6bd7178f8bf54cf78a003a52c3f4585158cZhijun He     * large.
1327f47f6bd7178f8bf54cf78a003a52c3f4585158cZhijun He     *
1337f47f6bd7178f8bf54cf78a003a52c3f4585158cZhijun He     * @param enable if true to instruct the camera HAL to store
1347f47f6bd7178f8bf54cf78a003a52c3f4585158cZhijun He     *        meta data in the video buffers; false to instruct
1357f47f6bd7178f8bf54cf78a003a52c3f4585158cZhijun He     *        the camera HAL to store real YUV data in the video
1367f47f6bd7178f8bf54cf78a003a52c3f4585158cZhijun He     *        buffers.
1377f47f6bd7178f8bf54cf78a003a52c3f4585158cZhijun He     *
1387f47f6bd7178f8bf54cf78a003a52c3f4585158cZhijun He     * @return OK on success.
1397f47f6bd7178f8bf54cf78a003a52c3f4585158cZhijun He     */
1407f47f6bd7178f8bf54cf78a003a52c3f4585158cZhijun He    int usbcam_store_meta_data_in_buffers(struct camera_device *, int enable);
1417f47f6bd7178f8bf54cf78a003a52c3f4585158cZhijun He
1427f47f6bd7178f8bf54cf78a003a52c3f4585158cZhijun He    /**
1437f47f6bd7178f8bf54cf78a003a52c3f4585158cZhijun He     * Start record mode. When a record image is available, a
1447f47f6bd7178f8bf54cf78a003a52c3f4585158cZhijun He     * CAMERA_MSG_VIDEO_FRAME message is sent with the corresponding
1457f47f6bd7178f8bf54cf78a003a52c3f4585158cZhijun He     * frame. Every record frame must be released by a camera HAL client via
1467f47f6bd7178f8bf54cf78a003a52c3f4585158cZhijun He     * releaseRecordingFrame() before the client calls
1477f47f6bd7178f8bf54cf78a003a52c3f4585158cZhijun He     * disableMsgType(CAMERA_MSG_VIDEO_FRAME). After the client calls
1487f47f6bd7178f8bf54cf78a003a52c3f4585158cZhijun He     * disableMsgType(CAMERA_MSG_VIDEO_FRAME), it is the camera HAL's
1497f47f6bd7178f8bf54cf78a003a52c3f4585158cZhijun He     * responsibility to manage the life-cycle of the video recording frames,
1507f47f6bd7178f8bf54cf78a003a52c3f4585158cZhijun He     * and the client must not modify/access any video recording frames.
1517f47f6bd7178f8bf54cf78a003a52c3f4585158cZhijun He     */
1527f47f6bd7178f8bf54cf78a003a52c3f4585158cZhijun He    int usbcam_start_recording(struct camera_device *);
1537f47f6bd7178f8bf54cf78a003a52c3f4585158cZhijun He
1547f47f6bd7178f8bf54cf78a003a52c3f4585158cZhijun He    /**
1557f47f6bd7178f8bf54cf78a003a52c3f4585158cZhijun He     * Stop a previously started recording.
1567f47f6bd7178f8bf54cf78a003a52c3f4585158cZhijun He     */
1577f47f6bd7178f8bf54cf78a003a52c3f4585158cZhijun He    void usbcam_stop_recording(struct camera_device *);
1587f47f6bd7178f8bf54cf78a003a52c3f4585158cZhijun He
1597f47f6bd7178f8bf54cf78a003a52c3f4585158cZhijun He    /**
1607f47f6bd7178f8bf54cf78a003a52c3f4585158cZhijun He     * Returns true if recording is enabled.
1617f47f6bd7178f8bf54cf78a003a52c3f4585158cZhijun He     */
1627f47f6bd7178f8bf54cf78a003a52c3f4585158cZhijun He    int usbcam_recording_enabled(struct camera_device *);
1637f47f6bd7178f8bf54cf78a003a52c3f4585158cZhijun He
1647f47f6bd7178f8bf54cf78a003a52c3f4585158cZhijun He    /**
1657f47f6bd7178f8bf54cf78a003a52c3f4585158cZhijun He     * Release a record frame previously returned by CAMERA_MSG_VIDEO_FRAME.
1667f47f6bd7178f8bf54cf78a003a52c3f4585158cZhijun He     *
1677f47f6bd7178f8bf54cf78a003a52c3f4585158cZhijun He     * It is camera HAL client's responsibility to release video recording
1687f47f6bd7178f8bf54cf78a003a52c3f4585158cZhijun He     * frames sent out by the camera HAL before the camera HAL receives a call
1697f47f6bd7178f8bf54cf78a003a52c3f4585158cZhijun He     * to disableMsgType(CAMERA_MSG_VIDEO_FRAME). After it receives the call to
1707f47f6bd7178f8bf54cf78a003a52c3f4585158cZhijun He     * disableMsgType(CAMERA_MSG_VIDEO_FRAME), it is the camera HAL's
1717f47f6bd7178f8bf54cf78a003a52c3f4585158cZhijun He     * responsibility to manage the life-cycle of the video recording frames.
1727f47f6bd7178f8bf54cf78a003a52c3f4585158cZhijun He     */
1737f47f6bd7178f8bf54cf78a003a52c3f4585158cZhijun He    void usbcam_release_recording_frame(struct camera_device *,
1747f47f6bd7178f8bf54cf78a003a52c3f4585158cZhijun He                  const void *opaque);
1757f47f6bd7178f8bf54cf78a003a52c3f4585158cZhijun He
1767f47f6bd7178f8bf54cf78a003a52c3f4585158cZhijun He    /**
1777f47f6bd7178f8bf54cf78a003a52c3f4585158cZhijun He     * Start auto focus, the notification callback routine is called with
1787f47f6bd7178f8bf54cf78a003a52c3f4585158cZhijun He     * CAMERA_MSG_FOCUS once when focusing is complete. autoFocus() will be
1797f47f6bd7178f8bf54cf78a003a52c3f4585158cZhijun He     * called again if another auto focus is needed.
1807f47f6bd7178f8bf54cf78a003a52c3f4585158cZhijun He     */
1817f47f6bd7178f8bf54cf78a003a52c3f4585158cZhijun He    int usbcam_auto_focus(struct camera_device *);
1827f47f6bd7178f8bf54cf78a003a52c3f4585158cZhijun He
1837f47f6bd7178f8bf54cf78a003a52c3f4585158cZhijun He    /**
1847f47f6bd7178f8bf54cf78a003a52c3f4585158cZhijun He     * Cancels auto-focus function. If the auto-focus is still in progress,
1857f47f6bd7178f8bf54cf78a003a52c3f4585158cZhijun He     * this function will cancel it. Whether the auto-focus is in progress or
1867f47f6bd7178f8bf54cf78a003a52c3f4585158cZhijun He     * not, this function will return the focus position to the default.  If
1877f47f6bd7178f8bf54cf78a003a52c3f4585158cZhijun He     * the camera does not support auto-focus, this is a no-op.
1887f47f6bd7178f8bf54cf78a003a52c3f4585158cZhijun He     */
1897f47f6bd7178f8bf54cf78a003a52c3f4585158cZhijun He    int usbcam_cancel_auto_focus(struct camera_device *);
1907f47f6bd7178f8bf54cf78a003a52c3f4585158cZhijun He
1917f47f6bd7178f8bf54cf78a003a52c3f4585158cZhijun He    /**
1927f47f6bd7178f8bf54cf78a003a52c3f4585158cZhijun He     * Take a picture.
1937f47f6bd7178f8bf54cf78a003a52c3f4585158cZhijun He     */
1947f47f6bd7178f8bf54cf78a003a52c3f4585158cZhijun He    int usbcam_take_picture(struct camera_device *);
1957f47f6bd7178f8bf54cf78a003a52c3f4585158cZhijun He
1967f47f6bd7178f8bf54cf78a003a52c3f4585158cZhijun He    /**
1977f47f6bd7178f8bf54cf78a003a52c3f4585158cZhijun He     * Cancel a picture that was started with takePicture. Calling this method
1987f47f6bd7178f8bf54cf78a003a52c3f4585158cZhijun He     * when no picture is being taken is a no-op.
1997f47f6bd7178f8bf54cf78a003a52c3f4585158cZhijun He     */
2007f47f6bd7178f8bf54cf78a003a52c3f4585158cZhijun He    int usbcam_cancel_picture(struct camera_device *);
2017f47f6bd7178f8bf54cf78a003a52c3f4585158cZhijun He
2027f47f6bd7178f8bf54cf78a003a52c3f4585158cZhijun He    /**
2037f47f6bd7178f8bf54cf78a003a52c3f4585158cZhijun He     * Set the camera parameters. This returns BAD_VALUE if any parameter is
2047f47f6bd7178f8bf54cf78a003a52c3f4585158cZhijun He     * invalid or not supported.
2057f47f6bd7178f8bf54cf78a003a52c3f4585158cZhijun He     */
2067f47f6bd7178f8bf54cf78a003a52c3f4585158cZhijun He    int usbcam_set_parameters(struct camera_device *, const char *parms);
2077f47f6bd7178f8bf54cf78a003a52c3f4585158cZhijun He
2087f47f6bd7178f8bf54cf78a003a52c3f4585158cZhijun He    //status_t setParameters(const QCameraParameters& params);
2097f47f6bd7178f8bf54cf78a003a52c3f4585158cZhijun He    /** Retrieve the camera parameters.  The buffer returned by the camera HAL
2107f47f6bd7178f8bf54cf78a003a52c3f4585158cZhijun He        must be returned back to it with put_parameters, if put_parameters
2117f47f6bd7178f8bf54cf78a003a52c3f4585158cZhijun He        is not NULL.
2127f47f6bd7178f8bf54cf78a003a52c3f4585158cZhijun He     */
2137f47f6bd7178f8bf54cf78a003a52c3f4585158cZhijun He    char* usbcam_get_parameters(struct camera_device *);
2147f47f6bd7178f8bf54cf78a003a52c3f4585158cZhijun He
2157f47f6bd7178f8bf54cf78a003a52c3f4585158cZhijun He    /** The camera HAL uses its own memory to pass us the parameters when we
2167f47f6bd7178f8bf54cf78a003a52c3f4585158cZhijun He        call get_parameters.  Use this function to return the memory back to
2177f47f6bd7178f8bf54cf78a003a52c3f4585158cZhijun He        the camera HAL, if put_parameters is not NULL.  If put_parameters
2187f47f6bd7178f8bf54cf78a003a52c3f4585158cZhijun He        is NULL, then you have to use free() to release the memory.
2197f47f6bd7178f8bf54cf78a003a52c3f4585158cZhijun He    */
2207f47f6bd7178f8bf54cf78a003a52c3f4585158cZhijun He    void usbcam_put_parameters(struct camera_device *, char *);
2217f47f6bd7178f8bf54cf78a003a52c3f4585158cZhijun He
2227f47f6bd7178f8bf54cf78a003a52c3f4585158cZhijun He    /**
2237f47f6bd7178f8bf54cf78a003a52c3f4585158cZhijun He     * Send command to camera driver.
2247f47f6bd7178f8bf54cf78a003a52c3f4585158cZhijun He     */
2257f47f6bd7178f8bf54cf78a003a52c3f4585158cZhijun He    int usbcam_send_command(struct camera_device *,
2267f47f6bd7178f8bf54cf78a003a52c3f4585158cZhijun He              int32_t cmd, int32_t arg1, int32_t arg2);
2277f47f6bd7178f8bf54cf78a003a52c3f4585158cZhijun He
2287f47f6bd7178f8bf54cf78a003a52c3f4585158cZhijun He    /**
2297f47f6bd7178f8bf54cf78a003a52c3f4585158cZhijun He     * Release the hardware resources owned by this object.  Note that this is
2307f47f6bd7178f8bf54cf78a003a52c3f4585158cZhijun He     * *not* done in the destructor.
2317f47f6bd7178f8bf54cf78a003a52c3f4585158cZhijun He     */
2327f47f6bd7178f8bf54cf78a003a52c3f4585158cZhijun He    void usbcam_release(struct camera_device *);
2337f47f6bd7178f8bf54cf78a003a52c3f4585158cZhijun He
2347f47f6bd7178f8bf54cf78a003a52c3f4585158cZhijun He    /**
2357f47f6bd7178f8bf54cf78a003a52c3f4585158cZhijun He     * Dump state of the camera hardware
2367f47f6bd7178f8bf54cf78a003a52c3f4585158cZhijun He     */
2377f47f6bd7178f8bf54cf78a003a52c3f4585158cZhijun He    int usbcam_dump(struct camera_device *, int fd);
2387f47f6bd7178f8bf54cf78a003a52c3f4585158cZhijun He
2397f47f6bd7178f8bf54cf78a003a52c3f4585158cZhijun He}; // namespace android
2407f47f6bd7178f8bf54cf78a003a52c3f4585158cZhijun He
2417f47f6bd7178f8bf54cf78a003a52c3f4585158cZhijun He} //extern "C"
2427f47f6bd7178f8bf54cf78a003a52c3f4585158cZhijun He
2437f47f6bd7178f8bf54cf78a003a52c3f4585158cZhijun He#endif
244