summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPaul Kocialkowski <contact@paulk.fr>2014-04-22 10:51:37 +0200
committerPaul Kocialkowski <contact@paulk.fr>2014-04-22 10:51:37 +0200
commit0e028ac00134ad05bfca03d277dc3b3fee325e87 (patch)
treec661b674bd08aee168023956d12a307ca35449fd
parentb6a9f0c2b2f317c283f50d29a3823c1cf708df69 (diff)
downloaddevice_samsung_smdk4412-common-0e028ac00134ad05bfca03d277dc3b3fee325e87.zip
device_samsung_smdk4412-common-0e028ac00134ad05bfca03d277dc3b3fee325e87.tar.gz
device_samsung_smdk4412-common-0e028ac00134ad05bfca03d277dc3b3fee325e87.tar.bz2
camera: Consistent device naming
Signed-off-by: Paul Kocialkowski <contact@paulk.fr>
-rw-r--r--camera/smdk4x12_camera.c171
1 files changed, 87 insertions, 84 deletions
diff --git a/camera/smdk4x12_camera.c b/camera/smdk4x12_camera.c
index f16e724..19aacdf 100644
--- a/camera/smdk4x12_camera.c
+++ b/camera/smdk4x12_camera.c
@@ -3886,7 +3886,7 @@ void smdk4x12_camera_auto_focus_thread_stop(struct smdk4x12_camera *smdk4x12_cam
* SMDK4x12 Camera OPS
*/
-int smdk4x12_camera_set_preview_window(struct camera_device *dev,
+int smdk4x12_camera_set_preview_window(struct camera_device *device,
struct preview_stream_ops *w)
{
struct smdk4x12_camera *smdk4x12_camera;
@@ -3899,12 +3899,12 @@ int smdk4x12_camera_set_preview_window(struct camera_device *dev,
int rc;
- ALOGD("%s(%p, %p)", __func__, dev, w);
+ ALOGD("%s(%p, %p)", __func__, device, w);
- if (dev == NULL || dev->priv == NULL)
+ if (device == NULL || device->priv == NULL)
return -EINVAL;
- smdk4x12_camera = (struct smdk4x12_camera *) dev->priv;
+ smdk4x12_camera = (struct smdk4x12_camera *) device->priv;
if (smdk4x12_camera->preview_thread_enabled)
pthread_mutex_lock(&smdk4x12_camera->preview_mutex);
@@ -3973,7 +3973,7 @@ complete:
return rc;
}
-void smdk4x12_camera_set_callbacks(struct camera_device *dev,
+void smdk4x12_camera_set_callbacks(struct camera_device *device,
camera_notify_callback notify_cb,
camera_data_callback data_cb,
camera_data_timestamp_callback data_cb_timestamp,
@@ -3982,12 +3982,12 @@ void smdk4x12_camera_set_callbacks(struct camera_device *dev,
{
struct smdk4x12_camera *smdk4x12_camera;
- ALOGD("%s(%p, %p)", __func__, dev, user);
+ ALOGD("%s(%p, %p)", __func__, device, user);
- if (dev == NULL || dev->priv == NULL)
+ if (device == NULL || device->priv == NULL)
return;
- smdk4x12_camera = (struct smdk4x12_camera *) dev->priv;
+ smdk4x12_camera = (struct smdk4x12_camera *) device->priv;
smdk4x12_camera->callbacks.notify = notify_cb;
smdk4x12_camera->callbacks.data = data_cb;
@@ -3996,59 +3996,62 @@ void smdk4x12_camera_set_callbacks(struct camera_device *dev,
smdk4x12_camera->callbacks.user = user;
}
-void smdk4x12_camera_enable_msg_type(struct camera_device *dev, int32_t msg_type)
+void smdk4x12_camera_enable_msg_type(struct camera_device *device,
+ int32_t msg_type)
{
struct smdk4x12_camera *smdk4x12_camera;
- ALOGD("%s(%p, %d)", __func__, dev, msg_type);
+ ALOGD("%s(%p, %d)", __func__, device, msg_type);
- if (dev == NULL || dev->priv == NULL)
+ if (device == NULL || device->priv == NULL)
return;
- smdk4x12_camera = (struct smdk4x12_camera *) dev->priv;
+ smdk4x12_camera = (struct smdk4x12_camera *) device->priv;
smdk4x12_camera->messages_enabled |= msg_type;
}
-void smdk4x12_camera_disable_msg_type(struct camera_device *dev, int32_t msg_type)
+void smdk4x12_camera_disable_msg_type(struct camera_device *device,
+ int32_t msg_type)
{
struct smdk4x12_camera *smdk4x12_camera;
- ALOGD("%s(%p, %d)", __func__, dev, msg_type);
+ ALOGD("%s(%p, %d)", __func__, device, msg_type);
- if (dev == NULL || dev->priv == NULL)
+ if (device == NULL || device->priv == NULL)
return;
- smdk4x12_camera = (struct smdk4x12_camera *) dev->priv;
+ smdk4x12_camera = (struct smdk4x12_camera *) device->priv;
smdk4x12_camera->messages_enabled &= ~msg_type;
}
-int smdk4x12_camera_msg_type_enabled(struct camera_device *dev, int32_t msg_type)
+int smdk4x12_camera_msg_type_enabled(struct camera_device *device,
+ int32_t msg_type)
{
struct smdk4x12_camera *smdk4x12_camera;
- ALOGD("%s(%p, %d)", __func__, dev, msg_type);
+ ALOGD("%s(%p, %d)", __func__, device, msg_type);
- if (dev == NULL || dev->priv == NULL)
+ if (device == NULL || device->priv == NULL)
return -EINVAL;
- smdk4x12_camera = (struct smdk4x12_camera *) dev->priv;
+ smdk4x12_camera = (struct smdk4x12_camera *) device->priv;
return smdk4x12_camera->messages_enabled & msg_type;
}
-int smdk4x12_camera_start_preview(struct camera_device *dev)
+int smdk4x12_camera_start_preview(struct camera_device *device)
{
struct smdk4x12_camera *smdk4x12_camera;
int rc;
- ALOGD("%s(%p)", __func__, dev);
+ ALOGD("%s(%p)", __func__, device);
- if (dev == NULL || dev->priv == NULL)
+ if (device == NULL || device->priv == NULL)
return -EINVAL;
- smdk4x12_camera = (struct smdk4x12_camera *) dev->priv;
+ smdk4x12_camera = (struct smdk4x12_camera *) device->priv;
smdk4x12_camera->callback_lock = 1;
rc = smdk4x12_camera_preview_thread_start(smdk4x12_camera);
@@ -4057,47 +4060,47 @@ int smdk4x12_camera_start_preview(struct camera_device *dev)
return rc;
}
-void smdk4x12_camera_stop_preview(struct camera_device *dev)
+void smdk4x12_camera_stop_preview(struct camera_device *device)
{
struct smdk4x12_camera *smdk4x12_camera;
- ALOGD("%s(%p)", __func__, dev);
+ ALOGD("%s(%p)", __func__, device);
- if (dev == NULL || dev->priv == NULL)
+ if (device == NULL || device->priv == NULL)
return;
- smdk4x12_camera = (struct smdk4x12_camera *) dev->priv;
+ smdk4x12_camera = (struct smdk4x12_camera *) device->priv;
smdk4x12_camera->callback_lock = 1;
smdk4x12_camera_preview_thread_stop(smdk4x12_camera);
smdk4x12_camera->callback_lock = 0;
}
-int smdk4x12_camera_preview_enabled(struct camera_device *dev)
+int smdk4x12_camera_preview_enabled(struct camera_device *device)
{
struct smdk4x12_camera *smdk4x12_camera;
- ALOGD("%s(%p)", __func__, dev);
+ ALOGD("%s(%p)", __func__, device);
- if (dev == NULL || dev->priv == NULL)
+ if (device == NULL || device->priv == NULL)
return -EINVAL;
- smdk4x12_camera = (struct smdk4x12_camera *) dev->priv;
+ smdk4x12_camera = (struct smdk4x12_camera *) device->priv;
return smdk4x12_camera->preview_thread_enabled;
}
-int smdk4x12_camera_store_meta_data_in_buffers(struct camera_device *dev,
+int smdk4x12_camera_store_meta_data_in_buffers(struct camera_device *device,
int enable)
{
struct smdk4x12_camera *smdk4x12_camera;
- ALOGD("%s(%p, %d)", __func__, dev, enable);
+ ALOGD("%s(%p, %d)", __func__, device, enable);
- if (dev == NULL || dev->priv == NULL)
+ if (device == NULL || device->priv == NULL)
return -EINVAL;
- smdk4x12_camera = (struct smdk4x12_camera *) dev->priv;
+ smdk4x12_camera = (struct smdk4x12_camera *) device->priv;
if (!smdk4x12_camera->recording_thread_enabled)
smdk4x12_camera->recording_metadata = enable;
@@ -4107,14 +4110,14 @@ int smdk4x12_camera_store_meta_data_in_buffers(struct camera_device *dev,
return 0;
}
-int smdk4x12_camera_start_recording(struct camera_device *dev)
+int smdk4x12_camera_start_recording(struct camera_device *device)
{
struct smdk4x12_camera *smdk4x12_camera;
int rc;
- ALOGD("%s(%p)", __func__, dev);
+ ALOGD("%s(%p)", __func__, device);
- smdk4x12_camera = (struct smdk4x12_camera *) dev->priv;
+ smdk4x12_camera = (struct smdk4x12_camera *) device->priv;
smdk4x12_camera->callback_lock = 1;
rc = smdk4x12_camera_recording_thread_start(smdk4x12_camera);
@@ -4123,89 +4126,89 @@ int smdk4x12_camera_start_recording(struct camera_device *dev)
return rc;
}
-void smdk4x12_camera_stop_recording(struct camera_device *dev)
+void smdk4x12_camera_stop_recording(struct camera_device *device)
{
struct smdk4x12_camera *smdk4x12_camera;
- ALOGD("%s(%p)", __func__, dev);
+ ALOGD("%s(%p)", __func__, device);
- smdk4x12_camera = (struct smdk4x12_camera *) dev->priv;
+ smdk4x12_camera = (struct smdk4x12_camera *) device->priv;
smdk4x12_camera->callback_lock = 1;
smdk4x12_camera_recording_thread_stop(smdk4x12_camera);
smdk4x12_camera->callback_lock = 0;
}
-int smdk4x12_camera_recording_enabled(struct camera_device *dev)
+int smdk4x12_camera_recording_enabled(struct camera_device *device)
{
struct smdk4x12_camera *smdk4x12_camera;
- ALOGD("%s(%p)", __func__, dev);
+ ALOGD("%s(%p)", __func__, device);
- if (dev == NULL || dev->priv == NULL)
+ if (device == NULL || device->priv == NULL)
return -EINVAL;
- smdk4x12_camera = (struct smdk4x12_camera *) dev->priv;
+ smdk4x12_camera = (struct smdk4x12_camera *) device->priv;
return smdk4x12_camera->recording_thread_enabled;
}
-void smdk4x12_camera_release_recording_frame(struct camera_device *dev,
+void smdk4x12_camera_release_recording_frame(struct camera_device *device,
const void *opaque)
{
struct smdk4x12_camera *smdk4x12_camera;
-// ALOGD("%s(%p, %p)", __func__, dev, opaque);
+// ALOGD("%s(%p, %p)", __func__, device, opaque);
- if (dev == NULL || dev->priv == NULL)
+ if (device == NULL || device->priv == NULL)
return;
- smdk4x12_camera = (struct smdk4x12_camera *) dev->priv;
+ smdk4x12_camera = (struct smdk4x12_camera *) device->priv;
smdk4x12_camera_recording_frame_release(smdk4x12_camera);
}
-int smdk4x12_camera_start_auto_focus(struct camera_device *dev)
+int smdk4x12_camera_start_auto_focus(struct camera_device *device)
{
struct smdk4x12_camera *smdk4x12_camera;
- ALOGD("%s(%p)", __func__, dev);
+ ALOGD("%s(%p)", __func__, device);
- if (dev == NULL || dev->priv == NULL)
+ if (device == NULL || device->priv == NULL)
return -EINVAL;
- smdk4x12_camera = (struct smdk4x12_camera *) dev->priv;
+ smdk4x12_camera = (struct smdk4x12_camera *) device->priv;
return smdk4x12_camera_auto_focus_thread_start(smdk4x12_camera);
}
-int smdk4x12_camera_cancel_auto_focus(struct camera_device *dev)
+int smdk4x12_camera_cancel_auto_focus(struct camera_device *device)
{
struct smdk4x12_camera *smdk4x12_camera;
- ALOGD("%s(%p)", __func__, dev);
+ ALOGD("%s(%p)", __func__, device);
- if (dev == NULL || dev->priv == NULL)
+ if (device == NULL || device->priv == NULL)
return -EINVAL;
- smdk4x12_camera = (struct smdk4x12_camera *) dev->priv;
+ smdk4x12_camera = (struct smdk4x12_camera *) device->priv;
smdk4x12_camera_auto_focus_thread_stop(smdk4x12_camera);
return 0;
}
-int smdk4x12_camera_take_picture(struct camera_device *dev)
+int smdk4x12_camera_take_picture(struct camera_device *device)
{
struct smdk4x12_camera *smdk4x12_camera;
int rc;
- ALOGD("%s(%p)", __func__, dev);
+ ALOGD("%s(%p)", __func__, device);
- if (dev == NULL || dev->priv == NULL)
+ if (device == NULL || device->priv == NULL)
return -EINVAL;
- smdk4x12_camera = (struct smdk4x12_camera *) dev->priv;
+ smdk4x12_camera = (struct smdk4x12_camera *) device->priv;
smdk4x12_camera->callback_lock = 1;
rc = smdk4x12_camera_picture_thread_start(smdk4x12_camera);
@@ -4214,17 +4217,17 @@ int smdk4x12_camera_take_picture(struct camera_device *dev)
return rc;
}
-int smdk4x12_camera_cancel_picture(struct camera_device *dev)
+int smdk4x12_camera_cancel_picture(struct camera_device *device)
{
struct smdk4x12_camera *smdk4x12_camera;
int rc;
- ALOGD("%s(%p)", __func__, dev);
+ ALOGD("%s(%p)", __func__, device);
- if (dev == NULL || dev->priv == NULL)
+ if (device == NULL || device->priv == NULL)
return -EINVAL;
- smdk4x12_camera = (struct smdk4x12_camera *) dev->priv;
+ smdk4x12_camera = (struct smdk4x12_camera *) device->priv;
smdk4x12_camera->callback_lock = 1;
smdk4x12_camera_picture_thread_stop(smdk4x12_camera);
@@ -4233,18 +4236,18 @@ int smdk4x12_camera_cancel_picture(struct camera_device *dev)
return 0;
}
-int smdk4x12_camera_set_parameters(struct camera_device *dev,
+int smdk4x12_camera_set_parameters(struct camera_device *device,
const char *params)
{
struct smdk4x12_camera *smdk4x12_camera;
int rc;
- ALOGD("%s(%p, %s)", __func__, dev, params);
+ ALOGD("%s(%p, %s)", __func__, device, params);
- if (dev == NULL || dev->priv == NULL || params == NULL)
+ if (device == NULL || device->priv == NULL || params == NULL)
return -EINVAL;
- smdk4x12_camera = (struct smdk4x12_camera *) dev->priv;
+ smdk4x12_camera = (struct smdk4x12_camera *) device->priv;
rc = smdk4x12_params_string_set(smdk4x12_camera, (char *) params);
if (rc < 0) {
@@ -4261,17 +4264,17 @@ int smdk4x12_camera_set_parameters(struct camera_device *dev,
return 0;
}
-char *smdk4x12_camera_get_parameters(struct camera_device *dev)
+char *smdk4x12_camera_get_parameters(struct camera_device *device)
{
struct smdk4x12_camera *smdk4x12_camera;
char *params;
- ALOGD("%s(%p)", __func__, dev);
+ ALOGD("%s(%p)", __func__, device);
- if (dev == NULL || dev->priv == NULL)
+ if (device == NULL || device->priv == NULL)
return NULL;
- smdk4x12_camera = (struct smdk4x12_camera *) dev->priv;
+ smdk4x12_camera = (struct smdk4x12_camera *) device->priv;
params = smdk4x12_params_string_get(smdk4x12_camera);
if (params == NULL) {
@@ -4282,41 +4285,41 @@ char *smdk4x12_camera_get_parameters(struct camera_device *dev)
return params;
}
-void smdk4x12_camera_put_parameters(struct camera_device *dev, char *params)
+void smdk4x12_camera_put_parameters(struct camera_device *device, char *params)
{
- ALOGD("%s(%p)", __func__, dev);
+ ALOGD("%s(%p)", __func__, device);
if (params != NULL)
free(params);
}
-int smdk4x12_camera_send_command(struct camera_device *dev,
+int smdk4x12_camera_send_command(struct camera_device *device,
int32_t cmd, int32_t arg1, int32_t arg2)
{
- ALOGD("%s(%p, %d, %d, %d)", __func__, dev, cmd, arg1, arg2);
+ ALOGD("%s(%p, %d, %d, %d)", __func__, device, cmd, arg1, arg2);
return 0;
}
-void smdk4x12_camera_release(struct camera_device *dev)
+void smdk4x12_camera_release(struct camera_device *device)
{
struct smdk4x12_camera *smdk4x12_camera;
- ALOGD("%s(%p)", __func__, dev);
+ ALOGD("%s(%p)", __func__, device);
- if (dev == NULL || dev->priv == NULL)
+ if (device == NULL || device->priv == NULL)
return;
- smdk4x12_camera = (struct smdk4x12_camera *) dev->priv;
+ smdk4x12_camera = (struct smdk4x12_camera *) device->priv;
smdk4x12_camera_capture_thread_stop(smdk4x12_camera);
smdk4x12_camera_stop(smdk4x12_camera);
}
-int smdk4x12_camera_dump(struct camera_device *dev, int fd)
+int smdk4x12_camera_dump(struct camera_device *device, int fd)
{
- ALOGD("%s(%p, %d)", __func__, dev, fd);
+ ALOGD("%s(%p, %d)", __func__, device, fd);
return 0;
}