diff options
| author | rohan <purohit.rohan@gmail.com> | 2016-10-28 15:10:54 +0530 |
|---|---|---|
| committer | rohan <purohit.rohan@gmail.com> | 2016-12-13 20:13:12 +0530 |
| commit | ad878c73991ea903580c6abf51ad0899ec307fdf (patch) | |
| tree | 521649a69711bece1c50363f112195abdbe950c2 | |
| parent | 61df1d5cfb5d8844362db10eba185725ef928555 (diff) | |
ferrari: camera: switch back to old HAL
* It was silly of me to update, when we used stock driver in kernel
reverts 6d72b8a02ece5ba11a16ecb327924aa592a34c63
18 files changed, 561 insertions, 712 deletions
diff --git a/camera/QCamera/HAL/test/Android.mk b/camera/QCamera/HAL/test/Android.mk index d3f5a12..8b13789 100755 --- a/camera/QCamera/HAL/test/Android.mk +++ b/camera/QCamera/HAL/test/Android.mk @@ -1 +1 @@ -
+ diff --git a/camera/QCamera/stack/mm-camera-interface/Android.mk b/camera/QCamera/stack/mm-camera-interface/Android.mk index 0934873..008df73 100755 --- a/camera/QCamera/stack/mm-camera-interface/Android.mk +++ b/camera/QCamera/stack/mm-camera-interface/Android.mk @@ -1,63 +1,63 @@ -#ifeq ($(call is-board-platform,msm8960),true)
-OLD_LOCAL_PATH := $(LOCAL_PATH)
-LOCAL_PATH := $(call my-dir)
-
-include $(CLEAR_VARS)
-
-MM_CAM_FILES := \
- src/mm_camera_interface.c \
- src/mm_camera_stream.c \
- src/mm_camera_channel.c \
- src/mm_camera.c \
- src/mm_camera_thread.c \
- src/mm_camera_data.c \
- src/mm_camera_sock.c \
- src/mm_camera_helper.c
-
-ifeq ($(strip $(TARGET_USES_ION)),true)
- LOCAL_CFLAGS += -DUSE_ION
-endif
-
-LOCAL_CFLAGS += -D_ANDROID_
-LOCAL_COPY_HEADERS_TO := mm-camera-interface
-LOCAL_COPY_HEADERS := inc/mm_camera_interface.h
-LOCAL_COPY_HEADERS += ../common/cam_list.h
-
-LOCAL_C_INCLUDES := \
- $(LOCAL_PATH)/inc \
- $(LOCAL_PATH)/../common \
- $(LOCAL_PATH)/../../../ \
- $(TARGET_OUT_HEADERS)/mm-camera \
- $(TARGET_OUT_HEADERS)/mm-camera/common
-
-LOCAL_C_INCLUDES += $(TARGET_OUT_INTERMEDIATES)/KERNEL_OBJ/usr/include
-LOCAL_C_INCLUDES += $(TARGET_OUT_INTERMEDIATES)/KERNEL_OBJ/usr/include/media
-LOCAL_ADDITIONAL_DEPENDENCIES := $(TARGET_OUT_INTERMEDIATES)/KERNEL_OBJ/usr
-
-# (BEGIN) Need to remove later once dependency on jpeg removed
-LOCAL_C_INCLUDES += \
- $(TARGET_OUT_HEADERS)/mm-still \
- $(TARGET_OUT_HEADERS)/mm-still/jpeg \
- $(TARGET_OUT_HEADERS)/mm-core/omxcore \
- $(TARGET_OUT_HEADERS)/mm-still/mm-omx
-# (END) Need to remove later once dependency on jpeg removed
-
-LOCAL_C_INCLUDES+= $(call project-path-for,qcom-media)/mm-core/inc
-LOCAL_CFLAGS += -include bionic/libc/kernel/common/linux/socket.h
-LOCAL_CFLAGS += -include bionic/libc/kernel/common/linux/un.h
-
-LOCAL_SRC_FILES := $(MM_CAM_FILES)
-LOCAL_MODULE := libmmcamera_interface
-LOCAL_32_BIT_ONLY := true
-LOCAL_PRELINK_MODULE := false
-LOCAL_SHARED_LIBRARIES := libdl libcutils liblog
-LOCAL_MODULE_TAGS := optional
-
-# (BEGIN) Need to remove later once dependency on jpeg removed
-# LOCAL_SHARED_LIBRARIES += libmmjpeg_interface
-# (END) Need to remove later once dependency on jpeg removed
-
-include $(BUILD_SHARED_LIBRARY)
-
-LOCAL_PATH := $(OLD_LOCAL_PATH)
-#endif
+#ifeq ($(call is-board-platform,msm8960),true) +OLD_LOCAL_PATH := $(LOCAL_PATH) +LOCAL_PATH := $(call my-dir) + +include $(CLEAR_VARS) + +MM_CAM_FILES := \ + src/mm_camera_interface.c \ + src/mm_camera_stream.c \ + src/mm_camera_channel.c \ + src/mm_camera.c \ + src/mm_camera_thread.c \ + src/mm_camera_data.c \ + src/mm_camera_sock.c \ + src/mm_camera_helper.c + +ifeq ($(strip $(TARGET_USES_ION)),true) + LOCAL_CFLAGS += -DUSE_ION +endif + +LOCAL_CFLAGS += -D_ANDROID_ +LOCAL_COPY_HEADERS_TO := mm-camera-interface +LOCAL_COPY_HEADERS := inc/mm_camera_interface.h +LOCAL_COPY_HEADERS += ../common/cam_list.h + +LOCAL_C_INCLUDES := \ + $(LOCAL_PATH)/inc \ + $(LOCAL_PATH)/../common \ + $(LOCAL_PATH)/../../../ \ + $(TARGET_OUT_HEADERS)/mm-camera \ + $(TARGET_OUT_HEADERS)/mm-camera/common + +LOCAL_C_INCLUDES += $(TARGET_OUT_INTERMEDIATES)/KERNEL_OBJ/usr/include +LOCAL_C_INCLUDES += $(TARGET_OUT_INTERMEDIATES)/KERNEL_OBJ/usr/include/media +LOCAL_ADDITIONAL_DEPENDENCIES := $(TARGET_OUT_INTERMEDIATES)/KERNEL_OBJ/usr + +# (BEGIN) Need to remove later once dependency on jpeg removed +LOCAL_C_INCLUDES += \ + $(TARGET_OUT_HEADERS)/mm-still \ + $(TARGET_OUT_HEADERS)/mm-still/jpeg \ + $(TARGET_OUT_HEADERS)/mm-core/omxcore \ + $(TARGET_OUT_HEADERS)/mm-still/mm-omx +# (END) Need to remove later once dependency on jpeg removed + +LOCAL_C_INCLUDES+= $(call project-path-for,qcom-media)/mm-core/inc +LOCAL_CFLAGS += -include bionic/libc/kernel/common/linux/socket.h +LOCAL_CFLAGS += -include bionic/libc/kernel/common/linux/un.h + +LOCAL_SRC_FILES := $(MM_CAM_FILES) +LOCAL_MODULE := libmmcamera_interface +LOCAL_32_BIT_ONLY := true +LOCAL_PRELINK_MODULE := false +LOCAL_SHARED_LIBRARIES := libdl libcutils liblog +LOCAL_MODULE_TAGS := optional + +# (BEGIN) Need to remove later once dependency on jpeg removed +# LOCAL_SHARED_LIBRARIES += libmmjpeg_interface +# (END) Need to remove later once dependency on jpeg removed + +include $(BUILD_SHARED_LIBRARY) + +LOCAL_PATH := $(OLD_LOCAL_PATH) +#endif diff --git a/camera/QCamera/stack/mm-camera-interface/inc/mm_camera.h b/camera/QCamera/stack/mm-camera-interface/inc/mm_camera.h index e96e8b6..ac4e798 100755 --- a/camera/QCamera/stack/mm-camera-interface/inc/mm_camera.h +++ b/camera/QCamera/stack/mm-camera-interface/inc/mm_camera.h @@ -131,9 +131,9 @@ typedef struct { typedef enum { MM_CAMERA_POLL_TYPE_EVT, MM_CAMERA_POLL_TYPE_CH, - MM_CAMERA_POLL_TYPE_MAX
+ MM_CAMERA_POLL_TYPE_MAX } mm_camera_poll_thread_type_t; -
+ /* function ptr defined for poll notify CB, * registered at poll thread with poll fd */ typedef void (*mm_camera_poll_notify_t)(void *user_data); diff --git a/camera/QCamera/stack/mm-camera-interface/src/mm_camera_sock.c b/camera/QCamera/stack/mm-camera-interface/src/mm_camera_sock.c index 9d14950..ff3f767 100755 --- a/camera/QCamera/stack/mm-camera-interface/src/mm_camera_sock.c +++ b/camera/QCamera/stack/mm-camera-interface/src/mm_camera_sock.c @@ -1,224 +1,224 @@ -/*
-Copyright (c) 2012, The Linux Foundation. All rights reserved.
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are
-met:
- * Redistributions of source code must retain the above copyright
- notice, this list of conditions and the following disclaimer.
- * Redistributions in binary form must reproduce the above
- copyright notice, this list of conditions and the following
- disclaimer in the documentation and/or other materials provided
- with the distribution.
- * Neither the name of The Linux Foundation nor the names of its
- contributors may be used to endorse or promote products derived
- from this software without specific prior written permission.
-
-THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
-WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
-MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
-ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
-BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
-CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
-SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
-BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
-WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
-OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
-IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-*/
-
-#include <stdio.h>
-#include <unistd.h>
-#include <stdlib.h>
-#include <errno.h>
-#include <string.h>
-#include <sys/socket.h>
-#include <sys/uio.h>
-#include <linux/un.h>
-
-#include "mm_camera_dbg.h"
-#include "mm_camera_sock.h"
-
-/*===========================================================================
- * FUNCTION - mm_camera_socket_create -
- *
- * DESCRIPTION: opens a domain socket tied to camera ID and socket type
- * int cam_id: camera ID
- * mm_camera_sock_type_t sock_type: socket type, TCP/UDP
- * retured fd related to the domain socket
- *==========================================================================*/
-int mm_camera_socket_create(int cam_id, mm_camera_sock_type_t sock_type)
-{
- int socket_fd;
- struct sockaddr_un sock_addr;
- int sktype;
- int rc;
-
- switch (sock_type)
- {
- case MM_CAMERA_SOCK_TYPE_UDP:
- sktype = SOCK_DGRAM;
- break;
- case MM_CAMERA_SOCK_TYPE_TCP:
- sktype = SOCK_STREAM;
- break;
- default:
- CDBG_ERROR("%s: unknown socket type =%d", __func__, sock_type);
- return -1;
- }
- socket_fd = socket(AF_UNIX, sktype, 0);
- if (socket_fd < 0) {
- CDBG_ERROR("%s: error create socket fd =%d", __func__, socket_fd);
- return socket_fd;
- }
-
- memset(&sock_addr, 0, sizeof(sock_addr));
- sock_addr.sun_family = AF_UNIX;
- snprintf(sock_addr.sun_path, UNIX_PATH_MAX, "/data/cam_socket%d", cam_id);
- if((rc = connect(socket_fd, (struct sockaddr *) &sock_addr,
- sizeof(sock_addr))) != 0) {
- close(socket_fd);
- socket_fd = -1;
- CDBG_ERROR("%s: socket_fd=%d %s ", __func__, socket_fd, strerror(errno));
- }
-
- CDBG("%s: socket_fd=%d %s", __func__, socket_fd, sock_addr.sun_path);
- return socket_fd;
-}
-
-/*===========================================================================
- * FUNCTION - mm_camera_socket_close -
- *
- * DESCRIPTION: close domain socket by its fd
- *==========================================================================*/
-void mm_camera_socket_close(int fd)
-{
- if (fd > 0) {
- close(fd);
- }
-}
-
-/*===========================================================================
- * FUNCTION - mm_camera_socket_sendmsg -
- *
- * DESCRIPTION: send msg through domain socket
- * int fd: socket fd
- * mm_camera_sock_msg_packet_t *msg: pointer to msg to be sent over domain socket
- * int sendfd: file descriptors to be sent
- * return the total bytes of sent msg
- *==========================================================================*/
-int mm_camera_socket_sendmsg(
- int fd,
- void *msg,
- uint32_t buf_size,
- int sendfd)
-{
- struct msghdr msgh;
- struct iovec iov[1];
- struct cmsghdr * cmsghp = NULL;
- char control[CMSG_SPACE(sizeof(int))];
-
- if (msg == NULL) {
- CDBG("%s: msg is NULL", __func__);
- return -1;
- }
- memset(&msgh, 0, sizeof(msgh));
- msgh.msg_name = NULL;
- msgh.msg_namelen = 0;
-
- iov[0].iov_base = msg;
- iov[0].iov_len = buf_size;
- msgh.msg_iov = iov;
- msgh.msg_iovlen = 1;
- CDBG("%s: iov_len=%d", __func__, iov[0].iov_len);
-
- msgh.msg_control = NULL;
- msgh.msg_controllen = 0;
-
- /* if sendfd is valid, we need to pass it through control msg */
- if( sendfd > 0) {
- msgh.msg_control = control;
- msgh.msg_controllen = sizeof(control);
- cmsghp = CMSG_FIRSTHDR(&msgh);
- if (cmsghp != NULL) {
- CDBG("%s: Got ctrl msg pointer", __func__);
- cmsghp->cmsg_level = SOL_SOCKET;
- cmsghp->cmsg_type = SCM_RIGHTS;
- cmsghp->cmsg_len = CMSG_LEN(sizeof(int));
- *((int *)CMSG_DATA(cmsghp)) = sendfd;
- CDBG("%s: cmsg data=%d", __func__, *((int *) CMSG_DATA(cmsghp)));
- } else {
- CDBG("%s: ctrl msg NULL", __func__);
- return -1;
- }
- }
-
- return sendmsg(fd, &(msgh), 0);
-}
-
-/*===========================================================================
- * FUNCTION - mm_camera_socket_recvmsg -
- *
- * DESCRIPTION: receive msg from domain socket.
- * int fd: socket fd
- * void *msg: pointer to mm_camera_sock_msg_packet_t to hold incoming msg,
- * need be allocated by the caller
- * uint32_t buf_size: the size of the buf that holds incoming msg
- * int *rcvdfd: pointer to hold recvd file descriptor if not NULL.
- * return the total bytes of received msg
- *==========================================================================*/
-int mm_camera_socket_recvmsg(
- int fd,
- void *msg,
- uint32_t buf_size,
- int *rcvdfd)
-{
- struct msghdr msgh;
- struct iovec iov[1];
- struct cmsghdr *cmsghp = NULL;
- char control[CMSG_SPACE(sizeof(int))];
- int rcvd_fd = -1;
- int rcvd_len = 0;
-
- if ( (msg == NULL) || (buf_size <= 0) ) {
- CDBG_ERROR(" %s: msg buf is NULL", __func__);
- return -1;
- }
-
- memset(&msgh, 0, sizeof(msgh));
- msgh.msg_name = NULL;
- msgh.msg_namelen = 0;
- msgh.msg_control = control;
- msgh.msg_controllen = sizeof(control);
-
- iov[0].iov_base = msg;
- iov[0].iov_len = buf_size;
- msgh.msg_iov = iov;
- msgh.msg_iovlen = 1;
-
- if ( (rcvd_len = recvmsg(fd, &(msgh), 0)) <= 0) {
- CDBG_ERROR(" %s: recvmsg failed", __func__);
- return rcvd_len;
- }
-
- CDBG("%s: msg_ctrl %p len %d", __func__, msgh.msg_control, msgh.msg_controllen);
-
- if( ((cmsghp = CMSG_FIRSTHDR(&msgh)) != NULL) &&
- (cmsghp->cmsg_len == CMSG_LEN(sizeof(int))) ) {
- if (cmsghp->cmsg_level == SOL_SOCKET &&
- cmsghp->cmsg_type == SCM_RIGHTS) {
- CDBG("%s: CtrlMsg is valid", __func__);
- rcvd_fd = *((int *) CMSG_DATA(cmsghp));
- CDBG("%s: Receieved fd=%d", __func__, rcvd_fd);
- } else {
- CDBG_ERROR("%s: Unexpected Control Msg. Line=%d", __func__, __LINE__);
- }
- }
-
- if (rcvdfd) {
- *rcvdfd = rcvd_fd;
- }
-
- return rcvd_len;
-}
-
+/* +Copyright (c) 2012, The Linux Foundation. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following + disclaimer in the documentation and/or other materials provided + with the distribution. + * Neither the name of The Linux Foundation nor the names of its + contributors may be used to endorse or promote products derived + from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED +WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT +ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS +BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR +BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE +OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN +IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +*/ + +#include <stdio.h> +#include <unistd.h> +#include <stdlib.h> +#include <errno.h> +#include <string.h> +#include <sys/socket.h> +#include <sys/uio.h> +#include <linux/un.h> + +#include "mm_camera_dbg.h" +#include "mm_camera_sock.h" + +/*=========================================================================== + * FUNCTION - mm_camera_socket_create - + * + * DESCRIPTION: opens a domain socket tied to camera ID and socket type + * int cam_id: camera ID + * mm_camera_sock_type_t sock_type: socket type, TCP/UDP + * retured fd related to the domain socket + *==========================================================================*/ +int mm_camera_socket_create(int cam_id, mm_camera_sock_type_t sock_type) +{ + int socket_fd; + struct sockaddr_un sock_addr; + int sktype; + int rc; + + switch (sock_type) + { + case MM_CAMERA_SOCK_TYPE_UDP: + sktype = SOCK_DGRAM; + break; + case MM_CAMERA_SOCK_TYPE_TCP: + sktype = SOCK_STREAM; + break; + default: + CDBG_ERROR("%s: unknown socket type =%d", __func__, sock_type); + return -1; + } + socket_fd = socket(AF_UNIX, sktype, 0); + if (socket_fd < 0) { + CDBG_ERROR("%s: error create socket fd =%d", __func__, socket_fd); + return socket_fd; + } + + memset(&sock_addr, 0, sizeof(sock_addr)); + sock_addr.sun_family = AF_UNIX; + snprintf(sock_addr.sun_path, UNIX_PATH_MAX, "/data/cam_socket%d", cam_id); + if((rc = connect(socket_fd, (struct sockaddr *) &sock_addr, + sizeof(sock_addr))) != 0) { + close(socket_fd); + socket_fd = -1; + CDBG_ERROR("%s: socket_fd=%d %s ", __func__, socket_fd, strerror(errno)); + } + + CDBG("%s: socket_fd=%d %s", __func__, socket_fd, sock_addr.sun_path); + return socket_fd; +} + +/*=========================================================================== + * FUNCTION - mm_camera_socket_close - + * + * DESCRIPTION: close domain socket by its fd + *==========================================================================*/ +void mm_camera_socket_close(int fd) +{ + if (fd > 0) { + close(fd); + } +} + +/*=========================================================================== + * FUNCTION - mm_camera_socket_sendmsg - + * + * DESCRIPTION: send msg through domain socket + * int fd: socket fd + * mm_camera_sock_msg_packet_t *msg: pointer to msg to be sent over domain socket + * int sendfd: file descriptors to be sent + * return the total bytes of sent msg + *==========================================================================*/ +int mm_camera_socket_sendmsg( + int fd, + void *msg, + uint32_t buf_size, + int sendfd) +{ + struct msghdr msgh; + struct iovec iov[1]; + struct cmsghdr * cmsghp = NULL; + char control[CMSG_SPACE(sizeof(int))]; + + if (msg == NULL) { + CDBG("%s: msg is NULL", __func__); + return -1; + } + memset(&msgh, 0, sizeof(msgh)); + msgh.msg_name = NULL; + msgh.msg_namelen = 0; + + iov[0].iov_base = msg; + iov[0].iov_len = buf_size; + msgh.msg_iov = iov; + msgh.msg_iovlen = 1; + CDBG("%s: iov_len=%d", __func__, iov[0].iov_len); + + msgh.msg_control = NULL; + msgh.msg_controllen = 0; + + /* if sendfd is valid, we need to pass it through control msg */ + if( sendfd > 0) { + msgh.msg_control = control; + msgh.msg_controllen = sizeof(control); + cmsghp = CMSG_FIRSTHDR(&msgh); + if (cmsghp != NULL) { + CDBG("%s: Got ctrl msg pointer", __func__); + cmsghp->cmsg_level = SOL_SOCKET; + cmsghp->cmsg_type = SCM_RIGHTS; + cmsghp->cmsg_len = CMSG_LEN(sizeof(int)); + *((int *)CMSG_DATA(cmsghp)) = sendfd; + CDBG("%s: cmsg data=%d", __func__, *((int *) CMSG_DATA(cmsghp))); + } else { + CDBG("%s: ctrl msg NULL", __func__); + return -1; + } + } + + return sendmsg(fd, &(msgh), 0); +} + +/*=========================================================================== + * FUNCTION - mm_camera_socket_recvmsg - + * + * DESCRIPTION: receive msg from domain socket. + * int fd: socket fd + * void *msg: pointer to mm_camera_sock_msg_packet_t to hold incoming msg, + * need be allocated by the caller + * uint32_t buf_size: the size of the buf that holds incoming msg + * int *rcvdfd: pointer to hold recvd file descriptor if not NULL. + * return the total bytes of received msg + *==========================================================================*/ +int mm_camera_socket_recvmsg( + int fd, + void *msg, + uint32_t buf_size, + int *rcvdfd) +{ + struct msghdr msgh; + struct iovec iov[1]; + struct cmsghdr *cmsghp = NULL; + char control[CMSG_SPACE(sizeof(int))]; + int rcvd_fd = -1; + int rcvd_len = 0; + + if ( (msg == NULL) || (buf_size <= 0) ) { + CDBG_ERROR(" %s: msg buf is NULL", __func__); + return -1; + } + + memset(&msgh, 0, sizeof(msgh)); + msgh.msg_name = NULL; + msgh.msg_namelen = 0; + msgh.msg_control = control; + msgh.msg_controllen = sizeof(control); + + iov[0].iov_base = msg; + iov[0].iov_len = buf_size; + msgh.msg_iov = iov; + msgh.msg_iovlen = 1; + + if ( (rcvd_len = recvmsg(fd, &(msgh), 0)) <= 0) { + CDBG_ERROR(" %s: recvmsg failed", __func__); + return rcvd_len; + } + + CDBG("%s: msg_ctrl %p len %d", __func__, msgh.msg_control, msgh.msg_controllen); + + if( ((cmsghp = CMSG_FIRSTHDR(&msgh)) != NULL) && + (cmsghp->cmsg_len == CMSG_LEN(sizeof(int))) ) { + if (cmsghp->cmsg_level == SOL_SOCKET && + cmsghp->cmsg_type == SCM_RIGHTS) { + CDBG("%s: CtrlMsg is valid", __func__); + rcvd_fd = *((int *) CMSG_DATA(cmsghp)); + CDBG("%s: Receieved fd=%d", __func__, rcvd_fd); + } else { + CDBG_ERROR("%s: Unexpected Control Msg. Line=%d", __func__, __LINE__); + } + } + + if (rcvdfd) { + *rcvdfd = rcvd_fd; + } + + return rcvd_len; +} + diff --git a/camera/QCamera/stack/mm-camera-interface/src/mm_camera_stream.c b/camera/QCamera/stack/mm-camera-interface/src/mm_camera_stream.c index 9e48f2b..a218eb0 100755 --- a/camera/QCamera/stack/mm-camera-interface/src/mm_camera_stream.c +++ b/camera/QCamera/stack/mm-camera-interface/src/mm_camera_stream.c @@ -83,15 +83,15 @@ int32_t mm_stream_buf_done(mm_stream_t * my_obj, /* state machine function declare */ -int32_t mm_stream_fsm_inited(mm_stream_t * my_obj,
+int32_t mm_stream_fsm_inited(mm_stream_t * my_obj, mm_stream_evt_type_t evt, void * in_val, void * out_val); -int32_t mm_stream_fsm_acquired(mm_stream_t * my_obj,
+int32_t mm_stream_fsm_acquired(mm_stream_t * my_obj, mm_stream_evt_type_t evt, void * in_val, void * out_val); -int32_t mm_stream_fsm_cfg(mm_stream_t * my_obj,
+int32_t mm_stream_fsm_cfg(mm_stream_t * my_obj, mm_stream_evt_type_t evt, void * in_val, void * out_val); @@ -99,15 +99,15 @@ int32_t mm_stream_fsm_buffed(mm_stream_t * my_obj, mm_stream_evt_type_t evt, void * in_val, void * out_val); -int32_t mm_stream_fsm_reg(mm_stream_t * my_obj,
+int32_t mm_stream_fsm_reg(mm_stream_t * my_obj, mm_stream_evt_type_t evt, void * in_val, void * out_val); -int32_t mm_stream_fsm_active_stream_on(mm_stream_t * my_obj,
+int32_t mm_stream_fsm_active_stream_on(mm_stream_t * my_obj, mm_stream_evt_type_t evt, void * in_val, void * out_val); -int32_t mm_stream_fsm_active_stream_off(mm_stream_t * my_obj,
+int32_t mm_stream_fsm_active_stream_off(mm_stream_t * my_obj, mm_stream_evt_type_t evt, void * in_val, void * out_val); @@ -406,13 +406,13 @@ int32_t mm_stream_fsm_fn(mm_stream_t *my_obj, } CDBG("%s : X rc =%d",__func__,rc); return rc; -}
+} int32_t mm_stream_fsm_inited(mm_stream_t *my_obj, mm_stream_evt_type_t evt, void * in_val, void * out_val) -{
+{ int32_t rc = 0; char dev_name[MM_CAMERA_DEV_NAME_LEN]; @@ -427,7 +427,7 @@ int32_t mm_stream_fsm_inited(mm_stream_t *my_obj, rc = -1; break; } -
+ snprintf(dev_name, sizeof(dev_name), "/dev/%s", mm_camera_util_get_dev_name(my_obj->ch_obj->cam_obj->my_hdl)); @@ -436,7 +436,7 @@ int32_t mm_stream_fsm_inited(mm_stream_t *my_obj, CDBG_ERROR("%s: open dev returned %d\n", __func__, my_obj->fd); rc = -1; break; - }
+ } CDBG("%s: open dev fd = %d, ext_image_mode = %d, sensor_idx = %d\n", __func__, my_obj->fd, my_obj->ext_image_mode, my_obj->sensor_idx); rc = mm_stream_set_ext_mode(my_obj); @@ -459,9 +459,9 @@ int32_t mm_stream_fsm_inited(mm_stream_t *my_obj, } } break; - default:
+ default: CDBG_ERROR("%s: Invalid evt=%d, stream_state=%d", - __func__,evt,my_obj->state);
+ __func__,evt,my_obj->state); break; } return rc; @@ -510,7 +510,7 @@ int32_t mm_stream_fsm_acquired(mm_stream_t *my_obj, return rc; } -int32_t mm_stream_fsm_cfg(mm_stream_t * my_obj,
+int32_t mm_stream_fsm_cfg(mm_stream_t * my_obj, mm_stream_evt_type_t evt, void * in_val, void * out_val) @@ -597,7 +597,7 @@ int32_t mm_stream_fsm_buffed(mm_stream_t * my_obj, return rc; } -int32_t mm_stream_fsm_reg(mm_stream_t * my_obj,
+int32_t mm_stream_fsm_reg(mm_stream_t * my_obj, mm_stream_evt_type_t evt, void * in_val, void * out_val) @@ -668,7 +668,7 @@ int32_t mm_stream_fsm_reg(mm_stream_t * my_obj, return rc; } -int32_t mm_stream_fsm_active_stream_on(mm_stream_t * my_obj,
+int32_t mm_stream_fsm_active_stream_on(mm_stream_t * my_obj, mm_stream_evt_type_t evt, void * in_val, void * out_val) @@ -706,7 +706,7 @@ int32_t mm_stream_fsm_active_stream_on(mm_stream_t * my_obj, return rc; } -int32_t mm_stream_fsm_active_stream_off(mm_stream_t * my_obj,
+int32_t mm_stream_fsm_active_stream_off(mm_stream_t * my_obj, mm_stream_evt_type_t evt, void * in_val, void * out_val) diff --git a/camera/QCamera/stack/mm-jpeg-interface/inc/mm_jpeg_interface.h b/camera/QCamera/stack/mm-jpeg-interface/inc/mm_jpeg_interface.h index cd1c9c8..2b8d2c6 100755 --- a/camera/QCamera/stack/mm-jpeg-interface/inc/mm_jpeg_interface.h +++ b/camera/QCamera/stack/mm-jpeg-interface/inc/mm_jpeg_interface.h @@ -1,217 +1,217 @@ -/* Copyright (c) 2012, The Linux Foundation. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are
- * met:
- * * Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * * Redistributions in binary form must reproduce the above
- * copyright notice, this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided
- * with the distribution.
- * * Neither the name of The Linux Foundation nor the names of its
- * contributors may be used to endorse or promote products derived
- * from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
- * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
- * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
- * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
- * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
- * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
- * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef MM_JPEG_INTERFACE_H_
-#define MM_JPEG_INTERFACE_H_
-#include "QCamera_Intf.h"
-
-typedef struct {
- int width;
- int height;
-} image_resolution;
-
-typedef enum {
- JPEG_SRC_IMAGE_FMT_YUV,
- JPEG_SRC_IMAGE_FMT_BITSTREAM
-} jpeg_enc_src_img_fmt_t;
-
-typedef enum {
- JPEG_SRC_IMAGE_TYPE_MAIN,
- JPEG_SRC_IMAGE_TYPE_THUMB,
- JPEG_SRC_IMAGE_TYPE_MAX
-} jpeg_enc_src_img_type_t;
-
-typedef struct {
- int32_t offset_x;
- int32_t offset_y;
- int32_t width;
- int32_t height;
-} image_crop_t;
-
-typedef struct {
- uint8_t sequence; /*for jpeg bit streams, assembling is based on sequence. sequence starts from 0*/
- uint8_t *buf_vaddr; /*ptr to buf*/
- int fd; /*fd of buf*/
- uint32_t buf_size; /* total size of buf (header + image) */
- uint32_t data_offset; /*data offset*/
-} src_bitstream_buffer_t;
-
-typedef struct {
- uint8_t *buf_vaddr; /*ptr to buf*/
- int fd; /*fd of buf*/
- cam_frame_len_offset_t offset; /*alway use multi-planar, offset is used to skip the metadata header*/
-} src_image_buffer_t;
-
-typedef enum {
- MM_JPEG_COLOR_FORMAT_YCRCBLP_H2V2,
- MM_JPEG_COLOR_FORMAT_YCBCRLP_H2V2,
- MM_JPEG_COLOR_FORMAT_YCRCBLP_H2V1,
- MM_JPEG_COLOR_FORMAT_YCBCRLP_H2V1,
- MM_JPEG_COLOR_FORMAT_YCRCBLP_H1V2,
- MM_JPEG_COLOR_FORMAT_YCBCRLP_H1V2,
- MM_JPEG_COLOR_FORMAT_YCRCBLP_H1V1,
- MM_JPEG_COLOR_FORMAT_YCBCRLP_H1V1,
- MM_JPEG_COLOR_FORMAT_RGB565,
- MM_JPEG_COLOR_FORMAT_RGB888,
- MM_JPEG_COLOR_FORMAT_RGBa,
- MM_JPEG_COLOR_FORMAT_BITSTREAM,
- MM_JPEG_COLOR_FORMAT_MAX
-} mm_jpeg_color_format;
-
-#define MAX_SRC_BUF_NUM 2
-typedef struct {
- /* src img format: YUV, Bitstream */
- jpeg_enc_src_img_fmt_t img_fmt;
-
- /* num of buf in src img */
- uint8_t num_bufs;
-
- /* src img bufs */
- union {
- src_bitstream_buffer_t bit_stream[MAX_SRC_BUF_NUM];
- src_image_buffer_t src_image[MAX_SRC_BUF_NUM];
- };
-
- /* src img type: main or thumbnail */
- jpeg_enc_src_img_type_t type;
-
- /* color format */
- mm_jpeg_color_format color_format;
-
- /* src img dimension */
- image_resolution src_dim;
-
- /* jpeg output dimension */
- image_resolution out_dim;
-
- /* crop information */
- image_crop_t crop;
-
- /* jpeg quality: range 0~100 */
- uint32_t quality;
-} src_image_buffer_info;
-
-typedef struct {
- uint8_t *buf_vaddr; /*ptr to buf*/
- int fd; /*fd of buf*/
- int buf_len;
-} out_image_buffer_info;
-
-typedef struct {
- /* num of src imgs: e.g. main/thumbnail img
- * if main img only: src_img_num = 1;
- * if main+thumbnail: src_img_num = 2;
- * No support for thumbnail only case */
- uint8_t src_img_num;
-
- /* index 0 is always for main image
- * if thumbnail presented, it will be in index 1 */
- src_image_buffer_info src_img[JPEG_SRC_IMAGE_TYPE_MAX];
-
- /* flag indicating if buffer is from video stream (special case for video-sized live snapshot) */
- uint8_t is_video_frame;
-} src_image_buffer_config;
-
-typedef struct {
- src_image_buffer_config src_imgs;
- out_image_buffer_info sink_img;
-} jpeg_image_buffer_config;
-
-typedef struct {
- /* config for scr images */
- jpeg_image_buffer_config buf_info;
-
- /* rotation informaiton */
- int rotation;
-
- /* num of exif entries */
- int exif_numEntries;
-
- /* buf to exif entries, caller needs to
- * take care of the memory manage with insider ptr */
- exif_tags_info_t *exif_data;
-
- /*for mobicat support*/
- const uint8_t * mobicat_data;
- int32_t mobicat_data_length;
- int hasmobicat;
-} mm_jpeg_encode_params;
-
-typedef enum {
- JPEG_JOB_STATUS_DONE = 0,
- JPEG_JOB_STATUS_ERROR
-} jpeg_job_status_t;
-
-typedef void (*jpeg_encode_callback_t)(jpeg_job_status_t status,
- uint8_t thumbnailDroppedFlag,
- uint32_t client_hdl,
- uint32_t jobId,
- uint8_t* out_data,
- uint32_t data_size,
- void *userData);
-
-typedef struct {
- mm_jpeg_encode_params encode_parm;
- jpeg_encode_callback_t jpeg_cb;
- void* userdata;
-} mm_jpeg_encode_job;
-
-typedef enum {
- JPEG_JOB_TYPE_ENCODE,
- //JPEG_JOB_TYPE_DECODE, /*enable decode later*/
- JPEG_JOB_TYPE_MAX
-} mm_jpeg_job_type_t;
-
-typedef struct {
- mm_jpeg_job_type_t job_type;
- union {
- mm_jpeg_encode_job encode_job;
- };
-} mm_jpeg_job;
-
-typedef struct {
- /* start a job -- async call
- * the result of job (DONE/ERROR) will rcvd through CB */
- int32_t (* start_job) (uint32_t client_hdl, mm_jpeg_job* job, uint32_t* jobId);
-
- /* abort a job -- sync call */
- int32_t (* abort_job) (uint32_t client_hdl, uint32_t jobId);
-
- /* close a jpeg client -- sync call */
- int32_t (* close) (uint32_t clientHdl);
-} mm_jpeg_ops_t;
-
-/* open a jpeg client -- sync call
- * returns client_handle.
- * failed if client_handle=0
- * jpeg ops tbl will be filled in if open succeeds */
-uint32_t jpeg_open(mm_jpeg_ops_t *ops);
-
-#endif /* MM_JPEG_INTERFACE_H_ */
-
-
+/* Copyright (c) 2012, The Linux Foundation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following + * disclaimer in the documentation and/or other materials provided + * with the distribution. + * * Neither the name of The Linux Foundation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS + * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR + * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE + * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN + * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef MM_JPEG_INTERFACE_H_ +#define MM_JPEG_INTERFACE_H_ +#include "QCamera_Intf.h" + +typedef struct { + int width; + int height; +} image_resolution; + +typedef enum { + JPEG_SRC_IMAGE_FMT_YUV, + JPEG_SRC_IMAGE_FMT_BITSTREAM +} jpeg_enc_src_img_fmt_t; + +typedef enum { + JPEG_SRC_IMAGE_TYPE_MAIN, + JPEG_SRC_IMAGE_TYPE_THUMB, + JPEG_SRC_IMAGE_TYPE_MAX +} jpeg_enc_src_img_type_t; + +typedef struct { + int32_t offset_x; + int32_t offset_y; + int32_t width; + int32_t height; +} image_crop_t; + +typedef struct { + uint8_t sequence; /*for jpeg bit streams, assembling is based on sequence. sequence starts from 0*/ + uint8_t *buf_vaddr; /*ptr to buf*/ + int fd; /*fd of buf*/ + uint32_t buf_size; /* total size of buf (header + image) */ + uint32_t data_offset; /*data offset*/ +} src_bitstream_buffer_t; + +typedef struct { + uint8_t *buf_vaddr; /*ptr to buf*/ + int fd; /*fd of buf*/ + cam_frame_len_offset_t offset; /*alway use multi-planar, offset is used to skip the metadata header*/ +} src_image_buffer_t; + +typedef enum { + MM_JPEG_COLOR_FORMAT_YCRCBLP_H2V2, + MM_JPEG_COLOR_FORMAT_YCBCRLP_H2V2, + MM_JPEG_COLOR_FORMAT_YCRCBLP_H2V1, + MM_JPEG_COLOR_FORMAT_YCBCRLP_H2V1, + MM_JPEG_COLOR_FORMAT_YCRCBLP_H1V2, + MM_JPEG_COLOR_FORMAT_YCBCRLP_H1V2, + MM_JPEG_COLOR_FORMAT_YCRCBLP_H1V1, + MM_JPEG_COLOR_FORMAT_YCBCRLP_H1V1, + MM_JPEG_COLOR_FORMAT_RGB565, + MM_JPEG_COLOR_FORMAT_RGB888, + MM_JPEG_COLOR_FORMAT_RGBa, + MM_JPEG_COLOR_FORMAT_BITSTREAM, + MM_JPEG_COLOR_FORMAT_MAX +} mm_jpeg_color_format; + +#define MAX_SRC_BUF_NUM 2 +typedef struct { + /* src img format: YUV, Bitstream */ + jpeg_enc_src_img_fmt_t img_fmt; + + /* num of buf in src img */ + uint8_t num_bufs; + + /* src img bufs */ + union { + src_bitstream_buffer_t bit_stream[MAX_SRC_BUF_NUM]; + src_image_buffer_t src_image[MAX_SRC_BUF_NUM]; + }; + + /* src img type: main or thumbnail */ + jpeg_enc_src_img_type_t type; + + /* color format */ + mm_jpeg_color_format color_format; + + /* src img dimension */ + image_resolution src_dim; + + /* jpeg output dimension */ + image_resolution out_dim; + + /* crop information */ + image_crop_t crop; + + /* jpeg quality: range 0~100 */ + uint32_t quality; +} src_image_buffer_info; + +typedef struct { + uint8_t *buf_vaddr; /*ptr to buf*/ + int fd; /*fd of buf*/ + int buf_len; +} out_image_buffer_info; + +typedef struct { + /* num of src imgs: e.g. main/thumbnail img + * if main img only: src_img_num = 1; + * if main+thumbnail: src_img_num = 2; + * No support for thumbnail only case */ + uint8_t src_img_num; + + /* index 0 is always for main image + * if thumbnail presented, it will be in index 1 */ + src_image_buffer_info src_img[JPEG_SRC_IMAGE_TYPE_MAX]; + + /* flag indicating if buffer is from video stream (special case for video-sized live snapshot) */ + uint8_t is_video_frame; +} src_image_buffer_config; + +typedef struct { + src_image_buffer_config src_imgs; + out_image_buffer_info sink_img; +} jpeg_image_buffer_config; + +typedef struct { + /* config for scr images */ + jpeg_image_buffer_config buf_info; + + /* rotation informaiton */ + int rotation; + + /* num of exif entries */ + int exif_numEntries; + + /* buf to exif entries, caller needs to + * take care of the memory manage with insider ptr */ + exif_tags_info_t *exif_data; + + /*for mobicat support*/ + const uint8_t * mobicat_data; + int32_t mobicat_data_length; + int hasmobicat; +} mm_jpeg_encode_params; + +typedef enum { + JPEG_JOB_STATUS_DONE = 0, + JPEG_JOB_STATUS_ERROR +} jpeg_job_status_t; + +typedef void (*jpeg_encode_callback_t)(jpeg_job_status_t status, + uint8_t thumbnailDroppedFlag, + uint32_t client_hdl, + uint32_t jobId, + uint8_t* out_data, + uint32_t data_size, + void *userData); + +typedef struct { + mm_jpeg_encode_params encode_parm; + jpeg_encode_callback_t jpeg_cb; + void* userdata; +} mm_jpeg_encode_job; + +typedef enum { + JPEG_JOB_TYPE_ENCODE, + //JPEG_JOB_TYPE_DECODE, /*enable decode later*/ + JPEG_JOB_TYPE_MAX +} mm_jpeg_job_type_t; + +typedef struct { + mm_jpeg_job_type_t job_type; + union { + mm_jpeg_encode_job encode_job; + }; +} mm_jpeg_job; + +typedef struct { + /* start a job -- async call + * the result of job (DONE/ERROR) will rcvd through CB */ + int32_t (* start_job) (uint32_t client_hdl, mm_jpeg_job* job, uint32_t* jobId); + + /* abort a job -- sync call */ + int32_t (* abort_job) (uint32_t client_hdl, uint32_t jobId); + + /* close a jpeg client -- sync call */ + int32_t (* close) (uint32_t clientHdl); +} mm_jpeg_ops_t; + +/* open a jpeg client -- sync call + * returns client_handle. + * failed if client_handle=0 + * jpeg ops tbl will be filled in if open succeeds */ +uint32_t jpeg_open(mm_jpeg_ops_t *ops); + +#endif /* MM_JPEG_INTERFACE_H_ */ + + diff --git a/camera/QCamera2/HAL/Android.mk b/camera/QCamera2/HAL/Android.mk index 29573a5..3a0ed2e 100644 --- a/camera/QCamera2/HAL/Android.mk +++ b/camera/QCamera2/HAL/Android.mk @@ -33,7 +33,6 @@ LOCAL_C_INCLUDES := \ $(LOCAL_PATH)/../stack/common \ frameworks/native/include/media/openmax \ $(call project-path-for,qcom-display)/libgralloc \ - $(call project-path-for,qcom-display)/libqdutils \ $(call project-path-for,qcom-media)/libstagefrighthw \ system/media/camera/include \ $(LOCAL_PATH)/../../mm-image-codec/qexif \ @@ -48,7 +47,7 @@ LOCAL_CFLAGS += -DUSE_KK_CODE endif #ifeq ($(TARGET_USE_VENDOR_CAMERA_EXT),true) -#LOCAL_C_INCLUDES += $(call project-path-for,qcom-display)/libgralloc +#LOCAL_C_INCLUDES += $(call project-path-for,qcom-display)/msm8974/libgralloc #else LOCAL_C_INCLUDES += $(call project-path-for,qcom-display)/libgralloc #endif @@ -57,7 +56,7 @@ LOCAL_C_INCLUDES += $(TARGET_OUT_INTERMEDIATES)/KERNEL_OBJ/usr/include/media LOCAL_ADDITIONAL_DEPENDENCIES := $(TARGET_OUT_INTERMEDIATES)/KERNEL_OBJ/usr LOCAL_SHARED_LIBRARIES := libcamera_client liblog libhardware libutils libcutils libdl -LOCAL_SHARED_LIBRARIES += libmmcamera_interface libmmjpeg_interface libqdMetaData +LOCAL_SHARED_LIBRARIES += libmmcamera_interface libmmjpeg_interface LOCAL_MODULE_RELATIVE_PATH := hw LOCAL_MODULE := camera.$(TARGET_BOARD_PLATFORM) diff --git a/camera/QCamera2/HAL/QCamera2HWI.cpp b/camera/QCamera2/HAL/QCamera2HWI.cpp index ed310a4..34be8c9 100644 --- a/camera/QCamera2/HAL/QCamera2HWI.cpp +++ b/camera/QCamera2/HAL/QCamera2HWI.cpp @@ -1305,17 +1305,6 @@ int QCamera2HardwareInterface::closeCamera() m_postprocessor.stop(); m_postprocessor.deinit(); - m_thermalAdapter.deinit(); - - // delete all channels if not already deleted - for (i = 0; i < QCAMERA_CH_TYPE_MAX; i++) { - if (m_channels[i] != NULL) { - m_channels[i]->stop(); - delete m_channels[i]; - m_channels[i] = NULL; - } - } - //free all pending api results here if(m_apiResultList != NULL) { api_result_list *apiResultList = m_apiResultList; @@ -1327,6 +1316,17 @@ int QCamera2HardwareInterface::closeCamera() } } + m_thermalAdapter.deinit(); + + // delete all channels if not already deleted + for (i = 0; i < QCAMERA_CH_TYPE_MAX; i++) { + if (m_channels[i] != NULL) { + m_channels[i]->stop(); + delete m_channels[i]; + m_channels[i] = NULL; + } + } + rc = mCameraHandle->ops->close_camera(mCameraHandle->camera_handle); mCameraHandle = NULL; CDBG_HIGH("%s: X", __func__); @@ -1713,17 +1713,14 @@ QCameraMemory *QCamera2HardwareInterface::allocateStreamBuf( stream_type); } else { cam_dimension_t dim; - int minFPS, maxFPS; QCameraGrallocMemory *grallocMemory = new QCameraGrallocMemory(mGetMemory); mParameters.getStreamDimension(stream_type, dim); - /* we are interested only in maxfps here */ - mParameters.getPreviewFpsRange(&minFPS, &maxFPS); if (grallocMemory) grallocMemory->setWindowInfo(mPreviewWindow, dim.width, dim.height, stride, scanline, - mParameters.getPreviewHalPixelFormat(), maxFPS); + mParameters.getPreviewHalPixelFormat()); mem = grallocMemory; } } @@ -1734,20 +1731,17 @@ QCameraMemory *QCamera2HardwareInterface::allocateStreamBuf( mem = new QCameraStreamMemory(mGetMemory, bCachedMem); } else { cam_dimension_t dim; - int minFPS, maxFPS; QCameraGrallocMemory *grallocMemory = new QCameraGrallocMemory(mGetMemory); mParameters.getStreamDimension(stream_type, dim); - /* we are interested only in maxfps here */ - mParameters.getPreviewFpsRange(&minFPS, &maxFPS); if (grallocMemory) { grallocMemory->setWindowInfo(mPreviewWindow, dim.width, dim.height, stride, scanline, - mParameters.getPreviewHalPixelFormat(), maxFPS); + mParameters.getPreviewHalPixelFormat()); } mem = grallocMemory; } @@ -3911,20 +3905,18 @@ int32_t QCamera2HardwareInterface::sendEvtNotify(int32_t msg_type, return m_cbNotifier.notifyCallback(cbArg); } -int32_t QCamera2HardwareInterface::processAEInfo(cam_ae_params_t &ae_params) +void QCamera2HardwareInterface::processAEInfo(cam_ae_params_t &ae_params) { pthread_mutex_lock(&m_parm_lock); mParameters.updateAEInfo(ae_params); pthread_mutex_unlock(&m_parm_lock); - return NO_ERROR; } -int32_t QCamera2HardwareInterface::processFocusPositionInfo(cam_focus_pos_info_t &cur_pos_info) +void QCamera2HardwareInterface::processFocusPositionInfo(cam_focus_pos_info_t &cur_pos_info) { pthread_mutex_lock(&m_parm_lock); mParameters.updateCurrentFocusPosition(cur_pos_info); pthread_mutex_unlock(&m_parm_lock); - return NO_ERROR; } /*=========================================================================== diff --git a/camera/QCamera2/HAL/QCamera2HWI.h b/camera/QCamera2/HAL/QCamera2HWI.h index 6f5517b..1f4f36d 100644 --- a/camera/QCamera2/HAL/QCamera2HWI.h +++ b/camera/QCamera2/HAL/QCamera2HWI.h @@ -382,8 +382,8 @@ private: int32_t processHDRData(cam_asd_hdr_scene_data_t hdr_scene); int32_t transAwbMetaToParams(cam_awb_params_t &awb_params); int32_t processAWBUpdate(cam_awb_params_t &awb_params); - int32_t processFocusPositionInfo(cam_focus_pos_info_t &cur_pos_info); - int32_t processAEInfo(cam_ae_params_t &ae_params); + void processFocusPositionInfo(cam_focus_pos_info_t &cur_pos_info); + void processAEInfo(cam_ae_params_t &ae_params); int32_t sendEvtNotify(int32_t msg_type, int32_t ext1, int32_t ext2); int32_t sendDataNotify(int32_t msg_type, diff --git a/camera/QCamera2/HAL/QCamera2HWICallbacks.cpp b/camera/QCamera2/HAL/QCamera2HWICallbacks.cpp index 476364e..7d693dc 100644 --- a/camera/QCamera2/HAL/QCamera2HWICallbacks.cpp +++ b/camera/QCamera2/HAL/QCamera2HWICallbacks.cpp @@ -1366,40 +1366,11 @@ void QCamera2HardwareInterface::metadata_stream_cb_routine(mm_camera_super_buf_t if(pMetaData->is_ae_params_valid) { pme->mExifParams.ae_params = pMetaData->ae_params; pme->mFlashNeeded = pMetaData->ae_params.flash_needed ? true : false; - qcamera_sm_internal_evt_payload_t *payload = - (qcamera_sm_internal_evt_payload_t *)malloc(sizeof(qcamera_sm_internal_evt_payload_t)); - if (NULL != payload) { - memset(payload, 0, sizeof(qcamera_sm_internal_evt_payload_t)); - payload->evt_type = QCAMERA_INTERNAL_EVT_AE_UPDATE; - payload->ae_data = pMetaData->ae_params; - int32_t rc = pme->processEvt(QCAMERA_SM_EVT_EVT_INTERNAL, payload); - if (rc != NO_ERROR) { - ALOGE("%s: processEvt ae_update failed", __func__); - free(payload); - payload = NULL; - } - } else { - ALOGE("%s: No memory for ae_update qcamera_sm_internal_evt_payload_t", __func__); - } + pme->processAEInfo(pMetaData->ae_params); } - if(pMetaData->is_awb_params_valid) { pme->mExifParams.awb_params = pMetaData->awb_params; - qcamera_sm_internal_evt_payload_t *payload = - (qcamera_sm_internal_evt_payload_t *)malloc(sizeof(qcamera_sm_internal_evt_payload_t)); - if (NULL != payload) { - memset(payload, 0, sizeof(qcamera_sm_internal_evt_payload_t)); - payload->evt_type = QCAMERA_INTERNAL_EVT_AWB_UPDATE; - payload->awb_data = pMetaData->awb_params; - int32_t rc = pme->processEvt(QCAMERA_SM_EVT_EVT_INTERNAL, payload); - if (rc != NO_ERROR) { - ALOGE("%s: processEvt awb_update failed", __func__); - free(payload); - payload = NULL; - } - } else { - ALOGE("%s: No memory for awb_update qcamera_sm_internal_evt_payload_t", __func__); - } + pme->transAwbMetaToParams(pMetaData->awb_params); } if(pMetaData->is_focus_valid) { pme->mExifParams.af_params = pMetaData->focus_data; @@ -1458,21 +1429,7 @@ void QCamera2HardwareInterface::metadata_stream_cb_routine(mm_camera_super_buf_t } if (pMetaData->is_focus_pos_info_valid) { - qcamera_sm_internal_evt_payload_t *payload = - (qcamera_sm_internal_evt_payload_t *)malloc(sizeof(qcamera_sm_internal_evt_payload_t)); - if (NULL != payload) { - memset(payload, 0, sizeof(qcamera_sm_internal_evt_payload_t)); - payload->evt_type = QCAMERA_INTERNAL_EVT_FOCUS_POS_UPDATE; - payload->focus_pos = pMetaData->cur_pos_info; - int32_t rc = pme->processEvt(QCAMERA_SM_EVT_EVT_INTERNAL, payload); - if (rc != NO_ERROR) { - ALOGE("%s: processEvt focus_pos_update failed", __func__); - free(payload); - payload = NULL; - } - } else { - ALOGE("%s: No memory for focus_pos_update qcamera_sm_internal_evt_payload_t", __func__); - } + pme->processFocusPositionInfo(pMetaData->cur_pos_info); } stream->bufDone(frame->buf_idx); diff --git a/camera/QCamera2/HAL/QCameraMem.cpp b/camera/QCamera2/HAL/QCameraMem.cpp index 06f25c5..0d795d9 100644 --- a/camera/QCamera2/HAL/QCameraMem.cpp +++ b/camera/QCamera2/HAL/QCameraMem.cpp @@ -1,4 +1,4 @@ -/* Copyright (c) 2012-2015, The Linux Foundataion. All rights reserved. +/* Copyright (c) 2012-2013, The Linux Foundataion. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are @@ -37,8 +37,6 @@ #include <utils/Trace.h> #include <gralloc_priv.h> #include <QComOMXMetadata.h> -#include <qdMetaData.h> - #include "QCamera2HWI.h" #include "QCameraMem.h" #include "QCameraParameters.h" @@ -1342,12 +1340,11 @@ QCameraGrallocMemory::~QCameraGrallocMemory() * @stride : stride of preview frame * @scanline: scanline of preview frame * @foramt : format of preview image - * @maxFPS : max fps of preview stream * * RETURN : none *==========================================================================*/ void QCameraGrallocMemory::setWindowInfo(preview_stream_ops_t *window, - int width, int height, int stride, int scanline, int format, int maxFPS) + int width, int height, int stride, int scanline, int format) { mWindow = window; mWidth = width; @@ -1355,32 +1352,6 @@ void QCameraGrallocMemory::setWindowInfo(preview_stream_ops_t *window, mStride = stride; mScanline = scanline; mFormat = format; - setMaxFPS(maxFPS); -} - -/*=========================================================================== - * FUNCTION : setMaxFPS - * - * DESCRIPTION: set max fps - * - * PARAMETERS : - * @maxFPS : max fps of preview stream - * - * RETURN : none - *==========================================================================*/ -void QCameraGrallocMemory::setMaxFPS(int maxFPS) -{ - /* input will be in multiples of 1000 */ - maxFPS = maxFPS/1000; - - /* set the lower cap to 30 always, otherwise MDP may result in underruns*/ - if (maxFPS < 30) { - maxFPS = 30; - } - - /* the new fps will be updated in metadata of the next frame enqueued to display*/ - mMaxFPS = maxFPS; - CDBG_HIGH("%s: Setting max fps %d to display", __func__, mMaxFPS); } /*=========================================================================== @@ -1545,8 +1516,6 @@ int QCameraGrallocMemory::allocate(uint8_t count, size_t /*size*/) mPrivateHandle[cnt] = (struct private_handle_t *)(*mBufferHandle[cnt]); - //update max fps info - setMetaData(mPrivateHandle[cnt], UPDATE_REFRESH_RATE, (void*)&mMaxFPS); mMemInfo[cnt].main_ion_fd = open("/dev/ion", O_RDONLY); if (mMemInfo[cnt].main_ion_fd < 0) { ALOGE("%s: failed: could not open ion device", __func__); diff --git a/camera/QCamera2/HAL/QCameraMem.h b/camera/QCamera2/HAL/QCameraMem.h index 52313e8..2349b17 100644 --- a/camera/QCamera2/HAL/QCameraMem.h +++ b/camera/QCamera2/HAL/QCameraMem.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2012-2015, The Linux Foundataion. All rights reserved. +/* Copyright (c) 2012-2013, The Linux Foundataion. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are @@ -219,19 +219,18 @@ public: virtual void *getPtr(uint32_t index) const; void setWindowInfo(preview_stream_ops_t *window, int width, int height, - int stride, int scanline, int format, int maxFPS); + int stride, int scanline, int format); // Enqueue/display buffer[index] onto the native window, // and dequeue one buffer from it. // Returns the buffer index of the dequeued buffer. int displayBuffer(uint32_t index); - void setMaxFPS(int maxFPS); private: buffer_handle_t *mBufferHandle[MM_CAMERA_MAX_NUM_FRAMES]; int mLocalFlag[MM_CAMERA_MAX_NUM_FRAMES]; struct private_handle_t *mPrivateHandle[MM_CAMERA_MAX_NUM_FRAMES]; preview_stream_ops_t *mWindow; - int mWidth, mHeight, mFormat, mStride, mScanline, mMaxFPS; + int mWidth, mHeight, mFormat, mStride, mScanline; camera_request_memory mGetMemory; camera_memory_t *mCameraMemory[MM_CAMERA_MAX_NUM_FRAMES]; int mMinUndequeuedBuffers; diff --git a/camera/QCamera2/HAL/QCameraPostProc.cpp b/camera/QCamera2/HAL/QCameraPostProc.cpp index 074265d..a4d2a6f 100755 --- a/camera/QCamera2/HAL/QCameraPostProc.cpp +++ b/camera/QCamera2/HAL/QCameraPostProc.cpp @@ -322,11 +322,7 @@ int32_t QCameraPostProcessor::start(QCameraChannel *pSrcChannel) if ( NULL != pSnapshotStream ) { mm_jpeg_encode_params_t encodeParam; memset(&encodeParam, 0, sizeof(mm_jpeg_encode_params_t)); - rc = getJpegEncodingConfig(encodeParam, pSnapshotStream, pThumbStream); - if (rc != NO_ERROR) { - ALOGE("%s: error getting encoding config", __func__); - return rc; - } + getJpegEncodingConfig(encodeParam, pSnapshotStream, pThumbStream); CDBG_HIGH("[KPI Perf] %s : call jpeg create_session", __func__); rc = mJpegHandle.create_session(mJpegClientHandle, @@ -491,9 +487,8 @@ int32_t QCameraPostProcessor::getJpegEncodingConfig(mm_jpeg_encode_params_t& enc if (thumb_stream == NULL) { thumb_stream = main_stream; - if (((90 == m_parent->getJpegRotation()) - || (270 == m_parent->getJpegRotation())) - && (m_parent->needRotationReprocess())) { + if ((90 == m_parent->getJpegRotation()) + || (270 == m_parent->getJpegRotation())) { IMG_SWAP(encode_parm.thumb_dim.dst_dim.width, encode_parm.thumb_dim.dst_dim.height); } @@ -1611,7 +1606,7 @@ int32_t QCameraPostProcessor::encodeData(qcamera_jpeg_data_t *jpeg_job_data, cbArg.cb_type = QCAMERA_DATA_CALLBACK; cbArg.msg_type = CAMERA_MSG_RAW_IMAGE; cbArg.data = mem; - cbArg.index = 0; + cbArg.index = 1; m_parent->m_cbNotifier.notifyCallback(cbArg); } if (NULL != m_parent->mNotifyCb && @@ -1639,11 +1634,7 @@ int32_t QCameraPostProcessor::encodeData(qcamera_jpeg_data_t *jpeg_job_data, // create jpeg encoding session mm_jpeg_encode_params_t encodeParam; memset(&encodeParam, 0, sizeof(mm_jpeg_encode_params_t)); - ret = getJpegEncodingConfig(encodeParam, main_stream, thumb_stream); - if (ret != NO_ERROR) { - ALOGE("%s: error getting encoding config", __func__); - return ret; - } + getJpegEncodingConfig(encodeParam, main_stream, thumb_stream); CDBG_HIGH("[KPI Perf] %s : call jpeg create_session", __func__); ret = mJpegHandle.create_session(mJpegClientHandle, &encodeParam, &mJpegSessionId); if (ret != NO_ERROR) { @@ -1825,9 +1816,8 @@ int32_t QCameraPostProcessor::encodeData(qcamera_jpeg_data_t *jpeg_job_data, thumb_stream = main_stream; thumb_frame = main_frame; - if (((90 == m_parent->getJpegRotation()) - || (270 == m_parent->getJpegRotation())) - && (m_parent->needRotationReprocess())) { + if ((90 == m_parent->getJpegRotation()) + || (270 == m_parent->getJpegRotation())) { IMG_SWAP(jpg_job.encode_job.thumb_dim.dst_dim.width, jpg_job.encode_job.thumb_dim.dst_dim.height); } diff --git a/camera/QCamera2/HAL/QCameraStateMachine.cpp b/camera/QCamera2/HAL/QCameraStateMachine.cpp index 3c9a772..84c780c 100644 --- a/camera/QCamera2/HAL/QCameraStateMachine.cpp +++ b/camera/QCamera2/HAL/QCameraStateMachine.cpp @@ -1244,12 +1244,6 @@ int32_t QCameraStateMachine::procEvtPreviewingState(qcamera_sm_evt_enum_t evt, case QCAMERA_INTERNAL_EVT_AWB_UPDATE: rc = m_parent->processAWBUpdate(internal_evt->awb_data); break; - case QCAMERA_INTERNAL_EVT_AE_UPDATE: - rc = m_parent->processAEInfo(internal_evt->ae_data); - break; - case QCAMERA_INTERNAL_EVT_FOCUS_POS_UPDATE: - rc = m_parent->processFocusPositionInfo(internal_evt->focus_pos); - break; default: ALOGE("%s: Invalid internal event %d in state(%d)", __func__, internal_evt->evt_type, m_state); @@ -1394,12 +1388,6 @@ int32_t QCameraStateMachine::procEvtPrepareSnapshotState(qcamera_sm_evt_enum_t e case QCAMERA_INTERNAL_EVT_AWB_UPDATE: rc = m_parent->processAWBUpdate(internal_evt->awb_data); break; - case QCAMERA_INTERNAL_EVT_AE_UPDATE: - rc = m_parent->processAEInfo(internal_evt->ae_data); - break; - case QCAMERA_INTERNAL_EVT_FOCUS_POS_UPDATE: - rc = m_parent->processFocusPositionInfo(internal_evt->focus_pos); - break; default: ALOGE("%s: Invalid internal event %d in state(%d)", @@ -1727,12 +1715,6 @@ int32_t QCameraStateMachine::procEvtPicTakingState(qcamera_sm_evt_enum_t evt, case QCAMERA_INTERNAL_EVT_AWB_UPDATE: rc = m_parent->processAWBUpdate(internal_evt->awb_data); break; - case QCAMERA_INTERNAL_EVT_AE_UPDATE: - rc = m_parent->processAEInfo(internal_evt->ae_data); - break; - case QCAMERA_INTERNAL_EVT_FOCUS_POS_UPDATE: - rc = m_parent->processFocusPositionInfo(internal_evt->focus_pos); - break; default: break; } @@ -2127,12 +2109,6 @@ int32_t QCameraStateMachine::procEvtRecordingState(qcamera_sm_evt_enum_t evt, case QCAMERA_INTERNAL_EVT_AWB_UPDATE: rc = m_parent->processAWBUpdate(internal_evt->awb_data); break; - case QCAMERA_INTERNAL_EVT_AE_UPDATE: - rc = m_parent->processAEInfo(internal_evt->ae_data); - break; - case QCAMERA_INTERNAL_EVT_FOCUS_POS_UPDATE: - rc = m_parent->processFocusPositionInfo(internal_evt->focus_pos); - break; default: break; } @@ -2474,12 +2450,6 @@ int32_t QCameraStateMachine::procEvtVideoPicTakingState(qcamera_sm_evt_enum_t ev case QCAMERA_INTERNAL_EVT_AWB_UPDATE: rc = m_parent->processAWBUpdate(internal_evt->awb_data); break; - case QCAMERA_INTERNAL_EVT_AE_UPDATE: - rc = m_parent->processAEInfo(internal_evt->ae_data); - break; - case QCAMERA_INTERNAL_EVT_FOCUS_POS_UPDATE: - rc = m_parent->processFocusPositionInfo(internal_evt->focus_pos); - break; default: break; } @@ -2866,12 +2836,6 @@ int32_t QCameraStateMachine::procEvtPreviewPicTakingState(qcamera_sm_evt_enum_t case QCAMERA_INTERNAL_EVT_AWB_UPDATE: rc = m_parent->processAWBUpdate(internal_evt->awb_data); break; - case QCAMERA_INTERNAL_EVT_AE_UPDATE: - rc = m_parent->processAEInfo(internal_evt->ae_data); - break; - case QCAMERA_INTERNAL_EVT_FOCUS_POS_UPDATE: - rc = m_parent->processFocusPositionInfo(internal_evt->focus_pos); - break; default: break; } diff --git a/camera/QCamera2/HAL/QCameraStateMachine.h b/camera/QCamera2/HAL/QCameraStateMachine.h index fcf3037..5da517e 100644 --- a/camera/QCamera2/HAL/QCameraStateMachine.h +++ b/camera/QCamera2/HAL/QCameraStateMachine.h @@ -144,8 +144,6 @@ typedef enum { QCAMERA_INTERNAL_EVT_CROP_INFO, // crop info QCAMERA_INTERNAL_EVT_ASD_UPDATE, // asd update result QCAMERA_INTERNAL_EVT_AWB_UPDATE, // awb update result - QCAMERA_INTERNAL_EVT_AE_UPDATE, // ae update result - QCAMERA_INTERNAL_EVT_FOCUS_POS_UPDATE, // focus position update result QCAMERA_INTERNAL_EVT_MAX } qcamera_internal_evt_type_t; @@ -159,8 +157,6 @@ typedef struct { cam_crop_data_t crop_data; cam_auto_scene_t asd_data; cam_awb_params_t awb_data; - cam_ae_params_t ae_data; - cam_focus_pos_info_t focus_pos; }; } qcamera_sm_internal_evt_payload_t; diff --git a/camera/QCamera2/stack/common/cam_types.h b/camera/QCamera2/stack/common/cam_types.h index 379f210..89a1f9c 100644 --- a/camera/QCamera2/stack/common/cam_types.h +++ b/camera/QCamera2/stack/common/cam_types.h @@ -1093,9 +1093,6 @@ typedef struct { uint8_t is_focus_pos_info_valid; cam_focus_pos_info_t cur_pos_info; - - /* Indication for Frame ID reset through recovery mechanism when bus overflow */ - uint8_t is_frame_id_reset; } cam_metadata_info_t; typedef enum { diff --git a/camera/QCamera2/stack/mm-camera-interface/src/mm_camera.c b/camera/QCamera2/stack/mm-camera-interface/src/mm_camera.c index 9440c7c..e0635b2 100644 --- a/camera/QCamera2/stack/mm-camera-interface/src/mm_camera.c +++ b/camera/QCamera2/stack/mm-camera-interface/src/mm_camera.c @@ -267,8 +267,7 @@ int32_t mm_camera_open(mm_camera_obj_t *my_obj) n_try--; my_obj->ctrl_fd = open(dev_name, O_RDWR | O_NONBLOCK); CDBG("%s: ctrl_fd = %d, errno == %d", __func__, my_obj->ctrl_fd, errno); - if((my_obj->ctrl_fd > 0) || (errno != EIO && errno != ETIMEDOUT) - || (n_try <= 0 )) { + if((my_obj->ctrl_fd > 0) || (errno != EIO) || (n_try <= 0 )) { CDBG_ERROR("%s: opened, break out while loop", __func__); break; } diff --git a/camera/QCamera2/stack/mm-camera-interface/src/mm_camera_channel.c b/camera/QCamera2/stack/mm-camera-interface/src/mm_camera_channel.c index 76b823d..fde5f93 100644 --- a/camera/QCamera2/stack/mm-camera-interface/src/mm_camera_channel.c +++ b/camera/QCamera2/stack/mm-camera-interface/src/mm_camera_channel.c @@ -1979,14 +1979,6 @@ int32_t mm_channel_handle_metadata( goto end; } - /* Flush all the OLD buffers if Frame ID is reset */ - if (metadata->is_frame_id_reset) { - CDBG_HIGH("%s: Flush all the old frames as frame ID is reset is_frame_id_reset=%d", - __func__, metadata->is_frame_id_reset); - mm_channel_superbuf_flush(ch_obj,queue, CAM_STREAM_TYPE_DEFAULT); - queue->expected_frame_id = 1; - } - if (metadata->is_meta_invalid) { CDBG_HIGH("meta invalid: Skipping meta frame_id = %d \n", metadata->meta_invalid_params.meta_frame_id); @@ -2083,7 +2075,6 @@ int32_t mm_channel_handle_metadata( ch_obj->need3ABracketing = FALSE; } } - CDBG("%s: queue->expected_frame_id = %d", __func__, queue->expected_frame_id); } end: return rc; @@ -2131,12 +2122,9 @@ int32_t mm_channel_superbuf_comp_and_enqueue( return -1; } - CDBG("%s: frame_idx = %d expected_frame_id = %d, match_cnt=%d", __func__, - buf_info->frame_idx, queue->expected_frame_id, queue->match_cnt); - if (mm_channel_util_seq_comp_w_rollover(buf_info->frame_idx, queue->expected_frame_id) < 0) { - CDBG_HIGH("%s: incoming buf is older than expected buf id, will discard it", __func__); + /* incoming buf is older than expected buf id, will discard it */ mm_channel_qbuf(ch_obj, buf_info->buf); return 0; } @@ -2237,7 +2225,7 @@ int32_t mm_channel_superbuf_comp_and_enqueue( } else { if ( ( queue->attr.max_unmatched_frames < unmatched_bundles ) && ( NULL == last_buf ) ) { - CDBG("%s, incoming frame is older than the last bundled one", __func__); + /* incoming frame is older than the last bundled one */ mm_channel_qbuf(ch_obj, buf_info->buf); } else { if ( queue->attr.max_unmatched_frames < unmatched_bundles ) { @@ -2255,8 +2243,7 @@ int32_t mm_channel_superbuf_comp_and_enqueue( free(node); free(super_buf); } - CDBG("%s, unmatched_bundles=%d insert the new frame at the appropriate position", - __func__, unmatched_bundles); + /* insert the new frame at the appropriate position. */ mm_channel_queue_node_t *new_buf = NULL; cam_node_t* new_node = NULL; |
