+ _stop_preview(g_cam_handle);
+}
+
+TEST_F(MMCamcorderTest, PauseP)
+{
+ int ret = MM_ERROR_NONE;
+ int video_encoder = 0;
+ int audio_encoder = 0;
+ int file_format = 0;
+ gboolean ret_settings = FALSE;
+
+ ASSERT_EQ(_start_preview(g_cam_handle), MM_ERROR_NONE);
+
+ if (mm_camcorder_set_muxed_stream_callback(g_cam_handle, _muxed_stream_callback, g_cam_handle) != MM_ERROR_NONE)
+ cout << "[FAILED] set muxed stream callback" << endl;
+
+ ret_settings = _get_video_recording_settings(&video_encoder, &audio_encoder, &file_format);
+ EXPECT_EQ(ret_settings, TRUE);
+
+ ret = mm_camcorder_set_attributes(g_cam_handle, NULL,
+ MMCAM_VIDEO_ENCODER, video_encoder,
+ MMCAM_AUDIO_ENCODER, audio_encoder,
+ MMCAM_FILE_FORMAT, file_format,
+ NULL);
+ EXPECT_EQ(ret, MM_ERROR_NONE);
+
+ ret = mm_camcorder_record(g_cam_handle);
+ EXPECT_EQ(ret, MM_ERROR_NONE);
+
+ if (ret == MM_ERROR_NONE) {
+ sleep(5);
+
+ ret = mm_camcorder_pause(g_cam_handle);
+ EXPECT_EQ(ret, MM_ERROR_NONE);
+
+ mm_camcorder_cancel(g_cam_handle);
+ }
+
+ _stop_preview(g_cam_handle);
+}
+
+TEST_F(MMCamcorderTest, GetStateP)
+{
+ int ret = MM_ERROR_NONE;
+ MMCamcorderStateType state = MM_CAMCORDER_STATE_NONE;
+
+ ret = mm_camcorder_get_state(g_cam_handle, &state);
+ ASSERT_EQ(ret, MM_ERROR_NONE);
+}
+
+TEST_F(MMCamcorderTest, GetState2P)
+{
+ int ret = MM_ERROR_NONE;
+ MMCamcorderStateType state = MM_CAMCORDER_STATE_NONE;
+ MMCamcorderStateType old_state = MM_CAMCORDER_STATE_NONE;
+
+ ret = mm_camcorder_get_state2(g_cam_handle, &state, &old_state);
+ ASSERT_EQ(ret, MM_ERROR_NONE);
+}
+
+TEST_F(MMCamcorderTest, GetAttributesP)
+{
+ int ret = MM_ERROR_NONE;
+ int device_count = 0;
+ int audio_device = 0;
+
+ ret = mm_camcorder_get_attributes(g_cam_handle, NULL,
+ MMCAM_CAMERA_DEVICE_COUNT, &device_count,
+ MMCAM_AUDIO_DEVICE, &audio_device,
+ NULL);
+ ASSERT_EQ(ret, MM_ERROR_NONE);
+}
+
+TEST_F(MMCamcorderTest, SetAttributesP)
+{
+ int ret = MM_ERROR_NONE;
+ int audio_encoder = 0;
+ int file_format = 0;
+ gboolean ret_settings = FALSE;
+
+ ret_settings = _get_audio_recording_settings(&audio_encoder, &file_format);
+ ASSERT_EQ(ret_settings, TRUE);
+
+ ret = mm_camcorder_set_attributes(g_cam_handle, NULL,
+ MMCAM_MODE, MM_CAMCORDER_MODE_AUDIO,
+ MMCAM_AUDIO_ENCODER, audio_encoder,
+ MMCAM_FILE_FORMAT, file_format,
+ NULL);
+ ASSERT_EQ(ret, MM_ERROR_NONE);
+}
+
+TEST_F(MMCamcorderTest, GetAttributeInfoP)
+{
+ int ret = MM_ERROR_NONE;
+ MMCamAttrsInfo info;
+
+ ret = mm_camcorder_get_attribute_info(g_cam_handle, MMCAM_MODE, &info);
+ ASSERT_EQ(ret, MM_ERROR_NONE);
+}
+
+TEST_F(MMCamcorderTest, GetFPSListByResolutionP)
+{
+ int ret = MM_ERROR_NONE;
+ int width = 0;
+ int height = 0;
+ MMCamAttrsInfo fps_info;
+
+ ret = mm_camcorder_get_attributes(g_cam_handle, NULL,
+ MMCAM_CAMERA_WIDTH, &width,
+ MMCAM_CAMERA_HEIGHT, &height,
+ NULL);
+ ASSERT_EQ(ret, MM_ERROR_NONE);
+
+ ret = mm_camcorder_get_fps_list_by_resolution(g_cam_handle, width, height, &fps_info);
+ ASSERT_EQ(ret, MM_ERROR_NONE);
+}
+
+TEST_F(MMCamcorderTest, InitFocsingP)
+{
+ ASSERT_EQ(_start_preview(g_cam_handle), MM_ERROR_NONE);
+
+ EXPECT_EQ(mm_camcorder_init_focusing(g_cam_handle), MM_ERROR_NONE);
+
+ _stop_preview(g_cam_handle);
+}
+
+TEST_F(MMCamcorderTest, StartFocusingP)
+{
+ gint64 end_time = 0;
+
+ ASSERT_EQ(_start_preview(g_cam_handle), MM_ERROR_NONE);
+
+ g_mutex_lock(&g_lock);
+
+ EXPECT_EQ(mm_camcorder_start_focusing(g_cam_handle), MM_ERROR_NONE);
+
+ end_time = g_get_monotonic_time() + 3 * G_TIME_SPAN_SECOND;
+
+ EXPECT_EQ(g_cond_wait_until(&g_focus_cond, &g_lock, end_time), TRUE);
+
+ g_mutex_unlock(&g_lock);
+
+ _stop_preview(g_cam_handle);
+}
+
+TEST_F(MMCamcorderTest, StopFocusingP)
+{
+ ASSERT_EQ(_start_preview(g_cam_handle), MM_ERROR_NONE);
+
+ EXPECT_EQ(mm_camcorder_start_focusing(g_cam_handle), MM_ERROR_NONE);
+ EXPECT_EQ(mm_camcorder_stop_focusing(g_cam_handle), MM_ERROR_NONE);
+
+ _stop_preview(g_cam_handle);