+++ /dev/null
-//
-// Copyright (c) 2014 Samsung Electronics Co., Ltd.
-//
-// 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.
-//
-#ifndef __TCT_VIDEO-UTIL-NATIVE_H__
-#define __TCT_VIDEO-UTIL-NATIVE_H__
-
-#include "testcase.h"
-#include "tct_common.h"
-
-extern void utc_video_util_startup(void);
-extern void utc_video_util_cleanup(void);
-
-extern int utc_video_util_create_n(void);
-extern int utc_video_util_create_p(void);
-extern int utc_video_util_set_file_path_n1(void);
-extern int utc_video_util_set_file_path_n2(void);
-extern int utc_video_util_set_file_path_p(void);
-extern int utc_video_util_set_accurate_mode_n(void);
-extern int utc_video_util_set_accurate_mode_p(void);
-extern int utc_video_util_set_video_codec_n1(void);
-extern int utc_video_util_set_video_codec_n2(void);
-extern int utc_video_util_set_video_codec_p(void);
-extern int utc_video_util_set_audio_codec_n1(void);
-extern int utc_video_util_set_audio_codec_n2(void);
-extern int utc_video_util_set_audio_codec_p(void);
-extern int utc_video_util_set_file_format_n1(void);
-extern int utc_video_util_set_file_format_n2(void);
-extern int utc_video_util_set_file_format_p(void);
-extern int utc_video_util_set_resolution_n1(void);
-extern int utc_video_util_set_resolution_n2(void);
-extern int utc_video_util_set_resolution_n3(void);
-extern int utc_video_util_set_resolution_p(void);
-extern int utc_video_util_set_fps_n1(void);
-extern int utc_video_util_set_fps_n2(void);
-extern int utc_video_util_set_fps_p(void);
-extern int utc_video_util_start_transcoding_n1(void);
-extern int utc_video_util_start_transcoding_n2(void);
-extern int utc_video_util_start_transcoding_p(void);
-extern int utc_video_util_get_progress_transcoding_n1(void);
-extern int utc_video_util_get_progress_transcoding_n2(void);
-extern int utc_video_util_get_progress_transcoding_n3(void);
-extern int utc_video_util_get_progress_transcoding_p(void);
-extern int utc_video_util_cancel_transcoding_n(void);
-extern int utc_video_util_cancel_transcoding_p(void);
-extern int utc_video_util_foreach_supported_file_format_n1(void);
-extern int utc_video_util_foreach_supported_file_format_n2(void);
-extern int utc_video_util_foreach_supported_file_format_p(void);
-extern int utc_video_util_foreach_supported_video_codec_n1(void);
-extern int utc_video_util_foreach_supported_video_codec_n2(void);
-extern int utc_video_util_foreach_supported_video_codec_p(void);
-extern int utc_video_util_foreach_supported_audio_codec_n1(void);
-extern int utc_video_util_foreach_supported_audio_codec_n2(void);
-extern int utc_video_util_foreach_supported_audio_codec_p(void);
-extern int utc_video_util_destroy_n(void);
-extern int utc_video_util_destroy_p(void);
-
-testcase tc_array[] = {
- {"utc_video_util_create_n",utc_video_util_create_n,utc_video_util_startup,utc_video_util_cleanup},
- {"utc_video_util_create_p",utc_video_util_create_p,utc_video_util_startup,utc_video_util_cleanup},
- {"utc_video_util_set_file_path_n1",utc_video_util_set_file_path_n1,utc_video_util_startup,utc_video_util_cleanup},
- {"utc_video_util_set_file_path_n2",utc_video_util_set_file_path_n2,utc_video_util_startup,utc_video_util_cleanup},
- {"utc_video_util_set_file_path_p",utc_video_util_set_file_path_p,utc_video_util_startup,utc_video_util_cleanup},
- {"utc_video_util_set_accurate_mode_n",utc_video_util_set_accurate_mode_n,utc_video_util_startup,utc_video_util_cleanup},
- {"utc_video_util_set_accurate_mode_p",utc_video_util_set_accurate_mode_p,utc_video_util_startup,utc_video_util_cleanup},
- {"utc_video_util_set_video_codec_n1",utc_video_util_set_video_codec_n1,utc_video_util_startup,utc_video_util_cleanup},
- {"utc_video_util_set_video_codec_n2",utc_video_util_set_video_codec_n2,utc_video_util_startup,utc_video_util_cleanup},
- {"utc_video_util_set_video_codec_p",utc_video_util_set_video_codec_p,utc_video_util_startup,utc_video_util_cleanup},
- {"utc_video_util_set_audio_codec_n1",utc_video_util_set_audio_codec_n1,utc_video_util_startup,utc_video_util_cleanup},
- {"utc_video_util_set_audio_codec_n2",utc_video_util_set_audio_codec_n2,utc_video_util_startup,utc_video_util_cleanup},
- {"utc_video_util_set_audio_codec_p",utc_video_util_set_audio_codec_p,utc_video_util_startup,utc_video_util_cleanup},
- {"utc_video_util_set_file_format_n1",utc_video_util_set_file_format_n1,utc_video_util_startup,utc_video_util_cleanup},
- {"utc_video_util_set_file_format_n2",utc_video_util_set_file_format_n2,utc_video_util_startup,utc_video_util_cleanup},
- {"utc_video_util_set_file_format_p",utc_video_util_set_file_format_p,utc_video_util_startup,utc_video_util_cleanup},
- {"utc_video_util_set_resolution_n1",utc_video_util_set_resolution_n1,utc_video_util_startup,utc_video_util_cleanup},
- {"utc_video_util_set_resolution_n2",utc_video_util_set_resolution_n2,utc_video_util_startup,utc_video_util_cleanup},
- {"utc_video_util_set_resolution_n3",utc_video_util_set_resolution_n3,utc_video_util_startup,utc_video_util_cleanup},
- {"utc_video_util_set_resolution_p",utc_video_util_set_resolution_p,utc_video_util_startup,utc_video_util_cleanup},
- {"utc_video_util_set_fps_n1",utc_video_util_set_fps_n1,utc_video_util_startup,utc_video_util_cleanup},
- {"utc_video_util_set_fps_n2",utc_video_util_set_fps_n2,utc_video_util_startup,utc_video_util_cleanup},
- {"utc_video_util_set_fps_p",utc_video_util_set_fps_p,utc_video_util_startup,utc_video_util_cleanup},
- {"utc_video_util_start_transcoding_n1",utc_video_util_start_transcoding_n1,utc_video_util_startup,utc_video_util_cleanup},
- {"utc_video_util_start_transcoding_n2",utc_video_util_start_transcoding_n2,utc_video_util_startup,utc_video_util_cleanup},
- {"utc_video_util_start_transcoding_p",utc_video_util_start_transcoding_p,utc_video_util_startup,utc_video_util_cleanup},
- {"utc_video_util_get_progress_transcoding_n1",utc_video_util_get_progress_transcoding_n1,utc_video_util_startup,utc_video_util_cleanup},
- {"utc_video_util_get_progress_transcoding_n2",utc_video_util_get_progress_transcoding_n2,utc_video_util_startup,utc_video_util_cleanup},
- {"utc_video_util_get_progress_transcoding_n3",utc_video_util_get_progress_transcoding_n3,utc_video_util_startup,utc_video_util_cleanup},
- {"utc_video_util_get_progress_transcoding_p",utc_video_util_get_progress_transcoding_p,utc_video_util_startup,utc_video_util_cleanup},
- {"utc_video_util_cancel_transcoding_n",utc_video_util_cancel_transcoding_n,utc_video_util_startup,utc_video_util_cleanup},
- {"utc_video_util_cancel_transcoding_p",utc_video_util_cancel_transcoding_p,utc_video_util_startup,utc_video_util_cleanup},
- {"utc_video_util_foreach_supported_file_format_n1",utc_video_util_foreach_supported_file_format_n1,utc_video_util_startup,utc_video_util_cleanup},
- {"utc_video_util_foreach_supported_file_format_n2",utc_video_util_foreach_supported_file_format_n2,utc_video_util_startup,utc_video_util_cleanup},
- {"utc_video_util_foreach_supported_file_format_p",utc_video_util_foreach_supported_file_format_p,utc_video_util_startup,utc_video_util_cleanup},
- {"utc_video_util_foreach_supported_video_codec_n1",utc_video_util_foreach_supported_video_codec_n1,utc_video_util_startup,utc_video_util_cleanup},
- {"utc_video_util_foreach_supported_video_codec_n2",utc_video_util_foreach_supported_video_codec_n2,utc_video_util_startup,utc_video_util_cleanup},
- {"utc_video_util_foreach_supported_video_codec_p",utc_video_util_foreach_supported_video_codec_p,utc_video_util_startup,utc_video_util_cleanup},
- {"utc_video_util_foreach_supported_audio_codec_n1",utc_video_util_foreach_supported_audio_codec_n1,utc_video_util_startup,utc_video_util_cleanup},
- {"utc_video_util_foreach_supported_audio_codec_n2",utc_video_util_foreach_supported_audio_codec_n2,utc_video_util_startup,utc_video_util_cleanup},
- {"utc_video_util_foreach_supported_audio_codec_p",utc_video_util_foreach_supported_audio_codec_p,utc_video_util_startup,utc_video_util_cleanup},
- {"utc_video_util_destroy_n",utc_video_util_destroy_n,utc_video_util_startup,utc_video_util_cleanup},
- {"utc_video_util_destroy_p",utc_video_util_destroy_p,utc_video_util_startup,utc_video_util_cleanup},
- {NULL, NULL}
-};
-
-#endif // __TCT_VIDEO-UTIL-NATIVE_H__
+++ /dev/null
-//
-// Copyright (c) 2014 Samsung Electronics Co., Ltd.
-//
-// 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.
-//
-#ifndef __TCT_VIDEO-UTIL-NATIVE_H__
-#define __TCT_VIDEO-UTIL-NATIVE_H__
-
-#include "testcase.h"
-#include "tct_common.h"
-
-extern void utc_video_util_startup(void);
-extern void utc_video_util_cleanup(void);
-
-extern int utc_video_util_create_n(void);
-extern int utc_video_util_create_p(void);
-extern int utc_video_util_set_file_path_n1(void);
-extern int utc_video_util_set_file_path_n2(void);
-extern int utc_video_util_set_file_path_p(void);
-extern int utc_video_util_set_accurate_mode_n(void);
-extern int utc_video_util_set_accurate_mode_p(void);
-extern int utc_video_util_set_video_codec_n1(void);
-extern int utc_video_util_set_video_codec_n2(void);
-extern int utc_video_util_set_video_codec_p(void);
-extern int utc_video_util_set_audio_codec_n1(void);
-extern int utc_video_util_set_audio_codec_n2(void);
-extern int utc_video_util_set_audio_codec_p(void);
-extern int utc_video_util_set_file_format_n1(void);
-extern int utc_video_util_set_file_format_n2(void);
-extern int utc_video_util_set_file_format_p(void);
-extern int utc_video_util_set_resolution_n1(void);
-extern int utc_video_util_set_resolution_n2(void);
-extern int utc_video_util_set_resolution_n3(void);
-extern int utc_video_util_set_resolution_p(void);
-extern int utc_video_util_set_fps_n1(void);
-extern int utc_video_util_set_fps_n2(void);
-extern int utc_video_util_set_fps_p(void);
-extern int utc_video_util_start_transcoding_n1(void);
-extern int utc_video_util_start_transcoding_n2(void);
-extern int utc_video_util_start_transcoding_p(void);
-extern int utc_video_util_get_progress_transcoding_n1(void);
-extern int utc_video_util_get_progress_transcoding_n2(void);
-extern int utc_video_util_get_progress_transcoding_n3(void);
-extern int utc_video_util_get_progress_transcoding_p(void);
-extern int utc_video_util_cancel_transcoding_n(void);
-extern int utc_video_util_cancel_transcoding_p(void);
-extern int utc_video_util_foreach_supported_file_format_n1(void);
-extern int utc_video_util_foreach_supported_file_format_n2(void);
-extern int utc_video_util_foreach_supported_file_format_p(void);
-extern int utc_video_util_foreach_supported_video_codec_n1(void);
-extern int utc_video_util_foreach_supported_video_codec_n2(void);
-extern int utc_video_util_foreach_supported_video_codec_p(void);
-extern int utc_video_util_foreach_supported_audio_codec_n1(void);
-extern int utc_video_util_foreach_supported_audio_codec_n2(void);
-extern int utc_video_util_foreach_supported_audio_codec_p(void);
-extern int utc_video_util_destroy_n(void);
-extern int utc_video_util_destroy_p(void);
-
-testcase tc_array[] = {
- {"utc_video_util_create_n",utc_video_util_create_n,utc_video_util_startup,utc_video_util_cleanup},
- {"utc_video_util_create_p",utc_video_util_create_p,utc_video_util_startup,utc_video_util_cleanup},
- {"utc_video_util_set_file_path_n1",utc_video_util_set_file_path_n1,utc_video_util_startup,utc_video_util_cleanup},
- {"utc_video_util_set_file_path_n2",utc_video_util_set_file_path_n2,utc_video_util_startup,utc_video_util_cleanup},
- {"utc_video_util_set_file_path_p",utc_video_util_set_file_path_p,utc_video_util_startup,utc_video_util_cleanup},
- {"utc_video_util_set_accurate_mode_n",utc_video_util_set_accurate_mode_n,utc_video_util_startup,utc_video_util_cleanup},
- {"utc_video_util_set_accurate_mode_p",utc_video_util_set_accurate_mode_p,utc_video_util_startup,utc_video_util_cleanup},
- {"utc_video_util_set_video_codec_n1",utc_video_util_set_video_codec_n1,utc_video_util_startup,utc_video_util_cleanup},
- {"utc_video_util_set_video_codec_n2",utc_video_util_set_video_codec_n2,utc_video_util_startup,utc_video_util_cleanup},
- {"utc_video_util_set_video_codec_p",utc_video_util_set_video_codec_p,utc_video_util_startup,utc_video_util_cleanup},
- {"utc_video_util_set_audio_codec_n1",utc_video_util_set_audio_codec_n1,utc_video_util_startup,utc_video_util_cleanup},
- {"utc_video_util_set_audio_codec_n2",utc_video_util_set_audio_codec_n2,utc_video_util_startup,utc_video_util_cleanup},
- {"utc_video_util_set_audio_codec_p",utc_video_util_set_audio_codec_p,utc_video_util_startup,utc_video_util_cleanup},
- {"utc_video_util_set_file_format_n1",utc_video_util_set_file_format_n1,utc_video_util_startup,utc_video_util_cleanup},
- {"utc_video_util_set_file_format_n2",utc_video_util_set_file_format_n2,utc_video_util_startup,utc_video_util_cleanup},
- {"utc_video_util_set_file_format_p",utc_video_util_set_file_format_p,utc_video_util_startup,utc_video_util_cleanup},
- {"utc_video_util_set_resolution_n1",utc_video_util_set_resolution_n1,utc_video_util_startup,utc_video_util_cleanup},
- {"utc_video_util_set_resolution_n2",utc_video_util_set_resolution_n2,utc_video_util_startup,utc_video_util_cleanup},
- {"utc_video_util_set_resolution_n3",utc_video_util_set_resolution_n3,utc_video_util_startup,utc_video_util_cleanup},
- {"utc_video_util_set_resolution_p",utc_video_util_set_resolution_p,utc_video_util_startup,utc_video_util_cleanup},
- {"utc_video_util_set_fps_n1",utc_video_util_set_fps_n1,utc_video_util_startup,utc_video_util_cleanup},
- {"utc_video_util_set_fps_n2",utc_video_util_set_fps_n2,utc_video_util_startup,utc_video_util_cleanup},
- {"utc_video_util_set_fps_p",utc_video_util_set_fps_p,utc_video_util_startup,utc_video_util_cleanup},
- {"utc_video_util_start_transcoding_n1",utc_video_util_start_transcoding_n1,utc_video_util_startup,utc_video_util_cleanup},
- {"utc_video_util_start_transcoding_n2",utc_video_util_start_transcoding_n2,utc_video_util_startup,utc_video_util_cleanup},
- {"utc_video_util_start_transcoding_p",utc_video_util_start_transcoding_p,utc_video_util_startup,utc_video_util_cleanup},
- {"utc_video_util_get_progress_transcoding_n1",utc_video_util_get_progress_transcoding_n1,utc_video_util_startup,utc_video_util_cleanup},
- {"utc_video_util_get_progress_transcoding_n2",utc_video_util_get_progress_transcoding_n2,utc_video_util_startup,utc_video_util_cleanup},
- {"utc_video_util_get_progress_transcoding_n3",utc_video_util_get_progress_transcoding_n3,utc_video_util_startup,utc_video_util_cleanup},
- {"utc_video_util_get_progress_transcoding_p",utc_video_util_get_progress_transcoding_p,utc_video_util_startup,utc_video_util_cleanup},
- {"utc_video_util_cancel_transcoding_n",utc_video_util_cancel_transcoding_n,utc_video_util_startup,utc_video_util_cleanup},
- {"utc_video_util_cancel_transcoding_p",utc_video_util_cancel_transcoding_p,utc_video_util_startup,utc_video_util_cleanup},
- {"utc_video_util_foreach_supported_file_format_n1",utc_video_util_foreach_supported_file_format_n1,utc_video_util_startup,utc_video_util_cleanup},
- {"utc_video_util_foreach_supported_file_format_n2",utc_video_util_foreach_supported_file_format_n2,utc_video_util_startup,utc_video_util_cleanup},
- {"utc_video_util_foreach_supported_file_format_p",utc_video_util_foreach_supported_file_format_p,utc_video_util_startup,utc_video_util_cleanup},
- {"utc_video_util_foreach_supported_video_codec_n1",utc_video_util_foreach_supported_video_codec_n1,utc_video_util_startup,utc_video_util_cleanup},
- {"utc_video_util_foreach_supported_video_codec_n2",utc_video_util_foreach_supported_video_codec_n2,utc_video_util_startup,utc_video_util_cleanup},
- {"utc_video_util_foreach_supported_video_codec_p",utc_video_util_foreach_supported_video_codec_p,utc_video_util_startup,utc_video_util_cleanup},
- {"utc_video_util_foreach_supported_audio_codec_n1",utc_video_util_foreach_supported_audio_codec_n1,utc_video_util_startup,utc_video_util_cleanup},
- {"utc_video_util_foreach_supported_audio_codec_n2",utc_video_util_foreach_supported_audio_codec_n2,utc_video_util_startup,utc_video_util_cleanup},
- {"utc_video_util_foreach_supported_audio_codec_p",utc_video_util_foreach_supported_audio_codec_p,utc_video_util_startup,utc_video_util_cleanup},
- {"utc_video_util_destroy_n",utc_video_util_destroy_n,utc_video_util_startup,utc_video_util_cleanup},
- {"utc_video_util_destroy_p",utc_video_util_destroy_p,utc_video_util_startup,utc_video_util_cleanup},
- {NULL, NULL}
-};
-
-#endif // __TCT_VIDEO-UTIL-NATIVE_H__
+++ /dev/null
-//
-// Copyright (c) 2014 Samsung Electronics Co., Ltd.
-//
-// 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 "assert.h"
-#include <unistd.h>
-#include <stdlib.h>
-#include <video_util.h>
-#include <glib.h>
-#include <system_info.h>
-#include <storage.h>
-#include "tct_common.h"
-
-#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";
-GMainLoop *g_loop = NULL;
-video_util_h video_h = NULL;
-int is_handle_error = VIDEO_UTIL_ERROR_NONE;
-bool CANCEL = FALSE;
-bool PROGRESS = FALSE;
-static bool g_video_info_transcoder = true;
-static int duration;
-static int current_position;
-
-/**
- * @function utc_video_util_startup
- * @description Called before each test
- * @parameter NA
- * @return NA
- */
-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);
- 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);
- 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 {
- 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);
-
- 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__);
-}
-
-/**
- * @function utc_video_util_cleanup
- * @description Called after each test
- * @parameter NA
- * @return NA
- */
-void utc_video_util_cleanup(void)
-{
- 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;
-}
-
-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;
-}
-
-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;
- }
-}
-
-/**
- * @testcase utc_video_util_create_n
- * @since_tizen 2.3
- * @description Nagative test case that creates a handle to video util
- */
-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;
- }
-
- ret = video_util_create(NULL);
- assert_neq(ret, VIDEO_UTIL_ERROR_NONE);
-
- return 0;
-}
-
-/**
- * @testcase utc_video_util_create_p
- * @since_tizen 2.3
- * @description Positive test case that creates a handle to video util
- */
-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;
- }
-
- assert_eq(is_handle_error, VIDEO_UTIL_ERROR_NONE);
-
- return 0;
-}
-
-/**
- * @testcase utc_video_util_set_file_path_n1
- * @since_tizen 2.3
- * @description Nagative test case that sets the video util's file path
- */
-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;
-}
-
-/**
- * @testcase utc_video_util_set_file_path_n2
- * @since_tizen 2.3
- * @description Nagative test case that sets the video util's file path
- */
-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;
- }
-
- ret = video_util_set_file_path(NULL, MEDIA_PATH);
- assert_neq(ret, VIDEO_UTIL_ERROR_NONE);
-
- return 0;
-}
-
-/**
- * @testcase utc_video_util_set_file_path_p
- * @since_tizen 2.3
- * @description Positive test case that sets the video util's file path
- */
-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;
-}
-
-/**
- * @testcase utc_video_util_set_accurate_mode_n
- * @since_tizen 2.3
- * @description Nagative test case that sets the video util's accurate mode
- */
-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;
- }
-
- ret = video_util_set_accurate_mode(NULL, 0);
- assert_neq(ret, VIDEO_UTIL_ERROR_NONE);
-
- return 0;
-}
-
-/**
- * @testcase utc_video_util_set_accurate_mode_p
- * @since_tizen 2.3
- * @description Positive test case that sets the video util's accurate mode
- */
-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;
-}
-
-/**
- * @testcase utc_video_util_set_video_codec_n1
- * @since_tizen 2.3
- * @description Nagative test case that sets the video codec for encoding video stream
- */
-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;
-}
-
-/**
- * @testcase utc_video_util_set_video_codec_n2
- * @since_tizen 2.3
- * @description Nagative test case that sets the video codec for encoding video stream
- */
-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;
- }
-
- ret = video_util_set_video_codec(NULL, VIDEO_UTIL_VIDEO_CODEC_MPEG4);
- assert_neq(ret, VIDEO_UTIL_ERROR_NONE);
-
- return 0;
-}
-
-/**
- * @testcase utc_video_util_set_video_codec_p
- * @since_tizen 2.3
- * @description Positive test case that sets the video codec for encoding video stream
- */
-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;
-}
-
-/**
- * @testcase utc_video_util_set_audio_codec_n1
- * @since_tizen 2.3
- * @description Nagative test case that sets the audio codec for encoding audio stream
- */
-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;
-}
-
-/**
- * @testcase utc_video_util_set_audio_codec_n2
- * @since_tizen 2.3
- * @description Nagative test case that sets the audio codec for encoding audio stream
- */
-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;
- }
-
- ret = video_util_set_audio_codec(NULL, VIDEO_UTIL_AUDIO_CODEC_AAC);
- assert_neq(ret, VIDEO_UTIL_ERROR_NONE);
-
- return 0;
-}
-
-/**
- * @testcase utc_video_util_set_audio_codec_p
- * @since_tizen 2.3
- * @description Positive test case that sets the audio codec for encoding audio stream
- */
-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;
-}
-
-/**
- * @testcase utc_video_util_set_file_format_n1
- * @since_tizen 2.3
- * @description Nagative test case that sets the file format for transcoding media stream
- */
-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;
-}
-
-/**
- * @testcase utc_video_util_set_file_format_n2
- * @since_tizen 2.3
- * @description Nagative test case that sets the file format for transcoding media stream
- */
-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;
- }
-
- ret = video_util_set_file_format(NULL, VIDEO_UTIL_FILE_FORMAT_3GP);
- assert_neq(ret, VIDEO_UTIL_ERROR_NONE);
-
- return 0;
-}
-
-/**
- * @testcase utc_video_util_set_file_format_p
- * @since_tizen 2.3
- * @description Positive test case that sets the file format for transcoding media stream
- */
-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;
-}
-
-/**
- * @testcase utc_video_util_set_resolution_n1
- * @since_tizen 2.3
- * @description Nagative test case that sets the resolution(width and height)
- */
-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;
-}
-
-/**
- * @testcase utc_video_util_set_resolution_n2
- * @since_tizen 2.3
- * @description Nagative test case that sets the resolution(width and height)
- */
-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;
-}
-
-/**
- * @testcase utc_video_util_set_resolution_n3
- * @since_tizen 2.3
- * @description Nagative test case that sets the resolution(width and height)
- */
-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;
- }
-
- ret = video_util_set_resolution(NULL, 176, 144);
- assert_neq(ret, VIDEO_UTIL_ERROR_NONE);
-
- return 0;
-}
-
-/**
- * @testcase utc_video_util_set_resolution_p
- * @since_tizen 2.3
- * @description Positive test case that sets the resolution(width and height)
- */
-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;
-}
-
-/**
- * @testcase utc_video_util_set_fps_n1
- * @since_tizen 2.3
- * @description Nagative test case that sets the frame rate
- */
-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;
-}
-
-/**
- * @testcase utc_video_util_set_fps_n2
- * @since_tizen 2.3
- * @description Nagative test case that Sets the frame rate
- */
-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;
- }
-
- ret = video_util_set_fps(NULL, 10);
- assert_neq(ret, VIDEO_UTIL_ERROR_NONE);
-
- return 0;
-}
-
-/**
- * @testcase utc_video_util_set_fps_p
- * @since_tizen 2.3
- * @description Positive test case that sets the frame rate
- */
-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;
-}
-
-/**
- * @testcase utc_video_util_start_transcoding_n1
- * @since_tizen 2.3
- * @description Nagative test case that Transcodes the video for given video util handle
- */
-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;
-}
-
-/**
- * @testcase utc_video_util_start_transcoding_n2
- * @since_tizen 2.3
- * @description Nagative test case that Transcodes the video for given video util handle
- */
-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;
- }
-
- ret = video_util_start_transcoding(NULL, 0, 0, MEDIA_OUTPUT_PATH, NULL, NULL, NULL);
- assert_neq(ret, VIDEO_UTIL_ERROR_NONE);
-
- return 0;
-}
-
-/**
- * @testcase utc_video_util_start_transcoding_p
- * @since_tizen 2.3
- * @description Positive test case that Transcodes the video for given video util handle
- */
-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;
-}
-
-/**
- * @testcase utc_video_util_get_progress_transcoding_n1
- * @since_tizen 2.3
- * @description Nagative test case that retreives the current position and duration of the video transcoding
- */
-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;
-}
-
-/**
- * @testcase utc_video_util_get_progress_transcoding_n2
- * @since_tizen 2.3
- * @description Nagative test case that retreives the current position and duration of the video transcoding
- */
-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;
-}
-
-/**
- * @testcase utc_video_util_get_progress_transcoding_n3
- * @since_tizen 2.3
- * @description Nagative test case that retreives the current position and duration of the video transcoding
- */
-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;
- }
-
- 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);
-
- return 0;
-}
-
-/**
- * @testcase utc_video_util_get_progress_transcoding_p
- * @since_tizen 2.3
- * @description Positive test case that retreives the current position and duration of the video transcoding
- */
-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;
-}
-
-/**
- * @testcase utc_video_util_cancel_transcoding_n
- * @since_tizen 2.3
- * @description Nagative test case that cancels transcoding the video for given video util handle
- */
-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;
- }
-
- ret = video_util_cancel_transcoding(NULL);
- assert_neq(ret, VIDEO_UTIL_ERROR_NONE);
-
- return 0;
-}
-
-/**
- * @testcase utc_video_util_cancel_transcoding_p
- * @since_tizen 2.3
- * @description Positive test case that cancels transcoding the video for given video util handle
- */
-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);
- 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;
-}
-
-/**
- * @testcase utc_video_util_foreach_supported_file_format_n1
- * @since_tizen 2.3
- * @description Nagative test case that cetrieves all supported media formats by invoking a specific callback for each supported media format
- */
-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;
-}
-
-/**
- * @testcase utc_video_util_foreach_supported_file_format_n2
- * @since_tizen 2.3
- * @description Nagative test case that cetrieves all supported media formats by invoking a specific callback for each supported media format
- */
-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;
- }
-
- 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;
-}
-
-/**
- * @testcase utc_video_util_foreach_supported_file_format_p
- * @since_tizen 2.3
- * @description Positive test case that retrieves all supported media formats by invoking a specific callback for each supported media format
- */
-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;
-}
-
-/**
- * @testcase utc_video_util_foreach_supported_video_codec_n1
- * @since_tizen 2.3
- * @description Nagative test case that retrieves all supported video encoders by invoking a specific callback for each supported video encoder
- */
-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;
-}
-
-/**
- * @testcase utc_video_util_foreach_supported_video_codec_n2
- * @since_tizen 2.3
- * @description Nagative test case that retrieves all supported video encoders by invoking a specific callback for each supported video encoder
- */
-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;
- }
-
- 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;
-}
-
-/**
- * @testcase utc_video_util_foreach_supported_video_codec_p
- * @since_tizen 2.3
- * @description Postitive test case that retrieves all supported video encoders by invoking a specific callback for each supported video encoder
- */
-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;
-}
-
-/**
- * @testcase utc_video_util_foreach_supported_audio_codec_n1
- * @since_tizen 2.3
- * @description Nagative test case that retrieves all supported audio encoders by invoking a specific callback for each supported audio encoder
- */
-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;
-}
-
-/**
- * @testcase utc_video_util_foreach_supported_audio_codec_n2
- * @since_tizen 2.3
- * @description Nagative test case that retrieves all supported audio encoders by invoking a specific callback for each supported audio encoder
- */
-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;
- }
-
- 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;
-}
-
-/**
- * @testcase utc_video_util_foreach_supported_audio_codec_p
- * @since_tizen 2.3
- * @description Positive test case that retrieves all supported audio encoders by invoking a specific callback for each supported audio encoder
- */
-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;
-}
-
-/**
- * @testcase utc_video_util_destroy_n
- * @since_tizen 2.3
- * @description Nagative test case that destroys a handle to video util
- */
-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;
- }
-
- ret = video_util_destroy(NULL);
- assert_neq(ret, VIDEO_UTIL_ERROR_NONE);
-
- return 0;
-}
-
-/**
- * @testcase utc_video_util_destroy_p
- * @since_tizen 2.3
- * @description Positive test case that destroys a handle to video util
- */
-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;
-}