2 * Copyright (c) 2011 Samsung Electronics Co., Ltd All Rights Reserved
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
19 #ifndef __TIZEN_THUMBNAIL_UTIL_PRIVATE_H__
20 #define __TIZEN_THUMBNAIL_UTIL_PRIVATE_H__
24 #include <asm/unistd.h>
29 #include <thumbnail_util_type.h>
31 #include <tzplatform_config.h>
36 #endif /* __cplusplus */
42 #define LOG_TAG "CAPI_MEDIA_THUMBNAIL_UTIL"
44 #define SAFE_STRLCPY(dst, src, n) ((g_strlcpy(dst, src, n) < n) ? TRUE : FALSE)
45 #define SAFE_STRLCAT(dst, src, n) g_strlcat(dst, src, n);
46 #define SAFE_FREE(src) {if(src) {free(src); src = NULL;}}
47 #define STRING_VALID(str) ((str != NULL && strlen(str) > 0) ? TRUE : FALSE)
55 unsigned char *thumb_data;
60 thumbnail_extracted_cb thumb_extract_cb;
62 }thumbnail_extract_cb_s;
64 #define FONT_COLOR_RESET "\033[0m"
65 #define FONT_COLOR_RED "\033[31m"
66 #define FONT_COLOR_GREEN "\033[32m"
67 #define FONT_COLOR_YELLOW "\033[33m"
68 #define FONT_COLOR_BLUE "\033[34m"
69 #define FONT_COLOR_PURPLE "\033[35m"
70 #define FONT_COLOR_CYAN "\033[36m"
71 #define FONT_COLOR_GRAY "\033[37m"
73 #define thumbnail_util_gettid() syscall(__NR_gettid)
75 #define thumbnail_util_retv_if(expr, val) do { \
77 LOGE(FONT_COLOR_RED"[%d]", media_content_gettid()); \
82 #define thumbnail_util_debug(fmt, arg...) do { \
83 LOGD(FONT_COLOR_RESET"[%d]"fmt"", thumbnail_util_gettid(), ##arg); \
86 #define thumbnail_util_info(fmt, arg...) do { \
87 LOGI(FONT_COLOR_GREEN"[%d]"fmt"", thumbnail_util_gettid() ,##arg); \
90 #define thumbnail_util_error(fmt, arg...) do { \
91 LOGE(FONT_COLOR_RED"[%d]"fmt"",thumbnail_util_gettid(), ##arg); \
94 #define thumbnail_util_debug_func() do { \
95 LOGD(FONT_COLOR_RESET"[%d]", thumbnail_util_gettid()); \
98 #define thumbnail_util_sec_debug(fmt, arg...) do { \
99 SECURE_LOGD(FONT_COLOR_RESET"[%d]"fmt"", thumbnail_util_gettid(), ##arg); \
102 #define thumbnail_util_sec_warn(fmt, arg...) do { \
103 SECURE_LOGW(FONT_COLOR_GREEN"[%d]"fmt"",thumbnail_util_gettid(), ##arg); \
106 #define thumbnail_util_sec_error(fmt, arg...) do { \
107 SECURE_LOGE(FONT_COLOR_RED"[%d]"fmt"",thumbnail_util_gettid(), ##arg); \
112 #endif /* __cplusplus */
113 #endif /*__TIZEN_THUMBNAIL_UTIL_PRIVATE_H__*/