+++ /dev/null
-CMakeCache.txt
-*/CMakeFiles/*
-*.cmake
-CMakeFiles*
-*.a
-*.so
-Testing
-cmake.depends
-cmake.check_depends
-cmake.check_cache
-core
-core.*
-gmon.out
-install_manifest.txt
-*~
-.kdev_include_paths
-src.kdev4
-.cproject
-.project
-tet_captured
-tet_lock
-*.pc
-*-test
-*-test_*
-*tester.c
-TC/config
# for package file
SET(dependents "dlog mm-camcorder capi-base-common")
-# for deb
-SET(deb_dependents "libdlog libmm-camcorder")
-
-
+SET(pc_dependents "capi-base-common")
SET(fw_name "${project_prefix}-${service}-${submodule}")
)
SET(PC_NAME ${fw_name})
-SET(PC_REQUIRED ${dependents})
+SET(PC_REQUIRED ${pc_dependents})
SET(PC_LDFLAGS -l${fw_name})
-SET(PC_CFLAGS -I\${includedir}/${service})
CONFIGURE_FILE(
${fw_name}.pc.in
Version: @VERSION@
Requires: @PC_REQUIRED@
Libs: -L${libdir} @PC_LDFLAGS@
-Cflags: -I${includedir} @PC_CFLAGS@
+Cflags: -I${includedir}
-capi-media-camera (0.1.0-8) unstable; urgency=low
+capi-media-camera (0.1.0-11) unstable; urgency=low
- * add so version
+ * update camrea API
* Git: slp-source.sec.samsung.net:slp/api/camera
- * Tag: capi-media-camera_0.1.0-8
+ * Tag: capi-media-camera_0.1.0-11
- -- Seungkeun Lee <sngn.lee@samsung.com> Tue, 14 Feb 2012 16:43:04 +0900
+ -- Seungkeun Lee <sngn.lee@samsung.com> Wed, 14 Mar 2012 11:38:20 +0900
capi-media-camera (0.0.1-1) unstable; urgency=low
Section: libs
Priority: extra
Maintainer: Seungkeun Lee <sngn.lee@samsung.com>, Kangho Hur<kagho.hur@samsung.com>
-Build-Depends: debhelper (>= 5), libmm-camcorder-dev, libmm-common-dev, libmm-session-dev, capi-base-common-dev
+Build-Depends: debhelper (>= 5), dlog-dev, libmm-camcorder-dev, libmm-common-dev, libmm-session-dev, capi-base-common-dev
Package: capi-media-camera
Architecture: any
-Depends: ${shilbs:Depends}, ${misc:Depends}
+Depends: ${shlibs:Depends}, ${misc:Depends}
Description: A Camera library in Tizen Native API
Package: capi-media-camera-dev
Architecture: any
-Depends: ${shlibs:Depends}, ${misc:Depends}, capi-media-camera (= ${Source-Version}), dlog-dev, capi-base-common-dev, libmm-camcorder-dev
+Depends: ${shlibs:Depends}, ${misc:Depends}, capi-media-camera (= ${Source-Version}), capi-base-common-dev
Description: A Camera library in Tizen Native API (DEV)
Package: capi-media-camera-dbg
* 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.
+* limitations under the License.
*/
/**
* @brief Enumerations of the camera display type.
- */
+ */
typedef enum
{
CAMERA_DISPLAY_TYPE_X11 = 0, /**< X surface display */
#ifndef GET_DISPLAY
/**
- * @brief Gets a display handle from x window id or evas object
+ * @brief Gets a display handle from x window id or evas object
*/
#define GET_DISPLAY(x) (void*)(x)
/**
- * @brief Enumerations of the camera display rotation type.
+ * @brief Enumerations of the camera rotation type.
+ */
+typedef enum
+{
+ CAMERA_ROTATION_NONE, /**< No rotation */
+ CAMERA_ROTATION_90, /**< 90 degree rotation */
+ CAMERA_ROTATION_180, /**< 180 degree rotation */
+ CAMERA_ROTATION_270, /**< 270 degree rotation */
+} camera_rotation_e;
+
+
+/**
+ * @brief Enumerations of the camera flip type.
*/
typedef enum
{
- CAMERA_DISPLAY_ROTATION_NONE, /**< No rotation of the display */
- CAMERA_DISPLAY_ROTATION_90, /**< 90 degree rotation */
- CAMERA_DISPLAY_ROTATION_180, /**< 180 degree rotation */
- CAMERA_DISPLAY_ROTATION_270, /**< 270 degree rotation */
-} camera_display_rotation_e;
+ CAMERA_FLIP_NONE, /**< No Flip */
+ CAMERA_FLIP_HORIZONTAL, /**< Horizontal flip */
+ CAMERA_FLIP_VERTICAL, /**< Vertical flip */
+ CAMERA_FLIP_BOTH /** Horizontal and vertical flip */
+}camera_flip_e;
/**
* @brief Enumerations of the camera display mode.
/**
- * @brief Called to get information about image data taken by the camera once per frame while capturing.
+ * @brief Called to get information about image data taken by the camera once per frame while capturing.
*
* @remarks This function is issued in the context of gstreamer (video source thread) so you should not directly invoke UI update code.
* You must not call camera_stop_preview() within this callback.
* @retval #CAMERA_ERROR_INVALID_OPERATION Invalid operation
*
* @pre The camera state must be #CAMERA_STATE_PREVIEW. \n
- * If needed, modify capture resolution(camera_set_capture_resolution()),
+ * If needed, modify capture resolution(camera_set_capture_resolution()),
* capture format(camera_set_capture_format()), or image quality(camera_attr_set_image_quality())
* @post If it succeeds the camera state will be #CAMERA_STATE_CAPTURED.
- *
+ *
* @see camera_start_preview()
* @see camera_set_capturing_cb()
* @see camera_set_capture_completed_cb()
* @pre The camera state should be #CAMERA_STATE_PREVIEW
*
* @see camera_start_focusing()
- * @see camera_focus_changed_cb()
+ * @see camera_focus_changed_cb()
*/
int camera_cancel_focusing(camera_h camera);
* @retval #CAMERA_ERROR_NONE Successful
* @retval #CAMERA_ERROR_INVALID_PARAMETER Invalid parameter
* @retval #CAMERA_ERROR_INVALID_STATE Invalid state
- * @retval #CAMERA_ERROR_INVALID_OPERATION Display type is not X11
+ * @retval #CAMERA_ERROR_INVALID_OPERATION Display type is not X11
*
* @see camera_start_preview()
* @see camera_get_x11_display_rotation()
*/
-int camera_set_x11_display_rotation(camera_h camera, camera_display_rotation_e rotation);
+int camera_set_x11_display_rotation(camera_h camera, camera_rotation_e rotation);
/**
* @brief Gets the display rotation.
* @ingroup CAPI_MEDIA_CAMERA_X11_DISPLAY_MODULE
- *
+ *
* @remarks This function is valid only for #CAMERA_DISPLAY_TYPE_X11.
*
* @param[in] camera The handle to the camera
*
* @see camera_set_x11_display_rotation()
*/
-int camera_get_x11_display_rotation(camera_h camera, camera_display_rotation_e *rotation);
+int camera_get_x11_display_rotation(camera_h camera, camera_rotation_e *rotation);
/**
* @brief Sets the visible property for X11 display.
int camera_unset_state_changed_cb(camera_h camera);
/**
- * @brief Registers a callback function to be called when auto-focus state changes.
+ * @brief Registers a callback function to be called when auto-focus state changes.
*
* @param[in] camera The handle to the camera
* @param[in] callback The callback function to register
/**
- * @brief Registers a callback function to be called when capture completes.
+ * @brief Registers a callback function to be called when capture completes.
*
* @param[in] camera The handle to the camera
* @param[in] callback The callback function to register
/**
- * @brief Registers a callback function to be called when an asynchronous operation error occurred.
+ * @brief Registers a callback function to be called when an asynchronous operation error occurred.
*
* @param[in] camera The handle to the camera
* @param[in] callback The callback function to register
* @addtogroup CAPI_MEDIA_CAMERA_ATTRIBUTES_MODULE
* @{
*/
-
+
/**
* @brief Sets the image quality.
*
* @retval #CAMERA_ERROR_INVALID_PARAMETER Invalid parameter
*
* @see camera_attr_get_zoom()
- * @see camera_attr_get_zoom_range()
+ * @see camera_attr_get_zoom_range()
*/
int camera_attr_set_zoom(camera_h camera, int zoom);
*
* @param[in] camera The handle to the camera
* @param[out] min The minimum zoom level
- * @param[out] max The maximum zoom level
+ * @param[out] max The maximum zoom level
* @return 0 on success, otherwise a negative error value.
* @retval #CAMERA_ERROR_NONE Successful
* @retval #CAMERA_ERROR_INVALID_PARAMETER Invalid parameter
* @addtogroup CAPI_MEDIA_CAMERA_CAPABILITY_MODULE
* @{
*/
-
+
/**
* @brief Retrieves all supported exposure modes by invoking callback function once for each supported exposure mode.
*
*
* @param[in] camera The handle to the camera
* @param[out] min The minimum exposure value
- * @param[out] max The maximum exposure value
+ * @param[out] max The maximum exposure value
* @return 0 on success, otherwise a negative error value.
* @retval #CAMERA_ERROR_NONE Successful
* @retval #CAMERA_ERROR_INVALID_PARAMETER Invalid parameter
*
* @param[in] camera The handle to the camera
* @param[out] min The minimum brightness level
- * @param[out] max The maximum brightness level
+ * @param[out] max The maximum brightness level
* @return 0 on success, otherwise a negative error value.
* @retval #CAMERA_ERROR_NONE Successful
* @retval #CAMERA_ERROR_INVALID_PARAMETER Invalid parameter
*
* @param[in] camera The handle to the camera
* @param[out] min The minimum contrast level
- * @param[out] max The maximum contrast level
+ * @param[out] max The maximum contrast level
* @return 0 on success, otherwise a negative error value.
* @retval #CAMERA_ERROR_NONE Successful
* @retval #CAMERA_ERROR_INVALID_PARAMETER Invalid parameter
int camera_attr_get_lens_orientation(camera_h camera, int *angle);
+/**
+ * @brief Sets stream rotation
+ *
+ * @param[in] camera The handle to the camera
+ * @param[in] rotation The stream rotation
+ * @return 0 on success, otherwise a negative error value.
+ * @retval #CAMERA_ERROR_NONE Successful
+ * @retval #CAMERA_ERROR_INVALID_PARAMETER Invalid parameter
+ *
+ * @pre The camera state must be CAMERA_STATE_CREATED.
+ *
+ * @see camera_attr_get_stream_rotation()
+ */
+int camera_attr_set_stream_rotation(camera_h camera , camera_rotation_e rotation);
+
+/**
+ * @brief Gets stream rotation
+ *
+ * @param[in] camera The handle to the camera
+ * @param[out] rotation The stream rotation
+ * @return 0 on success, otherwise a negative error value.
+ * @retval #CAMERA_ERROR_NONE Successful
+ * @retval #CAMERA_ERROR_INVALID_PARAMETER Invalid parameter
+ *
+ * @pre The camera state must be CAMERA_STATE_CREATED.
+ *
+ * @see camera_attr_set_stream_rotation()
+ */
+int camera_attr_get_stream_rotation(camera_h camera , camera_rotation_e *rotation);
+
+
+
+/**
+ * @brief Sets stream flip
+ *
+ * @param[in] camera The handle to the camera
+ * @param[in] flip The stream flip
+ * @return 0 on success, otherwise a negative error value.
+ * @retval #CAMERA_ERROR_NONE Successful
+ * @retval #CAMERA_ERROR_INVALID_PARAMETER Invalid parameter
+ *
+ * @pre The camera state must be CAMERA_STATE_CREATED.
+ *
+ * @see camera_attr_set_stream_rotation()
+ */
+int camera_attr_set_stream_flip(camera_h camera , camera_flip_e flip);
+
+/**
+ * @brief Gets stream flip
+ *
+ * @param[in] camera The handle to the camera
+ * @param[out] flip The stream flip
+ * @return 0 on success, otherwise a negative error value.
+ * @retval #CAMERA_ERROR_NONE Successful
+ * @retval #CAMERA_ERROR_INVALID_PARAMETER Invalid parameter
+ *
+ * @pre The camera state must be CAMERA_STATE_CREATED.
+ *
+ * @see camera_attr_set_stream_rotation()
+ */
+int camera_attr_get_stream_flip(camera_h camera , camera_flip_e *flip);
+
+
/**
* @}
*/
* 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.
+* limitations under the License.
*/
%build
-FULLVER=%{version}
-MAJORVER=`echo ${FULLVER} | cut -d '.' -f 1`
-cmake . -DCMAKE_INSTALL_PREFIX=/usr -DFULLVER=${FULLVER} -DMAJORVER=${MAJORVER}
+MAJORVER=`echo %{version} | awk 'BEGIN {FS="."}{print $1}'`
+cmake . -DCMAKE_INSTALL_PREFIX=/usr -DFULLVER=%{version} -DMAJORVER=${MAJORVER}
make %{?jobs:-j%jobs}
%files
-%{_libdir}/libcapi-media-camera.so*
+%{_libdir}/libcapi-media-camera.so.*
%files devel
%{_includedir}/media/camera.h
%{_libdir}/pkgconfig/*.pc
+%{_libdir}/libcapi-media-camera.so
* 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.
+* limitations under the License.
*/
camera_s * handle = (camera_s*)user_data;
MMMessageParamType *m = (MMMessageParamType*)param;
- camera_state_e previous_state;
+ camera_state_e previous_state;
switch(message){
}
break;
}
- case MM_MESSAGE_CAMCORDER_ERROR:
+ case MM_MESSAGE_CAMCORDER_ERROR:
{
int errorcode = m->code;
errorcode = __convert_camera_error_code("NOTIFY", errorcode);
char *error;
- ret = mm_camcorder_set_attributes(handle->mm_handle, &error,
- MMCAM_MODE , MM_CAMCORDER_MODE_IMAGE,
+ ret = mm_camcorder_set_attributes(handle->mm_handle, &error,
+ MMCAM_MODE , MM_CAMCORDER_MODE_IMAGE,
MMCAM_CAMERA_FORMAT, preview_format,
- MMCAM_IMAGE_ENCODER , MM_IMAGE_CODEC_JPEG,
+ MMCAM_IMAGE_ENCODER , MM_IMAGE_CODEC_JPEG,
MMCAM_CAPTURE_FORMAT, MM_PIXEL_FORMAT_ENCODED ,
- MMCAM_DISPLAY_SURFACE, MM_DISPLAY_SURFACE_NULL,
- MMCAM_DISPLAY_ROTATION, rotation,
- MMCAM_CAPTURE_COUNT, 1,
+ MMCAM_DISPLAY_SURFACE, MM_DISPLAY_SURFACE_NULL,
+ MMCAM_DISPLAY_ROTATION, rotation,
+ MMCAM_CAPTURE_COUNT, 1,
(void*)NULL);
handle->display_type = CAMERA_DISPLAY_TYPE_NONE;
handle->display_type = type;
ret = mm_camcorder_set_attributes(handle->mm_handle ,NULL,
MMCAM_DISPLAY_DEVICE, MM_DISPLAY_DEVICE_MAINLCD,
- MMCAM_DISPLAY_SURFACE ,type,
- MMCAM_DISPLAY_HANDLE , type == CAMERA_DISPLAY_TYPE_X11 ? &handle->display_handle : display , sizeof(display) ,
+ MMCAM_DISPLAY_SURFACE ,type,
+ MMCAM_DISPLAY_HANDLE , type == CAMERA_DISPLAY_TYPE_X11 ? &handle->display_handle : display , sizeof(display) ,
NULL);
return __convert_camera_error_code(__func__, ret);
}
return __convert_camera_error_code(__func__, ret);
}
-int camera_set_x11_display_rotation(camera_h camera, camera_display_rotation_e rotation){
+int camera_set_x11_display_rotation(camera_h camera, camera_rotation_e rotation){
if( camera == NULL){
LOGE( "[%s] INVALID_PARAMETER(0x%08x)",__func__,CAMERA_ERROR_INVALID_PARAMETER);
return CAMERA_ERROR_INVALID_PARAMETER;
}
- if( rotation < CAMERA_DISPLAY_ROTATION_NONE || rotation > CAMERA_DISPLAY_ROTATION_270 )
+ if( rotation < CAMERA_ROTATION_NONE || rotation > CAMERA_ROTATION_270 )
return CAMERA_ERROR_INVALID_PARAMETER;
int ret;
}
-int camera_get_x11_display_rotation( camera_h camera, camera_display_rotation_e *rotation){
+int camera_get_x11_display_rotation( camera_h camera, camera_rotation_e *rotation){
if( camera == NULL || rotation == NULL ){
LOGE( "[%s] INVALID_PARAMETER(0x%08x)",__func__,CAMERA_ERROR_INVALID_PARAMETER);
return CAMERA_ERROR_INVALID_PARAMETER;
case CAMERA_ATTR_AF_NONE:
ret = mm_camcorder_set_attributes(handle->mm_handle ,NULL, MMCAM_CAMERA_FOCUS_MODE , MM_CAMCORDER_FOCUS_MODE_NONE ,
MMCAM_CAMERA_AF_SCAN_RANGE , MM_CAMCORDER_AUTO_FOCUS_NORMAL , NULL);
- break;
+ break;
case CAMERA_ATTR_AF_NORMAL:
- ret = mm_camcorder_set_attributes(handle->mm_handle ,NULL, MMCAM_CAMERA_FOCUS_MODE , MM_CAMCORDER_FOCUS_MODE_AUTO ,
+ ret = mm_camcorder_set_attributes(handle->mm_handle ,NULL, MMCAM_CAMERA_FOCUS_MODE , MM_CAMCORDER_FOCUS_MODE_AUTO ,
MMCAM_CAMERA_AF_SCAN_RANGE , MM_CAMCORDER_AUTO_FOCUS_NORMAL , NULL);
break;
case CAMERA_ATTR_AF_MACRO:
- ret = mm_camcorder_set_attributes(handle->mm_handle ,NULL, MMCAM_CAMERA_FOCUS_MODE , MM_CAMCORDER_FOCUS_MODE_AUTO ,
+ ret = mm_camcorder_set_attributes(handle->mm_handle ,NULL, MMCAM_CAMERA_FOCUS_MODE , MM_CAMCORDER_FOCUS_MODE_AUTO ,
MMCAM_CAMERA_AF_SCAN_RANGE , MM_CAMCORDER_AUTO_FOCUS_MACRO , NULL);
break;
case CAMERA_ATTR_AF_FULL:
- ret = mm_camcorder_set_attributes(handle->mm_handle ,NULL, MMCAM_CAMERA_FOCUS_MODE , MM_CAMCORDER_FOCUS_MODE_AUTO ,
+ ret = mm_camcorder_set_attributes(handle->mm_handle ,NULL, MMCAM_CAMERA_FOCUS_MODE , MM_CAMCORDER_FOCUS_MODE_AUTO ,
MMCAM_CAMERA_AF_SCAN_RANGE , MM_CAMCORDER_AUTO_FOCUS_FULL , NULL);
break;
LOGE( "[%s] INVALID_PARAMETER(0x%08x)",__func__,CAMERA_ERROR_INVALID_PARAMETER);
return CAMERA_ERROR_INVALID_PARAMETER;
}
- int maptable[] = {MM_CAMCORDER_AUTO_EXPOSURE_OFF, //CAMCORDER_EXPOSURE_MODE_OFF
+ int maptable[] = {MM_CAMCORDER_AUTO_EXPOSURE_OFF, //CAMCORDER_EXPOSURE_MODE_OFF
MM_CAMCORDER_AUTO_EXPOSURE_ALL, //CAMCORDER_EXPOSURE_MODE_ALL
MM_CAMCORDER_AUTO_EXPOSURE_CENTER_1, //CAMCORDER_EXPOSURE_MODE_CENTER
MM_CAMCORDER_AUTO_EXPOSURE_SPOT_1, //CAMCORDER_EXPOSURE_MODE_SPOT
}
int maptable[] = {
CAMERA_ATTR_EFFECT_NONE, //MM_CAMCORDER_COLOR_TONE_NONE
- CAMERA_ATTR_EFFECT_MONO, //MM_CAMCORDER_COLOR_TONE_MONO,
+ CAMERA_ATTR_EFFECT_MONO, //MM_CAMCORDER_COLOR_TONE_MONO,
CAMERA_ATTR_EFFECT_SEPIA, //MM_CAMCORDER_COLOR_TONE_SEPIA, /**< Sepia */
CAMERA_ATTR_EFFECT_NEGATIVE, //MM_CAMCORDER_COLOR_TONE_NEGATIVE, //, /**< Negative */
CAMERA_ATTR_EFFECT_BLUE, //MM_CAMCORDER_COLOR_TONE_BLUE, /**< Blue */
}
+int camera_attr_set_stream_rotation(camera_h camera , camera_rotation_e rotation){
+ if( camera == NULL){
+ LOGE( "[%s] INVALID_PARAMETER(0x%08x)",__func__,CAMERA_ERROR_INVALID_PARAMETER);
+ return CAMERA_ERROR_INVALID_PARAMETER;
+ }
+
+ if( rotation < CAMERA_ROTATION_NONE || rotation > CAMERA_ROTATION_270 )
+ return CAMERA_ERROR_INVALID_PARAMETER;
+
+ int ret;
+ camera_s * handle = (camera_s*)camera;
+
+ ret = mm_camcorder_set_attributes(handle->mm_handle ,NULL, MMCAM_CAMERA_ROTATION , rotation, NULL);
+ return __convert_camera_error_code(__func__, ret);
+}
+
+int camera_attr_get_stream_rotation(camera_h camera , camera_rotation_e *rotation){
+ if( camera == NULL || rotation == NULL ){
+ LOGE( "[%s] INVALID_PARAMETER(0x%08x)",__func__,CAMERA_ERROR_INVALID_PARAMETER);
+ return CAMERA_ERROR_INVALID_PARAMETER;
+ }
+
+ int ret;
+ camera_s * handle = (camera_s*)camera;
+ ret = mm_camcorder_get_attributes(handle->mm_handle ,NULL, MMCAM_CAMERA_ROTATION , rotation, NULL);
+ return __convert_camera_error_code(__func__, ret);
+}
+int camera_attr_set_stream_flip(camera_h camera , camera_flip_e flip){
+ if( camera == NULL){
+ LOGE( "[%s] INVALID_PARAMETER(0x%08x)",__func__,CAMERA_ERROR_INVALID_PARAMETER);
+ return CAMERA_ERROR_INVALID_PARAMETER;
+ }
+
+ if( flip < CAMERA_FLIP_NONE || flip > CAMERA_FLIP_BOTH )
+ return CAMERA_ERROR_INVALID_PARAMETER;
+
+ int ret;
+ camera_s * handle = (camera_s*)camera;
+ int vflip = 0;
+ int hflip = 0;
+ vflip = (flip & CAMERA_FLIP_VERTICAL) == CAMERA_FLIP_VERTICAL;
+ hflip = (flip & CAMERA_FLIP_HORIZONTAL) == CAMERA_FLIP_HORIZONTAL;
+ ret = mm_camcorder_set_attributes(handle->mm_handle ,NULL, "" , hflip , "" , vflip , NULL);
+ return __convert_camera_error_code(__func__, ret);
+}
+
+int camera_attr_get_stream_flip(camera_h camera , camera_flip_e *flip){
+ if( camera == NULL || flip == NULL ){
+ LOGE( "[%s] INVALID_PARAMETER(0x%08x)",__func__,CAMERA_ERROR_INVALID_PARAMETER);
+ return CAMERA_ERROR_INVALID_PARAMETER;
+ }
+
+ int ret;
+ camera_s * handle = (camera_s*)camera;
+ int vflip =0;
+ int hflip = 0;
+ int result = 0;
+ char *error;
+ ret = mm_camcorder_get_attributes(handle->mm_handle ,&error, "" , &hflip , "" , &vflip , NULL);
+
+ if( ret == 0){
+ if( vflip)
+ result = result | CAMERA_FLIP_VERTICAL;
+ if( hflip )
+ result = result | CAMERA_FLIP_HORIZONTAL;
+ *flip = result;
+ }
+ return __convert_camera_error_code(__func__, ret);
+
+}
* 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.
+* limitations under the License.
*/
camera_attr_set_image_quality(camera, 100);
camera_set_capturing_cb(camera, capturing_cb, "/mnt/nfs/test.jpg");
camera_set_display(camera,CAMERA_DISPLAY_TYPE_X11, GET_DISPLAY(preview_win));
- camera_set_x11_display_rotation(camera, CAMERA_DISPLAY_ROTATION_270);
+ camera_set_x11_display_rotation(camera, CAMERA_ROTATION_270);
camera_attr_set_tag_orientation(camera,6);
//camera_attr_set_tag_orientation(camera,CAMERA_ATTR_TAG_ORT_0R_VT_0C_VR);
//camera_attr_enable_tag(camera, true);
return 0;
}
-bool g_af_test_pass ;
+bool g_af_test_pass ;
bool _af_mode_test_cb(camera_attr_af_mode_e mode, void *user_data){
camera_h camera = (camera_h) user_data;
int ret;
camera_h camera ;
camera_create(CAMERA_DEVICE_CAMERA0 , &camera);
camera_set_display(camera,CAMERA_DISPLAY_TYPE_X11, GET_DISPLAY(preview_win));
- camera_set_x11_display_rotation(camera, CAMERA_DISPLAY_ROTATION_270);
+ camera_set_x11_display_rotation(camera, CAMERA_ROTATION_270);
printf("-----------------------create camera-----------------------------\n");
preview_fps_test(camera);
camera_create(CAMERA_DEVICE_CAMERA0 , &camera);
camera_set_display(camera,CAMERA_DISPLAY_TYPE_X11, GET_DISPLAY(preview_win));
- camera_set_x11_display_rotation(camera, CAMERA_DISPLAY_ROTATION_270);
+ camera_set_x11_display_rotation(camera, CAMERA_ROTATION_270);
camera_set_preview_cb(camera, _camera_preview_test_cb , &preview_test_data);
ret = camera_foreach_supported_preview_format(camera, _preview_format_test_cb,enable_preview_format);
camera_create(CAMERA_DEVICE_CAMERA0 , &camera);
camera_set_display(camera,CAMERA_DISPLAY_TYPE_X11, GET_DISPLAY(preview_win));
- camera_set_x11_display_rotation(camera, CAMERA_DISPLAY_ROTATION_270);
+ camera_set_x11_display_rotation(camera, CAMERA_ROTATION_270);
camera_set_state_changed_cb(camera, _state_change_test_cb, &data);
camera_set_capturing_cb(camera,_capture_test_cb, NULL);
camera_create(CAMERA_DEVICE_CAMERA0 , &camera);
camera_set_display(camera,CAMERA_DISPLAY_TYPE_X11, GET_DISPLAY(preview_win));
- camera_set_x11_display_rotation(camera, CAMERA_DISPLAY_ROTATION_270);
+ camera_set_x11_display_rotation(camera, CAMERA_ROTATION_270);
camera_set_capturing_cb(camera,_capture_test2_cb, &iscalled);
camera_start_preview(camera);
iscalled = 0;
camera_create(CAMERA_DEVICE_CAMERA0 , &camera);
camera_set_display(camera,CAMERA_DISPLAY_TYPE_X11, GET_DISPLAY(preview_win));
- camera_set_x11_display_rotation(camera, CAMERA_DISPLAY_ROTATION_270);
+ camera_set_x11_display_rotation(camera, CAMERA_ROTATION_270);
resolution_list.count = 0;
camera_foreach_supported_capture_resolution(camera, capture_resolution_test_cb, &resolution_list);
//camera_set_state_changed_cb(camera, state_cb, NULL);
void preview_test(){
- camera_h camera ;
+ camera_h camera ;
camera_create(CAMERA_DEVICE_CAMERA0, &camera);
camera_set_display(camera, CAMERA_DISPLAY_TYPE_EVAS,img);
//camera_foreach_supported_preview_resolution(camera,preview_resolution_cb, NULL);
ret = camera_create(CAMERA_DEVICE_CAMERA0, &camera);
printf("camera_create %d\n", ret);
camera_set_display(camera, CAMERA_DISPLAY_TYPE_X11 , GET_DISPLAY(preview_win));
- camera_set_x11_display_rotation(camera, CAMERA_DISPLAY_ROTATION_NONE);
+ camera_set_x11_display_rotation(camera, CAMERA_ROTATION_NONE);
camera_start_preview(camera);
sleep(3);
printf("180\n");
- camera_set_x11_display_rotation(camera, CAMERA_DISPLAY_ROTATION_180);
+ camera_set_x11_display_rotation(camera, CAMERA_ROTATION_180);
sleep(3);
printf("270\n");
- camera_set_x11_display_rotation(camera, CAMERA_DISPLAY_ROTATION_270);
+ camera_set_x11_display_rotation(camera, CAMERA_ROTATION_270);
sleep(3);
printf("90\n");
- camera_set_x11_display_rotation(camera, CAMERA_DISPLAY_ROTATION_90);
+ camera_set_x11_display_rotation(camera, CAMERA_ROTATION_90);
sleep(10);
camera_stop_preview(camera);
ret = camera_create(CAMERA_DEVICE_CAMERA0, &camera);
printf("camera_create %d\n", ret);
camera_set_display(camera, CAMERA_DISPLAY_TYPE_X11 , GET_DISPLAY(preview_win));
- camera_set_x11_display_rotation(camera, CAMERA_DISPLAY_ROTATION_270);
+ camera_set_x11_display_rotation(camera, CAMERA_ROTATION_270);
camera_set_focus_changed_cb(camera, _focus_changed_cb2, NULL);
camera_start_preview(camera);
camera_attr_set_contrast(camera, 1);
}
+void rotation_flip_test(){
+ camera_h camera;
+ camera_flip_e flip;
+ camera_create(CAMERA_DEVICE_CAMERA0, &camera);
+ printf("flip in = %d\n", CAMERA_FLIP_HORIZONTAL);
+ camera_attr_set_stream_flip(camera, CAMERA_FLIP_HORIZONTAL);
+ camera_attr_get_stream_flip(camera, &flip);
+ printf("flip out = %d\n", flip);
+
+ printf("flip in = %d\n", CAMERA_FLIP_NONE);
+ camera_attr_set_stream_flip(camera, CAMERA_FLIP_NONE);
+ camera_attr_get_stream_flip(camera, &flip);
+ printf("flip out = %d\n", flip);
+
+ printf("flip in = %d\n", CAMERA_FLIP_VERTICAL);
+ camera_attr_set_stream_flip(camera, CAMERA_FLIP_VERTICAL);
+ camera_attr_get_stream_flip(camera, &flip);
+ printf("flip out = %d\n", flip);
+
+ printf("flip in = %d\n", CAMERA_FLIP_BOTH);
+ camera_attr_set_stream_flip(camera, CAMERA_FLIP_BOTH);
+ camera_attr_get_stream_flip(camera, &flip);
+ printf("flip out = %d\n", flip);
+
+
+}
+
int camera_test(){
int ret=0;
+ /*
ret = camera_attribute_test();
ret += camera_preview_test();
ret += camera_state_change_test();
camera_lens_rotation_test();
contrast_test2();
-
+ */
+ rotation_flip_test();
return ret;
}