From a15fc92f3b82f1b6d6f529b3269b3048947cffcb Mon Sep 17 00:00:00 2001 From: Gilbok Lee Date: Fri, 30 Mar 2018 15:06:56 +0900 Subject: [PATCH] [UTC][video-util][NonACR][Fix SVACE issue / modified indent] Change-Id: I966d90ef28ce4cdc9d78ebd065cb3ec36b624816 --- src/utc/video-util/utc-video-util.c | 1178 ++++++++++++++++++----------------- 1 file changed, 591 insertions(+), 587 deletions(-) diff --git a/src/utc/video-util/utc-video-util.c b/src/utc/video-util/utc-video-util.c index 9c63a9f..2e3d6ec 100755 --- a/src/utc/video-util/utc-video-util.c +++ b/src/utc/video-util/utc-video-util.c @@ -25,10 +25,10 @@ #define API_NAMESPACE "[VIDEO-UTIL]" //& set: Video-util -static const char* MEDIA_PATH = NULL; -static const char* MEDIA_FILE = "tct-content-tizen-tests_video.mp4"; -static const char* MEDIA_OUTPUT_PATH = NULL; -static const char* MEDIA_OUTPUT_FILE = "tct-content-tizen-tests_video_test.mp4"; +static const char *MEDIA_PATH = NULL; +static const char *MEDIA_FILE = "tct-content-tizen-tests_video.mp4"; +static const char *MEDIA_OUTPUT_PATH = NULL; +static const char *MEDIA_OUTPUT_FILE = "tct-content-tizen-tests_video_test.mp4"; GMainLoop *g_loop = NULL; video_util_h video_h = NULL; int is_handle_error = VIDEO_UTIL_ERROR_NONE; @@ -38,7 +38,6 @@ static bool g_video_info_transcoder = true; static int duration; static int current_position; - /** * @function utc_video_util_startup * @description Called before each test @@ -47,31 +46,35 @@ static int current_position; */ void utc_video_util_startup(void) { - system_info_get_platform_bool("http://tizen.org/feature/multimedia.transcoder", &g_video_info_transcoder); - - char pszValue[CONFIG_VALUE_LEN_MAX] = {0,}; - if ( true == GetValueForTCTSetting("DEVICE_SUITE_TARGET_30", pszValue, API_NAMESPACE )) - { - PRINT_UTC_LOG("[Line : %d][%s] 'DEVICE_SUITE_TARGET_30' Values Received = %s\\n", __LINE__, API_NAMESPACE, pszValue); - MEDIA_PATH = (char*)malloc(strlen(pszValue) + strlen(MEDIA_FILE) + 6); + system_info_get_platform_bool("http://tizen.org/feature/multimedia.transcoder", &g_video_info_transcoder); + + char pszValue[CONFIG_VALUE_LEN_MAX] = { 0, }; + if (true == GetValueForTCTSetting("DEVICE_SUITE_TARGET_30", pszValue, API_NAMESPACE)) { + PRINT_UTC_LOG("[Line : %d][%s] 'DEVICE_SUITE_TARGET_30' Values Received = %s\\n", __LINE__, API_NAMESPACE, pszValue); + MEDIA_PATH = (char *)malloc(strlen(pszValue) + strlen(MEDIA_FILE) + 6); + if (!MEDIA_PATH) { + PRINT_UTC_LOG("[Line : %d][%s] Fail to malloc MEDIA_PATH\n", __LINE__, API_NAMESPACE); + return; + } snprintf(MEDIA_PATH, strlen(pszValue) + strlen(MEDIA_FILE) + 6, "%s/res/%s", pszValue, MEDIA_FILE); - MEDIA_OUTPUT_PATH = (char*)malloc(strlen(pszValue) + strlen(MEDIA_OUTPUT_FILE) + 6); + MEDIA_OUTPUT_PATH = (char *)malloc(strlen(pszValue) + strlen(MEDIA_OUTPUT_FILE) + 6); + if (!MEDIA_OUTPUT_PATH) { + PRINT_UTC_LOG("[Line : %d][%s] Fail to malloc MEDIA_PATH\n", __LINE__, API_NAMESPACE); + return; + } snprintf(MEDIA_OUTPUT_PATH, strlen(pszValue) + strlen(MEDIA_OUTPUT_FILE) + 6, "%s/res/%s", pszValue, MEDIA_OUTPUT_FILE); - } - else - { + } else { PRINT_UTC_LOG("[Line : %d][%s] GetValueForTCTSetting returned error for 'DEVICE_SUITE_TARGET_30'\\n", __LINE__, API_NAMESPACE); } - int ret = video_util_create(&video_h); + int ret = video_util_create(&video_h); - if(VIDEO_UTIL_ERROR_NONE != ret) - is_handle_error = ret; + if (VIDEO_UTIL_ERROR_NONE != ret) + is_handle_error = ret; - if(MEDIA_PATH == NULL || MEDIA_OUTPUT_PATH == NULL) { - fprintf(stderr, "Startup error at %s:%d\n", __FILE__, __LINE__); - } + if (MEDIA_PATH == NULL || MEDIA_OUTPUT_PATH == NULL) + fprintf(stderr, "Startup error at %s:%d\n", __FILE__, __LINE__); } /** @@ -82,51 +85,56 @@ void utc_video_util_startup(void) */ void utc_video_util_cleanup(void) { - video_util_destroy(video_h); - video_h = NULL; - is_handle_error = VIDEO_UTIL_ERROR_NONE; - if(MEDIA_PATH != NULL) { - free(MEDIA_PATH); - } - if(MEDIA_OUTPUT_PATH != NULL) { - free(MEDIA_OUTPUT_PATH); - } + int ret = VIDEO_UTIL_ERROR_NONE; + ret = video_util_destroy(video_h); + if (ret != VIDEO_UTIL_ERROR_NONE) + PRINT_UTC_LOG("[Line : %d][%s] Fail to video_util_destroy \n", __LINE__, API_NAMESPACE); + + video_h = NULL; + is_handle_error = VIDEO_UTIL_ERROR_NONE; + if (MEDIA_PATH != NULL) { + free(MEDIA_PATH); + MEDIA_PATH = NULL; + } + if (MEDIA_OUTPUT_PATH != NULL) { + free(MEDIA_OUTPUT_PATH); + MEDIA_OUTPUT_PATH = NULL; + } } static bool utc_transcode_spec_cb(int value, void *user_data) { - return true; + return true; } static int utc_transcode_progress_cb(unsigned long current_position, unsigned long duration, void *user_data) { - int ret = VIDEO_UTIL_ERROR_NONE; - if(CANCEL) { - if(current_position > 700 && current_position < 800) { - ret = video_util_cancel_transcoding(video_h); - assert_eq(ret, VIDEO_UTIL_ERROR_NONE); - CANCEL = FALSE; - } - } else if(PROGRESS) { - if(current_position > 700 && current_position < 800) { - ret = video_util_get_progress_transcoding(video_h, ¤t_position, &duration); - assert_eq(ret, VIDEO_UTIL_ERROR_NONE); - PROGRESS = FALSE; - } - } - return true; + int ret = VIDEO_UTIL_ERROR_NONE; + if (CANCEL) { + if (current_position > 700 && current_position < 800) { + ret = video_util_cancel_transcoding(video_h); + assert_eq(ret, VIDEO_UTIL_ERROR_NONE); + CANCEL = FALSE; + } + } else if (PROGRESS) { + if (current_position > 700 && current_position < 800) { + ret = video_util_get_progress_transcoding(video_h, ¤t_position, &duration); + assert_eq(ret, VIDEO_UTIL_ERROR_NONE); + PROGRESS = FALSE; + } + } + return true; } static int utc_transcode_completed_cb(video_util_error_e error, void *user_data) { - if(error == VIDEO_UTIL_ERROR_NONE) { - if(g_loop) - g_main_loop_quit(g_loop); - return true; - } - else { - return false; - } + if (error == VIDEO_UTIL_ERROR_NONE) { + if (g_loop) + g_main_loop_quit(g_loop); + return true; + } else { + return false; + } } /** @@ -136,17 +144,17 @@ static int utc_transcode_completed_cb(video_util_error_e error, void *user_data) */ int utc_video_util_create_n(void) { - int ret = VIDEO_UTIL_ERROR_NONE; - if(g_video_info_transcoder == false) { - ret = video_util_create(NULL); - assert_eq(ret, VIDEO_UTIL_ERROR_NOT_SUPPORTED); - return 0; - } + int ret = VIDEO_UTIL_ERROR_NONE; + if (g_video_info_transcoder == false) { + ret = video_util_create(NULL); + assert_eq(ret, VIDEO_UTIL_ERROR_NOT_SUPPORTED); + return 0; + } - ret = video_util_create(NULL); - assert_neq(ret, VIDEO_UTIL_ERROR_NONE); + ret = video_util_create(NULL); + assert_neq(ret, VIDEO_UTIL_ERROR_NONE); - return 0; + return 0; } /** @@ -156,15 +164,15 @@ int utc_video_util_create_n(void) */ int utc_video_util_create_p(void) { - bool value = true; - if(g_video_info_transcoder == false) { - assert_eq(is_handle_error, VIDEO_UTIL_ERROR_NOT_SUPPORTED); - return 0; - } + bool value = true; + if (g_video_info_transcoder == false) { + assert_eq(is_handle_error, VIDEO_UTIL_ERROR_NOT_SUPPORTED); + return 0; + } - assert_eq(is_handle_error, VIDEO_UTIL_ERROR_NONE); + assert_eq(is_handle_error, VIDEO_UTIL_ERROR_NONE); - return 0; + return 0; } /** @@ -174,18 +182,18 @@ int utc_video_util_create_p(void) */ int utc_video_util_set_file_path_n1(void) { - int ret = VIDEO_UTIL_ERROR_NONE; - if(g_video_info_transcoder == false) { - ret = video_util_set_file_path(video_h, NULL); - assert_eq(ret, VIDEO_UTIL_ERROR_NOT_SUPPORTED); - return 0; - } - - assert_eq(is_handle_error, VIDEO_UTIL_ERROR_NONE); - ret = video_util_set_file_path(video_h, NULL); - assert_neq(ret, VIDEO_UTIL_ERROR_NONE); - - return 0; + int ret = VIDEO_UTIL_ERROR_NONE; + if (g_video_info_transcoder == false) { + ret = video_util_set_file_path(video_h, NULL); + assert_eq(ret, VIDEO_UTIL_ERROR_NOT_SUPPORTED); + return 0; + } + + assert_eq(is_handle_error, VIDEO_UTIL_ERROR_NONE); + ret = video_util_set_file_path(video_h, NULL); + assert_neq(ret, VIDEO_UTIL_ERROR_NONE); + + return 0; } /** @@ -195,17 +203,17 @@ int utc_video_util_set_file_path_n1(void) */ int utc_video_util_set_file_path_n2(void) { - int ret = VIDEO_UTIL_ERROR_NONE; - if(g_video_info_transcoder == false) { - ret = video_util_set_file_path(NULL, MEDIA_PATH); - assert_eq(ret, VIDEO_UTIL_ERROR_NOT_SUPPORTED); - return 0; - } + int ret = VIDEO_UTIL_ERROR_NONE; + if (g_video_info_transcoder == false) { + ret = video_util_set_file_path(NULL, MEDIA_PATH); + assert_eq(ret, VIDEO_UTIL_ERROR_NOT_SUPPORTED); + return 0; + } - ret = video_util_set_file_path(NULL, MEDIA_PATH); - assert_neq(ret, VIDEO_UTIL_ERROR_NONE); + ret = video_util_set_file_path(NULL, MEDIA_PATH); + assert_neq(ret, VIDEO_UTIL_ERROR_NONE); - return 0; + return 0; } /** @@ -215,18 +223,18 @@ int utc_video_util_set_file_path_n2(void) */ int utc_video_util_set_file_path_p(void) { - int ret = VIDEO_UTIL_ERROR_NONE; - if(g_video_info_transcoder == false) { - ret = video_util_set_file_path(video_h, MEDIA_PATH); - assert_eq(ret, VIDEO_UTIL_ERROR_NOT_SUPPORTED); - return 0; - } - - assert_eq(is_handle_error, VIDEO_UTIL_ERROR_NONE); - ret = video_util_set_file_path(video_h, MEDIA_PATH); - assert_eq(ret, VIDEO_UTIL_ERROR_NONE); - - return 0; + int ret = VIDEO_UTIL_ERROR_NONE; + if (g_video_info_transcoder == false) { + ret = video_util_set_file_path(video_h, MEDIA_PATH); + assert_eq(ret, VIDEO_UTIL_ERROR_NOT_SUPPORTED); + return 0; + } + + assert_eq(is_handle_error, VIDEO_UTIL_ERROR_NONE); + ret = video_util_set_file_path(video_h, MEDIA_PATH); + assert_eq(ret, VIDEO_UTIL_ERROR_NONE); + + return 0; } /** @@ -236,17 +244,17 @@ int utc_video_util_set_file_path_p(void) */ int utc_video_util_set_accurate_mode_n(void) { - int ret = VIDEO_UTIL_ERROR_NONE; - if(g_video_info_transcoder == false) { - ret = video_util_set_accurate_mode(NULL, 0); - assert_eq(ret, VIDEO_UTIL_ERROR_NOT_SUPPORTED); - return 0; - } + int ret = VIDEO_UTIL_ERROR_NONE; + if (g_video_info_transcoder == false) { + ret = video_util_set_accurate_mode(NULL, 0); + assert_eq(ret, VIDEO_UTIL_ERROR_NOT_SUPPORTED); + return 0; + } - ret = video_util_set_accurate_mode(NULL, 0); - assert_neq(ret, VIDEO_UTIL_ERROR_NONE); + ret = video_util_set_accurate_mode(NULL, 0); + assert_neq(ret, VIDEO_UTIL_ERROR_NONE); - return 0; + return 0; } /** @@ -256,18 +264,18 @@ int utc_video_util_set_accurate_mode_n(void) */ int utc_video_util_set_accurate_mode_p(void) { - int ret = VIDEO_UTIL_ERROR_NONE; - if(g_video_info_transcoder == false) { - ret = video_util_set_accurate_mode(video_h, 0); - assert_eq(ret, VIDEO_UTIL_ERROR_NOT_SUPPORTED); - return 0; - } - - assert_eq(is_handle_error, VIDEO_UTIL_ERROR_NONE); - ret = video_util_set_accurate_mode(video_h, 0); - assert_eq(ret, VIDEO_UTIL_ERROR_NONE); - - return 0; + int ret = VIDEO_UTIL_ERROR_NONE; + if (g_video_info_transcoder == false) { + ret = video_util_set_accurate_mode(video_h, 0); + assert_eq(ret, VIDEO_UTIL_ERROR_NOT_SUPPORTED); + return 0; + } + + assert_eq(is_handle_error, VIDEO_UTIL_ERROR_NONE); + ret = video_util_set_accurate_mode(video_h, 0); + assert_eq(ret, VIDEO_UTIL_ERROR_NONE); + + return 0; } /** @@ -277,18 +285,18 @@ int utc_video_util_set_accurate_mode_p(void) */ int utc_video_util_set_video_codec_n1(void) { - int ret = VIDEO_UTIL_ERROR_NONE; - if(g_video_info_transcoder == false) { - ret = video_util_set_video_codec(video_h, -1); - assert_eq(ret, VIDEO_UTIL_ERROR_NOT_SUPPORTED); - return 0; - } - - assert_eq(is_handle_error, VIDEO_UTIL_ERROR_NONE); - ret = video_util_set_video_codec(video_h, -1); - assert_neq(ret, VIDEO_UTIL_ERROR_NONE); - - return 0; + int ret = VIDEO_UTIL_ERROR_NONE; + if (g_video_info_transcoder == false) { + ret = video_util_set_video_codec(video_h, -1); + assert_eq(ret, VIDEO_UTIL_ERROR_NOT_SUPPORTED); + return 0; + } + + assert_eq(is_handle_error, VIDEO_UTIL_ERROR_NONE); + ret = video_util_set_video_codec(video_h, -1); + assert_neq(ret, VIDEO_UTIL_ERROR_NONE); + + return 0; } /** @@ -298,17 +306,17 @@ int utc_video_util_set_video_codec_n1(void) */ int utc_video_util_set_video_codec_n2(void) { - int ret = VIDEO_UTIL_ERROR_NONE; - if(g_video_info_transcoder == false) { - ret = video_util_set_video_codec(NULL, VIDEO_UTIL_VIDEO_CODEC_MPEG4); - assert_eq(ret, VIDEO_UTIL_ERROR_NOT_SUPPORTED); - return 0; - } + int ret = VIDEO_UTIL_ERROR_NONE; + if (g_video_info_transcoder == false) { + ret = video_util_set_video_codec(NULL, VIDEO_UTIL_VIDEO_CODEC_MPEG4); + assert_eq(ret, VIDEO_UTIL_ERROR_NOT_SUPPORTED); + return 0; + } - ret = video_util_set_video_codec(NULL, VIDEO_UTIL_VIDEO_CODEC_MPEG4); - assert_neq(ret, VIDEO_UTIL_ERROR_NONE); + ret = video_util_set_video_codec(NULL, VIDEO_UTIL_VIDEO_CODEC_MPEG4); + assert_neq(ret, VIDEO_UTIL_ERROR_NONE); - return 0; + return 0; } /** @@ -318,18 +326,18 @@ int utc_video_util_set_video_codec_n2(void) */ int utc_video_util_set_video_codec_p(void) { - int ret = VIDEO_UTIL_ERROR_NONE; - if(g_video_info_transcoder == false) { - ret = video_util_set_video_codec(video_h, VIDEO_UTIL_VIDEO_CODEC_MPEG4); - assert_eq(ret, VIDEO_UTIL_ERROR_NOT_SUPPORTED); - return 0; - } - - assert_eq(is_handle_error, VIDEO_UTIL_ERROR_NONE); - ret = video_util_set_video_codec(video_h, VIDEO_UTIL_VIDEO_CODEC_MPEG4); - assert_eq(ret, VIDEO_UTIL_ERROR_NONE); - - return 0; + int ret = VIDEO_UTIL_ERROR_NONE; + if (g_video_info_transcoder == false) { + ret = video_util_set_video_codec(video_h, VIDEO_UTIL_VIDEO_CODEC_MPEG4); + assert_eq(ret, VIDEO_UTIL_ERROR_NOT_SUPPORTED); + return 0; + } + + assert_eq(is_handle_error, VIDEO_UTIL_ERROR_NONE); + ret = video_util_set_video_codec(video_h, VIDEO_UTIL_VIDEO_CODEC_MPEG4); + assert_eq(ret, VIDEO_UTIL_ERROR_NONE); + + return 0; } /** @@ -339,18 +347,18 @@ int utc_video_util_set_video_codec_p(void) */ int utc_video_util_set_audio_codec_n1(void) { - int ret = VIDEO_UTIL_ERROR_NONE; - if(g_video_info_transcoder == false) { - ret = video_util_set_audio_codec(video_h, -1); - assert_eq(ret, VIDEO_UTIL_ERROR_NOT_SUPPORTED); - return 0; - } - - assert_eq(is_handle_error, VIDEO_UTIL_ERROR_NONE); - ret = video_util_set_audio_codec(video_h, -1); - assert_neq(ret, VIDEO_UTIL_ERROR_NONE); - - return 0; + int ret = VIDEO_UTIL_ERROR_NONE; + if (g_video_info_transcoder == false) { + ret = video_util_set_audio_codec(video_h, -1); + assert_eq(ret, VIDEO_UTIL_ERROR_NOT_SUPPORTED); + return 0; + } + + assert_eq(is_handle_error, VIDEO_UTIL_ERROR_NONE); + ret = video_util_set_audio_codec(video_h, -1); + assert_neq(ret, VIDEO_UTIL_ERROR_NONE); + + return 0; } /** @@ -360,17 +368,17 @@ int utc_video_util_set_audio_codec_n1(void) */ int utc_video_util_set_audio_codec_n2(void) { - int ret = VIDEO_UTIL_ERROR_NONE; - if(g_video_info_transcoder == false) { - ret = video_util_set_audio_codec(NULL, VIDEO_UTIL_AUDIO_CODEC_AAC); - assert_eq(ret, VIDEO_UTIL_ERROR_NOT_SUPPORTED); - return 0; - } + int ret = VIDEO_UTIL_ERROR_NONE; + if (g_video_info_transcoder == false) { + ret = video_util_set_audio_codec(NULL, VIDEO_UTIL_AUDIO_CODEC_AAC); + assert_eq(ret, VIDEO_UTIL_ERROR_NOT_SUPPORTED); + return 0; + } - ret = video_util_set_audio_codec(NULL, VIDEO_UTIL_AUDIO_CODEC_AAC); - assert_neq(ret, VIDEO_UTIL_ERROR_NONE); + ret = video_util_set_audio_codec(NULL, VIDEO_UTIL_AUDIO_CODEC_AAC); + assert_neq(ret, VIDEO_UTIL_ERROR_NONE); - return 0; + return 0; } /** @@ -380,18 +388,18 @@ int utc_video_util_set_audio_codec_n2(void) */ int utc_video_util_set_audio_codec_p(void) { - int ret = VIDEO_UTIL_ERROR_NONE; - if(g_video_info_transcoder == false) { - ret = video_util_set_audio_codec(video_h, VIDEO_UTIL_AUDIO_CODEC_AAC); - assert_eq(ret, VIDEO_UTIL_ERROR_NOT_SUPPORTED); - return 0; - } - - assert_eq(is_handle_error, VIDEO_UTIL_ERROR_NONE); - ret = video_util_set_audio_codec(video_h, VIDEO_UTIL_AUDIO_CODEC_AAC); - assert_eq(ret, VIDEO_UTIL_ERROR_NONE); - - return 0; + int ret = VIDEO_UTIL_ERROR_NONE; + if (g_video_info_transcoder == false) { + ret = video_util_set_audio_codec(video_h, VIDEO_UTIL_AUDIO_CODEC_AAC); + assert_eq(ret, VIDEO_UTIL_ERROR_NOT_SUPPORTED); + return 0; + } + + assert_eq(is_handle_error, VIDEO_UTIL_ERROR_NONE); + ret = video_util_set_audio_codec(video_h, VIDEO_UTIL_AUDIO_CODEC_AAC); + assert_eq(ret, VIDEO_UTIL_ERROR_NONE); + + return 0; } /** @@ -401,18 +409,18 @@ int utc_video_util_set_audio_codec_p(void) */ int utc_video_util_set_file_format_n1(void) { - int ret = VIDEO_UTIL_ERROR_NONE; - if(g_video_info_transcoder == false) { - ret = video_util_set_file_format(video_h, -1); - assert_eq(ret, VIDEO_UTIL_ERROR_NOT_SUPPORTED); - return 0; - } - - assert_eq(is_handle_error, VIDEO_UTIL_ERROR_NONE); - ret = video_util_set_file_format(video_h, -1); - assert_neq(ret, VIDEO_UTIL_ERROR_NONE); - - return 0; + int ret = VIDEO_UTIL_ERROR_NONE; + if (g_video_info_transcoder == false) { + ret = video_util_set_file_format(video_h, -1); + assert_eq(ret, VIDEO_UTIL_ERROR_NOT_SUPPORTED); + return 0; + } + + assert_eq(is_handle_error, VIDEO_UTIL_ERROR_NONE); + ret = video_util_set_file_format(video_h, -1); + assert_neq(ret, VIDEO_UTIL_ERROR_NONE); + + return 0; } /** @@ -422,17 +430,17 @@ int utc_video_util_set_file_format_n1(void) */ int utc_video_util_set_file_format_n2(void) { - int ret = VIDEO_UTIL_ERROR_NONE; - if(g_video_info_transcoder == false) { - ret = video_util_set_file_format(NULL, VIDEO_UTIL_FILE_FORMAT_3GP); - assert_eq(ret, VIDEO_UTIL_ERROR_NOT_SUPPORTED); - return 0; - } + int ret = VIDEO_UTIL_ERROR_NONE; + if (g_video_info_transcoder == false) { + ret = video_util_set_file_format(NULL, VIDEO_UTIL_FILE_FORMAT_3GP); + assert_eq(ret, VIDEO_UTIL_ERROR_NOT_SUPPORTED); + return 0; + } - ret = video_util_set_file_format(NULL, VIDEO_UTIL_FILE_FORMAT_3GP); - assert_neq(ret, VIDEO_UTIL_ERROR_NONE); + ret = video_util_set_file_format(NULL, VIDEO_UTIL_FILE_FORMAT_3GP); + assert_neq(ret, VIDEO_UTIL_ERROR_NONE); - return 0; + return 0; } /** @@ -442,18 +450,18 @@ int utc_video_util_set_file_format_n2(void) */ int utc_video_util_set_file_format_p(void) { - int ret = VIDEO_UTIL_ERROR_NONE; - if(g_video_info_transcoder == false) { - ret = video_util_set_file_format(video_h, VIDEO_UTIL_FILE_FORMAT_3GP); - assert_eq(ret, VIDEO_UTIL_ERROR_NOT_SUPPORTED); - return 0; - } - - assert_eq(is_handle_error, VIDEO_UTIL_ERROR_NONE); - ret = video_util_set_file_format(video_h, VIDEO_UTIL_FILE_FORMAT_3GP); - assert_eq(ret, VIDEO_UTIL_ERROR_NONE); - - return 0; + int ret = VIDEO_UTIL_ERROR_NONE; + if (g_video_info_transcoder == false) { + ret = video_util_set_file_format(video_h, VIDEO_UTIL_FILE_FORMAT_3GP); + assert_eq(ret, VIDEO_UTIL_ERROR_NOT_SUPPORTED); + return 0; + } + + assert_eq(is_handle_error, VIDEO_UTIL_ERROR_NONE); + ret = video_util_set_file_format(video_h, VIDEO_UTIL_FILE_FORMAT_3GP); + assert_eq(ret, VIDEO_UTIL_ERROR_NONE); + + return 0; } /** @@ -463,18 +471,18 @@ int utc_video_util_set_file_format_p(void) */ int utc_video_util_set_resolution_n1(void) { - int ret = VIDEO_UTIL_ERROR_NONE; - if(g_video_info_transcoder == false) { - ret = video_util_set_resolution(video_h, -1, 144); - assert_eq(ret, VIDEO_UTIL_ERROR_NOT_SUPPORTED); - return 0; - } - - assert_eq(is_handle_error, VIDEO_UTIL_ERROR_NONE); - ret = video_util_set_resolution(video_h, -1, 144); - assert_neq(ret, VIDEO_UTIL_ERROR_NONE); - - return 0; + int ret = VIDEO_UTIL_ERROR_NONE; + if (g_video_info_transcoder == false) { + ret = video_util_set_resolution(video_h, -1, 144); + assert_eq(ret, VIDEO_UTIL_ERROR_NOT_SUPPORTED); + return 0; + } + + assert_eq(is_handle_error, VIDEO_UTIL_ERROR_NONE); + ret = video_util_set_resolution(video_h, -1, 144); + assert_neq(ret, VIDEO_UTIL_ERROR_NONE); + + return 0; } /** @@ -484,18 +492,18 @@ int utc_video_util_set_resolution_n1(void) */ int utc_video_util_set_resolution_n2(void) { - int ret = VIDEO_UTIL_ERROR_NONE; - if(g_video_info_transcoder == false) { - ret = video_util_set_resolution(video_h, 176, -1); - assert_eq(ret, VIDEO_UTIL_ERROR_NOT_SUPPORTED); - return 0; - } - - assert_eq(is_handle_error, VIDEO_UTIL_ERROR_NONE); - ret = video_util_set_resolution(video_h, 176, -1); - assert_neq(ret, VIDEO_UTIL_ERROR_NONE); - - return 0; + int ret = VIDEO_UTIL_ERROR_NONE; + if (g_video_info_transcoder == false) { + ret = video_util_set_resolution(video_h, 176, -1); + assert_eq(ret, VIDEO_UTIL_ERROR_NOT_SUPPORTED); + return 0; + } + + assert_eq(is_handle_error, VIDEO_UTIL_ERROR_NONE); + ret = video_util_set_resolution(video_h, 176, -1); + assert_neq(ret, VIDEO_UTIL_ERROR_NONE); + + return 0; } /** @@ -505,17 +513,17 @@ int utc_video_util_set_resolution_n2(void) */ int utc_video_util_set_resolution_n3(void) { - int ret = VIDEO_UTIL_ERROR_NONE; - if(g_video_info_transcoder == false) { - ret = video_util_set_resolution(NULL, 176, 144); - assert_eq(ret, VIDEO_UTIL_ERROR_NOT_SUPPORTED); - return 0; - } + int ret = VIDEO_UTIL_ERROR_NONE; + if (g_video_info_transcoder == false) { + ret = video_util_set_resolution(NULL, 176, 144); + assert_eq(ret, VIDEO_UTIL_ERROR_NOT_SUPPORTED); + return 0; + } - ret = video_util_set_resolution(NULL, 176, 144); - assert_neq(ret, VIDEO_UTIL_ERROR_NONE); + ret = video_util_set_resolution(NULL, 176, 144); + assert_neq(ret, VIDEO_UTIL_ERROR_NONE); - return 0; + return 0; } /** @@ -525,18 +533,18 @@ int utc_video_util_set_resolution_n3(void) */ int utc_video_util_set_resolution_p(void) { - int ret = VIDEO_UTIL_ERROR_NONE; - if(g_video_info_transcoder == false) { - ret = video_util_set_resolution(video_h, 176, 144); - assert_eq(ret, VIDEO_UTIL_ERROR_NOT_SUPPORTED); - return 0; - } - - assert_eq(is_handle_error, VIDEO_UTIL_ERROR_NONE); - ret = video_util_set_resolution(video_h, 176, 144); - assert_eq(ret, VIDEO_UTIL_ERROR_NONE); - - return 0; + int ret = VIDEO_UTIL_ERROR_NONE; + if (g_video_info_transcoder == false) { + ret = video_util_set_resolution(video_h, 176, 144); + assert_eq(ret, VIDEO_UTIL_ERROR_NOT_SUPPORTED); + return 0; + } + + assert_eq(is_handle_error, VIDEO_UTIL_ERROR_NONE); + ret = video_util_set_resolution(video_h, 176, 144); + assert_eq(ret, VIDEO_UTIL_ERROR_NONE); + + return 0; } /** @@ -546,18 +554,18 @@ int utc_video_util_set_resolution_p(void) */ int utc_video_util_set_fps_n1(void) { - int ret = VIDEO_UTIL_ERROR_NONE; - if(g_video_info_transcoder == false) { - ret = video_util_set_fps(video_h, -1); - assert_eq(ret, VIDEO_UTIL_ERROR_NOT_SUPPORTED); - return 0; - } - - assert_eq(is_handle_error, VIDEO_UTIL_ERROR_NONE); - ret = video_util_set_fps(video_h, -1); - assert_neq(ret, VIDEO_UTIL_ERROR_NONE); - - return 0; + int ret = VIDEO_UTIL_ERROR_NONE; + if (g_video_info_transcoder == false) { + ret = video_util_set_fps(video_h, -1); + assert_eq(ret, VIDEO_UTIL_ERROR_NOT_SUPPORTED); + return 0; + } + + assert_eq(is_handle_error, VIDEO_UTIL_ERROR_NONE); + ret = video_util_set_fps(video_h, -1); + assert_neq(ret, VIDEO_UTIL_ERROR_NONE); + + return 0; } /** @@ -567,17 +575,17 @@ int utc_video_util_set_fps_n1(void) */ int utc_video_util_set_fps_n2(void) { - int ret = VIDEO_UTIL_ERROR_NONE; - if(g_video_info_transcoder == false) { - ret = video_util_set_fps(NULL, 10); - assert_eq(ret, VIDEO_UTIL_ERROR_NOT_SUPPORTED); - return 0; - } + int ret = VIDEO_UTIL_ERROR_NONE; + if (g_video_info_transcoder == false) { + ret = video_util_set_fps(NULL, 10); + assert_eq(ret, VIDEO_UTIL_ERROR_NOT_SUPPORTED); + return 0; + } - ret = video_util_set_fps(NULL, 10); - assert_neq(ret, VIDEO_UTIL_ERROR_NONE); + ret = video_util_set_fps(NULL, 10); + assert_neq(ret, VIDEO_UTIL_ERROR_NONE); - return 0; + return 0; } /** @@ -587,18 +595,18 @@ int utc_video_util_set_fps_n2(void) */ int utc_video_util_set_fps_p(void) { - int ret = VIDEO_UTIL_ERROR_NONE; - if(g_video_info_transcoder == false) { - ret = video_util_set_fps(video_h, 10); - assert_eq(ret, VIDEO_UTIL_ERROR_NOT_SUPPORTED); - return 0; - } - - assert_eq(is_handle_error, VIDEO_UTIL_ERROR_NONE); - ret = video_util_set_fps(video_h, 10); - assert_eq(ret, VIDEO_UTIL_ERROR_NONE); - - return 0; + int ret = VIDEO_UTIL_ERROR_NONE; + if (g_video_info_transcoder == false) { + ret = video_util_set_fps(video_h, 10); + assert_eq(ret, VIDEO_UTIL_ERROR_NOT_SUPPORTED); + return 0; + } + + assert_eq(is_handle_error, VIDEO_UTIL_ERROR_NONE); + ret = video_util_set_fps(video_h, 10); + assert_eq(ret, VIDEO_UTIL_ERROR_NONE); + + return 0; } /** @@ -608,21 +616,21 @@ int utc_video_util_set_fps_p(void) */ int utc_video_util_start_transcoding_n1(void) { - int ret = VIDEO_UTIL_ERROR_NONE; - if(g_video_info_transcoder == false) { - ret = video_util_start_transcoding(video_h, 0, 0, NULL, (video_util_transcoding_progress_cb) utc_transcode_progress_cb, (video_util_transcoding_completed_cb) utc_transcode_completed_cb, NULL); - assert_eq(ret, VIDEO_UTIL_ERROR_NOT_SUPPORTED); - return 0; - } - - assert_eq(is_handle_error, VIDEO_UTIL_ERROR_NONE); - ret = video_util_set_file_path(video_h, MEDIA_PATH); - assert_eq(ret, VIDEO_UTIL_ERROR_NONE); - ret = video_util_start_transcoding(video_h, 0, 0, NULL, (video_util_transcoding_progress_cb) utc_transcode_progress_cb, (video_util_transcoding_completed_cb) utc_transcode_completed_cb, NULL); - video_util_cancel_transcoding(video_h); - assert_neq(ret, VIDEO_UTIL_ERROR_NONE); - - return 0; + int ret = VIDEO_UTIL_ERROR_NONE; + if (g_video_info_transcoder == false) { + ret = video_util_start_transcoding(video_h, 0, 0, NULL, (video_util_transcoding_progress_cb) utc_transcode_progress_cb, (video_util_transcoding_completed_cb) utc_transcode_completed_cb, NULL); + assert_eq(ret, VIDEO_UTIL_ERROR_NOT_SUPPORTED); + return 0; + } + + assert_eq(is_handle_error, VIDEO_UTIL_ERROR_NONE); + ret = video_util_set_file_path(video_h, MEDIA_PATH); + assert_eq(ret, VIDEO_UTIL_ERROR_NONE); + ret = video_util_start_transcoding(video_h, 0, 0, NULL, (video_util_transcoding_progress_cb) utc_transcode_progress_cb, (video_util_transcoding_completed_cb) utc_transcode_completed_cb, NULL); + video_util_cancel_transcoding(video_h); + assert_neq(ret, VIDEO_UTIL_ERROR_NONE); + + return 0; } /** @@ -632,17 +640,17 @@ int utc_video_util_start_transcoding_n1(void) */ int utc_video_util_start_transcoding_n2(void) { - int ret = VIDEO_UTIL_ERROR_NONE; - if(g_video_info_transcoder == false) { - ret = video_util_start_transcoding(NULL, 0, 0, MEDIA_OUTPUT_PATH, NULL, NULL, NULL); - assert_eq(ret, VIDEO_UTIL_ERROR_NOT_SUPPORTED); - return 0; - } + int ret = VIDEO_UTIL_ERROR_NONE; + if (g_video_info_transcoder == false) { + ret = video_util_start_transcoding(NULL, 0, 0, MEDIA_OUTPUT_PATH, NULL, NULL, NULL); + assert_eq(ret, VIDEO_UTIL_ERROR_NOT_SUPPORTED); + return 0; + } - ret = video_util_start_transcoding(NULL, 0, 0, MEDIA_OUTPUT_PATH, NULL, NULL, NULL); - assert_neq(ret, VIDEO_UTIL_ERROR_NONE); + ret = video_util_start_transcoding(NULL, 0, 0, MEDIA_OUTPUT_PATH, NULL, NULL, NULL); + assert_neq(ret, VIDEO_UTIL_ERROR_NONE); - return 0; + return 0; } /** @@ -652,37 +660,35 @@ int utc_video_util_start_transcoding_n2(void) */ int utc_video_util_start_transcoding_p(void) { - int ret = VIDEO_UTIL_ERROR_NONE; - if(g_video_info_transcoder == false) { - ret = video_util_start_transcoding(video_h, 0, 1000, MEDIA_OUTPUT_PATH, - utc_transcode_progress_cb, utc_transcode_completed_cb, NULL); - assert_eq(ret, VIDEO_UTIL_ERROR_NOT_SUPPORTED); - return 0; - } - - assert_eq(is_handle_error, VIDEO_UTIL_ERROR_NONE); - ret = video_util_set_file_path(video_h, MEDIA_PATH); - assert_eq(ret, VIDEO_UTIL_ERROR_NONE); - ret = video_util_set_file_format(video_h, VIDEO_UTIL_FILE_FORMAT_3GP); - assert_eq(ret, VIDEO_UTIL_ERROR_NONE); - ret = video_util_set_video_codec(video_h, VIDEO_UTIL_VIDEO_CODEC_MPEG4); - assert_eq(ret, VIDEO_UTIL_ERROR_NONE); - ret = video_util_set_audio_codec(video_h, VIDEO_UTIL_AUDIO_CODEC_NONE); - assert_eq(ret, VIDEO_UTIL_ERROR_NONE); - ret = video_util_set_accurate_mode(video_h, 0); - assert_eq(ret, VIDEO_UTIL_ERROR_NONE); - ret = video_util_set_resolution(video_h, 176, 144); - assert_eq(ret, VIDEO_UTIL_ERROR_NONE); - ret = video_util_set_fps(video_h, 10); - assert_eq(ret, VIDEO_UTIL_ERROR_NONE); - ret = video_util_start_transcoding(video_h, 0, 1000, MEDIA_OUTPUT_PATH, - utc_transcode_progress_cb, utc_transcode_completed_cb, NULL); - g_loop = g_main_loop_new(NULL, FALSE); - - g_main_loop_run(g_loop); - g_main_loop_unref(g_loop); - - return 0; + int ret = VIDEO_UTIL_ERROR_NONE; + if (g_video_info_transcoder == false) { + ret = video_util_start_transcoding(video_h, 0, 1000, MEDIA_OUTPUT_PATH, utc_transcode_progress_cb, utc_transcode_completed_cb, NULL); + assert_eq(ret, VIDEO_UTIL_ERROR_NOT_SUPPORTED); + return 0; + } + + assert_eq(is_handle_error, VIDEO_UTIL_ERROR_NONE); + ret = video_util_set_file_path(video_h, MEDIA_PATH); + assert_eq(ret, VIDEO_UTIL_ERROR_NONE); + ret = video_util_set_file_format(video_h, VIDEO_UTIL_FILE_FORMAT_3GP); + assert_eq(ret, VIDEO_UTIL_ERROR_NONE); + ret = video_util_set_video_codec(video_h, VIDEO_UTIL_VIDEO_CODEC_MPEG4); + assert_eq(ret, VIDEO_UTIL_ERROR_NONE); + ret = video_util_set_audio_codec(video_h, VIDEO_UTIL_AUDIO_CODEC_NONE); + assert_eq(ret, VIDEO_UTIL_ERROR_NONE); + ret = video_util_set_accurate_mode(video_h, 0); + assert_eq(ret, VIDEO_UTIL_ERROR_NONE); + ret = video_util_set_resolution(video_h, 176, 144); + assert_eq(ret, VIDEO_UTIL_ERROR_NONE); + ret = video_util_set_fps(video_h, 10); + assert_eq(ret, VIDEO_UTIL_ERROR_NONE); + ret = video_util_start_transcoding(video_h, 0, 1000, MEDIA_OUTPUT_PATH, utc_transcode_progress_cb, utc_transcode_completed_cb, NULL); + g_loop = g_main_loop_new(NULL, FALSE); + + g_main_loop_run(g_loop); + g_main_loop_unref(g_loop); + + return 0; } /** @@ -692,22 +698,22 @@ int utc_video_util_start_transcoding_p(void) */ int utc_video_util_get_progress_transcoding_n1(void) { - int ret = VIDEO_UTIL_ERROR_NONE; - if(g_video_info_transcoder == false) { - ret = video_util_get_progress_transcoding(video_h, NULL, &duration); - assert_eq(ret, VIDEO_UTIL_ERROR_NOT_SUPPORTED); - return 0; - } - - unsigned long duration = 0; - - assert_eq(is_handle_error, VIDEO_UTIL_ERROR_NONE); - ret = video_util_set_file_path(video_h, MEDIA_PATH); - assert_eq(ret, VIDEO_UTIL_ERROR_NONE); - ret = video_util_get_progress_transcoding(video_h, NULL, &duration); - assert_neq(ret, VIDEO_UTIL_ERROR_NONE); - - return 0; + int ret = VIDEO_UTIL_ERROR_NONE; + if (g_video_info_transcoder == false) { + ret = video_util_get_progress_transcoding(video_h, NULL, &duration); + assert_eq(ret, VIDEO_UTIL_ERROR_NOT_SUPPORTED); + return 0; + } + + unsigned long duration = 0; + + assert_eq(is_handle_error, VIDEO_UTIL_ERROR_NONE); + ret = video_util_set_file_path(video_h, MEDIA_PATH); + assert_eq(ret, VIDEO_UTIL_ERROR_NONE); + ret = video_util_get_progress_transcoding(video_h, NULL, &duration); + assert_neq(ret, VIDEO_UTIL_ERROR_NONE); + + return 0; } /** @@ -717,22 +723,22 @@ int utc_video_util_get_progress_transcoding_n1(void) */ int utc_video_util_get_progress_transcoding_n2(void) { - int ret = VIDEO_UTIL_ERROR_NONE; - if(g_video_info_transcoder == false) { - ret = video_util_get_progress_transcoding(video_h, ¤t_position, NULL); - assert_eq(ret, VIDEO_UTIL_ERROR_NOT_SUPPORTED); - return 0; - } - - unsigned long current_position = 0; - - assert_eq(is_handle_error, VIDEO_UTIL_ERROR_NONE); - ret = video_util_set_file_path(video_h, MEDIA_PATH); - assert_eq(ret, VIDEO_UTIL_ERROR_NONE); - ret = video_util_get_progress_transcoding(video_h, ¤t_position, NULL); - assert_neq(ret, VIDEO_UTIL_ERROR_NONE); - - return 0; + int ret = VIDEO_UTIL_ERROR_NONE; + if (g_video_info_transcoder == false) { + ret = video_util_get_progress_transcoding(video_h, ¤t_position, NULL); + assert_eq(ret, VIDEO_UTIL_ERROR_NOT_SUPPORTED); + return 0; + } + + unsigned long current_position = 0; + + assert_eq(is_handle_error, VIDEO_UTIL_ERROR_NONE); + ret = video_util_set_file_path(video_h, MEDIA_PATH); + assert_eq(ret, VIDEO_UTIL_ERROR_NONE); + ret = video_util_get_progress_transcoding(video_h, ¤t_position, NULL); + assert_neq(ret, VIDEO_UTIL_ERROR_NONE); + + return 0; } /** @@ -742,20 +748,20 @@ int utc_video_util_get_progress_transcoding_n2(void) */ int utc_video_util_get_progress_transcoding_n3(void) { - int ret = VIDEO_UTIL_ERROR_NONE; - if(g_video_info_transcoder == false) { - ret = video_util_get_progress_transcoding(NULL, ¤t_position, &duration); - assert_eq(ret, VIDEO_UTIL_ERROR_NOT_SUPPORTED); - return 0; - } + int ret = VIDEO_UTIL_ERROR_NONE; + if (g_video_info_transcoder == false) { + ret = video_util_get_progress_transcoding(NULL, ¤t_position, &duration); + assert_eq(ret, VIDEO_UTIL_ERROR_NOT_SUPPORTED); + return 0; + } - unsigned long current_position = 0; - unsigned long duration = 0; + unsigned long current_position = 0; + unsigned long duration = 0; - ret = video_util_get_progress_transcoding(NULL, ¤t_position, &duration); - assert_neq(ret, VIDEO_UTIL_ERROR_NONE); + ret = video_util_get_progress_transcoding(NULL, ¤t_position, &duration); + assert_neq(ret, VIDEO_UTIL_ERROR_NONE); - return 0; + return 0; } /** @@ -765,41 +771,39 @@ int utc_video_util_get_progress_transcoding_n3(void) */ int utc_video_util_get_progress_transcoding_p(void) { - int ret = VIDEO_UTIL_ERROR_NONE; - if(g_video_info_transcoder == false) { - ret = video_util_start_transcoding(video_h, 0, 1000, MEDIA_OUTPUT_PATH, - utc_transcode_progress_cb, utc_transcode_completed_cb, NULL); - assert_eq(ret, VIDEO_UTIL_ERROR_NOT_SUPPORTED); - return 0; - } - - unsigned long current_position = 0; - unsigned long duration = 0; - - assert_eq(is_handle_error, VIDEO_UTIL_ERROR_NONE); - ret = video_util_set_file_path(video_h, MEDIA_PATH); - assert_eq(ret, VIDEO_UTIL_ERROR_NONE); - ret = video_util_set_file_format(video_h, VIDEO_UTIL_FILE_FORMAT_3GP); - assert_eq(ret, VIDEO_UTIL_ERROR_NONE); - ret = video_util_set_video_codec(video_h, VIDEO_UTIL_VIDEO_CODEC_MPEG4); - assert_eq(ret, VIDEO_UTIL_ERROR_NONE); - ret = video_util_set_audio_codec(video_h, VIDEO_UTIL_AUDIO_CODEC_NONE); - assert_eq(ret, VIDEO_UTIL_ERROR_NONE); - ret = video_util_set_accurate_mode(video_h, 0); - assert_eq(ret, VIDEO_UTIL_ERROR_NONE); - ret = video_util_set_resolution(video_h, 176, 144); - assert_eq(ret, VIDEO_UTIL_ERROR_NONE); - ret = video_util_set_fps(video_h, 10); - assert_eq(ret, VIDEO_UTIL_ERROR_NONE); - PROGRESS = TRUE; - ret = video_util_start_transcoding(video_h, 0, 1000, MEDIA_OUTPUT_PATH, - utc_transcode_progress_cb, utc_transcode_completed_cb, NULL); - g_loop = g_main_loop_new(NULL, FALSE); - - g_main_loop_run(g_loop); - g_main_loop_unref(g_loop); - - return 0; + int ret = VIDEO_UTIL_ERROR_NONE; + if (g_video_info_transcoder == false) { + ret = video_util_start_transcoding(video_h, 0, 1000, MEDIA_OUTPUT_PATH, utc_transcode_progress_cb, utc_transcode_completed_cb, NULL); + assert_eq(ret, VIDEO_UTIL_ERROR_NOT_SUPPORTED); + return 0; + } + + unsigned long current_position = 0; + unsigned long duration = 0; + + assert_eq(is_handle_error, VIDEO_UTIL_ERROR_NONE); + ret = video_util_set_file_path(video_h, MEDIA_PATH); + assert_eq(ret, VIDEO_UTIL_ERROR_NONE); + ret = video_util_set_file_format(video_h, VIDEO_UTIL_FILE_FORMAT_3GP); + assert_eq(ret, VIDEO_UTIL_ERROR_NONE); + ret = video_util_set_video_codec(video_h, VIDEO_UTIL_VIDEO_CODEC_MPEG4); + assert_eq(ret, VIDEO_UTIL_ERROR_NONE); + ret = video_util_set_audio_codec(video_h, VIDEO_UTIL_AUDIO_CODEC_NONE); + assert_eq(ret, VIDEO_UTIL_ERROR_NONE); + ret = video_util_set_accurate_mode(video_h, 0); + assert_eq(ret, VIDEO_UTIL_ERROR_NONE); + ret = video_util_set_resolution(video_h, 176, 144); + assert_eq(ret, VIDEO_UTIL_ERROR_NONE); + ret = video_util_set_fps(video_h, 10); + assert_eq(ret, VIDEO_UTIL_ERROR_NONE); + PROGRESS = TRUE; + ret = video_util_start_transcoding(video_h, 0, 1000, MEDIA_OUTPUT_PATH, utc_transcode_progress_cb, utc_transcode_completed_cb, NULL); + g_loop = g_main_loop_new(NULL, FALSE); + + g_main_loop_run(g_loop); + g_main_loop_unref(g_loop); + + return 0; } /** @@ -809,17 +813,17 @@ int utc_video_util_get_progress_transcoding_p(void) */ int utc_video_util_cancel_transcoding_n(void) { - int ret = VIDEO_UTIL_ERROR_NONE; - if(g_video_info_transcoder == false) { - ret = video_util_cancel_transcoding(NULL); - assert_eq(ret, VIDEO_UTIL_ERROR_NOT_SUPPORTED); - return 0; - } + int ret = VIDEO_UTIL_ERROR_NONE; + if (g_video_info_transcoder == false) { + ret = video_util_cancel_transcoding(NULL); + assert_eq(ret, VIDEO_UTIL_ERROR_NOT_SUPPORTED); + return 0; + } - ret = video_util_cancel_transcoding(NULL); - assert_neq(ret, VIDEO_UTIL_ERROR_NONE); + ret = video_util_cancel_transcoding(NULL); + assert_neq(ret, VIDEO_UTIL_ERROR_NONE); - return 0; + return 0; } /** @@ -829,28 +833,28 @@ int utc_video_util_cancel_transcoding_n(void) */ int utc_video_util_cancel_transcoding_p(void) { - int ret = VIDEO_UTIL_ERROR_NONE; - if(g_video_info_transcoder == false) { - ret = video_util_start_transcoding(video_h, 0, 1000, MEDIA_OUTPUT_PATH, - utc_transcode_progress_cb, utc_transcode_completed_cb, NULL); - assert_eq(ret, VIDEO_UTIL_ERROR_NOT_SUPPORTED); - return 0; - } - - assert_eq(is_handle_error, VIDEO_UTIL_ERROR_NONE); - ret = video_util_set_file_path(video_h, MEDIA_PATH); - assert_eq(ret, VIDEO_UTIL_ERROR_NONE); - video_util_set_resolution(video_h, 176, 144); - video_util_set_fps(video_h, 10); - CANCEL = TRUE; - ret = video_util_start_transcoding(video_h, 0, 1000, MEDIA_OUTPUT_PATH, - utc_transcode_progress_cb, utc_transcode_completed_cb, NULL); - g_loop = g_main_loop_new(NULL, FALSE); - - g_main_loop_run(g_loop); - g_main_loop_unref(g_loop); - - return 0; + int ret = VIDEO_UTIL_ERROR_NONE; + if (g_video_info_transcoder == false) { + ret = video_util_start_transcoding(video_h, 0, 1000, MEDIA_OUTPUT_PATH, utc_transcode_progress_cb, utc_transcode_completed_cb, NULL); + assert_eq(ret, VIDEO_UTIL_ERROR_NOT_SUPPORTED); + return 0; + } + + assert_eq(is_handle_error, VIDEO_UTIL_ERROR_NONE); + ret = video_util_set_file_path(video_h, MEDIA_PATH); + assert_eq(ret, VIDEO_UTIL_ERROR_NONE); + ret = video_util_set_resolution(video_h, 176, 144); + assert_eq(ret, VIDEO_UTIL_ERROR_NONE); + ret = video_util_set_fps(video_h, 10); + assert_eq(ret, VIDEO_UTIL_ERROR_NONE); + CANCEL = TRUE; + ret = video_util_start_transcoding(video_h, 0, 1000, MEDIA_OUTPUT_PATH, utc_transcode_progress_cb, utc_transcode_completed_cb, NULL); + g_loop = g_main_loop_new(NULL, FALSE); + + g_main_loop_run(g_loop); + g_main_loop_unref(g_loop); + + return 0; } /** @@ -860,18 +864,18 @@ int utc_video_util_cancel_transcoding_p(void) */ int utc_video_util_foreach_supported_file_format_n1(void) { - int ret = VIDEO_UTIL_ERROR_NONE; - if(g_video_info_transcoder == false) { - ret = video_util_foreach_supported_file_format(video_h, NULL, "format_check"); - assert_eq(ret, VIDEO_UTIL_ERROR_NOT_SUPPORTED); - return 0; - } - - assert_eq(is_handle_error, VIDEO_UTIL_ERROR_NONE); - ret = video_util_foreach_supported_file_format(video_h, NULL, "format_check"); - assert_neq(ret, VIDEO_UTIL_ERROR_NONE); - - return 0; + int ret = VIDEO_UTIL_ERROR_NONE; + if (g_video_info_transcoder == false) { + ret = video_util_foreach_supported_file_format(video_h, NULL, "format_check"); + assert_eq(ret, VIDEO_UTIL_ERROR_NOT_SUPPORTED); + return 0; + } + + assert_eq(is_handle_error, VIDEO_UTIL_ERROR_NONE); + ret = video_util_foreach_supported_file_format(video_h, NULL, "format_check"); + assert_neq(ret, VIDEO_UTIL_ERROR_NONE); + + return 0; } /** @@ -881,17 +885,17 @@ int utc_video_util_foreach_supported_file_format_n1(void) */ int utc_video_util_foreach_supported_file_format_n2(void) { - int ret = VIDEO_UTIL_ERROR_NONE; - if(g_video_info_transcoder == false) { - ret = video_util_foreach_supported_file_format(NULL, (video_util_supported_file_format_cb)utc_transcode_spec_cb, "format_check"); - assert_eq(ret, VIDEO_UTIL_ERROR_NOT_SUPPORTED); - return 0; - } + int ret = VIDEO_UTIL_ERROR_NONE; + if (g_video_info_transcoder == false) { + ret = video_util_foreach_supported_file_format(NULL, (video_util_supported_file_format_cb) utc_transcode_spec_cb, "format_check"); + assert_eq(ret, VIDEO_UTIL_ERROR_NOT_SUPPORTED); + return 0; + } - ret = video_util_foreach_supported_file_format(NULL, (video_util_supported_file_format_cb)utc_transcode_spec_cb, "format_check"); - assert_neq(ret, VIDEO_UTIL_ERROR_NONE); + ret = video_util_foreach_supported_file_format(NULL, (video_util_supported_file_format_cb) utc_transcode_spec_cb, "format_check"); + assert_neq(ret, VIDEO_UTIL_ERROR_NONE); - return 0; + return 0; } /** @@ -901,18 +905,18 @@ int utc_video_util_foreach_supported_file_format_n2(void) */ int utc_video_util_foreach_supported_file_format_p(void) { - int ret = VIDEO_UTIL_ERROR_NONE; - if(g_video_info_transcoder == false) { - ret = video_util_foreach_supported_file_format(video_h, (video_util_supported_file_format_cb)utc_transcode_spec_cb, "format_check"); - assert_eq(ret, VIDEO_UTIL_ERROR_NOT_SUPPORTED); - return 0; - } - - assert_eq(is_handle_error, VIDEO_UTIL_ERROR_NONE); - ret = video_util_foreach_supported_file_format(video_h, (video_util_supported_file_format_cb)utc_transcode_spec_cb, "format_check"); - assert_eq(ret, VIDEO_UTIL_ERROR_NONE); - - return 0; + int ret = VIDEO_UTIL_ERROR_NONE; + if (g_video_info_transcoder == false) { + ret = video_util_foreach_supported_file_format(video_h, (video_util_supported_file_format_cb) utc_transcode_spec_cb, "format_check"); + assert_eq(ret, VIDEO_UTIL_ERROR_NOT_SUPPORTED); + return 0; + } + + assert_eq(is_handle_error, VIDEO_UTIL_ERROR_NONE); + ret = video_util_foreach_supported_file_format(video_h, (video_util_supported_file_format_cb) utc_transcode_spec_cb, "format_check"); + assert_eq(ret, VIDEO_UTIL_ERROR_NONE); + + return 0; } /** @@ -922,18 +926,18 @@ int utc_video_util_foreach_supported_file_format_p(void) */ int utc_video_util_foreach_supported_video_codec_n1(void) { - int ret = VIDEO_UTIL_ERROR_NONE; - if(g_video_info_transcoder == false) { - ret = video_util_foreach_supported_video_codec(video_h, NULL, "video_codec_check"); - assert_eq(ret, VIDEO_UTIL_ERROR_NOT_SUPPORTED); - return 0; - } - - assert_eq(is_handle_error, VIDEO_UTIL_ERROR_NONE); - ret = video_util_foreach_supported_video_codec(video_h, NULL, "video_codec_check"); - assert_neq(ret, VIDEO_UTIL_ERROR_NONE); - - return 0; + int ret = VIDEO_UTIL_ERROR_NONE; + if (g_video_info_transcoder == false) { + ret = video_util_foreach_supported_video_codec(video_h, NULL, "video_codec_check"); + assert_eq(ret, VIDEO_UTIL_ERROR_NOT_SUPPORTED); + return 0; + } + + assert_eq(is_handle_error, VIDEO_UTIL_ERROR_NONE); + ret = video_util_foreach_supported_video_codec(video_h, NULL, "video_codec_check"); + assert_neq(ret, VIDEO_UTIL_ERROR_NONE); + + return 0; } /** @@ -943,17 +947,17 @@ int utc_video_util_foreach_supported_video_codec_n1(void) */ int utc_video_util_foreach_supported_video_codec_n2(void) { - int ret = VIDEO_UTIL_ERROR_NONE; - if(g_video_info_transcoder == false) { - ret = video_util_foreach_supported_video_codec(NULL, (video_util_supported_video_encoder_cb)utc_transcode_spec_cb, "video_codec_check"); - assert_eq(ret, VIDEO_UTIL_ERROR_NOT_SUPPORTED); - return 0; - } + int ret = VIDEO_UTIL_ERROR_NONE; + if (g_video_info_transcoder == false) { + ret = video_util_foreach_supported_video_codec(NULL, (video_util_supported_video_encoder_cb) utc_transcode_spec_cb, "video_codec_check"); + assert_eq(ret, VIDEO_UTIL_ERROR_NOT_SUPPORTED); + return 0; + } - ret = video_util_foreach_supported_video_codec(NULL, (video_util_supported_video_encoder_cb)utc_transcode_spec_cb, "video_codec_check"); - assert_neq(ret, VIDEO_UTIL_ERROR_NONE); + ret = video_util_foreach_supported_video_codec(NULL, (video_util_supported_video_encoder_cb) utc_transcode_spec_cb, "video_codec_check"); + assert_neq(ret, VIDEO_UTIL_ERROR_NONE); - return 0; + return 0; } /** @@ -963,18 +967,18 @@ int utc_video_util_foreach_supported_video_codec_n2(void) */ int utc_video_util_foreach_supported_video_codec_p(void) { - int ret = VIDEO_UTIL_ERROR_NONE; - if(g_video_info_transcoder == false) { - ret = video_util_foreach_supported_video_codec(video_h, (video_util_supported_video_encoder_cb)utc_transcode_spec_cb, "video_codec_check"); - assert_eq(ret, VIDEO_UTIL_ERROR_NOT_SUPPORTED); - return 0; - } - - assert_eq(is_handle_error, VIDEO_UTIL_ERROR_NONE); - ret = video_util_foreach_supported_video_codec(video_h, (video_util_supported_video_encoder_cb)utc_transcode_spec_cb, "video_codec_check"); - assert_eq(ret, VIDEO_UTIL_ERROR_NONE); - - return 0; + int ret = VIDEO_UTIL_ERROR_NONE; + if (g_video_info_transcoder == false) { + ret = video_util_foreach_supported_video_codec(video_h, (video_util_supported_video_encoder_cb) utc_transcode_spec_cb, "video_codec_check"); + assert_eq(ret, VIDEO_UTIL_ERROR_NOT_SUPPORTED); + return 0; + } + + assert_eq(is_handle_error, VIDEO_UTIL_ERROR_NONE); + ret = video_util_foreach_supported_video_codec(video_h, (video_util_supported_video_encoder_cb) utc_transcode_spec_cb, "video_codec_check"); + assert_eq(ret, VIDEO_UTIL_ERROR_NONE); + + return 0; } /** @@ -984,18 +988,18 @@ int utc_video_util_foreach_supported_video_codec_p(void) */ int utc_video_util_foreach_supported_audio_codec_n1(void) { - int ret = VIDEO_UTIL_ERROR_NONE; - if(g_video_info_transcoder == false) { - ret = video_util_foreach_supported_video_codec(video_h, NULL, "audio_codec_check"); - assert_eq(ret, VIDEO_UTIL_ERROR_NOT_SUPPORTED); - return 0; - } - - assert_eq(is_handle_error, VIDEO_UTIL_ERROR_NONE); - ret = video_util_foreach_supported_video_codec(video_h, NULL, "audio_codec_check"); - assert_neq(ret, VIDEO_UTIL_ERROR_NONE); - - return 0; + int ret = VIDEO_UTIL_ERROR_NONE; + if (g_video_info_transcoder == false) { + ret = video_util_foreach_supported_video_codec(video_h, NULL, "audio_codec_check"); + assert_eq(ret, VIDEO_UTIL_ERROR_NOT_SUPPORTED); + return 0; + } + + assert_eq(is_handle_error, VIDEO_UTIL_ERROR_NONE); + ret = video_util_foreach_supported_video_codec(video_h, NULL, "audio_codec_check"); + assert_neq(ret, VIDEO_UTIL_ERROR_NONE); + + return 0; } /** @@ -1005,17 +1009,17 @@ int utc_video_util_foreach_supported_audio_codec_n1(void) */ int utc_video_util_foreach_supported_audio_codec_n2(void) { - int ret = VIDEO_UTIL_ERROR_NONE; - if(g_video_info_transcoder == false) { - ret = video_util_foreach_supported_audio_codec(NULL, (video_util_supported_audio_encoder_cb)utc_transcode_spec_cb, "audio_codec_check"); - assert_eq(ret, VIDEO_UTIL_ERROR_NOT_SUPPORTED); - return 0; - } + int ret = VIDEO_UTIL_ERROR_NONE; + if (g_video_info_transcoder == false) { + ret = video_util_foreach_supported_audio_codec(NULL, (video_util_supported_audio_encoder_cb) utc_transcode_spec_cb, "audio_codec_check"); + assert_eq(ret, VIDEO_UTIL_ERROR_NOT_SUPPORTED); + return 0; + } - ret = video_util_foreach_supported_audio_codec(NULL, (video_util_supported_audio_encoder_cb)utc_transcode_spec_cb, "audio_codec_check"); - assert_neq(ret, VIDEO_UTIL_ERROR_NONE); + ret = video_util_foreach_supported_audio_codec(NULL, (video_util_supported_audio_encoder_cb) utc_transcode_spec_cb, "audio_codec_check"); + assert_neq(ret, VIDEO_UTIL_ERROR_NONE); - return 0; + return 0; } /** @@ -1025,18 +1029,18 @@ int utc_video_util_foreach_supported_audio_codec_n2(void) */ int utc_video_util_foreach_supported_audio_codec_p(void) { - int ret = VIDEO_UTIL_ERROR_NONE; - if(g_video_info_transcoder == false) { - ret = video_util_foreach_supported_audio_codec(video_h, (video_util_supported_audio_encoder_cb)utc_transcode_spec_cb, "audio_codec_check"); - assert_eq(ret, VIDEO_UTIL_ERROR_NOT_SUPPORTED); - return 0; - } - - assert_eq(is_handle_error, VIDEO_UTIL_ERROR_NONE); - ret = video_util_foreach_supported_audio_codec(video_h, (video_util_supported_audio_encoder_cb)utc_transcode_spec_cb, "audio_codec_check"); - assert_eq(ret, VIDEO_UTIL_ERROR_NONE); - - return 0; + int ret = VIDEO_UTIL_ERROR_NONE; + if (g_video_info_transcoder == false) { + ret = video_util_foreach_supported_audio_codec(video_h, (video_util_supported_audio_encoder_cb) utc_transcode_spec_cb, "audio_codec_check"); + assert_eq(ret, VIDEO_UTIL_ERROR_NOT_SUPPORTED); + return 0; + } + + assert_eq(is_handle_error, VIDEO_UTIL_ERROR_NONE); + ret = video_util_foreach_supported_audio_codec(video_h, (video_util_supported_audio_encoder_cb) utc_transcode_spec_cb, "audio_codec_check"); + assert_eq(ret, VIDEO_UTIL_ERROR_NONE); + + return 0; } /** @@ -1046,17 +1050,17 @@ int utc_video_util_foreach_supported_audio_codec_p(void) */ int utc_video_util_destroy_n(void) { - int ret = VIDEO_UTIL_ERROR_NONE; - if(g_video_info_transcoder == false) { - ret = video_util_destroy(NULL); - assert_eq(ret, VIDEO_UTIL_ERROR_NOT_SUPPORTED); - return 0; - } + int ret = VIDEO_UTIL_ERROR_NONE; + if (g_video_info_transcoder == false) { + ret = video_util_destroy(NULL); + assert_eq(ret, VIDEO_UTIL_ERROR_NOT_SUPPORTED); + return 0; + } - ret = video_util_destroy(NULL); - assert_neq(ret, VIDEO_UTIL_ERROR_NONE); + ret = video_util_destroy(NULL); + assert_neq(ret, VIDEO_UTIL_ERROR_NONE); - return 0; + return 0; } /** @@ -1066,17 +1070,17 @@ int utc_video_util_destroy_n(void) */ int utc_video_util_destroy_p(void) { - int ret = VIDEO_UTIL_ERROR_NONE; - if(g_video_info_transcoder == false) { - ret = video_util_destroy(video_h); - assert_eq(ret, VIDEO_UTIL_ERROR_NOT_SUPPORTED); - return 0; - } - - assert_eq(is_handle_error, VIDEO_UTIL_ERROR_NONE); - ret = video_util_destroy(video_h); - video_h = NULL; - assert_eq(ret, VIDEO_UTIL_ERROR_NONE); - - return 0; + int ret = VIDEO_UTIL_ERROR_NONE; + if (g_video_info_transcoder == false) { + ret = video_util_destroy(video_h); + assert_eq(ret, VIDEO_UTIL_ERROR_NOT_SUPPORTED); + return 0; + } + + assert_eq(is_handle_error, VIDEO_UTIL_ERROR_NONE); + ret = video_util_destroy(video_h); + video_h = NULL; + assert_eq(ret, VIDEO_UTIL_ERROR_NONE); + + return 0; } -- 2.7.4