From 70e71ce6be7153129a543240b4c30aaee368c7b9 Mon Sep 17 00:00:00 2001 From: Minje Ahn Date: Thu, 1 Feb 2018 11:16:50 +0900 Subject: Remove unused code Change-Id: I6e0d47fe3cc6b5091afe5a886e64f800132597a0 Signed-off-by: Minje Ahn --- CMakeLists.txt | 3 -- server/thumb-server-internal.c | 5 --- src/include/util/media-thumb-util.h | 2 - src/util/media-thumb-util.c | 14 ------- test/CMakeLists.txt | 13 ------ test/test-thumb.c | 80 ------------------------------------- thumbsvr | 4 -- 7 files changed, 121 deletions(-) delete mode 100644 test/CMakeLists.txt delete mode 100755 test/test-thumb.c delete mode 100644 thumbsvr diff --git a/CMakeLists.txt b/CMakeLists.txt index 43af632..bf9ba15 100755 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -76,9 +76,6 @@ INSTALL(TARGETS ${MEDIATHUMB-LIB} LIBRARY DESTINATION ${LIB_INSTALL_DIR}) INSTALL(TARGETS ${MEDIAHASH-LIB} LIBRARY DESTINATION ${LIB_INSTALL_DIR}) ADD_SUBDIRECTORY(server) -ADD_SUBDIRECTORY(test) INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/include/media-thumbnail.h DESTINATION include/${MEDIATHUMB-LIB}) INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/src/include/codec/img-codec-parser.h DESTINATION include/${MEDIATHUMB-LIB}) -#INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/thumbsvr DESTINATION /etc/init.d) - diff --git a/server/thumb-server-internal.c b/server/thumb-server-internal.c index 643f548..2f85b30 100755 --- a/server/thumb-server-internal.c +++ b/server/thumb-server-internal.c @@ -354,11 +354,6 @@ int _media_thumb_process(thumbMsg *req_msg, thumbMsg *res_msg) thumb_dbg_slog("Thumb path : %s", thumb_path); - if (g_file_test(thumb_path, G_FILE_TEST_IS_REGULAR)) { - thumb_warn("thumb path already exists in file system.. remove the existed file"); - _media_thumb_remove_file(thumb_path); - } - err = _thumbnail_get_data(origin_path, thumb_path); if (err != MS_MEDIA_ERR_NONE) { thumb_err("_thumbnail_get_data failed - %d", err); diff --git a/src/include/util/media-thumb-util.h b/src/include/util/media-thumb-util.h index 5b7b954..64515f2 100755 --- a/src/include/util/media-thumb-util.h +++ b/src/include/util/media-thumb-util.h @@ -40,7 +40,5 @@ int _media_thumb_get_file_type(const char *file_full_path); char* _media_thumb_generate_hash_name(const char *file); -int _media_thumb_remove_file(const char *path); - #endif /*_MEDIA_THUMB_UTIL_H_*/ diff --git a/src/util/media-thumb-util.c b/src/util/media-thumb-util.c index b9140cb..cc03075 100755 --- a/src/util/media-thumb-util.c +++ b/src/util/media-thumb-util.c @@ -90,20 +90,6 @@ int _media_thumb_get_file_type(const char *file_full_path) return THUMB_NONE_TYPE; } -int _media_thumb_remove_file(const char *path) -{ - int result = -1; - - result = remove(path); - if (result == 0) { - thumb_dbg("success to remove file"); - return TRUE; - } else { - thumb_stderror("fail to remove file"); - return FALSE; - } -} - int _media_thumb_get_file_ext(const char *file_path, char *file_ext, int max_len) { int i = 0; diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt deleted file mode 100644 index e762c17..0000000 --- a/test/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -SET(TEST-THUMB "test-thumb.c") - -INCLUDE(FindPkgConfig) - pkg_check_modules(pkgs REQUIRED glib-2.0 gthread-2.0 dlog mm-fileinfo aul libmedia-utils libtzplatform-config) - -FOREACH(flag ${pkgs_CFLAGS}) - SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} ${flag}") -ENDFOREACH(flag) - -SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${EXTRA_CFLAGS} -Wall -fPIE") - -ADD_EXECUTABLE(test-thumb ${TEST-THUMB}) -TARGET_LINK_LIBRARIES(test-thumb ${pkgs_LDFLAGS} ${MEDIATHUMB-LIB} ) diff --git a/test/test-thumb.c b/test/test-thumb.c deleted file mode 100755 index ac9e638..0000000 --- a/test/test-thumb.c +++ /dev/null @@ -1,80 +0,0 @@ -/* - * libmedia-thumbnail - * - * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved. - * - * Contact: Hyunjun Ko - * - * 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 -#include -#include -#include - -#include "media-thumbnail.h" -#include "thumb-server-internal.h" -#include "media-thumb-debug.h" -#include "media-thumb-ipc.h" -#include "media-thumb-util.h" - -int main(int argc, char *argv[]) -{ - int mode; - int err = -1; - unsigned int req_id = 0; - const char *origin_path = NULL; - - if ((argc != 3) && (argc != 4)) { - printf("Usage: %s [test mode number] [path]\n", argv[0]); - return -1; - } - - mode = atoi(argv[1]); - origin_path = argv[2]; - - if (origin_path && (mode == 1)) { - printf("Test _thumbnail_get_data\n"); -#if 0 - char *thumb_path = "thumbnail_path.jpg"; - - //long start = thumb_get_debug_time(); - - err = _thumbnail_get_data(origin_path, thumb_path); - if (err < 0) { - printf("_thumbnail_get_data failed - %d\n", err); - return -1; - } - - //long end = thumb_get_debug_time(); - //printf("Time : %f\n", ((double)(end - start) / (double)CLOCKS_PER_SEC)); -#endif - } else if (mode == 2) { - printf("Test thumbnail_request_cancel_media\n"); - - err = thumbnail_request_cancel_media(req_id); - if (err < 0) { - printf("thumbnail_request_cancel_media failed : %d\n", err); - return -1; - } else { - printf("thumbnail_request_cancel_media success!\n"); - } - } - - thumb_dbg("Test is Completed"); - - return 0; -} - diff --git a/thumbsvr b/thumbsvr deleted file mode 100644 index cd5b2d7..0000000 --- a/thumbsvr +++ /dev/null @@ -1,4 +0,0 @@ -#!/bin/sh -/etc/init.d/network start -/usr/bin/media-thumbnail-server & - -- cgit v1.2.3