diff options
Diffstat (limited to 'src/include/util/media-thumb-debug.h')
-rwxr-xr-x | src/include/util/media-thumb-debug.h | 81 |
1 files changed, 81 insertions, 0 deletions
diff --git a/src/include/util/media-thumb-debug.h b/src/include/util/media-thumb-debug.h new file mode 100755 index 0000000..65ca53f --- /dev/null +++ b/src/include/util/media-thumb-debug.h @@ -0,0 +1,81 @@ +/* + * libmedia-thumbnail + * + * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: Hyunjun Ko <zzoon.ko@samsung.com> + * + * 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 _MEDIA_THUMB_DEBUG_H_ +#define _MEDIA_THUMB_DEBUG_H_ + +#include <stdio.h> +#include <stdlib.h> +#include <dlog.h> + +#include <unistd.h> +#include <asm/unistd.h> + +#ifdef LOG_TAG +#undef LOG_TAG +#endif + + +#define _PERFORMANCE_CHECK_ + + +#define LOG_TAG "MEDIA_THUMBNAIL" + +static pid_t gettid(void) +{ + return syscall(__NR_gettid); +} + +#define FONT_COLOR_RESET "\033[0m" +#define FONT_COLOR_RED "\033[31m" +#define FONT_COLOR_GREEN "\033[32m" +#define FONT_COLOR_YELLOW "\033[33m" +#define FONT_COLOR_BLUE "\033[34m" +#define FONT_COLOR_PURPLE "\033[35m" +#define FONT_COLOR_CYAN "\033[36m" +#define FONT_COLOR_GRAY "\033[37m" + +#define thumb_dbg(fmt, arg...) LOGD(FONT_COLOR_RESET"[%d] " fmt "\n", gettid(), ##arg) +#define thumb_warn(fmt, arg...) LOGW(FONT_COLOR_GREEN"[%d] " fmt "\n", gettid(), ##arg) +#define thumb_err(fmt, arg...) LOGE(FONT_COLOR_RED"[%d] " fmt "\n", gettid(), ##arg) + +#ifdef _USE_LOG_FILE_ +void thumb_init_file_debug(); +void thumb_close_file_debug(); +FILE* get_fp(); +#define thumb_file_dbg(fmt,arg...) fprintf( get_fp(), "[%s: %d] " fmt "\n", __FUNCTION__, __LINE__, ##arg) + +#endif + + +#ifdef _PERFORMANCE_CHECK_ +long +thumb_get_debug_time(void); +void +thumb_reset_debug_time(void); +void +thumb_print_debug_time(char* time_string); +void +thumb_print_debug_time_ex(long start, long end, const char* func_name, char* time_string); +#endif + +#endif /*_MEDIA_THUMB_DEBUG_H_*/ + |