QCamera2: Resolve CLANG compilation errors

Resolve CLANG compilation errors

CRs-Fixed: 981949
Change-Id: Ibeaac796b5e5f0defae76a8ab9bd88d3d1e4c164
This commit is contained in:
Ranjith Kagathi Ananda 2016-03-01 20:47:59 -08:00 committed by Prateek Chaubey
parent c5e87c4791
commit 2792329531
30 changed files with 133 additions and 178 deletions

View file

@ -82,35 +82,35 @@ extern uint8_t gNumCameraSessions;
uint32_t QCamera2HardwareInterface::sNextJobId = 1; uint32_t QCamera2HardwareInterface::sNextJobId = 1;
camera_device_ops_t QCamera2HardwareInterface::mCameraOps = { camera_device_ops_t QCamera2HardwareInterface::mCameraOps = {
set_preview_window: QCamera2HardwareInterface::set_preview_window, .set_preview_window = QCamera2HardwareInterface::set_preview_window,
set_callbacks: QCamera2HardwareInterface::set_CallBacks, .set_callbacks = QCamera2HardwareInterface::set_CallBacks,
enable_msg_type: QCamera2HardwareInterface::enable_msg_type, .enable_msg_type = QCamera2HardwareInterface::enable_msg_type,
disable_msg_type: QCamera2HardwareInterface::disable_msg_type, .disable_msg_type = QCamera2HardwareInterface::disable_msg_type,
msg_type_enabled: QCamera2HardwareInterface::msg_type_enabled, .msg_type_enabled = QCamera2HardwareInterface::msg_type_enabled,
start_preview: QCamera2HardwareInterface::start_preview, .start_preview = QCamera2HardwareInterface::start_preview,
stop_preview: QCamera2HardwareInterface::stop_preview, .stop_preview = QCamera2HardwareInterface::stop_preview,
preview_enabled: QCamera2HardwareInterface::preview_enabled, .preview_enabled = QCamera2HardwareInterface::preview_enabled,
store_meta_data_in_buffers: QCamera2HardwareInterface::store_meta_data_in_buffers, .store_meta_data_in_buffers= QCamera2HardwareInterface::store_meta_data_in_buffers,
start_recording: QCamera2HardwareInterface::start_recording, .start_recording = QCamera2HardwareInterface::start_recording,
stop_recording: QCamera2HardwareInterface::stop_recording, .stop_recording = QCamera2HardwareInterface::stop_recording,
recording_enabled: QCamera2HardwareInterface::recording_enabled, .recording_enabled = QCamera2HardwareInterface::recording_enabled,
release_recording_frame: QCamera2HardwareInterface::release_recording_frame, .release_recording_frame = QCamera2HardwareInterface::release_recording_frame,
auto_focus: QCamera2HardwareInterface::auto_focus, .auto_focus = QCamera2HardwareInterface::auto_focus,
cancel_auto_focus: QCamera2HardwareInterface::cancel_auto_focus, .cancel_auto_focus = QCamera2HardwareInterface::cancel_auto_focus,
take_picture: QCamera2HardwareInterface::take_picture, .take_picture = QCamera2HardwareInterface::take_picture,
cancel_picture: QCamera2HardwareInterface::cancel_picture, .cancel_picture = QCamera2HardwareInterface::cancel_picture,
set_parameters: QCamera2HardwareInterface::set_parameters, .set_parameters = QCamera2HardwareInterface::set_parameters,
get_parameters: QCamera2HardwareInterface::get_parameters, .get_parameters = QCamera2HardwareInterface::get_parameters,
put_parameters: QCamera2HardwareInterface::put_parameters, .put_parameters = QCamera2HardwareInterface::put_parameters,
send_command: QCamera2HardwareInterface::send_command, .send_command = QCamera2HardwareInterface::send_command,
release: QCamera2HardwareInterface::release, .release = QCamera2HardwareInterface::release,
dump: QCamera2HardwareInterface::dump, .dump = QCamera2HardwareInterface::dump,
}; };
/*=========================================================================== /*===========================================================================
@ -1849,7 +1849,6 @@ int QCamera2HardwareInterface::openCamera(struct hw_device_t **hw_device)
*==========================================================================*/ *==========================================================================*/
int QCamera2HardwareInterface::openCamera() int QCamera2HardwareInterface::openCamera()
{ {
size_t i;
int32_t rc = NO_ERROR; int32_t rc = NO_ERROR;
char value[PROPERTY_VALUE_MAX]; char value[PROPERTY_VALUE_MAX];
@ -3104,7 +3103,6 @@ QCameraMemory *QCamera2HardwareInterface::allocateStreamUserBuf(
{ {
int rc = NO_ERROR; int rc = NO_ERROR;
QCameraMemory *mem = NULL; QCameraMemory *mem = NULL;
int bufferCnt = 0;
int size = 0; int size = 0;
if (streamInfo->streaming_mode != CAM_STREAMING_MODE_BATCH) { if (streamInfo->streaming_mode != CAM_STREAMING_MODE_BATCH) {
@ -5446,7 +5444,7 @@ int QCamera2HardwareInterface::putParameters(char *parms)
* none-zero failure code * none-zero failure code
*==========================================================================*/ *==========================================================================*/
int QCamera2HardwareInterface::sendCommand(int32_t command, int QCamera2HardwareInterface::sendCommand(int32_t command,
int32_t &arg1, int32_t &arg2) __unused int32_t &arg1, __unused int32_t &arg2)
{ {
int rc = NO_ERROR; int rc = NO_ERROR;
@ -6186,7 +6184,8 @@ int32_t QCamera2HardwareInterface::processRetroAECUnlock()
* NO_ERROR -- success * NO_ERROR -- success
* none-zero failure code * none-zero failure code
*==========================================================================*/ *==========================================================================*/
int32_t QCamera2HardwareInterface::processHDRData(cam_asd_hdr_scene_data_t hdr_scene) int32_t QCamera2HardwareInterface::processHDRData(
__unused cam_asd_hdr_scene_data_t hdr_scene)
{ {
int rc = NO_ERROR; int rc = NO_ERROR;
@ -6309,7 +6308,8 @@ int32_t QCamera2HardwareInterface::processPrepSnapshotDoneEvent(
* NO_ERROR -- success * NO_ERROR -- success
* none-zero failure code * none-zero failure code
*==========================================================================*/ *==========================================================================*/
int32_t QCamera2HardwareInterface::processASDUpdate(cam_auto_scene_t scene) int32_t QCamera2HardwareInterface::processASDUpdate(
__unused cam_auto_scene_t scene)
{ {
size_t data_len = sizeof(cam_auto_scene_t); size_t data_len = sizeof(cam_auto_scene_t);
size_t buffer_len = 1 *sizeof(int) //meta type size_t buffer_len = 1 *sizeof(int) //meta type
@ -7883,8 +7883,8 @@ int32_t QCamera2HardwareInterface::preparePreview()
bool recordingHint = mParameters.getRecordingHintValue(); bool recordingHint = mParameters.getRecordingHintValue();
if(!isRdiMode() && recordingHint) { if(!isRdiMode() && recordingHint) {
//stop face detection,longshot,etc if turned ON in Camera mode //stop face detection,longshot,etc if turned ON in Camera mode
int32_t arg; //dummy arg
#ifndef VANILLA_HAL #ifndef VANILLA_HAL
int32_t arg; //dummy arg
if (isLongshotEnabled()) { if (isLongshotEnabled()) {
sendCommand(CAMERA_CMD_LONGSHOT_OFF, arg, arg); sendCommand(CAMERA_CMD_LONGSHOT_OFF, arg, arg);
} }
@ -8335,7 +8335,8 @@ void QCamera2HardwareInterface::returnStreamBuffer(void *data,
* NO_ERROR -- success * NO_ERROR -- success
* none-zero failure code * none-zero failure code
*==========================================================================*/ *==========================================================================*/
int32_t QCamera2HardwareInterface::processHistogramStats(cam_hist_stats_t &stats_data) int32_t QCamera2HardwareInterface::processHistogramStats(
__unused cam_hist_stats_t &stats_data)
{ {
#ifndef VANILLA_HAL #ifndef VANILLA_HAL
if (!mParameters.isHistogramEnabled()) { if (!mParameters.isHistogramEnabled()) {

View file

@ -70,7 +70,6 @@ void QCamera2HardwareInterface::zsl_channel_cb(mm_camera_super_buf_t *recvd_fram
LOGH("[KPI Perf]: E"); LOGH("[KPI Perf]: E");
char value[PROPERTY_VALUE_MAX]; char value[PROPERTY_VALUE_MAX];
bool dump_raw = false; bool dump_raw = false;
bool dump_yuv = false;
bool log_matching = false; bool log_matching = false;
QCamera2HardwareInterface *pme = (QCamera2HardwareInterface *)userdata; QCamera2HardwareInterface *pme = (QCamera2HardwareInterface *)userdata;
if (pme == NULL || if (pme == NULL ||
@ -385,7 +384,6 @@ void QCamera2HardwareInterface::capture_channel_cb_routine(mm_camera_super_buf_t
KPI_ATRACE_CALL(); KPI_ATRACE_CALL();
char value[PROPERTY_VALUE_MAX]; char value[PROPERTY_VALUE_MAX];
LOGH("[KPI Perf]: E PROFILE_YUV_CB_TO_HAL"); LOGH("[KPI Perf]: E PROFILE_YUV_CB_TO_HAL");
bool dump_yuv = false;
QCamera2HardwareInterface *pme = (QCamera2HardwareInterface *)userdata; QCamera2HardwareInterface *pme = (QCamera2HardwareInterface *)userdata;
if (pme == NULL || if (pme == NULL ||
pme->mCameraHandle == NULL || pme->mCameraHandle == NULL ||
@ -2542,7 +2540,7 @@ void QCamera2HardwareInterface::dumpJpegToFile(const void *data,
snprintf(buf, sizeof(buf), QCAMERA_DUMP_FRM_LOCATION "%d_%d.jpg", snprintf(buf, sizeof(buf), QCAMERA_DUMP_FRM_LOCATION "%d_%d.jpg",
mDumpFrmCnt, index); mDumpFrmCnt, index);
if (true == m_bIntJpegEvtPending) { if (true == m_bIntJpegEvtPending) {
strlcpy(m_BackendFileName, buf, sizeof(buf)); strlcpy(m_BackendFileName, buf, QCAMERA_MAX_FILEPATH_LENGTH);
mBackendFileSize = size; mBackendFileSize = size;
} }

View file

@ -1379,7 +1379,6 @@ int32_t QCameraReprocessChannel::doReprocessOffline(mm_camera_super_buf_t *frame
mm_camera_buf_def_t *meta_buf, QCameraParametersIntf &mParameter) mm_camera_buf_def_t *meta_buf, QCameraParametersIntf &mParameter)
{ {
int32_t rc = 0; int32_t rc = 0;
OfflineBuffer mappedBuffer;
QCameraStream *pStream = NULL; QCameraStream *pStream = NULL;
if (mStreams.size() < 1) { if (mStreams.size() < 1) {

View file

@ -1052,7 +1052,7 @@ int QCameraMetadataStreamMemory::getRegFlags(uint8_t *regFlags) const
QCameraStreamMemory::QCameraStreamMemory(camera_request_memory memory, QCameraStreamMemory::QCameraStreamMemory(camera_request_memory memory,
bool cached, bool cached,
QCameraMemoryPool *pool, QCameraMemoryPool *pool,
cam_stream_type_t streamType, cam_stream_buf_type bufType) cam_stream_type_t streamType, __unused cam_stream_buf_type bufType)
:QCameraMemory(cached, pool, streamType), :QCameraMemory(cached, pool, streamType),
mGetMemory(memory) mGetMemory(memory)
{ {
@ -1982,7 +1982,6 @@ int QCameraGrallocMemory::displayBuffer(uint32_t index)
int32_t QCameraGrallocMemory::enqueueBuffer(uint32_t index, nsecs_t timeStamp) int32_t QCameraGrallocMemory::enqueueBuffer(uint32_t index, nsecs_t timeStamp)
{ {
int32_t err = NO_ERROR; int32_t err = NO_ERROR;
int32_t dequeuedIdx = BAD_INDEX;
if (BUFFER_NOT_OWNED == mLocalFlag[index]) { if (BUFFER_NOT_OWNED == mLocalFlag[index]) {
LOGE("buffer to be enqueued is not owned"); LOGE("buffer to be enqueued is not owned");
@ -2023,7 +2022,6 @@ int32_t QCameraGrallocMemory::dequeueBuffer()
int32_t dequeuedIdx = BAD_INDEX; int32_t dequeuedIdx = BAD_INDEX;
buffer_handle_t *buffer_handle = NULL; buffer_handle_t *buffer_handle = NULL;
int32_t stride = 0; int32_t stride = 0;
uint8_t dequeueCnt = 1;
dequeuedIdx = BAD_INDEX; dequeuedIdx = BAD_INDEX;
err = mWindow->dequeue_buffer(mWindow, &buffer_handle, &stride); err = mWindow->dequeue_buffer(mWindow, &buffer_handle, &stride);

View file

@ -128,7 +128,6 @@ QCameraMuxer::QCameraMuxer(uint32_t num_of_cameras)
m_pPhyCamera(NULL), m_pPhyCamera(NULL),
m_pLogicalCamera(NULL), m_pLogicalCamera(NULL),
m_pCallbacks(NULL), m_pCallbacks(NULL),
m_bDualCameraEnabled(FALSE),
m_bAuxCameraExposed(FALSE), m_bAuxCameraExposed(FALSE),
m_nPhyCameras(num_of_cameras), m_nPhyCameras(num_of_cameras),
m_nLogicalCameras(0), m_nLogicalCameras(0),
@ -246,7 +245,7 @@ int QCameraMuxer::get_camera_info(int camera_id, struct camera_info *info)
* NO_ERROR : success * NO_ERROR : success
* other: non-zero failure code * other: non-zero failure code
*==========================================================================*/ *==========================================================================*/
int QCameraMuxer::set_callbacks(const camera_module_callbacks_t *callbacks) int QCameraMuxer::set_callbacks(__unused const camera_module_callbacks_t *callbacks)
{ {
// Not implemented // Not implemented
return NO_ERROR; return NO_ERROR;
@ -268,7 +267,7 @@ int QCameraMuxer::set_callbacks(const camera_module_callbacks_t *callbacks)
* other: non-zero failure code * other: non-zero failure code
*==========================================================================*/ *==========================================================================*/
int QCameraMuxer::camera_device_open( int QCameraMuxer::camera_device_open(
const struct hw_module_t *module, const char *id, __unused const struct hw_module_t *module, const char *id,
struct hw_device_t **hw_device) struct hw_device_t **hw_device)
{ {
int rc = NO_ERROR; int rc = NO_ERROR;
@ -299,8 +298,8 @@ int QCameraMuxer::camera_device_open(
* BAD_VALUE : Invalid Camera ID * BAD_VALUE : Invalid Camera ID
* other: non-zero failure code * other: non-zero failure code
*==========================================================================*/ *==========================================================================*/
int QCameraMuxer::open_legacy(const struct hw_module_t* module, int QCameraMuxer::open_legacy(__unused const struct hw_module_t* module,
const char* id, uint32_t halVersion, struct hw_device_t** hw_device) const char* id, __unused uint32_t halVersion, struct hw_device_t** hw_device)
{ {
int rc = NO_ERROR; int rc = NO_ERROR;
LOGH("id= %d", atoi(id)); LOGH("id= %d", atoi(id));
@ -1440,7 +1439,6 @@ char* QCameraMuxer::get_parameters(struct camera_device * device)
return NULL; return NULL;
char* ret = NULL; char* ret = NULL;
int rc = NO_ERROR;
qcamera_physical_descriptor_t *pCam = NULL; qcamera_physical_descriptor_t *pCam = NULL;
qcamera_logical_descriptor_t *cam = gMuxer->getLogicalCamera(device); qcamera_logical_descriptor_t *cam = gMuxer->getLogicalCamera(device);
if (!cam) { if (!cam) {
@ -1753,7 +1751,6 @@ int QCameraMuxer::setupLogicalCameras()
int rc = NO_ERROR; int rc = NO_ERROR;
char prop[PROPERTY_VALUE_MAX]; char prop[PROPERTY_VALUE_MAX];
int i = 0; int i = 0;
camera_info info;
int primaryType = CAM_TYPE_MAIN; int primaryType = CAM_TYPE_MAIN;
LOGH("[%d] E: rc = %d", rc); LOGH("[%d] E: rc = %d", rc);
@ -1909,7 +1906,7 @@ int QCameraMuxer::getNumberOfCameras()
* none-zero failure code * none-zero failure code
*==========================================================================*/ *==========================================================================*/
int QCameraMuxer::getCameraInfo(int camera_id, int QCameraMuxer::getCameraInfo(int camera_id,
struct camera_info *info, cam_sync_type_t *p_cam_type) struct camera_info *info, __unused cam_sync_type_t *p_cam_type)
{ {
int rc = NO_ERROR; int rc = NO_ERROR;
LOGH("E, camera_id = %d", camera_id); LOGH("E, camera_id = %d", camera_id);
@ -2259,7 +2256,6 @@ int32_t QCameraMuxer::sendEvtNotify(int32_t msg_type, int32_t ext1,
int32_t ext2) int32_t ext2)
{ {
LOGH("E"); LOGH("E");
int rc = NO_ERROR;
CHECK_MUXER_ERROR(); CHECK_MUXER_ERROR();
@ -2434,7 +2430,7 @@ void QCameraMuxer::composeMpo(cam_compose_jpeg_info_t* main_Jpeg,
* *
* RETURN : true or false based on whether match was successful or not * RETURN : true or false based on whether match was successful or not
*==========================================================================*/ *==========================================================================*/
bool QCameraMuxer::matchFrameId(void *data, void *user_data, bool QCameraMuxer::matchFrameId(void *data, __unused void *user_data,
void *match_data) void *match_data)
{ {
LOGH("E"); LOGH("E");
@ -2461,7 +2457,7 @@ bool QCameraMuxer::matchFrameId(void *data, void *user_data,
* *
* RETURN : true or false based on whether match was successful or not * RETURN : true or false based on whether match was successful or not
*==========================================================================*/ *==========================================================================*/
bool QCameraMuxer::findPreviousJpegs(void *data, void *user_data, bool QCameraMuxer::findPreviousJpegs(void *data, __unused void *user_data,
void *match_data) void *match_data)
{ {
LOGH("E"); LOGH("E");
@ -2487,7 +2483,7 @@ bool QCameraMuxer::findPreviousJpegs(void *data, void *user_data,
* *
* RETURN : None * RETURN : None
*==========================================================================*/ *==========================================================================*/
void QCameraMuxer::releaseJpegInfo(void *data, void *user_data) void QCameraMuxer::releaseJpegInfo(void *data, __unused void *user_data)
{ {
LOGH("E"); LOGH("E");
@ -2512,7 +2508,7 @@ void QCameraMuxer::releaseJpegInfo(void *data, void *user_data)
* *
* RETURN : void* to thread * RETURN : void* to thread
*==========================================================================*/ *==========================================================================*/
void* QCameraMuxer::composeMpoRoutine(void *data) void* QCameraMuxer::composeMpoRoutine(__unused void *data)
{ {
LOGH("E"); LOGH("E");
if (!gMuxer) { if (!gMuxer) {
@ -2525,7 +2521,6 @@ void* QCameraMuxer::composeMpoRoutine(void *data)
uint8_t is_active = FALSE; uint8_t is_active = FALSE;
QCameraCmdThread *cmdThread = &gMuxer->m_ComposeMpoTh; QCameraCmdThread *cmdThread = &gMuxer->m_ComposeMpoTh;
cmdThread->setName("CAM_ComposeMpo"); cmdThread->setName("CAM_ComposeMpo");
char saveName[PROPERTY_VALUE_MAX];
do { do {
do { do {
@ -2790,35 +2785,35 @@ int32_t QCameraMuxer::storeJpeg(cam_sync_type_t cam_type,
// Muxer Ops // Muxer Ops
camera_device_ops_t QCameraMuxer::mCameraMuxerOps = { camera_device_ops_t QCameraMuxer::mCameraMuxerOps = {
set_preview_window: QCameraMuxer::set_preview_window, .set_preview_window = QCameraMuxer::set_preview_window,
set_callbacks: QCameraMuxer::set_callBacks, .set_callbacks = QCameraMuxer::set_callBacks,
enable_msg_type: QCameraMuxer::enable_msg_type, .enable_msg_type = QCameraMuxer::enable_msg_type,
disable_msg_type: QCameraMuxer::disable_msg_type, .disable_msg_type = QCameraMuxer::disable_msg_type,
msg_type_enabled: QCameraMuxer::msg_type_enabled, .msg_type_enabled = QCameraMuxer::msg_type_enabled,
start_preview: QCameraMuxer::start_preview, .start_preview = QCameraMuxer::start_preview,
stop_preview: QCameraMuxer::stop_preview, .stop_preview = QCameraMuxer::stop_preview,
preview_enabled: QCameraMuxer::preview_enabled, .preview_enabled = QCameraMuxer::preview_enabled,
store_meta_data_in_buffers: QCameraMuxer::store_meta_data_in_buffers, .store_meta_data_in_buffers= QCameraMuxer::store_meta_data_in_buffers,
start_recording: QCameraMuxer::start_recording, .start_recording = QCameraMuxer::start_recording,
stop_recording: QCameraMuxer::stop_recording, .stop_recording = QCameraMuxer::stop_recording,
recording_enabled: QCameraMuxer::recording_enabled, .recording_enabled = QCameraMuxer::recording_enabled,
release_recording_frame: QCameraMuxer::release_recording_frame, .release_recording_frame = QCameraMuxer::release_recording_frame,
auto_focus: QCameraMuxer::auto_focus, .auto_focus = QCameraMuxer::auto_focus,
cancel_auto_focus: QCameraMuxer::cancel_auto_focus, .cancel_auto_focus = QCameraMuxer::cancel_auto_focus,
take_picture: QCameraMuxer::take_picture, .take_picture = QCameraMuxer::take_picture,
cancel_picture: QCameraMuxer::cancel_picture, .cancel_picture = QCameraMuxer::cancel_picture,
set_parameters: QCameraMuxer::set_parameters, .set_parameters = QCameraMuxer::set_parameters,
get_parameters: QCameraMuxer::get_parameters, .get_parameters = QCameraMuxer::get_parameters,
put_parameters: QCameraMuxer::put_parameters, .put_parameters = QCameraMuxer::put_parameters,
send_command: QCameraMuxer::send_command, .send_command = QCameraMuxer::send_command,
release: QCameraMuxer::release, .release = QCameraMuxer::release,
dump: QCameraMuxer::dump, .dump = QCameraMuxer::dump,
}; };

View file

@ -221,7 +221,6 @@ private:
qcamera_physical_descriptor_t *m_pPhyCamera; qcamera_physical_descriptor_t *m_pPhyCamera;
qcamera_logical_descriptor_t *m_pLogicalCamera; qcamera_logical_descriptor_t *m_pLogicalCamera;
const camera_module_callbacks_t *m_pCallbacks; const camera_module_callbacks_t *m_pCallbacks;
bool m_bDualCameraEnabled;
bool m_bAuxCameraExposed; bool m_bAuxCameraExposed;
uint8_t m_nPhyCameras; uint8_t m_nPhyCameras;
uint8_t m_nLogicalCameras; uint8_t m_nLogicalCameras;

View file

@ -7407,7 +7407,6 @@ int32_t QCameraParameters::configureAEBracketing(cam_capture_frame_config_t &fra
int32_t QCameraParameters::configureLowLight(cam_capture_frame_config_t &frame_config) int32_t QCameraParameters::configureLowLight(cam_capture_frame_config_t &frame_config)
{ {
int32_t rc = NO_ERROR; int32_t rc = NO_ERROR;
uint32_t i = 0;
frame_config.num_batch = 1; frame_config.num_batch = 1;
frame_config.configs[0].num_frames = getNumOfSnapshots(); frame_config.configs[0].num_frames = getNumOfSnapshots();
@ -7552,7 +7551,7 @@ int32_t QCameraParameters::configFrameCapture(bool commitSettings)
*==========================================================================*/ *==========================================================================*/
int32_t QCameraParameters::resetFrameCapture(bool commitSettings) int32_t QCameraParameters::resetFrameCapture(bool commitSettings)
{ {
int32_t rc = NO_ERROR, i = 0; int32_t rc = NO_ERROR;
memset(&m_captureFrameConfig, 0, sizeof(cam_capture_frame_config_t)); memset(&m_captureFrameConfig, 0, sizeof(cam_capture_frame_config_t));
if (commitSettings) { if (commitSettings) {
@ -8241,12 +8240,13 @@ int32_t QCameraParameters::parseGains(const char *gainStr, double &r_gain,
{ {
int32_t rc = NO_ERROR; int32_t rc = NO_ERROR;
char *saveptr = NULL; char *saveptr = NULL;
char* gains = (char*) calloc(1, strlen(gainStr) + 1); size_t gains_size = strlen(gainStr) + 1;
char* gains = (char*) calloc(1, gains_size);
if (NULL == gains) { if (NULL == gains) {
LOGE("No memory for gains"); LOGE("No memory for gains");
return NO_MEMORY; return NO_MEMORY;
} }
strlcpy(gains, gainStr, strlen(gainStr) + 1); strlcpy(gains, gainStr, gains_size);
char *token = strtok_r(gains, ",", &saveptr); char *token = strtok_r(gains, ",", &saveptr);
if (NULL != token) { if (NULL != token) {
@ -10731,7 +10731,7 @@ int32_t QCameraParameters::getExifGpsProcessingMethod(char *gpsProcessingMethod,
if(str != NULL) { if(str != NULL) {
memcpy(gpsProcessingMethod, ExifAsciiPrefix, EXIF_ASCII_PREFIX_SIZE); memcpy(gpsProcessingMethod, ExifAsciiPrefix, EXIF_ASCII_PREFIX_SIZE);
count = EXIF_ASCII_PREFIX_SIZE; count = EXIF_ASCII_PREFIX_SIZE;
strlcpy(gpsProcessingMethod + EXIF_ASCII_PREFIX_SIZE, str, strlen(str)+1); strlcpy(gpsProcessingMethod + EXIF_ASCII_PREFIX_SIZE, str, GPS_PROCESSING_METHOD_SIZE);
count += (uint32_t)strlen(str); count += (uint32_t)strlen(str);
gpsProcessingMethod[count++] = '\0'; // increase 1 for the last NULL char gpsProcessingMethod[count++] = '\0'; // increase 1 for the last NULL char
return NO_ERROR; return NO_ERROR;
@ -11847,7 +11847,6 @@ int32_t QCameraParameters::commitParamChanges()
QCameraParameters::QCameraReprocScaleParam::QCameraReprocScaleParam() QCameraParameters::QCameraReprocScaleParam::QCameraReprocScaleParam()
: mScaleEnabled(false), : mScaleEnabled(false),
mIsUnderScaling(false), mIsUnderScaling(false),
mScaleDirection(0),
mNeedScaleCnt(0), mNeedScaleCnt(0),
mSensorSizeTblCnt(0), mSensorSizeTblCnt(0),
mSensorSizeTbl(NULL), mSensorSizeTbl(NULL),
@ -13462,7 +13461,7 @@ void QCameraParameters::setVideoBatchSize()
* *
* RETURN : error value * RETURN : error value
*==========================================================================*/ *==========================================================================*/
int32_t QCameraParameters::setCustomParams(const QCameraParameters& params) int32_t QCameraParameters::setCustomParams(__unused const QCameraParameters& params)
{ {
int32_t rc = NO_ERROR; int32_t rc = NO_ERROR;
@ -13931,9 +13930,9 @@ int32_t QCameraParameters::getPicSizeFromAPK(int &width, int &height)
* NO_ERROR -- success * NO_ERROR -- success
* none-zero failure code * none-zero failure code
*==========================================================================*/ *==========================================================================*/
int32_t QCameraParameters::setDualLedCalibration(const QCameraParameters& params) int32_t QCameraParameters::setDualLedCalibration(
__unused const QCameraParameters& params)
{ {
int32_t rc = NO_ERROR;
char value[PROPERTY_VALUE_MAX]; char value[PROPERTY_VALUE_MAX];
int32_t calibration = 0; int32_t calibration = 0;

View file

@ -90,7 +90,6 @@ private:
bool mScaleEnabled; bool mScaleEnabled;
bool mIsUnderScaling; //if in scale status bool mIsUnderScaling; //if in scale status
bool mScaleDirection; // 0: Upscaling; 1: Downscaling
// picture size cnt that need scale operation // picture size cnt that need scale operation
size_t mNeedScaleCnt; size_t mNeedScaleCnt;
@ -1130,7 +1129,6 @@ private:
bool m_bHfrMode; bool m_bHfrMode;
bool m_bSensorHDREnabled; // if HDR is enabled bool m_bSensorHDREnabled; // if HDR is enabled
bool m_bRdiMode; // if RDI mode bool m_bRdiMode; // if RDI mode
bool m_bUbiRefocus;
bool m_bSecureMode; bool m_bSecureMode;
bool m_bAeBracketingEnabled; bool m_bAeBracketingEnabled;
int32_t mFlashValue; int32_t mFlashValue;

View file

@ -576,7 +576,6 @@ int32_t QCameraPostProcessor::getJpegEncodingConfig(mm_jpeg_encode_params_t& enc
dst_dim.width, dst_dim.height); dst_dim.width, dst_dim.height);
if (m_bThumbnailNeeded == TRUE) { if (m_bThumbnailNeeded == TRUE) {
uint32_t jpeg_rotation = m_parent->mParameters.getJpegRotation();
m_parent->getThumbnailSize(encode_parm.thumb_dim.dst_dim); m_parent->getThumbnailSize(encode_parm.thumb_dim.dst_dim);
if (thumb_stream == NULL) { if (thumb_stream == NULL) {
@ -910,8 +909,6 @@ mm_camera_buf_def_t *QCameraPostProcessor::getOfflinePPInputBuffer(
*==========================================================================*/ *==========================================================================*/
int32_t QCameraPostProcessor::processData(mm_camera_super_buf_t *frame) int32_t QCameraPostProcessor::processData(mm_camera_super_buf_t *frame)
{ {
QCameraChannel *m_pReprocChannel = NULL;
if (m_bInited == FALSE) { if (m_bInited == FALSE) {
LOGE("postproc not initialized yet"); LOGE("postproc not initialized yet");
return UNKNOWN_ERROR; return UNKNOWN_ERROR;
@ -3014,7 +3011,6 @@ int32_t QCameraPostProcessor::doReprocess()
QCameraStream *pMetaStream = NULL; QCameraStream *pMetaStream = NULL;
uint8_t meta_buf_index = 0; uint8_t meta_buf_index = 0;
mm_camera_buf_def_t *meta_buf = NULL; mm_camera_buf_def_t *meta_buf = NULL;
bool found_meta = FALSE;
mm_camera_super_buf_t *ppInputFrame = NULL; mm_camera_super_buf_t *ppInputFrame = NULL;
qcamera_pp_data_t *ppreq_job = (qcamera_pp_data_t *)m_inputPPQ.peek(); qcamera_pp_data_t *ppreq_job = (qcamera_pp_data_t *)m_inputPPQ.peek();

View file

@ -533,7 +533,7 @@ void QCameraStream::deleteStream()
* none-zero failure code * none-zero failure code
*==========================================================================*/ *==========================================================================*/
int32_t QCameraStream::unMapBuf(QCameraMemory *Buf, int32_t QCameraStream::unMapBuf(QCameraMemory *Buf,
cam_mapping_buf_type bufType, mm_camera_map_unmap_ops_tbl_t *ops_tbl) cam_mapping_buf_type bufType, __unused mm_camera_map_unmap_ops_tbl_t *ops_tbl)
{ {
int32_t rc = NO_ERROR; int32_t rc = NO_ERROR;
uint8_t cnt; uint8_t cnt;
@ -579,10 +579,9 @@ int32_t QCameraStream::unMapBuf(QCameraMemory *Buf,
* none-zero failure code * none-zero failure code
*==========================================================================*/ *==========================================================================*/
int32_t QCameraStream::mapBufs(QCameraMemory *Buf, int32_t QCameraStream::mapBufs(QCameraMemory *Buf,
cam_mapping_buf_type bufType, mm_camera_map_unmap_ops_tbl_t *ops_tbl) cam_mapping_buf_type bufType, __unused mm_camera_map_unmap_ops_tbl_t *ops_tbl)
{ {
int32_t rc = NO_ERROR; int32_t rc = NO_ERROR;
ssize_t bufSize = BAD_INDEX;
uint32_t i = 0; uint32_t i = 0;
QCameraBufferMaps bufferMaps; QCameraBufferMaps bufferMaps;
@ -1427,11 +1426,11 @@ int32_t QCameraStream::getBufs(cam_frame_len_offset_t *offset,
* NO_ERROR -- success * NO_ERROR -- success
* none-zero failure code * none-zero failure code
*==========================================================================*/ *==========================================================================*/
int32_t QCameraStream::getBufsDeferred(cam_frame_len_offset_t *offset, int32_t QCameraStream::getBufsDeferred(__unused cam_frame_len_offset_t *offset,
uint8_t *num_bufs, uint8_t *num_bufs,
uint8_t **initial_reg_flag, uint8_t **initial_reg_flag,
mm_camera_buf_def_t **bufs, mm_camera_buf_def_t **bufs,
mm_camera_map_unmap_ops_tbl_t *ops_tbl) __unused mm_camera_map_unmap_ops_tbl_t *ops_tbl)
{ {
int32_t rc = NO_ERROR; int32_t rc = NO_ERROR;
// wait for allocation // wait for allocation
@ -2485,7 +2484,7 @@ int32_t QCameraStream::mapBuf(uint8_t buf_type, uint32_t buf_idx,
*==========================================================================*/ *==========================================================================*/
int32_t QCameraStream::mapBufs(cam_buf_map_type_list bufMapList, int32_t QCameraStream::mapBufs(cam_buf_map_type_list bufMapList,
mm_camera_map_unmap_ops_tbl_t *ops_tbl) __unused mm_camera_map_unmap_ops_tbl_t *ops_tbl)
{ {
if (m_MemOpsTbl.bundled_map_ops != NULL) { if (m_MemOpsTbl.bundled_map_ops != NULL) {
return m_MemOpsTbl.bundled_map_ops(&bufMapList, m_MemOpsTbl.userdata); return m_MemOpsTbl.bundled_map_ops(&bufMapList, m_MemOpsTbl.userdata);

View file

@ -983,7 +983,7 @@ int32_t QCamera3ProcessingChannel::request(buffer_handle_t *buffer,
* NO_ERROR -- success * NO_ERROR -- success
* none-zero failure code * none-zero failure code
*==========================================================================*/ *==========================================================================*/
int32_t QCamera3ProcessingChannel::initialize(cam_is_type_t isType) int32_t QCamera3ProcessingChannel::initialize(__unused cam_is_type_t isType)
{ {
int32_t rc = NO_ERROR; int32_t rc = NO_ERROR;
rc = mOfflineMetaMemory.allocateAll(sizeof(metadata_buffer_t)); rc = mOfflineMetaMemory.allocateAll(sizeof(metadata_buffer_t));
@ -1394,7 +1394,7 @@ int32_t QCamera3ProcessingChannel::translateStreamTypeAndFormat(camera3_stream_t
*==========================================================================*/ *==========================================================================*/
int32_t QCamera3ProcessingChannel::setReprocConfig(reprocess_config_t &reproc_cfg, int32_t QCamera3ProcessingChannel::setReprocConfig(reprocess_config_t &reproc_cfg,
camera3_stream_buffer_t *pInputBuffer, camera3_stream_buffer_t *pInputBuffer,
metadata_buffer_t *metadata, __unused metadata_buffer_t *metadata,
cam_format_t streamFormat, cam_dimension_t dim) cam_format_t streamFormat, cam_dimension_t dim)
{ {
int32_t rc = 0; int32_t rc = 0;
@ -2338,7 +2338,7 @@ void QCamera3RawDumpChannel::dumpRawSnapshot(mm_camera_buf_def_t *frame)
* RETURN : NA * RETURN : NA
*==========================================================================*/ *==========================================================================*/
void QCamera3RawDumpChannel::streamCbRoutine(mm_camera_super_buf_t *super_frame, void QCamera3RawDumpChannel::streamCbRoutine(mm_camera_super_buf_t *super_frame,
QCamera3Stream *stream) __unused QCamera3Stream *stream)
{ {
LOGD("E"); LOGD("E");
if (super_frame == NULL || super_frame->num_bufs != 1) { if (super_frame == NULL || super_frame->num_bufs != 1) {
@ -2609,7 +2609,6 @@ int32_t QCamera3YUVChannel::request(buffer_handle_t *buffer,
metadata_buffer_t* metadata, bool &needMetadata) metadata_buffer_t* metadata, bool &needMetadata)
{ {
int32_t rc = NO_ERROR; int32_t rc = NO_ERROR;
int index;
Mutex::Autolock lock(mOfflinePpLock); Mutex::Autolock lock(mOfflinePpLock);
LOGD("pInputBuffer is %p frame number %d", pInputBuffer, frameNumber); LOGD("pInputBuffer is %p frame number %d", pInputBuffer, frameNumber);
@ -3210,7 +3209,6 @@ int32_t QCamera3PicChannel::initialize(cam_is_type_t isType)
cam_dimension_t streamDim; cam_dimension_t streamDim;
cam_stream_type_t streamType; cam_stream_type_t streamType;
cam_format_t streamFormat; cam_format_t streamFormat;
mm_camera_channel_attr_t attr;
if (NULL == mCamera3Stream) { if (NULL == mCamera3Stream) {
LOGE("Camera stream uninitialized"); LOGE("Camera stream uninitialized");
@ -3466,8 +3464,6 @@ void QCamera3PicChannel::streamCbRoutine(mm_camera_super_buf_t *super_frame,
QCamera3StreamMem* QCamera3PicChannel::getStreamBufs(uint32_t len) QCamera3StreamMem* QCamera3PicChannel::getStreamBufs(uint32_t len)
{ {
int rc = 0;
mYuvMemory = new QCamera3StreamMem(mCamera3Stream->max_buffers, false); mYuvMemory = new QCamera3StreamMem(mCamera3Stream->max_buffers, false);
if (!mYuvMemory) { if (!mYuvMemory) {
LOGE("unable to create metadata memory"); LOGE("unable to create metadata memory");
@ -3867,7 +3863,6 @@ int32_t QCamera3ReprocessChannel::resetToCamPerfNormal(uint32_t frameNumber)
*==========================================================================*/ *==========================================================================*/
QCamera3StreamMem* QCamera3ReprocessChannel::getStreamBufs(uint32_t len) QCamera3StreamMem* QCamera3ReprocessChannel::getStreamBufs(uint32_t len)
{ {
int rc = 0;
if (mReprocessType == REPROCESS_TYPE_JPEG) { if (mReprocessType == REPROCESS_TYPE_JPEG) {
mMemory = new QCamera3StreamMem(mNumBuffers, false); mMemory = new QCamera3StreamMem(mNumBuffers, false);
if (!mMemory) { if (!mMemory) {

View file

@ -283,6 +283,7 @@ public:
virtual uint32_t getStreamTypeMask(); virtual uint32_t getStreamTypeMask();
virtual int32_t queueBatchBuf(); virtual int32_t queueBatchBuf();
virtual int32_t initialize(cam_is_type_t isType); virtual int32_t initialize(cam_is_type_t isType);
using QCamera3ProcessingChannel::request;
virtual int32_t request(buffer_handle_t *buffer, uint32_t frameNumber); virtual int32_t request(buffer_handle_t *buffer, uint32_t frameNumber);
virtual reprocess_type_t getReprocessType(); virtual reprocess_type_t getReprocessType();
@ -408,6 +409,7 @@ public:
QCamera3Channel *metadataChannel); QCamera3Channel *metadataChannel);
~QCamera3YUVChannel(); ~QCamera3YUVChannel();
virtual int32_t initialize(cam_is_type_t isType); virtual int32_t initialize(cam_is_type_t isType);
using QCamera3ProcessingChannel::request;
virtual int32_t request(buffer_handle_t *buffer, virtual int32_t request(buffer_handle_t *buffer,
uint32_t frameNumber, uint32_t frameNumber,
camera3_stream_buffer_t* pInputBuffer, camera3_stream_buffer_t* pInputBuffer,

View file

@ -298,15 +298,15 @@ const QCamera3HardwareInterface::QCameraMap<
}; };
camera3_device_ops_t QCamera3HardwareInterface::mCameraOps = { camera3_device_ops_t QCamera3HardwareInterface::mCameraOps = {
initialize: QCamera3HardwareInterface::initialize, .initialize = QCamera3HardwareInterface::initialize,
configure_streams: QCamera3HardwareInterface::configure_streams, .configure_streams = QCamera3HardwareInterface::configure_streams,
register_stream_buffers: NULL, .register_stream_buffers = NULL,
construct_default_request_settings: QCamera3HardwareInterface::construct_default_request_settings, .construct_default_request_settings = QCamera3HardwareInterface::construct_default_request_settings,
process_capture_request: QCamera3HardwareInterface::process_capture_request, .process_capture_request = QCamera3HardwareInterface::process_capture_request,
get_metadata_vendor_tag_ops: NULL, .get_metadata_vendor_tag_ops = NULL,
dump: QCamera3HardwareInterface::dump, .dump = QCamera3HardwareInterface::dump,
flush: QCamera3HardwareInterface::flush, .flush = QCamera3HardwareInterface::flush,
reserved: {0}, .reserved = {0},
}; };
/*=========================================================================== /*===========================================================================
@ -862,7 +862,6 @@ int QCamera3HardwareInterface::validateStreamDimensions(
camera3_stream_configuration_t *streamList) camera3_stream_configuration_t *streamList)
{ {
int rc = NO_ERROR; int rc = NO_ERROR;
int32_t available_processed_sizes[MAX_SIZES_CNT * 2];
size_t count = 0; size_t count = 0;
camera3_stream_t *inputStream = NULL; camera3_stream_t *inputStream = NULL;
@ -884,7 +883,6 @@ int QCamera3HardwareInterface::validateStreamDimensions(
*/ */
for (size_t j = 0; j < streamList->num_streams; j++) { for (size_t j = 0; j < streamList->num_streams; j++) {
bool sizeFound = false; bool sizeFound = false;
size_t jpeg_sizes_cnt = 0;
camera3_stream_t *newStream = streamList->streams[j]; camera3_stream_t *newStream = streamList->streams[j];
uint32_t rotatedHeight = newStream->height; uint32_t rotatedHeight = newStream->height;
@ -1359,7 +1357,6 @@ int QCamera3HardwareInterface::configureStreamsPerfLocked(
uint8_t eis_prop_set; uint8_t eis_prop_set;
uint32_t maxEisWidth = 0; uint32_t maxEisWidth = 0;
uint32_t maxEisHeight = 0; uint32_t maxEisHeight = 0;
int32_t hal_version = CAM_HAL_V3;
memset(&mInputStreamInfo, 0, sizeof(mInputStreamInfo)); memset(&mInputStreamInfo, 0, sizeof(mInputStreamInfo));
@ -2579,7 +2576,6 @@ void QCamera3HardwareInterface::handleBatchMetadata(
pthread_mutex_unlock(&mMutex); pthread_mutex_unlock(&mMutex);
} }
done_batch_metadata:
/* BufDone metadata buffer */ /* BufDone metadata buffer */
if (free_and_bufdone_meta_buf) { if (free_and_bufdone_meta_buf) {
mMetadataChannel->bufDone(metadata_buf); mMetadataChannel->bufDone(metadata_buf);
@ -4149,9 +4145,7 @@ int QCamera3HardwareInterface::flushPerf()
ATRACE_CALL(); ATRACE_CALL();
int32_t rc = 0; int32_t rc = 0;
struct timespec timeout; struct timespec timeout;
unsigned int frameNum = 0;
bool timed_wait = false; bool timed_wait = false;
camera3_stream_buffer_t *pStream_Buf = NULL;
FlushMap flushMap; FlushMap flushMap;
pthread_mutex_lock(&mMutex); pthread_mutex_lock(&mMutex);
@ -4341,8 +4335,6 @@ void QCamera3HardwareInterface::captureResultCb(mm_camera_super_buf_t *metadata_
*==========================================================================*/ *==========================================================================*/
int32_t QCamera3HardwareInterface::getReprocessibleOutputStreamId(uint32_t &id) int32_t QCamera3HardwareInterface::getReprocessibleOutputStreamId(uint32_t &id)
{ {
stream_info_t* stream = NULL;
/* check if any output or bidirectional stream with the same size and format /* check if any output or bidirectional stream with the same size and format
and return that stream */ and return that stream */
if ((mInputStreamInfo.dim.width > 0) && if ((mInputStreamInfo.dim.width > 0) &&
@ -4543,7 +4535,6 @@ QCamera3HardwareInterface::translateFromHalMetadata(
IF_META_AVAILABLE(cam_edge_application_t, edgeApplication, IF_META_AVAILABLE(cam_edge_application_t, edgeApplication,
CAM_INTF_META_EDGE_MODE, metadata) { CAM_INTF_META_EDGE_MODE, metadata) {
uint8_t edgeStrength = (uint8_t) edgeApplication->sharpness;
camMetadata.update(ANDROID_EDGE_MODE, &(edgeApplication->edge_mode), 1); camMetadata.update(ANDROID_EDGE_MODE, &(edgeApplication->edge_mode), 1);
} }
@ -5491,8 +5482,6 @@ void QCamera3HardwareInterface::dumpMetadataToFile(tuning_params_t &meta,
const char *type, const char *type,
uint32_t frameNumber) uint32_t frameNumber)
{ {
uint32_t frm_num = 0;
//Some sanity checks //Some sanity checks
if (meta.tuning_sensor_data_size > TUNING_SENSOR_DATA_MAX) { if (meta.tuning_sensor_data_size > TUNING_SENSOR_DATA_MAX) {
LOGE("Tuning sensor data size bigger than expected %d: %d", LOGE("Tuning sensor data size bigger than expected %d: %d",
@ -6416,7 +6405,6 @@ int QCamera3HardwareInterface::initStaticMetadata(uint32_t cameraId)
} }
break; break;
case HAL_PIXEL_FORMAT_BLOB: case HAL_PIXEL_FORMAT_BLOB:
cam_dimension_t jpeg_size;
for (size_t i = 0; i < MIN(MAX_SIZES_CNT, for (size_t i = 0; i < MIN(MAX_SIZES_CNT,
gCamCapability[cameraId]->picture_sizes_tbl_cnt); i++) { gCamCapability[cameraId]->picture_sizes_tbl_cnt); i++) {
addStreamConfig(available_stream_configs, scalar_formats[j], addStreamConfig(available_stream_configs, scalar_formats[j],

View file

@ -584,7 +584,6 @@ ALLOC_FAILED:
int QCamera3HeapMemory::allocateOne(size_t size) int QCamera3HeapMemory::allocateOne(size_t size)
{ {
unsigned int heap_id_mask = 0x1 << ION_IOMMU_HEAP_ID; unsigned int heap_id_mask = 0x1 << ION_IOMMU_HEAP_ID;
uint32_t i;
int rc = NO_ERROR; int rc = NO_ERROR;
//Note that now we allow incremental allocation. In other words, we allow //Note that now we allow incremental allocation. In other words, we allow
@ -741,7 +740,7 @@ QCamera3GrallocMemory::~QCamera3GrallocMemory()
* none-zero failure code * none-zero failure code
*==========================================================================*/ *==========================================================================*/
int QCamera3GrallocMemory::registerBuffer(buffer_handle_t *buffer, int QCamera3GrallocMemory::registerBuffer(buffer_handle_t *buffer,
cam_stream_type_t type) __unused cam_stream_type_t type)
{ {
status_t ret = NO_ERROR; status_t ret = NO_ERROR;
struct ion_fd_data ion_info_fd; struct ion_fd_data ion_info_fd;

View file

@ -123,7 +123,6 @@ private:
int allocOneBuffer(struct QCamera3MemInfo &memInfo, int allocOneBuffer(struct QCamera3MemInfo &memInfo,
unsigned int heap_id, size_t size); unsigned int heap_id, size_t size);
void deallocOneBuffer(struct QCamera3MemInfo &memInfo); void deallocOneBuffer(struct QCamera3MemInfo &memInfo);
bool mQueueAll;
uint32_t mMaxCnt; uint32_t mMaxCnt;
}; };

View file

@ -52,6 +52,8 @@ namespace qcamera {
static const char ExifAsciiPrefix[] = static const char ExifAsciiPrefix[] =
{ 0x41, 0x53, 0x43, 0x49, 0x49, 0x0, 0x0, 0x0 }; // "ASCII\0\0\0" { 0x41, 0x53, 0x43, 0x49, 0x49, 0x0, 0x0, 0x0 }; // "ASCII\0\0\0"
__unused
static const char ExifUndefinedPrefix[] = static const char ExifUndefinedPrefix[] =
{ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; // "\0\0\0\0\0\0\0\0" { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; // "\0\0\0\0\0\0\0\0"
@ -397,7 +399,6 @@ int32_t QCamera3PostProcessor::getFWKJpegEncodeConfig(
LOGD("X"); LOGD("X");
return NO_ERROR; return NO_ERROR;
on_error:
LOGD("X with error %d", ret); LOGD("X with error %d", ret);
return ret; return ret;
} }
@ -561,7 +562,6 @@ int32_t QCamera3PostProcessor::processData(mm_camera_super_buf_t *input,
buffer_handle_t *output, uint32_t frameNumber) buffer_handle_t *output, uint32_t frameNumber)
{ {
LOGD("E"); LOGD("E");
QCamera3HardwareInterface* hal_obj = (QCamera3HardwareInterface*)m_parent->mUserData;
pthread_mutex_lock(&mReprocJobLock); pthread_mutex_lock(&mReprocJobLock);
// enqueue to post proc input queue // enqueue to post proc input queue
@ -603,7 +603,6 @@ int32_t QCamera3PostProcessor::processData(mm_camera_super_buf_t *input,
*==========================================================================*/ *==========================================================================*/
int32_t QCamera3PostProcessor::processData(qcamera_fwk_input_pp_data_t *frame) int32_t QCamera3PostProcessor::processData(qcamera_fwk_input_pp_data_t *frame)
{ {
QCamera3HardwareInterface* hal_obj = (QCamera3HardwareInterface*)m_parent->mUserData;
if (frame->reproc_config.reprocess_type != REPROCESS_TYPE_NONE) { if (frame->reproc_config.reprocess_type != REPROCESS_TYPE_NONE) {
ATRACE_INT("Camera:Reprocess", 1); ATRACE_INT("Camera:Reprocess", 1);
pthread_mutex_lock(&mReprocJobLock); pthread_mutex_lock(&mReprocJobLock);
@ -2150,7 +2149,7 @@ int32_t getExifGpsProcessingMethod(char *gpsProcessingMethod,
count = EXIF_ASCII_PREFIX_SIZE; count = EXIF_ASCII_PREFIX_SIZE;
strlcpy(gpsProcessingMethod + EXIF_ASCII_PREFIX_SIZE, strlcpy(gpsProcessingMethod + EXIF_ASCII_PREFIX_SIZE,
value, value,
strlen(value)+1); GPS_PROCESSING_METHOD_SIZE);
count += (uint32_t)strlen(value); count += (uint32_t)strlen(value);
gpsProcessingMethod[count++] = '\0'; // increase 1 for the last NULL char gpsProcessingMethod[count++] = '\0'; // increase 1 for the last NULL char
return NO_ERROR; return NO_ERROR;
@ -2177,7 +2176,7 @@ int32_t getExifLatitude(rat_t *latitude, char *latRef, double value)
{ {
char str[30]; char str[30];
snprintf(str, sizeof(str), "%f", value); snprintf(str, sizeof(str), "%f", value);
if(str != NULL) { if(str[0] != '\0') {
parseGPSCoordinate(str, latitude); parseGPSCoordinate(str, latitude);
//set Latitude Ref //set Latitude Ref
@ -2212,7 +2211,7 @@ int32_t getExifLongitude(rat_t *longitude, char *lonRef, double value)
{ {
char str[30]; char str[30];
snprintf(str, sizeof(str), "%f", value); snprintf(str, sizeof(str), "%f", value);
if(str != NULL) { if(str[0] != '\0') {
parseGPSCoordinate(str, longitude); parseGPSCoordinate(str, longitude);
//set Longitude Ref //set Longitude Ref
@ -2247,7 +2246,7 @@ int32_t getExifAltitude(rat_t *altitude, char *altRef, double argValue)
{ {
char str[30]; char str[30];
snprintf(str, sizeof(str), "%f", argValue); snprintf(str, sizeof(str), "%f", argValue);
if (str != NULL) { if (str[0] != '\0') {
double value = atof(str); double value = atof(str);
*altRef = 0; *altRef = 0;
if(value < 0){ if(value < 0){
@ -2280,7 +2279,7 @@ int32_t getExifGpsDateTimeStamp(char *gpsDateStamp, uint32_t bufLen,
{ {
char str[30]; char str[30];
snprintf(str, sizeof(str), "%lld", (long long int)value); snprintf(str, sizeof(str), "%lld", (long long int)value);
if(str != NULL) { if(str[0] != '\0') {
time_t unixTime = (time_t)atol(str); time_t unixTime = (time_t)atol(str);
struct tm *UTCTimestamp = gmtime(&unixTime); struct tm *UTCTimestamp = gmtime(&unixTime);
if (UTCTimestamp != NULL && gpsDateStamp != NULL if (UTCTimestamp != NULL && gpsDateStamp != NULL

View file

@ -1403,7 +1403,6 @@ int32_t QCamera3Stream::aggregateBufToBatch(mm_camera_buf_def_t& bufDef)
int32_t QCamera3Stream::queueBatchBuf() int32_t QCamera3Stream::queueBatchBuf()
{ {
int32_t rc = NO_ERROR; int32_t rc = NO_ERROR;
struct msm_camera_user_buf_cont_t *cont_buf = NULL;
if (!mCurrentBatchBufDef) { if (!mCurrentBatchBufDef) {
LOGE("No buffers were queued into batch"); LOGE("No buffers were queued into batch");

View file

@ -41,8 +41,6 @@ using namespace android;
namespace qcamera { namespace qcamera {
const int QCAMERA3_SECTION_COUNT = QCAMERA3_SECTIONS_END - VENDOR_SECTION;
enum qcamera3_ext_tags qcamera3_ext3_section_bounds[QCAMERA3_SECTIONS_END - enum qcamera3_ext_tags qcamera3_ext3_section_bounds[QCAMERA3_SECTIONS_END -
VENDOR_SECTION] = { VENDOR_SECTION] = {
QCAMERA3_PRIVATEDATA_END, QCAMERA3_PRIVATEDATA_END,

View file

@ -156,7 +156,6 @@ QCamera2Factory::~QCamera2Factory()
int QCamera2Factory::get_number_of_cameras() int QCamera2Factory::get_number_of_cameras()
{ {
int numCameras = 0; int numCameras = 0;
int rc = NO_ERROR;
if (!gQCamera2Factory) { if (!gQCamera2Factory) {
gQCamera2Factory = new QCamera2Factory(); gQCamera2Factory = new QCamera2Factory();
@ -454,7 +453,7 @@ int QCamera2Factory::camera_device_open(
} }
struct hw_module_methods_t QCamera2Factory::mModuleMethods = { struct hw_module_methods_t QCamera2Factory::mModuleMethods = {
open: QCamera2Factory::camera_device_open, .open = QCamera2Factory::camera_device_open,
}; };
/*=========================================================================== /*===========================================================================

View file

@ -32,25 +32,25 @@
#include "HAL3/QCamera3VendorTags.h" #include "HAL3/QCamera3VendorTags.h"
static hw_module_t camera_common = { static hw_module_t camera_common = {
tag: HARDWARE_MODULE_TAG, .tag = HARDWARE_MODULE_TAG,
module_api_version: CAMERA_MODULE_API_VERSION_2_4, .module_api_version = CAMERA_MODULE_API_VERSION_2_4,
hal_api_version: HARDWARE_HAL_API_VERSION, .hal_api_version = HARDWARE_HAL_API_VERSION,
id: CAMERA_HARDWARE_MODULE_ID, .id = CAMERA_HARDWARE_MODULE_ID,
name: "QCamera Module", .name = "QCamera Module",
author: "Qualcomm Innovation Center Inc", .author = "Qualcomm Innovation Center Inc",
methods: &qcamera::QCamera2Factory::mModuleMethods, .methods = &qcamera::QCamera2Factory::mModuleMethods,
dso: NULL, .dso = NULL,
reserved: {0} .reserved = {0}
}; };
camera_module_t HAL_MODULE_INFO_SYM = { camera_module_t HAL_MODULE_INFO_SYM = {
common: camera_common, .common = camera_common,
get_number_of_cameras: qcamera::QCamera2Factory::get_number_of_cameras, .get_number_of_cameras = qcamera::QCamera2Factory::get_number_of_cameras,
get_camera_info: qcamera::QCamera2Factory::get_camera_info, .get_camera_info = qcamera::QCamera2Factory::get_camera_info,
set_callbacks: qcamera::QCamera2Factory::set_callbacks, .set_callbacks = qcamera::QCamera2Factory::set_callbacks,
get_vendor_tag_ops: qcamera::QCamera3VendorTags::get_vendor_tag_ops, .get_vendor_tag_ops = qcamera::QCamera3VendorTags::get_vendor_tag_ops,
open_legacy: qcamera::QCamera2Factory::open_legacy, .open_legacy = qcamera::QCamera2Factory::open_legacy,
set_torch_mode: qcamera::QCamera2Factory::set_torch_mode, .set_torch_mode = qcamera::QCamera2Factory::set_torch_mode,
init : NULL, .init = NULL,
reserved: {0} .reserved = {0}
}; };

View file

@ -259,7 +259,6 @@ int32_t mm_camera_open(mm_camera_obj_t *my_obj)
uint8_t sleep_msec=MM_CAMERA_DEV_OPEN_RETRY_SLEEP; uint8_t sleep_msec=MM_CAMERA_DEV_OPEN_RETRY_SLEEP;
int cam_idx = 0; int cam_idx = 0;
const char *dev_name_value = NULL; const char *dev_name_value = NULL;
char prop[PROPERTY_VALUE_MAX];
int l_errno = 0; int l_errno = 0;
LOGD("begin\n"); LOGD("begin\n");
@ -2163,7 +2162,6 @@ int32_t mm_camera_reg_stream_buf_cb(mm_camera_obj_t *my_obj,
mm_camera_stream_cb_type cb_type, void *userdata) mm_camera_stream_cb_type cb_type, void *userdata)
{ {
int rc = 0; int rc = 0;
mm_stream_t *stream = NULL;
mm_stream_data_cb_t buf_cb; mm_stream_data_cb_t buf_cb;
mm_channel_t * ch_obj = mm_channel_t * ch_obj =
mm_camera_util_get_channel_by_handler(my_obj, ch_id); mm_camera_util_get_channel_by_handler(my_obj, ch_id);
@ -2252,6 +2250,7 @@ static module_debug_t cam_loginfo[(int)CAM_LAST_MODULE] = {
* *
* Return: logging level * Return: logging level
**/ **/
__unused
static cam_global_debug_level_t cam_get_dbg_level(const char *module, static cam_global_debug_level_t cam_get_dbg_level(const char *module,
char *pValue) { char *pValue) {

View file

@ -228,7 +228,6 @@ static void mm_channel_process_stream_buf(mm_camera_cmdcb_t * cmd_cb,
uint32_t i = 0; uint32_t i = 0;
/* Set expected frame id to a future frame idx, large enough to wait /* Set expected frame id to a future frame idx, large enough to wait
* for good_frame_idx_range, and small enough to still capture an image */ * for good_frame_idx_range, and small enough to still capture an image */
const uint32_t max_future_frame_offset = MM_CAMERA_MAX_FUTURE_FRAME_WAIT;
uint8_t needStartZSL = FALSE; uint8_t needStartZSL = FALSE;
if (NULL == ch_obj) { if (NULL == ch_obj) {
@ -439,7 +438,6 @@ static void mm_channel_process_stream_buf(mm_camera_cmdcb_t * cmd_cb,
(!ch_obj->bWaitForPrepSnapshotDone)) { (!ch_obj->bWaitForPrepSnapshotDone)) {
/* dequeue */ /* dequeue */
uint32_t match_frame = 0;
mm_channel_node_info_t info; mm_channel_node_info_t info;
memset(&info, 0x0, sizeof(info)); memset(&info, 0x0, sizeof(info));
@ -507,8 +505,6 @@ static void mm_channel_process_stream_buf(mm_camera_cmdcb_t * cmd_cb,
} }
} }
if (info.num_nodes > 0) { if (info.num_nodes > 0) {
uint8_t bReady = 0;
/* decrease pending_cnt */ /* decrease pending_cnt */
if (MM_CAMERA_SUPER_BUF_NOTIFY_BURST == notify_mode) { if (MM_CAMERA_SUPER_BUF_NOTIFY_BURST == notify_mode) {
ch_obj->pending_cnt--; ch_obj->pending_cnt--;

View file

@ -48,7 +48,7 @@
static pthread_mutex_t g_intf_lock = PTHREAD_MUTEX_INITIALIZER; static pthread_mutex_t g_intf_lock = PTHREAD_MUTEX_INITIALIZER;
static mm_camera_ctrl_t g_cam_ctrl = {0, {{0}}, {0}, {{0}}, {0}, {0}, {0}}; static mm_camera_ctrl_t g_cam_ctrl;
static pthread_mutex_t g_handler_lock = PTHREAD_MUTEX_INITIALIZER; static pthread_mutex_t g_handler_lock = PTHREAD_MUTEX_INITIALIZER;
static uint16_t g_handler_history_count = 0; /* history count for handler */ static uint16_t g_handler_history_count = 0; /* history count for handler */

View file

@ -1834,7 +1834,6 @@ int32_t mm_stream_map_buf(mm_stream_t * my_obj,
size_t size) size_t size)
{ {
int32_t rc = 0; int32_t rc = 0;
int8_t i;
if (NULL == my_obj || NULL == my_obj->ch_obj || NULL == my_obj->ch_obj->cam_obj) { if (NULL == my_obj || NULL == my_obj->ch_obj || NULL == my_obj->ch_obj->cam_obj) {
LOGE("NULL obj of stream/channel/camera"); LOGE("NULL obj of stream/channel/camera");
return -1; return -1;
@ -2199,12 +2198,10 @@ int32_t mm_stream_unreg_buf(mm_stream_t * my_obj)
/* reset buf reference count */ /* reset buf reference count */
pthread_mutex_lock(&my_obj->buf_lock); pthread_mutex_lock(&my_obj->buf_lock);
if (NULL != my_obj->buf_status) {
for(i = 0; i < my_obj->buf_num; i++){ for(i = 0; i < my_obj->buf_num; i++){
my_obj->buf_status[i].buf_refcnt = 0; my_obj->buf_status[i].buf_refcnt = 0;
my_obj->buf_status[i].in_kernel = 0; my_obj->buf_status[i].in_kernel = 0;
} }
}
pthread_mutex_unlock(&my_obj->buf_lock); pthread_mutex_unlock(&my_obj->buf_lock);
return rc; return rc;

View file

@ -114,7 +114,8 @@ int mm_app_load_hal(mm_camera_app_t *my_cam_app)
return MM_CAMERA_OK; return MM_CAMERA_OK;
} }
int mm_app_allocate_ion_memory(mm_camera_app_buf_t *buf, unsigned int ion_type) int mm_app_allocate_ion_memory(mm_camera_app_buf_t *buf,
__unused unsigned int ion_type)
{ {
int rc = MM_CAMERA_OK; int rc = MM_CAMERA_OK;
struct ion_handle_data handle_data; struct ion_handle_data handle_data;
@ -1857,7 +1858,8 @@ EXIT:
int mm_camera_lib_send_command(mm_camera_lib_handle *handle, int mm_camera_lib_send_command(mm_camera_lib_handle *handle,
mm_camera_lib_commands cmd, mm_camera_lib_commands cmd,
void *in_data, void *out_data) void *in_data,
__unused void *out_data)
{ {
uint32_t width, height; uint32_t width, height;
int rc = MM_CAMERA_OK; int rc = MM_CAMERA_OK;

View file

@ -1423,7 +1423,7 @@ int set_flash_mode (mm_camera_lib_handle *lib_handle, int action_param) {
break; break;
case FLASH_MODE_TORCH: case FLASH_MODE_TORCH:
printf("\n FLASH_MODE_TORCH\n"); printf("\n FLASH_MODE_TORCH\n");
type = CAM_ISO_MODE_100; type = CAM_FLASH_MODE_TORCH;
break; break;
default: default:
break; break;

View file

@ -178,6 +178,7 @@ int createEncodingSession(mm_camera_test_obj_t *test_obj,
* *
* *
**/ **/
__unused
static void mm_app_snapshot_metadata_notify_cb(mm_camera_super_buf_t *bufs, static void mm_app_snapshot_metadata_notify_cb(mm_camera_super_buf_t *bufs,
void *user_data) void *user_data)
{ {

View file

@ -329,7 +329,7 @@ int process_sensor_data(cam_sensor_params_t *p_sensor_params,
} }
/*Flash*/ /*Flash*/
short val_short; short val_short = 0;
int flash_mode_exif, flash_fired; int flash_mode_exif, flash_fired;
if (p_sensor_params->flash_state == CAM_FLASH_STATE_FIRED) { if (p_sensor_params->flash_state == CAM_FLASH_STATE_FIRED) {
flash_fired = 1; flash_fired = 1;

View file

@ -59,7 +59,8 @@ namespace qcamera {
* *
* RETURN : always returns 1 * RETURN : always returns 1
*==========================================================================*/ *==========================================================================*/
int QCameraDisplay::vsyncEventReceiverCamera(int fd, int events, void* data) { int QCameraDisplay::vsyncEventReceiverCamera(__unused int fd,
__unused int events, void* data) {
android::DisplayEventReceiver::Event buffer[DISPLAY_EVENT_RECEIVER_ARRAY_SIZE]; android::DisplayEventReceiver::Event buffer[DISPLAY_EVENT_RECEIVER_ARRAY_SIZE];
QCameraDisplay* pQCameraDisplay = (QCameraDisplay *) data; QCameraDisplay* pQCameraDisplay = (QCameraDisplay *) data;
ssize_t n; ssize_t n;

View file

@ -102,7 +102,6 @@ void QCameraPerfLock::lock_init()
{ {
const char *rc; const char *rc;
char value[PROPERTY_VALUE_MAX]; char value[PROPERTY_VALUE_MAX];
int len;
LOGD("E"); LOGD("E");
Mutex::Autolock lock(mLock); Mutex::Autolock lock(mLock);