Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
40ae219
Hard-code project pathmap.
freshgiammi Dec 8, 2016
46741a1
clang: Disable multiple error warnings
freshgiammi Jan 17, 2017
c4b6a3a
QCamera2: Replace GNU old-style field designators with standard syntax
freshgiammi Oct 30, 2014
78b0c05
QCamera2: Fix some errors with CLANG compiling
freshgiammi Feb 7, 2017
bf75fd2
QCamera2: Opt out from CLANG for now.
freshgiammi Feb 7, 2017
b3a8a9f
Add missing parameters and fix build
AgentFabulous Feb 8, 2017
5ae5fe7
Add a typecast to allow comparing a signed and unsigned int
AgentFabulous Feb 8, 2017
8a4e7d3
QCamera2: Set common ints in shared header.
Aug 29, 2016
a6f3891
QCamera2: Wait for sensorservice initialization before opening camera
HighwayStar Mar 18, 2017
d9d5085
QCamera2: Use AOSP HAL paths
AgentFabulous Aug 20, 2017
5f12f30
mm-image-codec: Add missing liblog dependency
AgentFabulous Aug 20, 2017
231dd5c
QCamera2: HAL: Don't look for caf repos at all
AgentFabulous Aug 20, 2017
16f8e96
camera: We're using the msm8994 Display HAL
AgentFabulous Sep 3, 2017
90a9da4
camera: Upgrade library dependencies for AOSP 8.0.0
AdrianDC Sep 3, 2017
0b7f538
camera: Remove an unneeded header
AgentFabulous Sep 3, 2017
0d7097c
QCamera2: Correct user ptr returned when using request memory callback
billchen1977 Sep 8, 2017
e36702f
QCamera2: Move to vendor
jhenrique09 Sep 8, 2017
f41f65e
QCamera2: mm-camera-interface: Camera Daemon late start issue fix
Jun 29, 2017
3378f4b
camera: Fix build
ShivamKumarJha Dec 31, 2017
6c0a63c
camera: debug
ShivamKumarJha Jan 2, 2018
f9ed89f
camera: Add Morpho HDR
ShivamKumarJha Jan 2, 2018
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions QCamera/HAL/core/Android.mk
Original file line number Diff line number Diff line change
Expand Up @@ -105,9 +105,9 @@ 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

LOCAL_C_INCLUDES += hardware/qcom/display/libgralloc \
hardware/qcom/display/libgenlock \
hardware/qcom/media/libstagefrighthw
LOCAL_C_INCLUDES += hardware/qcom/display/msm8994/libgralloc \
hardware/qcom/display/msm8994/libgenlock \
hardware/qcom/media/msm8974/libstagefrighthw

# if debug service layer and up , use stub camera!
LOCAL_C_INCLUDES += \
Expand Down
2 changes: 1 addition & 1 deletion QCamera/HAL/core/src/QCameraHAL.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
/*#error uncomment this for compiler test!*/

//#define ALOG_NDEBUG 0
#define ALOG_NIDEBUG 0
#define ALOG_NIDEBUG 1
#define LOG_TAG "QCameraHAL"
#include <utils/Log.h>
#include <utils/threads.h>
Expand Down
2 changes: 1 addition & 1 deletion QCamera/HAL/core/src/QCameraHWI_Mem.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
/*#error uncomment this for compiler test!*/

//#define ALOG_NDEBUG 0
#define ALOG_NIDEBUG 0
#define ALOG_NIDEBUG 1
#define LOG_TAG "QCameraHWI_Mem"
#include <utils/Log.h>

Expand Down
2 changes: 1 addition & 1 deletion QCamera/HAL/core/src/QCameraHWI_Parm.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
*/

//#define ALOG_NDEBUG 0
#define ALOG_NIDEBUG 0
#define ALOG_NIDEBUG 1
#define LOG_TAG "QCameraHWI_Parm"
#include <utils/Log.h>

Expand Down
2 changes: 1 addition & 1 deletion QCamera/HAL/core/src/QCameraHWI_Record.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
/*#error uncomment this for compiler test!*/

//#define ALOG_NDEBUG 0
#define ALOG_NIDEBUG 0
#define ALOG_NIDEBUG 1
#define LOG_TAG "QCameraHWI_Record"
#include <utils/Log.h>
#include <utils/threads.h>
Expand Down
6 changes: 3 additions & 3 deletions QCamera/HAL/core/src/QCameraHWI_Still.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@

/*#error uncomment this for compiler test!*/

#define LOG_NDEBUG 0
#define LOG_NDDEBUG 0
#define LOG_NIDEBUG 0
#define LOG_NDEBUG 1
#define LOG_NDDEBUG 1
#define LOG_NIDEBUG 1
#define LOG_TAG "QCameraHWI_Still"
#include <utils/Log.h>
#include <utils/threads.h>
Expand Down
4 changes: 2 additions & 2 deletions QCamera/HAL/core/src/QCameraStream.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@

/*#error uncomment this for compiler test!*/

#define ALOG_NDEBUG 0
#define ALOG_NIDEBUG 0
#define ALOG_NDEBUG 1
#define ALOG_NIDEBUG 1
#define LOG_TAG __FILE__
#include <utils/Log.h>

Expand Down
2 changes: 1 addition & 1 deletion QCamera/HAL/usbcamcore/src/QCameraMjpegDecode.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
*/

//#define ALOG_NDEBUG 0
#define ALOG_NIDEBUG 0
#define ALOG_NIDEBUG 1
#define LOG_TAG "QCameraMjpegDecode"
#include <utils/Log.h>

Expand Down
2 changes: 1 addition & 1 deletion QCamera/HAL/usbcamcore/src/QCameraUsbParm.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
*/

//#define ALOG_NDEBUG 0
#define ALOG_NIDEBUG 0
#define ALOG_NIDEBUG 1
#define LOG_TAG "QCameraUsbParm"
#include <utils/Log.h>

Expand Down
2 changes: 1 addition & 1 deletion QCamera/HAL/usbcamcore/src/QualcommUsbCamera.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
*/
/*#error uncomment this for compiler test!*/
//#define ALOG_NDEBUG 0
#define ALOG_NIDEBUG 0
#define ALOG_NIDEBUG 1
#define LOG_TAG "QualcommUsbCamera"

#include <utils/Log.h>
Expand Down
2 changes: 1 addition & 1 deletion QCamera/HAL/wrapper/QualcommCamera.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
/*#error uncomment this for compiler test!*/

//#define ALOG_NDEBUG 0
#define ALOG_NIDEBUG 0
#define ALOG_NIDEBUG 1
#define LOG_TAG "QualcommCamera"
#include <utils/Log.h>
#include <utils/threads.h>
Expand Down
6 changes: 3 additions & 3 deletions QCamera/HAL2/core/Android.mk
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,9 @@ LOCAL_C_INCLUDES := \
$(LOCAL_PATH)/../../stack/mm-jpeg-interface/inc\
$(TARGET_OUT_INTERMEDIATES)/include/mm-camera-interface_badger \

LOCAL_C_INCLUDES += hardware/qcom/display/libgralloc \
hardware/qcom/display/libgenlock \
hardware/qcom/media/libstagefrighthw \
LOCAL_C_INCLUDES += hardware/qcom/display/msm8994/libgralloc \
hardware/qcom/display/msm8994/libgenlock \
hardware/qcom/media/msm8974/libstagefrighthw \
system/media/camera/include

# if debug service layer and up , use stub camera!
Expand Down
2 changes: 1 addition & 1 deletion QCamera/HAL2/core/src/QCameraHAL.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
/*#error uncomment this for compiler test!*/

//#define ALOG_NDEBUG 0
#define ALOG_NIDEBUG 0
#define ALOG_NIDEBUG 1
#define LOG_TAG "QCameraHAL"
#include <utils/Log.h>
#include <utils/threads.h>
Expand Down
2 changes: 1 addition & 1 deletion QCamera/HAL2/core/src/QCameraHWI.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

/*#error uncomment this for compiler test!*/

#define LOG_NIDEBUG 0
#define LOG_NIDEBUG 1
//#define LOG_NDEBUG 0

#define LOG_TAG "QCameraHWI"
Expand Down
4 changes: 2 additions & 2 deletions QCamera/HAL2/core/src/QCameraStream.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@

/*#error uncomment this for compiler test!*/

#define ALOG_NDEBUG 0
#define ALOG_NIDEBUG 0
#define ALOG_NDEBUG 1
#define ALOG_NIDEBUG 1
#define LOG_TAG __FILE__
#include <utils/Log.h>
#include <utils/threads.h>
Expand Down
2 changes: 1 addition & 1 deletion QCamera/HAL2/wrapper/QualcommCamera.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
/*#error uncomment this for compiler test!*/

//#define ALOG_NDEBUG 0
#define ALOG_NIDEBUG 0
#define ALOG_NIDEBUG 1
#define LOG_TAG "QualcommCamera"
#include <utils/Log.h>
#include <utils/threads.h>
Expand Down
2 changes: 1 addition & 1 deletion QCamera/stack/mm-camera-interface/Android.mk
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ LOCAL_C_INCLUDES += \
$(TARGET_OUT_HEADERS)/mm-still/mm-omx
# (END) Need to remove later once dependency on jpeg removed

LOCAL_C_INCLUDES+= hardware/qcom/media/mm-core/inc
LOCAL_C_INCLUDES+= hardware/qcom/media/msm8974/mm-core/inc
LOCAL_CFLAGS += -include bionic/libc/kernel/common/linux/socket.h
LOCAL_CFLAGS += -include bionic/libc/kernel/common/linux/un.h

Expand Down
23 changes: 14 additions & 9 deletions QCamera2/HAL/Android.mk
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,11 @@ LOCAL_SRC_FILES := \
wrapper/QualcommCamera.cpp

LOCAL_CFLAGS = -Wall
LOCAL_CLANG_CFLAGS += \
-Wno-error=unused-variable \
-Wno-error=sign-compare \
-Wno-error=unused-parameter \
-Wno-error=unused-private-field

LOCAL_CFLAGS += -DHAS_MULTIMEDIA_HINTS -DDEFAULT_ZSL_MODE_ON -DDEFAULT_DENOISE_MODE_ON -DCANCRO_CAMERA_HAL

Expand All @@ -42,9 +47,10 @@ endif

LOCAL_C_INCLUDES := \
$(LOCAL_PATH)/../stack/common \
framework/native/include \
frameworks/native/include/media/openmax \
hardware/qcom/display/libgralloc \
hardware/qcom/media/libstagefrighthw \
hardware/qcom/display/msm8994/libgralloc \
hardware/qcom/media/msm8974/libstagefrighthw \
$(LOCAL_PATH)/../../mm-image-codec/qexif \
$(LOCAL_PATH)/../../mm-image-codec/qomx_core \
$(LOCAL_PATH)/../util \
Expand All @@ -56,20 +62,19 @@ else
LOCAL_CFLAGS += -DUSE_KK_CODE
endif

ifeq ($(TARGET_USE_VENDOR_CAMERA_EXT),true)
LOCAL_C_INCLUDES += hardware/qcom/display/msm8974/libgralloc
else
LOCAL_C_INCLUDES += hardware/qcom/display/libgralloc
endif
LOCAL_C_INCLUDES += hardware/qcom/display/msm8994/libgralloc
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

LOCAL_SHARED_LIBRARIES := libcamera_client liblog libhardware libutils libcutils libdl
LOCAL_SHARED_LIBRARIES += libmmcamera_interface libmmjpeg_interface
LOCAL_SHARED_LIBRARIES := libcamera_client liblog libhardware libutils libcutils libdl libgui
LOCAL_SHARED_LIBRARIES += libmmcamera_interface libmmjpeg_interface libhidltransport libsensor [email protected]
LOCAL_STATIC_LIBRARIES := libarect

LOCAL_MODULE_PATH := $(TARGET_OUT_SHARED_LIBRARIES)/hw
LOCAL_PROPRIETARY_MODULE := true
LOCAL_MODULE := camera.$(TARGET_BOARD_PLATFORM)
LOCAL_CLANG := false
LOCAL_MODULE_TAGS := optional

include $(BUILD_SHARED_LIBRARY)
Expand Down
23 changes: 22 additions & 1 deletion QCamera2/HAL/QCamera2Factory.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
#include <stdlib.h>
#include <utils/Errors.h>
#include <hardware/camera.h>
#include <sensor/SensorManager.h>

#include "QCamera2Factory.h"

Expand Down Expand Up @@ -140,6 +141,14 @@ int QCamera2Factory::getCameraInfo(int camera_id, struct camera_info *info)
return rc;
}

bool QCamera2Factory::can_talk_to_sensormanager()
{
android::SensorManager& sensorManager(
android::SensorManager::getInstanceForPackage(android::String16("camera")));
android::Sensor const * const * sensorList;
return sensorManager.getSensorList(&sensorList) >= 0;
}

/*===========================================================================
* FUNCTION : cameraDeviceOpen
*
Expand All @@ -157,9 +166,21 @@ int QCamera2Factory::cameraDeviceOpen(int camera_id,
struct hw_device_t **hw_device)
{
int rc = NO_ERROR;

android::Mutex::Autolock lock(gCameraWrapperLock);

if (camera_id < 0 || camera_id >= mNumOfCameras)
return BAD_VALUE;

// mm-qcamera-daemon blocks until initialization of sensorservice
// and might miss V4L events generated by the HAL during that time,
// causing HAL initialization failures. Avoid those failures by waiting
// for sensorservice initialization before opening the HAL.
if (!can_talk_to_sensormanager()) {
ALOGE("Waiting for sensor service failed.");
return android::NO_INIT;
}

QCamera2HardwareInterface *hw = new QCamera2HardwareInterface((uint32_t)camera_id);
if (!hw) {
ALOGE("Allocation of hardware interface failed");
Expand Down Expand Up @@ -202,7 +223,7 @@ int QCamera2Factory::camera_device_open(
}

struct hw_module_methods_t QCamera2Factory::mModuleMethods = {
open: QCamera2Factory::camera_device_open,
.open = QCamera2Factory::camera_device_open,
};

}; // namespace qcamera
2 changes: 2 additions & 0 deletions QCamera2/HAL/QCamera2Factory.h
Original file line number Diff line number Diff line change
Expand Up @@ -53,12 +53,14 @@ class QCamera2Factory
int cameraDeviceOpen(int camera_id, struct hw_device_t **hw_device);
static int camera_device_open(const struct hw_module_t *module, const char *id,
struct hw_device_t **hw_device);
bool can_talk_to_sensormanager();

public:
static struct hw_module_methods_t mModuleMethods;

private:
int mNumOfCameras;
android::Mutex gCameraWrapperLock;
};

}; /*namespace qcamera*/
Expand Down
Loading