/**
* @testcase utc_media_streamrecorder_prepare_n1
* @description To check prepare recorder with invalid precondition.
- * @scenario This test is for checking with invalid precondition with default setting. \n
+ * @scenario This test is for checking with invalid precondition. \n
1. Prepare recorder. \n
- 2. Destroy recorder. \n
+ 2. Prepare recorder again. \n
+ 3. Unprepare recorder. \n
* @parameter N/A
* @return 1 is the fail. You need to check log in tct tool. \n
0 is the success. \n
int ret = STREAMRECORDER_ERROR_NONE;
assert_eq(startup_ret, STREAMRECORDER_ERROR_NONE);
- streamrecorder_destroy(recorder);
+ ret |= streamrecorder_enable_source_buffer(recorder, STREAMRECORDER_SOURCE_VIDEO);
+ ret |= streamrecorder_set_video_source_format(recorder, STREAMRECORDER_VIDEO_SOURCE_FORMAT_I420);
+ ret |= streamrecorder_set_file_format(recorder, STREAMRECORDER_FILE_FORMAT_MP4);
+ ret |= streamrecorder_set_video_encoder(recorder, STREAMRECORDER_VIDEO_CODEC_MPEG4);
+ ret |= streamrecorder_set_video_resolution(recorder, 1280, 720);
+ ret |= streamrecorder_set_filename(recorder, media_path);
+ ret |= streamrecorder_prepare(recorder);
+ if (ret != STREAMRECORDER_ERROR_NONE) {
+ assert_eq(ret, STREAMRECORDER_ERROR_NONE);
+ }
+
ret = streamrecorder_prepare(recorder);
+ streamrecorder_unprepare(recorder);
assert_eq(ret, STREAMRECORDER_ERROR_INVALID_STATE);
- recorder = NULL;
return 0;
}