*
* @since_tizen 2.4
*
+ * @privlevel public
+ * @privilege %http://tizen.org/privilege/mediastorage \n
+ * %http://tizen.org/privilege/externalstorage
+ *
* @remarks You must release @a request_id using free(). \n
* http://tizen.org/privilege/mediastorage is needed if input or output path are relevant to media storage. \n
* http://tizen.org/privilege/externalstorage is needed if input or output path are relevant to external storage. \n
/**
* @brief Cancels the thumbnail extraction request for the given media.
* @since_tizen 2.4
+ * @remarks If there is no item you want to cancel, this API return MEDIA_CONTENT_ERROR_INVALID_OPERATION
*
* @param[in] thumb The media thumbnail info handle
* @param[in] request_id The generated request id by thumbnail extraction request
/**
* @brief Cancels all thumbnail extraction requests associated with the given thumbnail info handle.
* @since_tizen 2.4
+ * @remarks If there is no item you want to cancel, this API return MEDIA_CONTENT_ERROR_INVALID_OPERATION
*
* @param[in] thumb The media thumbnail info handle
*
Name: capi-media-thumbnail-util
Summary: A media thumbnail util library in SLP C API
-Version: 0.1.1
+Version: 0.1.2
Release: 1
Group: System/Libraries
License: Apache-2.0
%build
+export CFLAGS+=" -Wextra -Wno-array-bounds"
+export CFLAGS+=" -Wno-ignored-qualifiers -Wno-unused-parameter -Wshadow"
+export CFLAGS+=" -Wwrite-strings -Wswitch-default"
MAJORVER=`echo %{version} | awk 'BEGIN {FS="."}{print $1}'`
%cmake . -DFULLVER=%{version} -DMAJORVER=${MAJORVER}
make %{?jobs:-j%jobs}
char *buf = NULL;
buf = malloc(MAX_SIZE * sizeof(char));
- snprintf(buf, MAX_SIZE, "%d", request_id);
- *req_str = strndup(buf, strlen(buf));
- SAFE_FREE(buf);
+
+ if (buf != NULL) {
+ snprintf(buf, MAX_SIZE, "%d", request_id);
+ *req_str = strndup(buf, strlen(buf));
+ SAFE_FREE(buf);
+ }
}
void __thumbnail_util_extract_completed_cb(int error, int request_id, const char *path, int thumb_width, int thumb_height, unsigned char *thumb_data, int thumb_size, void *user_data)
{
_thumb->request_id = g_thumbnail_req_id;
__thumbnail_util_convert_itoa(_thumb->request_id, request_id);
thumbnail_extract_cb_s *_thumb_cb = (thumbnail_extract_cb_s *)calloc(1, sizeof(thumbnail_extract_cb_s));
- _thumb_cb->handle = _thumb;
- _thumb_cb->user_data = user_data;
- _thumb_cb->thumb_extract_cb = callback;
+
+ if (_thumb_cb != NULL) {
+ _thumb_cb->handle = _thumb;
+ _thumb_cb->user_data = user_data;
+ _thumb_cb->thumb_extract_cb = callback;
+ }
if (_thumb->dst_width == 0 || _thumb->dst_height == 0) {
_thumb->dst_width = 320;
int ret = THUMBNAIL_UTIL_ERROR_NONE;
thumbnail_s *_thumb = (thumbnail_s *)thumb;
- if(_thumb != NULL) {
+ if (_thumb != NULL) {
ret = thumbnail_request_cancel_all(true, tzplatform_getuid(TZ_USER_NAME));
} else {
thumbnail_util_error("INVALID_PARAMETER(0x%08x)", THUMBNAIL_UTIL_ERROR_INVALID_PARAMETER);