-SUBDIRS = testcase
+SUBDIRS = src testcase
+
+pcfiles = camera-hal-interface.pc
+pkgconfigdir = $(libdir)/pkgconfig
+pkgconfig_DATA = $(pcfiles)
+EXTRA_DIST = $(pcfiles)
--- /dev/null
+prefix=@prefix@
+exec_prefix=@exec_prefix@
+libdir=@libdir@
+includedir=@includedir@
+
+Name: camera-hal-interface
+Description: Multimedia Framework Camera HAL Interface library
+Requires: glib-2.0 dlog
+Version: $VERSION
+Libs: -L${libdir} -lcamera_hal_interface
+Cflags: -I${includedir}/
# Checks for library functions.
AC_CONFIG_FILES([
Makefile
+src/Makefile
+src/camera/Makefile
testcase/Makefile
testcase/camera/Makefile
+camera-hal-interface.pc
])
AC_OUTPUT
--- /dev/null
+/*
+ * camera_hal_interface.h
+ *
+ * Copyright (c) 2018 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact: Jeongmo Yang <jm80.yang@samsung.com>
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+
+#include <tizen-camera.h>
+
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+typedef struct _camera_hal_interface camera_hal_interface;
+
+int camera_hal_interface_init(camera_hal_interface **h);
+int camera_hal_interface_deinit(camera_hal_interface *h);
+int camera_hal_interface_get_device_info_list(camera_hal_interface *h, camera_device_info_list_t *device_info_list);
+int camera_hal_interface_open_device(camera_hal_interface *h, int device_index);
+int camera_hal_interface_close_device(camera_hal_interface *h);
+int camera_hal_interface_add_message_callback(camera_hal_interface *h, camera_message_cb callback, void *user_data, uint32_t *cb_id);
+int camera_hal_interface_remove_message_callback(camera_hal_interface *h, uint32_t cb_id);
+int camera_hal_interface_set_preview_stream_format(camera_hal_interface *h, camera_format_t *format);
+int camera_hal_interface_get_preview_stream_format(camera_hal_interface *h, camera_format_t *format);
+int camera_hal_interface_start_preview(camera_hal_interface *h, camera_preview_frame_cb callback, void *user_data);
+int camera_hal_interface_release_preview_buffer(camera_hal_interface *h, int buffer_index);
+int camera_hal_interface_stop_preview(camera_hal_interface *h);
+int camera_hal_interface_start_auto_focus(camera_hal_interface *h);
+int camera_hal_interface_stop_auto_focus(camera_hal_interface *h);
+int camera_hal_interface_start_capture(camera_hal_interface *h, camera_capture_cb callback, void *user_data);
+int camera_hal_interface_stop_capture(camera_hal_interface *h);
+int camera_hal_interface_set_video_stream_format(camera_hal_interface *h, camera_format_t *format);
+int camera_hal_interface_get_video_stream_format(camera_hal_interface *h, camera_format_t *format);
+int camera_hal_interface_start_record(camera_hal_interface *h, camera_video_frame_cb callback, void *user_data);
+int camera_hal_interface_release_video_buffer(camera_hal_interface *h, int buffer_index);
+int camera_hal_interface_stop_record(camera_hal_interface *h);
+int camera_hal_interface_set_command(camera_hal_interface *h, int64_t command, void *value);
+int camera_hal_interface_get_command(camera_hal_interface *h, int64_t command, void *value);
+int camera_hal_interface_set_batch_command(camera_hal_interface *h, camera_batch_command_control_t *batch_command, int64_t *error_command);
+
+#ifdef __cplusplus
+}
+#endif
+
--- /dev/null
+<manifest>
+ <request>
+ <domain name="_" />
+ </request>
+</manifest>
Name: mm-hal-interface
Summary: Multimedia HAL Interface
-Version: 0.0.6
+Version: 0.0.7
Release: 0
Group: Multimedia/Development
License: Apache-2.0
Source0: %{name}-%{version}.tar.gz
+Requires(post): /sbin/ldconfig
+Requires(postun): /sbin/ldconfig
+BuildRequires: pkgconfig(glib-2.0)
+BuildRequires: pkgconfig(dlog)
+BuildRequires: gtest-devel
%description
Multimedia framework hardware abstraction layer interface package.
+%package devel
+Summary: Multimedia framework hardware abstraction layer interface development package
+Group: libdevel
+Version: %{version}
+Requires: %{name} = %{version}-%{release}
+
+%description devel
+Multimedia framework hardware abstraction layer interface development package.
+
+
%package -n camera-hal-gtests
Summary: gtest for camera HAL APIs
Group: Development/Tools
Version: %{version}
-Requires(post): /sbin/ldconfig
-Requires(postun): /sbin/ldconfig
-BuildRequires: pkgconfig(glib-2.0)
-BuildRequires: pkgconfig(dlog)
-BuildRequires: gtest-devel
%description -n camera-hal-gtests
gtest for camera HAL APIs.
install -m 644 include/radio/*.h %{buildroot}%{_includedir}
%make_install
+%post -p /sbin/ldconfig
+%postun -p /sbin/ldconfig
+
%post -n camera-hal-gtests -p /sbin/ldconfig
%postun -n camera-hal-gtests -p /sbin/ldconfig
%files
+%manifest mm-hal-interface.manifest
+%license LICENSE.APLv2
+%defattr(-,root,root,-)
+%{_libdir}/*.so.*
+
+%files devel
%defattr(-,root,root,-)
%{_includedir}/*.h
-%license LICENSE.APLv2
+%{_libdir}/pkgconfig/*.pc
+%{_libdir}/*.so
%files -n camera-hal-gtests
%manifest mm-hal-gtests.manifest
--- /dev/null
+SUBDIRS = camera
+
--- /dev/null
+lib_LTLIBRARIES = libcamera_hal_interface.la
+
+libcamera_hal_interface_la_SOURCES = camera_hal_interface.c
+libcamera_hal_interface_la_CFLAGS = $(GLIB_CFLAGS) $(DLOG_CFLAGS) -I$(srcdir)/../../include/camera
+libcamera_hal_interface_la_LIBADD = $(GLIB_LIBS) $(DLOG_LIBS) -ldl
+
--- /dev/null
+/*
+ * camera_hal_interface.c
+ *
+ * Copyright (c) 2018 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact: Jeongmo Yang <jm80.yang@samsung.com>
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include <errno.h>
+#include <dlfcn.h>
+#include <glib.h>
+#include <dlog.h>
+#include "camera_hal_interface.h"
+
+#ifdef LOG_TAG
+#undef LOG_TAG
+#endif /* LOG_TAG */
+#define LOG_TAG "CAMERA_HAL_INTF"
+
+#define LIB_TIZEN_CAMERA "libtizen-camera.so"
+
+struct _camera_hal_interface {
+ void *dl_handle;
+ void *hal_handle;
+ camera_interface_t intf;
+};
+
+
+int camera_hal_interface_init(camera_hal_interface **h)
+{
+ int ret = CAMERA_ERROR_NONE;
+ camera_hal_interface *tmp_h = NULL;
+
+ if (h == NULL) {
+ LOGE("invalid parameter for camera_hal_interface");
+ return CAMERA_ERROR_INVALID_PARAMETER;
+ }
+
+ tmp_h = g_new0(camera_hal_interface, 1);
+ if (tmp_h == NULL) {
+ LOGE("failed to allocate hal interface");
+ return CAMERA_ERROR_OUT_OF_MEMORY;
+ }
+
+ tmp_h->dl_handle = dlopen(LIB_TIZEN_CAMERA, RTLD_NOW);
+ if (tmp_h->dl_handle) {
+ tmp_h->intf.init = dlsym(tmp_h->dl_handle, "camera_init");
+ tmp_h->intf.deinit = dlsym(tmp_h->dl_handle, "camera_deinit");
+ tmp_h->intf.get_device_info_list = dlsym(tmp_h->dl_handle, "camera_get_device_info_list");
+ tmp_h->intf.open_device = dlsym(tmp_h->dl_handle, "camera_open_device");
+ tmp_h->intf.close_device = dlsym(tmp_h->dl_handle, "camera_close_device");
+ tmp_h->intf.add_message_callback = dlsym(tmp_h->dl_handle, "camera_add_message_callback");
+ tmp_h->intf.remove_message_callback = dlsym(tmp_h->dl_handle, "camera_remove_message_callback");
+ tmp_h->intf.set_preview_stream_format = dlsym(tmp_h->dl_handle, "camera_set_preview_stream_format");
+ tmp_h->intf.get_preview_stream_format = dlsym(tmp_h->dl_handle, "camera_get_preview_stream_format");
+ tmp_h->intf.start_preview = dlsym(tmp_h->dl_handle, "camera_start_preview");
+ tmp_h->intf.release_preview_buffer = dlsym(tmp_h->dl_handle, "camera_release_preview_buffer");
+ tmp_h->intf.stop_preview = dlsym(tmp_h->dl_handle, "camera_stop_preview");
+ tmp_h->intf.start_auto_focus = dlsym(tmp_h->dl_handle, "camera_start_auto_focus");
+ tmp_h->intf.stop_auto_focus = dlsym(tmp_h->dl_handle, "camera_stop_auto_focus");
+ tmp_h->intf.start_capture = dlsym(tmp_h->dl_handle, "camera_start_capture");
+ tmp_h->intf.stop_capture = dlsym(tmp_h->dl_handle, "camera_stop_capture");
+ tmp_h->intf.set_video_stream_format = dlsym(tmp_h->dl_handle, "camera_set_video_stream_format");
+ tmp_h->intf.get_video_stream_format = dlsym(tmp_h->dl_handle, "camera_get_video_stream_format");
+ tmp_h->intf.start_record = dlsym(tmp_h->dl_handle, "camera_start_record");
+ tmp_h->intf.release_video_buffer = dlsym(tmp_h->dl_handle, "camera_release_video_buffer");
+ tmp_h->intf.stop_record = dlsym(tmp_h->dl_handle, "camera_stop_record");
+ tmp_h->intf.set_command = dlsym(tmp_h->dl_handle, "camera_set_command");
+ tmp_h->intf.get_command = dlsym(tmp_h->dl_handle, "camera_get_command");
+ tmp_h->intf.set_batch_command = dlsym(tmp_h->dl_handle, "camera_set_batch_command");
+
+ if (tmp_h->intf.init == NULL || tmp_h->intf.deinit == NULL) {
+ LOGE("could not get mandatory function. %p %p", tmp_h->intf.init, tmp_h->intf.deinit);
+ ret = CAMERA_ERROR_INTERNAL;
+ goto _CAMERA_HAL_INTERFACE_GET_FAILED;
+ }
+
+ if (tmp_h->intf.init) {
+ ret = tmp_h->intf.init(&tmp_h->hal_handle);
+ if (ret != CAMERA_ERROR_NONE) {
+ LOGE("camera_init failed 0x%x", ret);
+ goto _CAMERA_HAL_INTERFACE_GET_FAILED;
+ }
+ } else {
+ LOGE("no camera_init function");
+ ret = CAMERA_ERROR_INTERNAL;
+ goto _CAMERA_HAL_INTERFACE_GET_FAILED;
+ }
+ } else {
+ LOGE("dlopen failed [%s][errno %d]", LIB_TIZEN_CAMERA, errno);
+ ret = CAMERA_ERROR_DEVICE_NOT_SUPPORTED;
+ goto _CAMERA_HAL_INTERFACE_GET_FAILED;
+ }
+
+ *h = tmp_h;
+
+ return ret;
+
+_CAMERA_HAL_INTERFACE_GET_FAILED:
+ if (tmp_h) {
+ if (tmp_h->dl_handle)
+ dlclose(tmp_h->dl_handle);
+
+ g_free(tmp_h);
+ }
+
+ return ret;
+}
+
+
+int camera_hal_interface_deinit(camera_hal_interface *h)
+{
+ int ret = CAMERA_ERROR_NONE;
+
+ if (h == NULL) {
+ LOGE("NULL interface");
+ return CAMERA_ERROR_INVALID_PARAMETER;
+ }
+
+ if (h->dl_handle) {
+ ret = h->intf.deinit(h->hal_handle);
+ if (ret != CAMERA_ERROR_NONE) {
+ LOGE("camera_deinit failed 0x%x", ret);
+ return ret;
+ }
+
+ h->hal_handle = NULL;
+
+ dlclose(h->dl_handle);
+ h->dl_handle = NULL;
+ }
+
+ g_free(h);
+
+ return CAMERA_ERROR_NONE;
+}
+
+
+int camera_hal_interface_get_device_info_list(camera_hal_interface *h, camera_device_info_list_t *device_info_list)
+{
+ int ret = CAMERA_ERROR_NONE;
+
+ if (h == NULL) {
+ LOGE("NULL interface");
+ return CAMERA_ERROR_INVALID_PARAMETER;
+ }
+
+ if (h->intf.get_device_info_list) {
+ ret = h->intf.get_device_info_list(device_info_list);
+ } else {
+ LOGE("camera_get_device_info_list not implemented");
+ ret = CAMERA_ERROR_NOT_IMPLEMENTED;
+ }
+
+ return ret;
+}
+
+
+int camera_hal_interface_open_device(camera_hal_interface *h, int device_index)
+{
+ int ret = CAMERA_ERROR_NONE;
+
+ if (h == NULL) {
+ LOGE("NULL interface");
+ return CAMERA_ERROR_INVALID_PARAMETER;
+ }
+
+ if (h->intf.open_device) {
+ ret = h->intf.open_device(h->hal_handle, device_index);
+ } else {
+ LOGE("camera_open_device not implemented");
+ ret = CAMERA_ERROR_NOT_IMPLEMENTED;
+ }
+
+ return ret;
+}
+
+
+int camera_hal_interface_close_device(camera_hal_interface *h)
+{
+ int ret = CAMERA_ERROR_NONE;
+
+ if (h == NULL) {
+ LOGE("NULL interface");
+ return CAMERA_ERROR_INVALID_PARAMETER;
+ }
+
+ if (h->intf.close_device) {
+ ret = h->intf.close_device(h->hal_handle);
+ } else {
+ LOGE("camera_close_device not implemented");
+ ret = CAMERA_ERROR_NOT_IMPLEMENTED;
+ }
+
+ return ret;
+}
+
+
+int camera_hal_interface_add_message_callback(camera_hal_interface *h, camera_message_cb callback, void *user_data, uint32_t *cb_id)
+{
+ int ret = CAMERA_ERROR_NONE;
+
+ if (h == NULL) {
+ LOGE("NULL interface");
+ return CAMERA_ERROR_INVALID_PARAMETER;
+ }
+
+ if (h->intf.add_message_callback) {
+ ret = h->intf.add_message_callback(h->hal_handle, callback, user_data, cb_id);
+ } else {
+ LOGE("camera_add_message_callback not implemented");
+ ret = CAMERA_ERROR_NOT_IMPLEMENTED;
+ }
+
+ return ret;
+}
+
+
+int camera_hal_interface_remove_message_callback(camera_hal_interface *h, uint32_t cb_id)
+{
+ int ret = CAMERA_ERROR_NONE;
+
+ if (h == NULL) {
+ LOGE("NULL interface");
+ return CAMERA_ERROR_INVALID_PARAMETER;
+ }
+
+ if (h->intf.remove_message_callback) {
+ ret = h->intf.remove_message_callback(h->hal_handle, cb_id);
+ } else {
+ LOGE("camera_remove_message_callback not implemented");
+ ret = CAMERA_ERROR_NOT_IMPLEMENTED;
+ }
+
+ return ret;
+}
+
+
+int camera_hal_interface_set_preview_stream_format(camera_hal_interface *h, camera_format_t *format)
+{
+ int ret = CAMERA_ERROR_NONE;
+
+ if (h == NULL) {
+ LOGE("NULL interface");
+ return CAMERA_ERROR_INVALID_PARAMETER;
+ }
+
+ if (h->intf.set_preview_stream_format) {
+ ret = h->intf.set_preview_stream_format(h->hal_handle, format);
+ } else {
+ LOGE("camera_set_preview_stream_format not implemented");
+ ret = CAMERA_ERROR_NOT_IMPLEMENTED;
+ }
+
+ return ret;
+}
+
+
+int camera_hal_interface_get_preview_stream_format(camera_hal_interface *h, camera_format_t *format)
+{
+ int ret = CAMERA_ERROR_NONE;
+
+ if (h == NULL) {
+ LOGE("NULL interface");
+ return CAMERA_ERROR_INVALID_PARAMETER;
+ }
+
+ if (h->intf.get_preview_stream_format) {
+ ret = h->intf.get_preview_stream_format(h->hal_handle, format);
+ } else {
+ LOGE("camera_get_preview_stream_format not implemented");
+ ret = CAMERA_ERROR_NOT_IMPLEMENTED;
+ }
+
+ return ret;
+}
+
+
+int camera_hal_interface_start_preview(camera_hal_interface *h, camera_preview_frame_cb callback, void *user_data)
+{
+ int ret = CAMERA_ERROR_NONE;
+
+ if (h == NULL) {
+ LOGE("NULL interface");
+ return CAMERA_ERROR_INVALID_PARAMETER;
+ }
+
+ if (h->intf.start_preview) {
+ ret = h->intf.start_preview(h->hal_handle, callback, user_data);
+ } else {
+ LOGE("camera_start_preview not implemented");
+ ret = CAMERA_ERROR_NOT_IMPLEMENTED;
+ }
+
+ return ret;
+}
+
+
+int camera_hal_interface_release_preview_buffer(camera_hal_interface *h, int buffer_index)
+{
+ int ret = CAMERA_ERROR_NONE;
+
+ if (h == NULL) {
+ LOGE("NULL interface");
+ return CAMERA_ERROR_INVALID_PARAMETER;
+ }
+
+ if (h->intf.release_preview_buffer) {
+ ret = h->intf.release_preview_buffer(h->hal_handle, buffer_index);
+ } else {
+ LOGE("camera_release_preview_buffer not implemented");
+ ret = CAMERA_ERROR_NOT_IMPLEMENTED;
+ }
+
+ return ret;
+}
+
+
+int camera_hal_interface_stop_preview(camera_hal_interface *h)
+{
+ int ret = CAMERA_ERROR_NONE;
+
+ if (h == NULL) {
+ LOGE("NULL interface");
+ return CAMERA_ERROR_INVALID_PARAMETER;
+ }
+
+ if (h->intf.stop_preview) {
+ ret = h->intf.stop_preview(h->hal_handle);
+ } else {
+ LOGE("camera_stop_preview not implemented");
+ ret = CAMERA_ERROR_NOT_IMPLEMENTED;
+ }
+
+ return ret;
+}
+
+
+int camera_hal_interface_start_auto_focus(camera_hal_interface *h)
+{
+ int ret = CAMERA_ERROR_NONE;
+
+ if (h == NULL) {
+ LOGE("NULL interface");
+ return CAMERA_ERROR_INVALID_PARAMETER;
+ }
+
+ if (h->intf.start_auto_focus) {
+ ret = h->intf.start_auto_focus(h->hal_handle);
+ } else {
+ LOGE("camera_start_auto_focus not implemented");
+ ret = CAMERA_ERROR_NOT_IMPLEMENTED;
+ }
+
+ return ret;
+}
+
+
+int camera_hal_interface_stop_auto_focus(camera_hal_interface *h)
+{
+ int ret = CAMERA_ERROR_NONE;
+
+ if (h == NULL) {
+ LOGE("NULL interface");
+ return CAMERA_ERROR_INVALID_PARAMETER;
+ }
+
+ if (h->intf.stop_auto_focus) {
+ ret = h->intf.stop_auto_focus(h->hal_handle);
+ } else {
+ LOGE("camera_stop_auto_focus not implemented");
+ ret = CAMERA_ERROR_NOT_IMPLEMENTED;
+ }
+
+ return ret;
+}
+
+
+int camera_hal_interface_start_capture(camera_hal_interface *h, camera_capture_cb callback, void *user_data)
+{
+ int ret = CAMERA_ERROR_NONE;
+
+ if (h == NULL) {
+ LOGE("NULL interface");
+ return CAMERA_ERROR_INVALID_PARAMETER;
+ }
+
+ if (h->intf.start_capture) {
+ ret = h->intf.start_capture(h->hal_handle, callback, user_data);
+ } else {
+ LOGE("camera_start_capture not implemented");
+ ret = CAMERA_ERROR_NOT_IMPLEMENTED;
+ }
+
+ return ret;
+}
+
+
+int camera_hal_interface_stop_capture(camera_hal_interface *h)
+{
+ int ret = CAMERA_ERROR_NONE;
+
+ if (h == NULL) {
+ LOGE("NULL interface");
+ return CAMERA_ERROR_INVALID_PARAMETER;
+ }
+
+ if (h->intf.stop_capture) {
+ ret = h->intf.stop_capture(h->hal_handle);
+ } else {
+ LOGE("camera_stop_capture not implemented");
+ ret = CAMERA_ERROR_NOT_IMPLEMENTED;
+ }
+
+ return ret;
+}
+
+
+int camera_hal_interface_set_video_stream_format(camera_hal_interface *h, camera_format_t *format)
+{
+ int ret = CAMERA_ERROR_NONE;
+
+ if (h == NULL) {
+ LOGE("NULL interface");
+ return CAMERA_ERROR_INVALID_PARAMETER;
+ }
+
+ if (h->intf.set_video_stream_format) {
+ ret = h->intf.set_video_stream_format(h->hal_handle, format);
+ } else {
+ LOGE("camera_set_video_stream_format not implemented");
+ ret = CAMERA_ERROR_NOT_IMPLEMENTED;
+ }
+
+ return ret;
+}
+
+
+int camera_hal_interface_get_video_stream_format(camera_hal_interface *h, camera_format_t *format)
+{
+ int ret = CAMERA_ERROR_NONE;
+
+ if (h == NULL) {
+ LOGE("NULL interface");
+ return CAMERA_ERROR_INVALID_PARAMETER;
+ }
+
+ if (h->intf.get_video_stream_format) {
+ ret = h->intf.get_video_stream_format(h->hal_handle, format);
+ } else {
+ LOGE("camera_get_video_stream_format not implemented");
+ ret = CAMERA_ERROR_NOT_IMPLEMENTED;
+ }
+
+ return ret;
+}
+
+
+int camera_hal_interface_start_record(camera_hal_interface *h, camera_video_frame_cb callback, void *user_data)
+{
+ int ret = CAMERA_ERROR_NONE;
+
+ if (h == NULL) {
+ LOGE("NULL interface");
+ return CAMERA_ERROR_INVALID_PARAMETER;
+ }
+
+ if (h->intf.start_record) {
+ ret = h->intf.start_record(h->hal_handle, callback, user_data);
+ } else {
+ LOGE("camera_start_record not implemented");
+ ret = CAMERA_ERROR_NOT_IMPLEMENTED;
+ }
+
+ return ret;
+}
+
+
+int camera_hal_interface_release_video_buffer(camera_hal_interface *h, int buffer_index)
+{
+ int ret = CAMERA_ERROR_NONE;
+
+ if (h == NULL) {
+ LOGE("NULL interface");
+ return CAMERA_ERROR_INVALID_PARAMETER;
+ }
+
+ if (h->intf.release_video_buffer) {
+ ret = h->intf.release_video_buffer(h->hal_handle, buffer_index);
+ } else {
+ LOGE("camera_release_video_buffer not implemented");
+ ret = CAMERA_ERROR_NOT_IMPLEMENTED;
+ }
+
+ return ret;
+}
+
+
+int camera_hal_interface_stop_record(camera_hal_interface *h)
+{
+ int ret = CAMERA_ERROR_NONE;
+
+ if (h == NULL) {
+ LOGE("NULL interface");
+ return CAMERA_ERROR_INVALID_PARAMETER;
+ }
+
+ if (h->intf.stop_record) {
+ ret = h->intf.stop_record(h->hal_handle);
+ } else {
+ LOGE("camera_stop_record not implemented");
+ ret = CAMERA_ERROR_NOT_IMPLEMENTED;
+ }
+
+ return ret;
+}
+
+
+int camera_hal_interface_set_command(camera_hal_interface *h, int64_t command, void *value)
+{
+ int ret = CAMERA_ERROR_NONE;
+
+ if (h == NULL) {
+ LOGE("NULL interface");
+ return CAMERA_ERROR_INVALID_PARAMETER;
+ }
+
+ if (h->intf.set_command) {
+ ret = h->intf.set_command(h->hal_handle, command, value);
+ } else {
+ LOGE("camera_set_command not implemented");
+ ret = CAMERA_ERROR_NOT_IMPLEMENTED;
+ }
+
+ return ret;
+}
+
+
+int camera_hal_interface_get_command(camera_hal_interface *h, int64_t command, void *value)
+{
+ int ret = CAMERA_ERROR_NONE;
+
+ if (h == NULL) {
+ LOGE("NULL interface");
+ return CAMERA_ERROR_INVALID_PARAMETER;
+ }
+
+ if (h->intf.get_command) {
+ ret = h->intf.get_command(h->hal_handle, command, value);
+ } else {
+ LOGE("camera_get_command not implemented");
+ ret = CAMERA_ERROR_NOT_IMPLEMENTED;
+ }
+
+ return ret;
+}
+
+
+int camera_hal_interface_set_batch_command(camera_hal_interface *h, camera_batch_command_control_t *batch_command, int64_t *error_command)
+{
+ int ret = CAMERA_ERROR_NONE;
+
+ if (h == NULL) {
+ LOGE("NULL interface");
+ return CAMERA_ERROR_INVALID_PARAMETER;
+ }
+
+ if (h->intf.set_batch_command) {
+ ret = h->intf.set_batch_command(h->hal_handle, batch_command, error_command);
+ } else {
+ LOGE("camera_set_batch_command not implemented");
+ ret = CAMERA_ERROR_NOT_IMPLEMENTED;
+ }
+
+ return ret;
+}
# with gtest
bin_PROGRAMS = camera_hal_gtests
-camera_hal_gtests_SOURCES = camera_hal_tc.cpp camera_hal_interface.c
+camera_hal_gtests_SOURCES = \
+ camera_hal_tc.cpp
-camera_hal_gtests_CFLAGS = $(GLIB_CFLAGS) $(DLOG_CFLAGS)
-camera_hal_gtests_CPPFLAGS = $(GLIB_CFLAGS) $(DLOG_CFLAGS) -I$(srcdir)/../../include/camera
+camera_hal_gtests_CPPFLAGS = \
+ $(GLIB_CFLAGS)\
+ $(DLOG_CFLAGS)\
+ -I$(srcdir)/../../include/camera
camera_hal_gtests_LDADD = \
- -ldl \
- -lgtest \
- $(GLIB_LIBS) \
+ -ldl\
+ -lgtest\
+ $(top_builddir)/src/camera/libcamera_hal_interface.la\
+ $(GLIB_LIBS)\
$(DLOG_LIBS)
+++ /dev/null
-/*
- * Copyright (c) 2018 Samsung Electronics Co., Ltd. All rights reserved.
- *
- * Contact: Jeongmo Yang <jm80.yang@samsung.com>
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-
-#include <errno.h>
-#include <dlfcn.h>
-#include <glib.h>
-#include <dlog.h>
-#include "camera_hal_interface.h"
-
-#ifdef LOG_TAG
-#undef LOG_TAG
-#endif /* LOG_TAG */
-#define LOG_TAG "CAMERA_HAL_INTF"
-
-#define LIB_TIZEN_CAMERA "libtizen-camera.so"
-
-struct _camera_hal_interface {
- void *dl_handle;
- void *hal_handle;
- camera_interface_t intf;
-};
-
-
-int camera_hal_interface_init(camera_hal_interface **h)
-{
- int ret = CAMERA_ERROR_NONE;
- camera_hal_interface *tmp_h = NULL;
-
- if (h == NULL) {
- LOGE("invalid parameter for camera_hal_interface");
- return CAMERA_ERROR_INVALID_PARAMETER;
- }
-
- tmp_h = g_new0(camera_hal_interface, 1);
- if (tmp_h == NULL) {
- LOGE("failed to allocate hal interface");
- return CAMERA_ERROR_OUT_OF_MEMORY;
- }
-
- tmp_h->dl_handle = dlopen(LIB_TIZEN_CAMERA, RTLD_NOW);
- if (tmp_h->dl_handle) {
- tmp_h->intf.init = dlsym(tmp_h->dl_handle, "camera_init");
- tmp_h->intf.deinit = dlsym(tmp_h->dl_handle, "camera_deinit");
- tmp_h->intf.get_device_info_list = dlsym(tmp_h->dl_handle, "camera_get_device_info_list");
- tmp_h->intf.open_device = dlsym(tmp_h->dl_handle, "camera_open_device");
- tmp_h->intf.close_device = dlsym(tmp_h->dl_handle, "camera_close_device");
- tmp_h->intf.add_message_callback = dlsym(tmp_h->dl_handle, "camera_add_message_callback");
- tmp_h->intf.remove_message_callback = dlsym(tmp_h->dl_handle, "camera_remove_message_callback");
- tmp_h->intf.set_preview_stream_format = dlsym(tmp_h->dl_handle, "camera_set_preview_stream_format");
- tmp_h->intf.get_preview_stream_format = dlsym(tmp_h->dl_handle, "camera_get_preview_stream_format");
- tmp_h->intf.start_preview = dlsym(tmp_h->dl_handle, "camera_start_preview");
- tmp_h->intf.release_preview_buffer = dlsym(tmp_h->dl_handle, "camera_release_preview_buffer");
- tmp_h->intf.stop_preview = dlsym(tmp_h->dl_handle, "camera_stop_preview");
- tmp_h->intf.start_auto_focus = dlsym(tmp_h->dl_handle, "camera_start_auto_focus");
- tmp_h->intf.stop_auto_focus = dlsym(tmp_h->dl_handle, "camera_stop_auto_focus");
- tmp_h->intf.start_capture = dlsym(tmp_h->dl_handle, "camera_start_capture");
- tmp_h->intf.stop_capture = dlsym(tmp_h->dl_handle, "camera_stop_capture");
- tmp_h->intf.set_video_stream_format = dlsym(tmp_h->dl_handle, "camera_set_video_stream_format");
- tmp_h->intf.get_video_stream_format = dlsym(tmp_h->dl_handle, "camera_get_video_stream_format");
- tmp_h->intf.start_record = dlsym(tmp_h->dl_handle, "camera_start_record");
- tmp_h->intf.release_video_buffer = dlsym(tmp_h->dl_handle, "camera_release_video_buffer");
- tmp_h->intf.stop_record = dlsym(tmp_h->dl_handle, "camera_stop_record");
- tmp_h->intf.set_command = dlsym(tmp_h->dl_handle, "camera_set_command");
- tmp_h->intf.get_command = dlsym(tmp_h->dl_handle, "camera_get_command");
- tmp_h->intf.set_batch_command = dlsym(tmp_h->dl_handle, "camera_set_batch_command");
-
- if (tmp_h->intf.init == NULL || tmp_h->intf.deinit == NULL) {
- LOGE("could not get mandatory funtion. %p %1p", tmp_h->intf.init, tmp_h->intf.deinit);
- ret = CAMERA_ERROR_INTERNAL;
- goto _CAMERA_HAL_INTERFACE_GET_FAILED;
- }
-
- if (tmp_h->intf.init) {
- ret = tmp_h->intf.init(&tmp_h->hal_handle);
- if (ret != CAMERA_ERROR_NONE) {
- LOGE("camera_init failed 0x%x", ret);
- goto _CAMERA_HAL_INTERFACE_GET_FAILED;
- }
- } else {
- LOGE("no camera_init function");
- ret = CAMERA_ERROR_INTERNAL;
- goto _CAMERA_HAL_INTERFACE_GET_FAILED;
- }
- } else {
- LOGE("dlopen failed [%s][errno %d]", LIB_TIZEN_CAMERA, errno);
- ret = CAMERA_ERROR_DEVICE_NOT_SUPPORTED;
- goto _CAMERA_HAL_INTERFACE_GET_FAILED;
- }
-
- *h = tmp_h;
-
- return ret;
-
-_CAMERA_HAL_INTERFACE_GET_FAILED:
- if (tmp_h) {
- if (tmp_h->dl_handle)
- dlclose(tmp_h->dl_handle);
-
- g_free(tmp_h);
- }
-
- return ret;
-}
-
-
-int camera_hal_interface_deinit(camera_hal_interface *h)
-{
- int ret = CAMERA_ERROR_NONE;
-
- if (h == NULL) {
- LOGE("NULL interface");
- return CAMERA_ERROR_INVALID_PARAMETER;
- }
-
- if (h->dl_handle) {
- ret = h->intf.deinit(h->hal_handle);
- if (ret != CAMERA_ERROR_NONE) {
- LOGE("camera_deinit failed 0x%x", ret);
- return ret;
- }
-
- h->hal_handle = NULL;
-
- dlclose(h->dl_handle);
- h->dl_handle = NULL;
- }
-
- g_free(h);
-
- return CAMERA_ERROR_NONE;
-}
-
-
-int camera_hal_interface_get_device_info_list(camera_hal_interface *h, camera_device_info_list_t *device_info_list)
-{
- int ret = CAMERA_ERROR_NONE;
-
- if (h == NULL) {
- LOGE("NULL interface");
- return CAMERA_ERROR_INVALID_PARAMETER;
- }
-
- if (h->intf.get_device_info_list) {
- ret = h->intf.get_device_info_list(device_info_list);
- } else {
- LOGE("camera_get_device_info_list not implemented");
- ret = CAMERA_ERROR_NOT_IMPLEMENTED;
- }
-
- return ret;
-}
-
-
-int camera_hal_interface_open_device(camera_hal_interface *h, int device_index)
-{
- int ret = CAMERA_ERROR_NONE;
-
- if (h == NULL) {
- LOGE("NULL interface");
- return CAMERA_ERROR_INVALID_PARAMETER;
- }
-
- if (h->intf.open_device) {
- ret = h->intf.open_device(h->hal_handle, device_index);
- } else {
- LOGE("camera_open_device not implemented");
- ret = CAMERA_ERROR_NOT_IMPLEMENTED;
- }
-
- return ret;
-}
-
-
-int camera_hal_interface_close_device(camera_hal_interface *h)
-{
- int ret = CAMERA_ERROR_NONE;
-
- if (h == NULL) {
- LOGE("NULL interface");
- return CAMERA_ERROR_INVALID_PARAMETER;
- }
-
- if (h->intf.close_device) {
- ret = h->intf.close_device(h->hal_handle);
- } else {
- LOGE("camera_close_device not implemented");
- ret = CAMERA_ERROR_NOT_IMPLEMENTED;
- }
-
- return ret;
-}
-
-
-int camera_hal_interface_add_message_callback(camera_hal_interface *h, camera_message_cb callback, void *user_data, uint32_t *cb_id)
-{
- int ret = CAMERA_ERROR_NONE;
-
- if (h == NULL) {
- LOGE("NULL interface");
- return CAMERA_ERROR_INVALID_PARAMETER;
- }
-
- if (h->intf.add_message_callback) {
- ret = h->intf.add_message_callback(h->hal_handle, callback, user_data, cb_id);
- } else {
- LOGE("camera_add_message_callback not implemented");
- ret = CAMERA_ERROR_NOT_IMPLEMENTED;
- }
-
- return ret;
-}
-
-
-int camera_hal_interface_remove_message_callback(camera_hal_interface *h, uint32_t cb_id)
-{
- int ret = CAMERA_ERROR_NONE;
-
- if (h == NULL) {
- LOGE("NULL interface");
- return CAMERA_ERROR_INVALID_PARAMETER;
- }
-
- if (h->intf.remove_message_callback) {
- ret = h->intf.remove_message_callback(h->hal_handle, cb_id);
- } else {
- LOGE("camera_remove_message_callback not implemented");
- ret = CAMERA_ERROR_NOT_IMPLEMENTED;
- }
-
- return ret;
-}
-
-
-int camera_hal_interface_set_preview_stream_format(camera_hal_interface *h, camera_format_t *format)
-{
- int ret = CAMERA_ERROR_NONE;
-
- if (h == NULL) {
- LOGE("NULL interface");
- return CAMERA_ERROR_INVALID_PARAMETER;
- }
-
- if (h->intf.set_preview_stream_format) {
- ret = h->intf.set_preview_stream_format(h->hal_handle, format);
- } else {
- LOGE("camera_set_preview_stream_format not implemented");
- ret = CAMERA_ERROR_NOT_IMPLEMENTED;
- }
-
- return ret;
-}
-
-
-int camera_hal_interface_get_preview_stream_format(camera_hal_interface *h, camera_format_t *format)
-{
- int ret = CAMERA_ERROR_NONE;
-
- if (h == NULL) {
- LOGE("NULL interface");
- return CAMERA_ERROR_INVALID_PARAMETER;
- }
-
- if (h->intf.get_preview_stream_format) {
- ret = h->intf.get_preview_stream_format(h->hal_handle, format);
- } else {
- LOGE("camera_get_preview_stream_format not implemented");
- ret = CAMERA_ERROR_NOT_IMPLEMENTED;
- }
-
- return ret;
-}
-
-
-int camera_hal_interface_start_preview(camera_hal_interface *h, camera_preview_frame_cb callback, void *user_data)
-{
- int ret = CAMERA_ERROR_NONE;
-
- if (h == NULL) {
- LOGE("NULL interface");
- return CAMERA_ERROR_INVALID_PARAMETER;
- }
-
- if (h->intf.start_preview) {
- ret = h->intf.start_preview(h->hal_handle, callback, user_data);
- } else {
- LOGE("camera_start_preview not implemented");
- ret = CAMERA_ERROR_NOT_IMPLEMENTED;
- }
-
- return ret;
-}
-
-
-int camera_hal_interface_release_preview_buffer(camera_hal_interface *h, int buffer_index)
-{
- int ret = CAMERA_ERROR_NONE;
-
- if (h == NULL) {
- LOGE("NULL interface");
- return CAMERA_ERROR_INVALID_PARAMETER;
- }
-
- if (h->intf.release_preview_buffer) {
- ret = h->intf.release_preview_buffer(h->hal_handle, buffer_index);
- } else {
- LOGE("camera_release_preview_buffer not implemented");
- ret = CAMERA_ERROR_NOT_IMPLEMENTED;
- }
-
- return ret;
-}
-
-
-int camera_hal_interface_stop_preview(camera_hal_interface *h)
-{
- int ret = CAMERA_ERROR_NONE;
-
- if (h == NULL) {
- LOGE("NULL interface");
- return CAMERA_ERROR_INVALID_PARAMETER;
- }
-
- if (h->intf.stop_preview) {
- ret = h->intf.stop_preview(h->hal_handle);
- } else {
- LOGE("camera_stop_preview not implemented");
- ret = CAMERA_ERROR_NOT_IMPLEMENTED;
- }
-
- return ret;
-}
-
-
-int camera_hal_interface_start_auto_focus(camera_hal_interface *h)
-{
- int ret = CAMERA_ERROR_NONE;
-
- if (h == NULL) {
- LOGE("NULL interface");
- return CAMERA_ERROR_INVALID_PARAMETER;
- }
-
- if (h->intf.start_auto_focus) {
- ret = h->intf.start_auto_focus(h->hal_handle);
- } else {
- LOGE("camera_start_auto_focus not implemented");
- ret = CAMERA_ERROR_NOT_IMPLEMENTED;
- }
-
- return ret;
-}
-
-
-int camera_hal_interface_stop_auto_focus(camera_hal_interface *h)
-{
- int ret = CAMERA_ERROR_NONE;
-
- if (h == NULL) {
- LOGE("NULL interface");
- return CAMERA_ERROR_INVALID_PARAMETER;
- }
-
- if (h->intf.stop_auto_focus) {
- ret = h->intf.stop_auto_focus(h->hal_handle);
- } else {
- LOGE("camera_stop_auto_focus not implemented");
- ret = CAMERA_ERROR_NOT_IMPLEMENTED;
- }
-
- return ret;
-}
-
-
-int camera_hal_interface_start_capture(camera_hal_interface *h, camera_capture_cb callback, void *user_data)
-{
- int ret = CAMERA_ERROR_NONE;
-
- if (h == NULL) {
- LOGE("NULL interface");
- return CAMERA_ERROR_INVALID_PARAMETER;
- }
-
- if (h->intf.start_capture) {
- ret = h->intf.start_capture(h->hal_handle, callback, user_data);
- } else {
- LOGE("camera_start_capture not implemented");
- ret = CAMERA_ERROR_NOT_IMPLEMENTED;
- }
-
- return ret;
-}
-
-
-int camera_hal_interface_stop_capture(camera_hal_interface *h)
-{
- int ret = CAMERA_ERROR_NONE;
-
- if (h == NULL) {
- LOGE("NULL interface");
- return CAMERA_ERROR_INVALID_PARAMETER;
- }
-
- if (h->intf.stop_capture) {
- ret = h->intf.stop_capture(h->hal_handle);
- } else {
- LOGE("camera_stop_capture not implemented");
- ret = CAMERA_ERROR_NOT_IMPLEMENTED;
- }
-
- return ret;
-}
-
-
-int camera_hal_interface_set_video_stream_format(camera_hal_interface *h, camera_format_t *format)
-{
- int ret = CAMERA_ERROR_NONE;
-
- if (h == NULL) {
- LOGE("NULL interface");
- return CAMERA_ERROR_INVALID_PARAMETER;
- }
-
- if (h->intf.set_video_stream_format) {
- ret = h->intf.set_video_stream_format(h->hal_handle, format);
- } else {
- LOGE("camera_set_video_stream_format not implemented");
- ret = CAMERA_ERROR_NOT_IMPLEMENTED;
- }
-
- return ret;
-}
-
-
-int camera_hal_interface_get_video_stream_format(camera_hal_interface *h, camera_format_t *format)
-{
- int ret = CAMERA_ERROR_NONE;
-
- if (h == NULL) {
- LOGE("NULL interface");
- return CAMERA_ERROR_INVALID_PARAMETER;
- }
-
- if (h->intf.get_video_stream_format) {
- ret = h->intf.get_video_stream_format(h->hal_handle, format);
- } else {
- LOGE("camera_get_video_stream_format not implemented");
- ret = CAMERA_ERROR_NOT_IMPLEMENTED;
- }
-
- return ret;
-}
-
-
-int camera_hal_interface_start_record(camera_hal_interface *h, camera_video_frame_cb callback, void *user_data)
-{
- int ret = CAMERA_ERROR_NONE;
-
- if (h == NULL) {
- LOGE("NULL interface");
- return CAMERA_ERROR_INVALID_PARAMETER;
- }
-
- if (h->intf.start_record) {
- ret = h->intf.start_record(h->hal_handle, callback, user_data);
- } else {
- LOGE("camera_start_record not implemented");
- ret = CAMERA_ERROR_NOT_IMPLEMENTED;
- }
-
- return ret;
-}
-
-
-int camera_hal_interface_release_video_buffer(camera_hal_interface *h, int buffer_index)
-{
- int ret = CAMERA_ERROR_NONE;
-
- if (h == NULL) {
- LOGE("NULL interface");
- return CAMERA_ERROR_INVALID_PARAMETER;
- }
-
- if (h->intf.release_video_buffer) {
- ret = h->intf.release_video_buffer(h->hal_handle, buffer_index);
- } else {
- LOGE("camera_release_video_buffer not implemented");
- ret = CAMERA_ERROR_NOT_IMPLEMENTED;
- }
-
- return ret;
-}
-
-
-int camera_hal_interface_stop_record(camera_hal_interface *h)
-{
- int ret = CAMERA_ERROR_NONE;
-
- if (h == NULL) {
- LOGE("NULL interface");
- return CAMERA_ERROR_INVALID_PARAMETER;
- }
-
- if (h->intf.stop_record) {
- ret = h->intf.stop_record(h->hal_handle);
- } else {
- LOGE("camera_stop_record not implemented");
- ret = CAMERA_ERROR_NOT_IMPLEMENTED;
- }
-
- return ret;
-}
-
-
-int camera_hal_interface_set_command(camera_hal_interface *h, int64_t command, void *value)
-{
- int ret = CAMERA_ERROR_NONE;
-
- if (h == NULL) {
- LOGE("NULL interface");
- return CAMERA_ERROR_INVALID_PARAMETER;
- }
-
- if (h->intf.set_command) {
- ret = h->intf.set_command(h->hal_handle, command, value);
- } else {
- LOGE("camera_set_command not implemented");
- ret = CAMERA_ERROR_NOT_IMPLEMENTED;
- }
-
- return ret;
-}
-
-
-int camera_hal_interface_get_command(camera_hal_interface *h, int64_t command, void *value)
-{
- int ret = CAMERA_ERROR_NONE;
-
- if (h == NULL) {
- LOGE("NULL interface");
- return CAMERA_ERROR_INVALID_PARAMETER;
- }
-
- if (h->intf.get_command) {
- ret = h->intf.get_command(h->hal_handle, command, value);
- } else {
- LOGE("camera_get_command not implemented");
- ret = CAMERA_ERROR_NOT_IMPLEMENTED;
- }
-
- return ret;
-}
-
-
-int camera_hal_interface_set_batch_command(camera_hal_interface *h, camera_batch_command_control_t *batch_command, int64_t *error_command)
-{
- int ret = CAMERA_ERROR_NONE;
-
- if (h == NULL) {
- LOGE("NULL interface");
- return CAMERA_ERROR_INVALID_PARAMETER;
- }
-
- if (h->intf.set_batch_command) {
- ret = h->intf.set_batch_command(h->hal_handle, batch_command, error_command);
- } else {
- LOGE("camera_set_batch_command not implemented");
- ret = CAMERA_ERROR_NOT_IMPLEMENTED;
- }
-
- return ret;
-}
-
+++ /dev/null
-/*
- * Copyright (c) 2018 Samsung Electronics Co., Ltd. All rights reserved.
- *
- * Contact: Jeongmo Yang <jm80.yang@samsung.com>
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#include <tizen-camera.h>
-
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-typedef struct _camera_hal_interface camera_hal_interface;
-
-int camera_hal_interface_init(camera_hal_interface **h);
-int camera_hal_interface_deinit(camera_hal_interface *h);
-int camera_hal_interface_get_device_info_list(camera_hal_interface *h, camera_device_info_list_t *device_info_list);
-int camera_hal_interface_open_device(camera_hal_interface *h, int device_index);
-int camera_hal_interface_close_device(camera_hal_interface *h);
-int camera_hal_interface_add_message_callback(camera_hal_interface *h, camera_message_cb callback, void *user_data, uint32_t *cb_id);
-int camera_hal_interface_remove_message_callback(camera_hal_interface *h, uint32_t cb_id);
-int camera_hal_interface_set_preview_stream_format(camera_hal_interface *h, camera_format_t *format);
-int camera_hal_interface_get_preview_stream_format(camera_hal_interface *h, camera_format_t *format);
-int camera_hal_interface_start_preview(camera_hal_interface *h, camera_preview_frame_cb callback, void *user_data);
-int camera_hal_interface_release_preview_buffer(camera_hal_interface *h, int buffer_index);
-int camera_hal_interface_stop_preview(camera_hal_interface *h);
-int camera_hal_interface_start_auto_focus(camera_hal_interface *h);
-int camera_hal_interface_stop_auto_focus(camera_hal_interface *h);
-int camera_hal_interface_start_capture(camera_hal_interface *h, camera_capture_cb callback, void *user_data);
-int camera_hal_interface_stop_capture(camera_hal_interface *h);
-int camera_hal_interface_set_video_stream_format(camera_hal_interface *h, camera_format_t *format);
-int camera_hal_interface_get_video_stream_format(camera_hal_interface *h, camera_format_t *format);
-int camera_hal_interface_start_record(camera_hal_interface *h, camera_video_frame_cb callback, void *user_data);
-int camera_hal_interface_release_video_buffer(camera_hal_interface *h, int buffer_index);
-int camera_hal_interface_stop_record(camera_hal_interface *h);
-int camera_hal_interface_set_command(camera_hal_interface *h, int64_t command, void *value);
-int camera_hal_interface_get_command(camera_hal_interface *h, int64_t command, void *value);
-int camera_hal_interface_set_batch_command(camera_hal_interface *h, camera_batch_command_control_t *batch_command, int64_t *error_command);
-
-#ifdef __cplusplus
-}
-#endif
-
#include <gtest/gtest.h>
#include <unistd.h>
#include <iostream>
-#include "camera_hal_interface.h"
+#include <camera_hal_interface.h>
using namespace std;