3
0

camera: Coding style (for loops, whitespaces and newlines)

Change-Id: Icc042027fa3bd37fc2815e7756a1743745be450e
Signed-off-by: Paul Kocialkowski <contact@paulk.fr>
This commit is contained in:
Paul Kocialkowski 2013-07-30 23:11:46 +02:00
parent 3b8230bbf2
commit 5099a80f5a
3 changed files with 16 additions and 16 deletions

View File

@ -1552,7 +1552,7 @@ void exynos_camera_picture_stop(struct exynos_camera *exynos_camera)
pthread_mutex_unlock(&exynos_camera->picture_mutex); pthread_mutex_unlock(&exynos_camera->picture_mutex);
// Wait for the thread to end // Wait for the thread to end
for (i=0 ; i < 10 ; i++) { for (i = 0; i < 10; i++) {
if (!exynos_camera->picture_thread_running) if (!exynos_camera->picture_thread_running)
break; break;
@ -1622,7 +1622,7 @@ thread_exit:
if (EXYNOS_CAMERA_MSG_ENABLED(CAMERA_MSG_FOCUS) && EXYNOS_CAMERA_CALLBACK_DEFINED(notify)) if (EXYNOS_CAMERA_MSG_ENABLED(CAMERA_MSG_FOCUS) && EXYNOS_CAMERA_CALLBACK_DEFINED(notify))
exynos_camera->callbacks.notify(CAMERA_MSG_FOCUS, exynos_camera->callbacks.notify(CAMERA_MSG_FOCUS,
(int32_t) auto_focus_result, 0, exynos_camera->callbacks.user); (int32_t) auto_focus_result, 0, exynos_camera->callbacks.user);
exynos_camera->auto_focus_thread_running = 0; exynos_camera->auto_focus_thread_running = 0;
exynos_camera->auto_focus_enabled = 0; exynos_camera->auto_focus_enabled = 0;
@ -1684,7 +1684,7 @@ void exynos_camera_auto_focus_stop(struct exynos_camera *exynos_camera)
pthread_mutex_unlock(&exynos_camera->auto_focus_mutex); pthread_mutex_unlock(&exynos_camera->auto_focus_mutex);
// Wait for the thread to end // Wait for the thread to end
for (i=0 ; i < 10 ; i++) { for (i = 0; i < 10; i++) {
if (!exynos_camera->auto_focus_thread_running) if (!exynos_camera->auto_focus_thread_running)
break; break;
@ -1926,7 +1926,7 @@ int exynos_camera_preview_start(struct exynos_camera *exynos_camera)
return -1; return -1;
} }
for (i=EXYNOS_CAMERA_MAX_BUFFERS_COUNT ; i >= EXYNOS_CAMERA_MIN_BUFFERS_COUNT ; i--) { for (i = EXYNOS_CAMERA_MAX_BUFFERS_COUNT; i >= EXYNOS_CAMERA_MIN_BUFFERS_COUNT; i--) {
rc = exynos_v4l2_reqbufs_cap(exynos_camera, 0, i); rc = exynos_v4l2_reqbufs_cap(exynos_camera, 0, i);
if (rc >= 0) if (rc >= 0)
break; break;
@ -1952,7 +1952,7 @@ int exynos_camera_preview_start(struct exynos_camera *exynos_camera)
} }
frame_size = (int) ((float) width * (float) height * format_bpp); frame_size = (int) ((float) width * (float) height * format_bpp);
for (i=0 ; i < exynos_camera->preview_buffers_count ; i++) { for (i = 0; i < exynos_camera->preview_buffers_count; i++) {
rc = exynos_v4l2_querybuf_cap(exynos_camera, 0, i); rc = exynos_v4l2_querybuf_cap(exynos_camera, 0, i);
if (rc < 0) { if (rc < 0) {
ALOGE("%s: querybuf failed!", __func__); ALOGE("%s: querybuf failed!", __func__);
@ -1985,7 +1985,7 @@ int exynos_camera_preview_start(struct exynos_camera *exynos_camera)
return -1; return -1;
} }
for (i=0 ; i < exynos_camera->preview_buffers_count ; i++) { for (i = 0; i < exynos_camera->preview_buffers_count; i++) {
rc = exynos_v4l2_qbuf_cap(exynos_camera, 0, i); rc = exynos_v4l2_qbuf_cap(exynos_camera, 0, i);
if (rc < 0) { if (rc < 0) {
ALOGE("%s: qbuf failed!", __func__); ALOGE("%s: qbuf failed!", __func__);
@ -2064,7 +2064,7 @@ void exynos_camera_preview_stop(struct exynos_camera *exynos_camera)
pthread_mutex_lock(&exynos_camera->preview_mutex); pthread_mutex_lock(&exynos_camera->preview_mutex);
// Wait for the thread to end // Wait for the thread to end
for (i=0 ; i < 10 ; i++) { for (i = 0; i < 10; i++) {
if (!exynos_camera->preview_thread_running) if (!exynos_camera->preview_thread_running)
break; break;
@ -2154,7 +2154,7 @@ int exynos_camera_recording_start(struct exynos_camera *exynos_camera)
goto error; goto error;
} }
for (i=EXYNOS_CAMERA_MAX_BUFFERS_COUNT ; i >= EXYNOS_CAMERA_MIN_BUFFERS_COUNT ; i--) { for (i = EXYNOS_CAMERA_MAX_BUFFERS_COUNT; i >= EXYNOS_CAMERA_MIN_BUFFERS_COUNT; i--) {
rc = exynos_v4l2_reqbufs_cap(exynos_camera, 2, i); rc = exynos_v4l2_reqbufs_cap(exynos_camera, 2, i);
if (rc >= 0) if (rc >= 0)
break; break;
@ -2168,7 +2168,7 @@ int exynos_camera_recording_start(struct exynos_camera *exynos_camera)
exynos_camera->recording_buffers_count = rc; exynos_camera->recording_buffers_count = rc;
ALOGD("Found %d recording buffers available!", exynos_camera->recording_buffers_count); ALOGD("Found %d recording buffers available!", exynos_camera->recording_buffers_count);
for (i=0 ; i < exynos_camera->recording_buffers_count ; i++) { for (i = 0; i < exynos_camera->recording_buffers_count; i++) {
rc = exynos_v4l2_querybuf_cap(exynos_camera, 2, i); rc = exynos_v4l2_querybuf_cap(exynos_camera, 2, i);
if (rc < 0) { if (rc < 0) {
ALOGE("%s: querybuf failed!", __func__); ALOGE("%s: querybuf failed!", __func__);
@ -2192,7 +2192,7 @@ int exynos_camera_recording_start(struct exynos_camera *exynos_camera)
goto error; goto error;
} }
for (i=0 ; i < exynos_camera->recording_buffers_count ; i++) { for (i = 0; i < exynos_camera->recording_buffers_count; i++) {
rc = exynos_v4l2_qbuf_cap(exynos_camera, 2, i); rc = exynos_v4l2_qbuf_cap(exynos_camera, 2, i);
if (rc < 0) { if (rc < 0) {
ALOGE("%s: qbuf failed!", __func__); ALOGE("%s: qbuf failed!", __func__);

View File

@ -242,7 +242,7 @@ int exynos_exif_attributes_create_params(struct exynos_camera *exynos_camera,
} }
// Time // Time
time(&time_data); time(&time_data);
time_info = localtime(&time_data); time_info = localtime(&time_data);
strftime((char *) exif_attributes->date_time, sizeof(exif_attributes->date_time), strftime((char *) exif_attributes->date_time, sizeof(exif_attributes->date_time),
"%Y:%m:%d %H:%M:%S", time_info); "%Y:%m:%d %H:%M:%S", time_info);
@ -372,7 +372,7 @@ bv_ioctl:
} }
int exynos_exif_write_data(void *exif_data, unsigned short tag, int exynos_exif_write_data(void *exif_data, unsigned short tag,
unsigned short type, unsigned int count, int *offset, void *start, unsigned short type, unsigned int count, int *offset, void *start,
void *data, int length) void *data, int length)
{ {
unsigned char *pointer; unsigned char *pointer;
@ -397,7 +397,7 @@ int exynos_exif_write_data(void *exif_data, unsigned short tag,
pointer += sizeof(*offset); pointer += sizeof(*offset);
memcpy((void *) ((int) start + *offset), data, count * length); memcpy((void *) ((int) start + *offset), data, count * length);
*offset += count * length; *offset += count * length;
} else { } else {
memcpy(pointer, data, count * length); memcpy(pointer, data, count * length);
pointer += 4; pointer += 4;
@ -655,7 +655,7 @@ int exynos_exif_create(struct exynos_camera *exynos_camera,
pointer += NUM_SIZE; pointer += NUM_SIZE;
offset += NUM_SIZE + value * IFD_SIZE + OFFSET_SIZE; offset += NUM_SIZE + value * IFD_SIZE + OFFSET_SIZE;
count = exynos_exif_write_data(pointer, EXIF_TAG_GPS_VERSION_ID, count = exynos_exif_write_data(pointer, EXIF_TAG_GPS_VERSION_ID,
EXIF_TYPE_BYTE, 4, NULL, NULL, &exif_attributes->gps_version_id, sizeof(char)); EXIF_TYPE_BYTE, 4, NULL, NULL, &exif_attributes->gps_version_id, sizeof(char));
pointer += count; pointer += count;
@ -773,7 +773,7 @@ int exynos_exif_create(struct exynos_camera *exynos_camera,
} else { } else {
value = 0; value = 0;
memcpy(exif_ifd_thumb, &value, OFFSET_SIZE); memcpy(exif_ifd_thumb, &value, OFFSET_SIZE);
} }
pointer = (unsigned char *) exif_ifd_data_start; pointer = (unsigned char *) exif_ifd_data_start;

View File

@ -54,7 +54,7 @@ int exynos_v4l2_find_index(struct exynos_camera *exynos_camera, int exynos_v4l2_
return -1; return -1;
index = -1; index = -1;
for (i=0 ; i < exynos_camera->config->v4l2_nodes_count ; i++) { for (i = 0; i < exynos_camera->config->v4l2_nodes_count; i++) {
if (exynos_camera->config->v4l2_nodes[i].id == exynos_v4l2_id && if (exynos_camera->config->v4l2_nodes[i].id == exynos_v4l2_id &&
exynos_camera->config->v4l2_nodes[i].node != NULL) { exynos_camera->config->v4l2_nodes[i].node != NULL) {
index = i; index = i;