* @param[in] path The path to the media file
* @param[out] info The handle to the media info
*
- * @return @c 0 on success,
+ * @return @c 0 on success,
* otherwise a negative error value
*
* @retval #MEDIA_CONTENT_ERROR_NONE Successful
*
* @see media_content_connect()
*/
-int media_info_insert_to_db (const char *path, media_info_h *info);
+int media_info_insert_to_db(const char *path, media_info_h *info);
/**
* @brief Inserts media files into the media database, asynchronously.
* @param[in] callback The callback to be invoked when media items inserted completely
* @param[in] user_data The user data to be passed to the callback function
*
- * @return @c 0 on success,
+ * @return @c 0 on success,
* otherwise a negative error value
*
* @retval #MEDIA_CONTENT_ERROR_NONE Successful
* @see media_content_connect()
* @see media_insert_completed_cb()
*/
-int media_info_insert_batch_to_db(const char **path_array,unsigned int array_length, media_insert_completed_cb callback, void *user_data);
+int media_info_insert_batch_to_db(const char **path_array, unsigned int array_length, media_insert_completed_cb callback, void *user_data);
/**
* @brief Inserts the burst shot images into the media database, asynchronously.
* @param[in] callback The callback to be invoked when the images are inserted completely
* @param[in] user_data The user data to be passed to the callback function
*
- * @return @c 0 on success,
+ * @return @c 0 on success,
* otherwise a negative error value
*
* @retval #MEDIA_CONTENT_ERROR_NONE Successful
* @see media_content_connect()
* @see media_insert_burst_shot_completed_cb()
*/
-int media_info_insert_burst_shot_to_db(const char **path_array,unsigned int array_length, media_insert_burst_shot_completed_cb callback, void *user_data);
+int media_info_insert_burst_shot_to_db(const char **path_array, unsigned int array_length, media_insert_burst_shot_completed_cb callback, void *user_data);
/**
* @brief Deletes a media file from the media database.
*
* @param[in] media_id The ID to the media file
*
- * @return @c 0 on success,
+ * @return @c 0 on success,
* otherwise a negative error value
*
* @retval #MEDIA_CONTENT_ERROR_NONE Successful
*
* @param[in] filter The handle to filter
*
- * @return @c 0 on success,
+ * @return @c 0 on success,
* otherwise a negative error value
*
* @retval #MEDIA_CONTENT_ERROR_NONE Successful
*
* @param[in] media The media info handle
*
- * @return @c 0 on success,
+ * @return @c 0 on success,
* otherwise a negative error value
*
* @retval #MEDIA_CONTENT_ERROR_NONE Successful
* @param[out] dst The destination handle to the media info
* @param[in] src The source handle to media info
*
- * @return @c 0 on success,
+ * @return @c 0 on success,
* otherwise a negative error value
*
* @retval #MEDIA_CONTENT_ERROR_NONE Successful
* @param[in] filter The handle to filter
* @param[out] media_count The count of media
*
- * @return @c 0 on success,
+ * @return @c 0 on success,
* otherwise a negative error value
*
* @retval #MEDIA_CONTENT_ERROR_NONE Successful
* @param[in] callback The callback function to be invoked
* @param[in] user_data The user data to be passed to the callback function
*
- * @return @c 0 on success,
+ * @return @c 0 on success,
* otherwise a negative error value
*
* @retval #MEDIA_CONTENT_ERROR_NONE Successful
* @param[in] filter The handle to the media filter
* @param[out] tag_count The count of the media tag
*
- * @return @c 0 on success,
+ * @return @c 0 on success,
* otherwise a negative error value
*
* @retval #MEDIA_CONTENT_ERROR_NONE Successful
* @param[in] callback The callback function to be invoked
* @param[in] user_data The user data to be passed to the callback function
*
- * @return @c 0 on success,
+ * @return @c 0 on success,
* otherwise a negative error value
*
* @retval #MEDIA_CONTENT_ERROR_NONE Successful
* @param[in] filter The handle to the media filter
* @param[out] bookmark_count The count of the media tag
*
- * @return @c 0 on success,
+ * @return @c 0 on success,
* otherwise a negative error value
*
* @retval #MEDIA_CONTENT_ERROR_NONE Successful
* @param[in] callback The callback function to be invoked
* @param[in] user_data The user data to be passed to the callback function
*
- * @return @c 0 on success,
+ * @return @c 0 on success,
* otherwise a negative error value
*
* @retval #MEDIA_CONTENT_ERROR_NONE Successful
* @see media_content_connect()
* @see media_bookmark_cb()
*/
-int media_info_foreach_bookmark_from_db (const char *media_id, filter_h filter, media_bookmark_cb callback, void *user_data);
+int media_info_foreach_bookmark_from_db(const char *media_id, filter_h filter, media_bookmark_cb callback, void *user_data);
/**
* @brief Gets the number of face for the passed @a media_id from the media database.
* @see media_filter_create()
*
*/
-int media_info_foreach_face_from_db (const char *media_id, filter_h filter, media_face_cb callback, void *user_data);
+int media_info_foreach_face_from_db(const char *media_id, filter_h filter, media_face_cb callback, void *user_data);
/**
* @brief Gets the image metadata for a given media info.
* @param[in] media The media info handle
* @param[out] image A handle to image metadata
*
- * @return @c 0 on success,
+ * @return @c 0 on success,
* otherwise a negative error value
*
* @retval #MEDIA_CONTENT_ERROR_NONE Successful
* @param[in] media The media info handle
* @param[out] video A handle to the video meta
*
- * @return @c 0 on success,
+ * @return @c 0 on success,
* otherwise a negative error value
*
* @retval #MEDIA_CONTENT_ERROR_NONE Successful
* @param[in] media The media info handle
* @param[out] audio A handle to the audio meta
*
- * @return @c 0 on success,
+ * @return @c 0 on success,
* otherwise a negative error value
*
* @retval #MEDIA_CONTENT_ERROR_NONE Successful
* @param[in] media The media info handle
* @param[out] media_id The ID of the media tag
*
- * @return @c 0 on success,
+ * @return @c 0 on success,
* otherwise a negative error value
*
* @retval #MEDIA_CONTENT_ERROR_NONE Successful
* @param[in] media The media info handle
* @param[out] path The path of the media info
*
- * @return @c 0 on success,
+ * @return @c 0 on success,
* otherwise a negative error value
*
* @retval #MEDIA_CONTENT_ERROR_NONE Successful
* @param[in] media The media info handle
* @param[out] name The name of media info
*
- * @return @c 0 on success,
+ * @return @c 0 on success,
* otherwise a negative error value
*
* @retval #MEDIA_CONTENT_ERROR_NONE Successful
* @param[in] media The media info handle
* @param[out] type The type of the media content (#media_content_type_e)
*
- * @return @c 0 on success,
+ * @return @c 0 on success,
* otherwise a negative error value
*
* @retval #MEDIA_CONTENT_ERROR_NONE Successful
* @param[in] media The media info handle
* @param[out] mime_type The MIME type of the media info
*
- * @return @c 0 on success,
+ * @return @c 0 on success,
* otherwise a negative error value
*
* @retval #MEDIA_CONTENT_ERROR_NONE Successful
* @param[in] media The media info handle
* @param[out] size The type of the media content
*
- * @return @c 0 on success,
+ * @return @c 0 on success,
* otherwise a negative error value
*
* @retval #MEDIA_CONTENT_ERROR_NONE Successful
* @param[in] media The media info handle
* @param[out] added_time The added time to the DB
*
- * @return @c 0 on success,
+ * @return @c 0 on success,
* otherwise a negative error value
*
* @retval #MEDIA_CONTENT_ERROR_NONE Successful
* @param[out] time The date of modification of the file \n
* Get from the file.
*
- * @return @c 0 on success,
+ * @return @c 0 on success,
* otherwise a negative error value
*
* @retval #MEDIA_CONTENT_ERROR_NONE Successful
* @param[in] media The media info handle
* @param[out] time The date of the timeline
*
- * @return @c 0 on success,
+ * @return @c 0 on success,
* otherwise a negative error value
*
* @retval #MEDIA_CONTENT_ERROR_NONE Successful
* @param[in] media The media info handle
* @param[out] path The path to the thumbnail of the media info
*
- * @return @c 0 on success,
+ * @return @c 0 on success,
* otherwise a negative error value
*
* @retval #MEDIA_CONTENT_ERROR_NONE Successful
* @param[in] media The media info handle
* @param[out] description The description of the media info
*
- * @return @c 0 on success,
+ * @return @c 0 on success,
* otherwise a negative error value
*
* @retval #MEDIA_CONTENT_ERROR_NONE Successful
* @param[in] media The media info handle
* @param[out] longitude The longitude of the media info
*
- * @return @c 0 on success,
+ * @return @c 0 on success,
* otherwise a negative error value
*
* @retval #MEDIA_CONTENT_ERROR_NONE Successful
* @param[in] media The media info handle
* @param[out] latitude The latitude of the media info
*
- * @return @c 0 on success,
+ * @return @c 0 on success,
* otherwise a negative error value
*
* @retval #MEDIA_CONTENT_ERROR_NONE Successful
* @param[in] media The media info handle
* @param[out] altitude The altitude of the media info
*
- * @return @c 0 on success,
+ * @return @c 0 on success,
* otherwise a negative error value
*
* @retval #MEDIA_CONTENT_ERROR_NONE Successful
* @param[in] media The media info handle
* @param[out] weather The weather of the media info
*
- * @return @c 0 on success,
+ * @return @c 0 on success,
* otherwise a negative error value
*
* @retval #MEDIA_CONTENT_ERROR_NONE Successful
* @param[in] media The media info handle
* @param[out] rating The rating of the media info
*
- * @return @c 0 on success,
+ * @return @c 0 on success,
* otherwise a negative error value
*
* @retval #MEDIA_CONTENT_ERROR_NONE Successful
* @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
*
* @param[in] media The media info handle
- * @param[out] favorite @c true if media info is set as favorite,
+ * @param[out] favorite @c true if media info is set as favorite,
* otherwise @c false if media info is not set as favorite
*
- * @return @c 0 on success,
+ * @return @c 0 on success,
* otherwise a negative error value
*
* @retval #MEDIA_CONTENT_ERROR_NONE Successful
* @param[in] media The media info handle
* @param[out] author The author of the media info
*
- * @return @c 0 on success,
+ * @return @c 0 on success,
* otherwise a negative error value
*
* @retval #MEDIA_CONTENT_ERROR_NONE Successful
* @param[in] media The media info handle
* @param[out] provider The provider of the media info
*
- * @return @c 0 on success,
+ * @return @c 0 on success,
* otherwise a negative error value
*
* @retval #MEDIA_CONTENT_ERROR_NONE Successful
* @param[in] media The media info handle
* @param[out] content_name The content name of the media info
*
- * @return @c 0 on success,
+ * @return @c 0 on success,
* otherwise a negative error value
*
* @retval #MEDIA_CONTENT_ERROR_NONE Successful
* @param[in] media The media info handle
* @param[out] title The title of the media info
*
- * @return @c 0 on success,
+ * @return @c 0 on success,
* otherwise a negative error value
*
* @retval #MEDIA_CONTENT_ERROR_NONE Successful
* @param[in] media The media info handle
* @param[out] category The category of the media info
*
- * @return @c 0 on success,
+ * @return @c 0 on success,
* otherwise a negative error value
*
* @retval #MEDIA_CONTENT_ERROR_NONE Successful
* @param[in] media The media info handle
* @param[out] location_tag The location of the media info
*
- * @return @c 0 on success,
+ * @return @c 0 on success,
* otherwise a negative error value
*
* @retval #MEDIA_CONTENT_ERROR_NONE Successful
* @param[in] media The media info handle
* @param[out] age_rating The age rating of the media info
*
- * @return @c 0 on success,
+ * @return @c 0 on success,
* otherwise a negative error value
*
* @retval #MEDIA_CONTENT_ERROR_NONE Successful
* @param[in] media The media info handle
* @param[out] keyword The keyword of the media info
*
- * @return @c 0 on success,
+ * @return @c 0 on success,
* otherwise a negative error value
*
* @retval #MEDIA_CONTENT_ERROR_NONE Successful
* @param[in] media The media info handle
* @param[out] storage_id The storage id of the media info
*
- * @return @c 0 on success,
+ * @return @c 0 on success,
* otherwise a negative error value
*
* @retval #MEDIA_CONTENT_ERROR_NONE Successful
* @param[out] is_drm @c true if media is DRM media,
* otherwise @c false if media is not DRM media
*
- * @return @c 0 on success,
+ * @return @c 0 on success,
* otherwise a negative error value
*
* @retval #MEDIA_CONTENT_ERROR_NONE Successful
* @param[in] media The media info handle
* @param[out] storage_type The storage type of the media info
*
- * @return @c 0 on success,
+ * @return @c 0 on success,
* otherwise a negative error value
*
* @retval #MEDIA_CONTENT_ERROR_NONE Successful
* @param[in] media The media info handle
* @param[in] display_name The display name of the media info
*
- * @return @c 0 on success,
+ * @return @c 0 on success,
* otherwise a negative error value
*
* @retval #MEDIA_CONTENT_ERROR_NONE Successful
* @param[in] media The media info handle
* @param[in] description The description of the media info
*
- * @return @c 0 on success,
+ * @return @c 0 on success,
* otherwise a negative error value
*
* @retval #MEDIA_CONTENT_ERROR_NONE Successful
* @param[in] media The media info handle
* @param[in] longitude The longitude of the media info
*
- * @return @c 0 on success,
+ * @return @c 0 on success,
* otherwise a negative error value
*
* @retval #MEDIA_CONTENT_ERROR_NONE Successful
* @param[in] media The media info handle
* @param[in] latitude The latitude of the media info
*
- * @return @c 0 on success,
+ * @return @c 0 on success,
* otherwise a negative error value
*
* @retval #MEDIA_CONTENT_ERROR_NONE Successful
* @param[in] media The media info handle
* @param[in] altitude The altitude of the media info
*
- * @return @c 0 on success,
+ * @return @c 0 on success,
* otherwise a negative error value
*
* @retval #MEDIA_CONTENT_ERROR_NONE Successful
* @param[in] media The media info handle
* @param[in] weather The weather of the media info
*
- * @return @c 0 on success,
+ * @return @c 0 on success,
* otherwise a negative error value
*
* @retval #MEDIA_CONTENT_ERROR_NONE Successful
* @param[in] media The media info handle
* @param[in] rating The rating of the media info
*
- * @return @c 0 on success,
+ * @return @c 0 on success,
* otherwise a negative error value
*
* @retval #MEDIA_CONTENT_ERROR_NONE Successful
* @param[in] favorite Set @c true to set the media info as favorite,
* otherwise set @c false to not set the media info as favorite
*
- * @return @c 0 on success,
+ * @return @c 0 on success,
* otherwise a negative error value
*
* @retval #MEDIA_CONTENT_ERROR_NONE Successful
* @param[in] media The media info handle
* @param[in] author The author of the media info
*
- * @return @c 0 on success,
+ * @return @c 0 on success,
* otherwise a negative error value
*
* @retval #MEDIA_CONTENT_ERROR_NONE Successful
* @param[in] media The media info handle
* @param[in] provider The provider of the media info
*
- * @return @c 0 on success,
+ * @return @c 0 on success,
* otherwise a negative error value
*
* @retval #MEDIA_CONTENT_ERROR_NONE Successful
* @param[in] media The media info handle
* @param[in] content_name The content name of the media info
*
- * @return @c 0 on success,
+ * @return @c 0 on success,
* otherwise a negative error value
*
* @retval #MEDIA_CONTENT_ERROR_NONE Successful
* @param[in] media The media info handle
* @param[in] category The category of the media info
*
- * @return @c 0 on success,
+ * @return @c 0 on success,
* otherwise a negative error value
*
* @retval #MEDIA_CONTENT_ERROR_NONE Successful
* @param[in] media The media info handle
* @param[in] location_tag The location of the media info
*
- * @return @c 0 on success,
+ * @return @c 0 on success,
* otherwise a negative error value
*
* @retval #MEDIA_CONTENT_ERROR_NONE Successful
* @param[in] media The media info handle
* @param[in] age_rating The age rating of the media info
*
- * @return @c 0 on success,
+ * @return @c 0 on success,
* otherwise a negative error value
*
* @retval #MEDIA_CONTENT_ERROR_NONE Successful
* @param[in] media The media info handle
* @param[in] keyword The keyword of the media info
*
- * @return @c 0 on success,
+ * @return @c 0 on success,
* otherwise a negative error value
*
* @retval #MEDIA_CONTENT_ERROR_NONE Successful
/**
* @brief Updates the media info to the media database.
- *
+ *
* @details The function updates the given media info in the media database.
*
* @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
*
* @param[in] media The media info handle
*
- * @return @c 0 on success,
+ * @return @c 0 on success,
* otherwise a negative error value
*
* @retval #MEDIA_CONTENT_ERROR_NONE Successful
*
* @param[in] media_id The ID of the media info
*
- * @return @c 0 on success,
+ * @return @c 0 on success,
* otherwise a negative error value
*
* @retval #MEDIA_CONTENT_ERROR_NONE Successful
* @param[in] media The media info handle
* @param[in] added_time The added time of the media info
*
- * @return @c 0 on success,
+ * @return @c 0 on success,
* otherwise a negative error value
*
* @retval #MEDIA_CONTENT_ERROR_NONE Successful
* @param[in] media The media info handle
* @param[in] dst_path The path of destination
*
- * @return @c 0 on success,
+ * @return @c 0 on success,
* otherwise a negative error value
*
* @retval #MEDIA_CONTENT_ERROR_NONE Successful
* @param[in] callback The callback function to be invoked
* @param[in] user_data The user data to be passed to the callback function
*
- * @return @c 0 on success,
+ * @return @c 0 on success,
* otherwise a negative error value
*
* @retval #MEDIA_CONTENT_ERROR_NONE Successful
*
* @param[in] media The media info handle
*
- * @return @c 0 on success,
+ * @return @c 0 on success,
* otherwise a negative error value
*
* @retval #MEDIA_CONTENT_ERROR_NONE Successful
media_insert_cb_s *_cb_data = (media_insert_cb_s *)user_data;
if (_cb_data) {
- if (result) {
+ if (result)
ret = _content_error_capi(MEDIA_CONTENT_TYPE, result->result);
- }
if (_cb_data->insert_completed_cb)
_cb_data->insert_completed_cb(ret, _cb_data->user_data);
if (STRING_VALID(_cb_data->insert_list_path)) {
- if (unlink(_cb_data->insert_list_path) < 0) {
+ if (unlink(_cb_data->insert_list_path) < 0)
media_content_stderror("failed to delete");
- }
SAFE_FREE(_cb_data->insert_list_path);
}
}
media_thumbnail_cb_s *_thumb_cb = (media_thumbnail_cb_s *)user_data;
media_info_s *media = NULL;
- if (_thumb_cb != NULL)
- {
+ if (_thumb_cb != NULL) {
media = _thumb_cb->handle;
- if((media != NULL) && STRING_VALID(path))
- {
+ if ((media != NULL) && STRING_VALID(path)) {
SAFE_FREE(media->thumbnail_path);
media->thumbnail_path = strdup(path);
}
media_info_get_thumbnail_path(media, &thumb_path);
if (STRING_VALID(thumb_path) && STRING_VALID(MEDIA_CONTENT_THUMB_DEFAULT_PATH)) {
- if (strncmp(MEDIA_CONTENT_THUMB_DEFAULT_PATH, thumb_path, strlen(MEDIA_CONTENT_THUMB_DEFAULT_PATH)) != 0) {
+ if (strncmp(MEDIA_CONTENT_THUMB_DEFAULT_PATH, thumb_path, strlen(MEDIA_CONTENT_THUMB_DEFAULT_PATH)) != 0)
g_array_append_val(thumb_list, thumb_path);
- }
}
} else {
media_content_error("media_info_get_media_type failed");
ret = _media_util_check_file_exist(path_array[idx]);
if (ret != MEDIA_CONTENT_ERROR_NONE) {
fclose(fp);
- if (unlink(list_path) < 0) {
+ if (unlink(list_path) < 0)
media_content_stderror("failed to delete");
- }
return ret;
}
if (nwrites != size) {
media_content_stderror("failed to write");
fclose(fp);
- if (unlink(list_path) < 0) {
+ if (unlink(list_path) < 0)
media_content_stderror("failed to delete");
- }
return MEDIA_CONTENT_ERROR_INVALID_OPERATION;
}
if (nwrites != 1) {
media_content_stderror("failed to write");
fclose(fp);
- if (unlink(list_path) < 0) {
+ if (unlink(list_path) < 0)
media_content_stderror("failed to delete");
- }
return MEDIA_CONTENT_ERROR_INVALID_OPERATION;
}
} else {
if (ret != MEDIA_CONTENT_ERROR_NONE) {
media_content_error("media_files_register failed : %d", ret);
- if (unlink(list_path) < 0) {
+ if (unlink(list_path) < 0)
media_content_stderror("failed to delete");
- }
return _content_error_capi(MEDIA_CONTENT_TYPE, ret);
}
_media->size = (unsigned long long)sqlite3_column_int64(stmt, MEDIA_INFO_SIZE);
_media->added_time = (int)sqlite3_column_int(stmt, MEDIA_INFO_ADDED_TIME);
_media->modified_time = (int)sqlite3_column_int(stmt, MEDIA_INFO_MODIFIED_TIME);
- _media->thumbnail_path= g_strdup((const char *)sqlite3_column_text(stmt, MEDIA_INFO_THUMBNAIL_PATH));
+ _media->thumbnail_path = g_strdup((const char *)sqlite3_column_text(stmt, MEDIA_INFO_THUMBNAIL_PATH));
_media->description = g_strdup((const char *)sqlite3_column_text(stmt, MEDIA_INFO_DESCRIPTION));
_media->rating = (int)sqlite3_column_int(stmt, MEDIA_INFO_RATING);
_media->favourite = (int)sqlite3_column_int(stmt, MEDIA_INFO_FAVOURITE);
_media->image_meta->exposure_time = g_strdup((const char *)sqlite3_column_text(stmt, MEDIA_INFO_EXPOSURE_TIME));
_media->image_meta->model = g_strdup((const char *)sqlite3_column_text(stmt, MEDIA_INFO_MODEL));
}
-
} else if (_media->media_type == MEDIA_CONTENT_TYPE_VIDEO) {
_media->video_meta = (video_meta_s *)calloc(1, sizeof(video_meta_s));
if (_media->video_meta) {
_media->video_meta->played_position = sqlite3_column_int(stmt, MEDIA_INFO_LAST_PLAYED_POSITION);
}
- }
- else if ((_media->media_type == MEDIA_CONTENT_TYPE_MUSIC) || (_media->media_type == MEDIA_CONTENT_TYPE_SOUND)) {
+ } else if ((_media->media_type == MEDIA_CONTENT_TYPE_MUSIC) || (_media->media_type == MEDIA_CONTENT_TYPE_SOUND)) {
_media->audio_meta = (audio_meta_s *)calloc(1, sizeof(audio_meta_s));
if (_media->audio_meta) {
_media->audio_meta->media_id = g_strdup(_media->media_id);
SQLITE3_SAFE_FREE(select_query);
media_content_retv_if(ret != MEDIA_CONTENT_ERROR_NONE, ret);
- if (sqlite3_step(stmt) == SQLITE_ROW)
- {
+ if (sqlite3_step(stmt) == SQLITE_ROW) {
_media_info_item_get_detail(stmt, (media_info_h)_media);
} else {
media_content_error("There's no media!!");
memset(storage_id, 0x00, sizeof(storage_id));
ret = media_svc_get_storage_id(_content_get_db_handle(), path, storage_id);
- if (ret != MS_MEDIA_ERR_NONE)
- {
+ if (ret != MS_MEDIA_ERR_NONE) {
media_content_error("media_svc_get_storage_id failed : %d", ret);
return _content_error_capi(MEDIA_CONTENT_TYPE, ret);
}
char *path = NULL;
char storage_id[MEDIA_CONTENT_UUID_SIZE+1] = {0, };
- if (!STRING_VALID(media_id))
- {
+ if (!STRING_VALID(media_id)) {
media_content_error("INVALID_PARAMETER(0x%08x)", MEDIA_CONTENT_ERROR_INVALID_PARAMETER);
return MEDIA_CONTENT_ERROR_INVALID_PARAMETER;
}
char *thumb_path = NULL;
if (thumb_list != NULL) {
-
list_len = thumb_list->len;
-
- for (i = 0; i < list_len; i ++) {
+ for (i = 0; i < list_len; i++) {
thumb_path = g_array_index(thumb_list, char*, i);
media_content_debug("thumb path [%s]", thumb_path);
- if (unlink(thumb_path) < 0) {
+ if (unlink(thumb_path) < 0)
media_content_stderror("failed to delete");
- }
}
}
return MEDIA_CONTENT_ERROR_NONE;
char *thumb_path = NULL;
if (thumb_list != NULL) {
-
list_len = thumb_list->len;
-
- for (i = 0; i < list_len; i ++) {
+ for (i = 0; i < list_len; i++) {
thumb_path = g_array_index(thumb_list, char*, 0);
- g_array_remove_index(thumb_list,0);
+ g_array_remove_index(thumb_list, 0);
SAFE_FREE(thumb_path);
}
_filter = (filter_s*)filter;
attr = _content_get_attirbute_handle();
- if (_filter->condition)
- {
+ if (_filter->condition) {
ret = _media_filter_attribute_generate(attr, _filter->condition, _filter->condition_collate_type, &condition_query);
if (ret != MEDIA_CONTENT_ERROR_NONE) {
__media_info_release_thumb_list(thumb_list);
}
}
- if (STRING_VALID(condition_query))
- {
+ if (STRING_VALID(condition_query)) {
if (_filter->storage_id == NULL) {
/*FIX ME*/
query_string = sqlite3_mprintf(DELETE_MEDIA_FROM_MEDIA_BATCH, "media", condition_query);
} else {
query_string = sqlite3_mprintf(DELETE_MEDIA_FROM_MEDIA_BATCH, _filter->storage_id, condition_query);
}
- }
- else
- {
+ } else {
SAFE_FREE(condition_query);
__media_info_release_thumb_list(thumb_list);
int ret = MEDIA_CONTENT_ERROR_NONE;
media_info_s *_media = (media_info_s*)media;
- if (_media)
- {
+ if (_media) {
SAFE_FREE(_media->media_id);
SAFE_FREE(_media->file_path);
SAFE_FREE(_media->display_name);
SAFE_FREE(_media);
ret = MEDIA_CONTENT_ERROR_NONE;
- }
- else
- {
+ } else {
media_content_error("INVALID_PARAMETER(0x%08x)", MEDIA_CONTENT_ERROR_INVALID_PARAMETER);
ret = MEDIA_CONTENT_ERROR_INVALID_PARAMETER;
}
int ret = MEDIA_CONTENT_ERROR_NONE;
media_info_s *_src = (media_info_s*)src;
- if (_src != NULL)
- {
+ if (_src != NULL) {
media_info_s *_dst = (media_info_s*)calloc(1, sizeof(media_info_s));
media_content_retvm_if(_dst == NULL, MEDIA_CONTENT_ERROR_OUT_OF_MEMORY, "OUT_OF_MEMORY");
- if(STRING_VALID(_src->media_id))
- {
+ if (STRING_VALID(_src->media_id)) {
_dst->media_id = strdup(_src->media_id);
- if(_dst->media_id == NULL)
- {
+ if (_dst->media_id == NULL) {
media_content_error("OUT_OF_MEMORY(0x%08x)", MEDIA_CONTENT_ERROR_OUT_OF_MEMORY);
media_info_destroy((media_info_h)_dst);
return MEDIA_CONTENT_ERROR_OUT_OF_MEMORY;
}
}
- if(STRING_VALID(_src->file_path))
- {
+ if (STRING_VALID(_src->file_path)) {
_dst->file_path = strdup(_src->file_path);
- if(_dst->file_path == NULL)
- {
+ if (_dst->file_path == NULL) {
media_content_error("OUT_OF_MEMORY(0x%08x)", MEDIA_CONTENT_ERROR_OUT_OF_MEMORY);
media_info_destroy((media_info_h)_dst);
return MEDIA_CONTENT_ERROR_OUT_OF_MEMORY;
}
}
- if(STRING_VALID(_src->display_name))
- {
+ if (STRING_VALID(_src->display_name)) {
_dst->display_name = strdup(_src->display_name);
- if(_dst->display_name == NULL)
- {
+ if (_dst->display_name == NULL) {
media_content_error("OUT_OF_MEMORY(0x%08x)", MEDIA_CONTENT_ERROR_OUT_OF_MEMORY);
media_info_destroy((media_info_h)_dst);
return MEDIA_CONTENT_ERROR_OUT_OF_MEMORY;
}
}
- if(STRING_VALID(_src->mime_type))
- {
+ if (STRING_VALID(_src->mime_type)) {
_dst->mime_type = strdup(_src->mime_type);
- if(_dst->mime_type == NULL)
- {
+ if (_dst->mime_type == NULL) {
media_content_error("OUT_OF_MEMORY(0x%08x)", MEDIA_CONTENT_ERROR_OUT_OF_MEMORY);
media_info_destroy((media_info_h)_dst);
return MEDIA_CONTENT_ERROR_OUT_OF_MEMORY;
}
}
- if(STRING_VALID(_src->thumbnail_path))
- {
+ if (STRING_VALID(_src->thumbnail_path)) {
_dst->thumbnail_path = strdup(_src->thumbnail_path);
- if(_dst->thumbnail_path == NULL)
- {
+ if (_dst->thumbnail_path == NULL) {
media_content_error("OUT_OF_MEMORY(0x%08x)", MEDIA_CONTENT_ERROR_OUT_OF_MEMORY);
media_info_destroy((media_info_h)_dst);
return MEDIA_CONTENT_ERROR_OUT_OF_MEMORY;
}
}
- if(STRING_VALID(_src->description))
- {
+ if (STRING_VALID(_src->description)) {
_dst->description = strdup(_src->description);
- if(_dst->description == NULL)
- {
+ if (_dst->description == NULL) {
media_content_error("OUT_OF_MEMORY(0x%08x)", MEDIA_CONTENT_ERROR_OUT_OF_MEMORY);
media_info_destroy((media_info_h)_dst);
return MEDIA_CONTENT_ERROR_OUT_OF_MEMORY;
}
}
- if(STRING_VALID(_src->weather))
- {
+ if (STRING_VALID(_src->weather)) {
_dst->weather = strdup(_src->weather);
- if(_dst->weather == NULL)
- {
+ if (_dst->weather == NULL) {
media_content_error("OUT_OF_MEMORY(0x%08x)", MEDIA_CONTENT_ERROR_OUT_OF_MEMORY);
media_info_destroy((media_info_h)_dst);
return MEDIA_CONTENT_ERROR_OUT_OF_MEMORY;
}
}
- if(STRING_VALID(_src->title))
- {
+ if (STRING_VALID(_src->title)) {
_dst->title = strdup(_src->title);
- if(_dst->title == NULL)
- {
+ if (_dst->title == NULL) {
media_content_error("OUT_OF_MEMORY(0x%08x)", MEDIA_CONTENT_ERROR_OUT_OF_MEMORY);
media_info_destroy((media_info_h)_dst);
return MEDIA_CONTENT_ERROR_OUT_OF_MEMORY;
}
}
- if(STRING_VALID(_src->author))
- {
+ if (STRING_VALID(_src->author)) {
_dst->author = strdup(_src->author);
- if(_dst->author == NULL)
- {
+ if (_dst->author == NULL) {
media_content_error("OUT_OF_MEMORY(0x%08x)", MEDIA_CONTENT_ERROR_OUT_OF_MEMORY);
media_info_destroy((media_info_h)_dst);
return MEDIA_CONTENT_ERROR_OUT_OF_MEMORY;
}
}
- if(STRING_VALID(_src->provider))
- {
+ if (STRING_VALID(_src->provider)) {
_dst->provider = strdup(_src->provider);
- if(_dst->provider == NULL)
- {
+ if (_dst->provider == NULL) {
media_content_error("OUT_OF_MEMORY(0x%08x)", MEDIA_CONTENT_ERROR_OUT_OF_MEMORY);
media_info_destroy((media_info_h)_dst);
return MEDIA_CONTENT_ERROR_OUT_OF_MEMORY;
}
}
- if(STRING_VALID(_src->content_name))
- {
+ if (STRING_VALID(_src->content_name)) {
_dst->content_name = strdup(_src->content_name);
- if(_dst->content_name == NULL)
- {
+ if (_dst->content_name == NULL) {
media_content_error("OUT_OF_MEMORY(0x%08x)", MEDIA_CONTENT_ERROR_OUT_OF_MEMORY);
media_info_destroy((media_info_h)_dst);
return MEDIA_CONTENT_ERROR_OUT_OF_MEMORY;
}
}
- if(STRING_VALID(_src->category))
- {
+ if (STRING_VALID(_src->category)) {
_dst->category = strdup(_src->category);
- if(_dst->category == NULL)
- {
+ if (_dst->category == NULL) {
media_content_error("OUT_OF_MEMORY(0x%08x)", MEDIA_CONTENT_ERROR_OUT_OF_MEMORY);
media_info_destroy((media_info_h)_dst);
return MEDIA_CONTENT_ERROR_OUT_OF_MEMORY;
}
}
- if(STRING_VALID(_src->location_tag))
- {
+ if (STRING_VALID(_src->location_tag)) {
_dst->location_tag = strdup(_src->location_tag);
- if(_dst->location_tag == NULL)
- {
+ if (_dst->location_tag == NULL) {
media_content_error("OUT_OF_MEMORY(0x%08x)", MEDIA_CONTENT_ERROR_OUT_OF_MEMORY);
media_info_destroy((media_info_h)_dst);
return MEDIA_CONTENT_ERROR_OUT_OF_MEMORY;
}
}
- if(STRING_VALID(_src->age_rating))
- {
+ if (STRING_VALID(_src->age_rating)) {
_dst->age_rating = strdup(_src->age_rating);
- if(_dst->age_rating == NULL)
- {
+ if (_dst->age_rating == NULL) {
media_content_error("OUT_OF_MEMORY(0x%08x)", MEDIA_CONTENT_ERROR_OUT_OF_MEMORY);
media_info_destroy((media_info_h)_dst);
return MEDIA_CONTENT_ERROR_OUT_OF_MEMORY;
}
}
- if(STRING_VALID(_src->keyword))
- {
+ if (STRING_VALID(_src->keyword)) {
_dst->keyword = strdup(_src->keyword);
- if(_dst->keyword == NULL)
- {
+ if (_dst->keyword == NULL) {
media_content_error("OUT_OF_MEMORY(0x%08x)", MEDIA_CONTENT_ERROR_OUT_OF_MEMORY);
media_info_destroy((media_info_h)_dst);
return MEDIA_CONTENT_ERROR_OUT_OF_MEMORY;
}
}
- if(STRING_VALID(_src->storage_uuid))
- {
+ if (STRING_VALID(_src->storage_uuid)) {
_dst->storage_uuid = strdup(_src->storage_uuid);
- if(_dst->storage_uuid == NULL)
- {
+ if (_dst->storage_uuid == NULL) {
media_content_error("OUT_OF_MEMORY(0x%08x)", MEDIA_CONTENT_ERROR_OUT_OF_MEMORY);
media_info_destroy((media_info_h)_dst);
return MEDIA_CONTENT_ERROR_OUT_OF_MEMORY;
if (_src->media_type == MEDIA_CONTENT_TYPE_IMAGE && _src->image_meta) {
_dst->image_meta = (image_meta_s *)calloc(1, sizeof(image_meta_s));
- if (_dst->image_meta == NULL)
- {
+ if (_dst->image_meta == NULL) {
media_content_error("OUT_OF_MEMORY(0x%08x)", MEDIA_CONTENT_ERROR_OUT_OF_MEMORY);
media_info_destroy((media_info_h)_dst);
return MEDIA_CONTENT_ERROR_OUT_OF_MEMORY;
}
- if(STRING_VALID(_src->image_meta->media_id))
- {
+ if (STRING_VALID(_src->image_meta->media_id)) {
_dst->image_meta->media_id = strdup(_src->image_meta->media_id);
- if(_dst->image_meta->media_id == NULL)
- {
+ if (_dst->image_meta->media_id == NULL) {
media_content_error("OUT_OF_MEMORY(0x%08x)", MEDIA_CONTENT_ERROR_OUT_OF_MEMORY);
media_info_destroy((media_info_h)_dst);
return MEDIA_CONTENT_ERROR_OUT_OF_MEMORY;
}
}
- if(STRING_VALID(_src->image_meta->date_taken))
- {
+ if (STRING_VALID(_src->image_meta->date_taken)) {
_dst->image_meta->date_taken = strdup(_src->image_meta->date_taken);
- if(_dst->image_meta->date_taken == NULL)
- {
+ if (_dst->image_meta->date_taken == NULL) {
media_content_error("OUT_OF_MEMORY(0x%08x)", MEDIA_CONTENT_ERROR_OUT_OF_MEMORY);
media_info_destroy((media_info_h)_dst);
return MEDIA_CONTENT_ERROR_OUT_OF_MEMORY;
}
}
- if(STRING_VALID(_src->image_meta->burst_id))
- {
+ if (STRING_VALID(_src->image_meta->burst_id)) {
_dst->image_meta->burst_id = strdup(_src->image_meta->burst_id);
- if(_dst->image_meta->burst_id == NULL)
- {
+ if (_dst->image_meta->burst_id == NULL) {
media_content_error("OUT_OF_MEMORY(0x%08x)", MEDIA_CONTENT_ERROR_OUT_OF_MEMORY);
media_info_destroy((media_info_h)_dst);
return MEDIA_CONTENT_ERROR_OUT_OF_MEMORY;
}
}
- if(STRING_VALID(_src->image_meta->weather))
- {
+ if (STRING_VALID(_src->image_meta->weather)) {
_dst->image_meta->weather = strdup(_src->image_meta->weather);
- if(_dst->image_meta->weather == NULL)
- {
+ if (_dst->image_meta->weather == NULL) {
media_content_error("OUT_OF_MEMORY(0x%08x)", MEDIA_CONTENT_ERROR_OUT_OF_MEMORY);
media_info_destroy((media_info_h)_dst);
return MEDIA_CONTENT_ERROR_OUT_OF_MEMORY;
}
}
- if(STRING_VALID(_src->image_meta->exposure_time))
- {
+ if (STRING_VALID(_src->image_meta->exposure_time)) {
_dst->image_meta->exposure_time = strdup(_src->image_meta->exposure_time);
- if(_dst->image_meta->exposure_time == NULL)
- {
+ if (_dst->image_meta->exposure_time == NULL) {
media_content_error("OUT_OF_MEMORY(0x%08x)", MEDIA_CONTENT_ERROR_OUT_OF_MEMORY);
media_info_destroy((media_info_h)_dst);
return MEDIA_CONTENT_ERROR_OUT_OF_MEMORY;
}
}
- if(STRING_VALID(_src->image_meta->model))
- {
+ if (STRING_VALID(_src->image_meta->model)) {
_dst->image_meta->model = strdup(_src->image_meta->model);
- if(_dst->image_meta->model == NULL)
- {
+ if (_dst->image_meta->model == NULL) {
media_content_error("OUT_OF_MEMORY(0x%08x)", MEDIA_CONTENT_ERROR_OUT_OF_MEMORY);
media_info_destroy((media_info_h)_dst);
return MEDIA_CONTENT_ERROR_OUT_OF_MEMORY;
} else if (_src->media_type == MEDIA_CONTENT_TYPE_VIDEO && _src->video_meta) {
_dst->video_meta = (video_meta_s *)calloc(1, sizeof(video_meta_s));
- if (_dst->video_meta == NULL)
- {
+ if (_dst->video_meta == NULL) {
media_content_error("OUT_OF_MEMORY(0x%08x)", MEDIA_CONTENT_ERROR_OUT_OF_MEMORY);
media_info_destroy((media_info_h)_dst);
return MEDIA_CONTENT_ERROR_OUT_OF_MEMORY;
}
- if(STRING_VALID(_src->video_meta->media_id))
- {
+ if (STRING_VALID(_src->video_meta->media_id)) {
_dst->video_meta->media_id = strdup(_src->video_meta->media_id);
- if(_dst->video_meta->media_id == NULL)
- {
+ if (_dst->video_meta->media_id == NULL) {
media_content_error("OUT_OF_MEMORY(0x%08x)", MEDIA_CONTENT_ERROR_OUT_OF_MEMORY);
media_info_destroy((media_info_h)_dst);
return MEDIA_CONTENT_ERROR_OUT_OF_MEMORY;
}
}
- if(STRING_VALID(_src->video_meta->title))
- {
+ if (STRING_VALID(_src->video_meta->title)) {
_dst->video_meta->title = strdup(_src->video_meta->title);
- if(_dst->video_meta->title == NULL)
- {
+ if (_dst->video_meta->title == NULL) {
media_content_error("OUT_OF_MEMORY(0x%08x)", MEDIA_CONTENT_ERROR_OUT_OF_MEMORY);
media_info_destroy((media_info_h)_dst);
return MEDIA_CONTENT_ERROR_OUT_OF_MEMORY;
}
}
- if(STRING_VALID(_src->video_meta->album))
- {
+ if (STRING_VALID(_src->video_meta->album)) {
_dst->video_meta->album = strdup(_src->video_meta->album);
- if(_dst->video_meta->album == NULL)
- {
+ if (_dst->video_meta->album == NULL) {
media_content_error("OUT_OF_MEMORY(0x%08x)", MEDIA_CONTENT_ERROR_OUT_OF_MEMORY);
media_info_destroy((media_info_h)_dst);
return MEDIA_CONTENT_ERROR_OUT_OF_MEMORY;
}
}
- if(STRING_VALID(_src->video_meta->artist))
- {
+ if (STRING_VALID(_src->video_meta->artist)) {
_dst->video_meta->artist = strdup(_src->video_meta->artist);
- if(_dst->video_meta->artist == NULL)
- {
+ if (_dst->video_meta->artist == NULL) {
media_content_error("OUT_OF_MEMORY(0x%08x)", MEDIA_CONTENT_ERROR_OUT_OF_MEMORY);
media_info_destroy((media_info_h)_dst);
return MEDIA_CONTENT_ERROR_OUT_OF_MEMORY;
}
}
- if(STRING_VALID(_src->video_meta->album_artist))
- {
+ if (STRING_VALID(_src->video_meta->album_artist)) {
_dst->video_meta->album_artist = strdup(_src->video_meta->album_artist);
- if(_dst->video_meta->album_artist == NULL)
- {
+ if (_dst->video_meta->album_artist == NULL) {
media_content_error("OUT_OF_MEMORY(0x%08x)", MEDIA_CONTENT_ERROR_OUT_OF_MEMORY);
media_info_destroy((media_info_h)_dst);
return MEDIA_CONTENT_ERROR_OUT_OF_MEMORY;
}
}
- if(STRING_VALID(_src->video_meta->genre))
- {
+ if (STRING_VALID(_src->video_meta->genre)) {
_dst->video_meta->genre = strdup(_src->video_meta->genre);
- if(_dst->video_meta->genre == NULL)
- {
+ if (_dst->video_meta->genre == NULL) {
media_content_error("OUT_OF_MEMORY(0x%08x)", MEDIA_CONTENT_ERROR_OUT_OF_MEMORY);
media_info_destroy((media_info_h)_dst);
return MEDIA_CONTENT_ERROR_OUT_OF_MEMORY;
}
}
- if(STRING_VALID(_src->video_meta->composer))
- {
+ if (STRING_VALID(_src->video_meta->composer)) {
_dst->video_meta->composer = strdup(_src->video_meta->composer);
- if(_dst->video_meta->composer == NULL)
- {
+ if (_dst->video_meta->composer == NULL) {
media_content_error("OUT_OF_MEMORY(0x%08x)", MEDIA_CONTENT_ERROR_OUT_OF_MEMORY);
media_info_destroy((media_info_h)_dst);
return MEDIA_CONTENT_ERROR_OUT_OF_MEMORY;
}
}
- if(STRING_VALID(_src->video_meta->year))
- {
+ if (STRING_VALID(_src->video_meta->year)) {
_dst->video_meta->year = strdup(_src->video_meta->year);
- if(_dst->video_meta->year == NULL)
- {
+ if (_dst->video_meta->year == NULL) {
media_content_error("OUT_OF_MEMORY(0x%08x)", MEDIA_CONTENT_ERROR_OUT_OF_MEMORY);
media_info_destroy((media_info_h)_dst);
return MEDIA_CONTENT_ERROR_OUT_OF_MEMORY;
}
}
- if(STRING_VALID(_src->video_meta->recorded_date))
- {
+ if (STRING_VALID(_src->video_meta->recorded_date)) {
_dst->video_meta->recorded_date = strdup(_src->video_meta->recorded_date);
- if(_dst->video_meta->recorded_date == NULL)
- {
+ if (_dst->video_meta->recorded_date == NULL) {
media_content_error("OUT_OF_MEMORY(0x%08x)", MEDIA_CONTENT_ERROR_OUT_OF_MEMORY);
media_info_destroy((media_info_h)_dst);
return MEDIA_CONTENT_ERROR_OUT_OF_MEMORY;
}
}
- if(STRING_VALID(_src->video_meta->copyright))
- {
+ if (STRING_VALID(_src->video_meta->copyright)) {
_dst->video_meta->copyright = strdup(_src->video_meta->copyright);
- if(_dst->video_meta->copyright == NULL)
- {
+ if (_dst->video_meta->copyright == NULL) {
media_content_error("OUT_OF_MEMORY(0x%08x)", MEDIA_CONTENT_ERROR_OUT_OF_MEMORY);
media_info_destroy((media_info_h)_dst);
return MEDIA_CONTENT_ERROR_OUT_OF_MEMORY;
}
}
- if(STRING_VALID(_src->video_meta->track_num))
- {
+ if (STRING_VALID(_src->video_meta->track_num)) {
_dst->video_meta->track_num = strdup(_src->video_meta->track_num);
- if(_dst->video_meta->track_num == NULL)
- {
+ if (_dst->video_meta->track_num == NULL) {
media_content_error("OUT_OF_MEMORY(0x%08x)", MEDIA_CONTENT_ERROR_OUT_OF_MEMORY);
media_info_destroy((media_info_h)_dst);
return MEDIA_CONTENT_ERROR_OUT_OF_MEMORY;
} else if ((_src->media_type == MEDIA_CONTENT_TYPE_MUSIC || _src->media_type == MEDIA_CONTENT_TYPE_SOUND) && _src->audio_meta) {
_dst->audio_meta = (audio_meta_s *)calloc(1, sizeof(audio_meta_s));
- if (_dst->audio_meta == NULL)
- {
+ if (_dst->audio_meta == NULL) {
media_content_error("OUT_OF_MEMORY(0x%08x)", MEDIA_CONTENT_ERROR_OUT_OF_MEMORY);
media_info_destroy((media_info_h)_dst);
return MEDIA_CONTENT_ERROR_OUT_OF_MEMORY;
}
- if(STRING_VALID(_src->audio_meta->media_id))
- {
+ if (STRING_VALID(_src->audio_meta->media_id)) {
_dst->audio_meta->media_id = strdup(_src->audio_meta->media_id);
- if(_dst->audio_meta->media_id == NULL)
- {
+ if (_dst->audio_meta->media_id == NULL) {
media_content_error("OUT_OF_MEMORY(0x%08x)", MEDIA_CONTENT_ERROR_OUT_OF_MEMORY);
media_info_destroy((media_info_h)_dst);
return MEDIA_CONTENT_ERROR_OUT_OF_MEMORY;
}
}
- if(STRING_VALID(_src->audio_meta->title))
- {
+ if (STRING_VALID(_src->audio_meta->title)) {
_dst->audio_meta->title = strdup(_src->audio_meta->title);
- if(_dst->audio_meta->title == NULL)
- {
+ if (_dst->audio_meta->title == NULL) {
media_content_error("OUT_OF_MEMORY(0x%08x)", MEDIA_CONTENT_ERROR_OUT_OF_MEMORY);
media_info_destroy((media_info_h)_dst);
return MEDIA_CONTENT_ERROR_OUT_OF_MEMORY;
}
}
- if(STRING_VALID(_src->audio_meta->album))
- {
+ if (STRING_VALID(_src->audio_meta->album)) {
_dst->audio_meta->album = strdup(_src->audio_meta->album);
- if(_dst->audio_meta->album == NULL)
- {
+ if (_dst->audio_meta->album == NULL) {
media_content_error("OUT_OF_MEMORY(0x%08x)", MEDIA_CONTENT_ERROR_OUT_OF_MEMORY);
media_info_destroy((media_info_h)_dst);
return MEDIA_CONTENT_ERROR_OUT_OF_MEMORY;
}
}
- if(STRING_VALID(_src->audio_meta->artist))
- {
+ if (STRING_VALID(_src->audio_meta->artist)) {
_dst->audio_meta->artist = strdup(_src->audio_meta->artist);
- if(_dst->audio_meta->artist == NULL)
- {
+ if (_dst->audio_meta->artist == NULL) {
media_content_error("OUT_OF_MEMORY(0x%08x)", MEDIA_CONTENT_ERROR_OUT_OF_MEMORY);
media_info_destroy((media_info_h)_dst);
return MEDIA_CONTENT_ERROR_OUT_OF_MEMORY;
}
}
- if(STRING_VALID(_src->audio_meta->album_artist))
- {
+ if (STRING_VALID(_src->audio_meta->album_artist)) {
_dst->audio_meta->album_artist = strdup(_src->audio_meta->album_artist);
- if(_dst->audio_meta->album_artist == NULL)
- {
+ if (_dst->audio_meta->album_artist == NULL) {
media_content_error("OUT_OF_MEMORY(0x%08x)", MEDIA_CONTENT_ERROR_OUT_OF_MEMORY);
media_info_destroy((media_info_h)_dst);
return MEDIA_CONTENT_ERROR_OUT_OF_MEMORY;
}
}
- if(STRING_VALID(_src->audio_meta->genre))
- {
+ if (STRING_VALID(_src->audio_meta->genre)) {
_dst->audio_meta->genre = strdup(_src->audio_meta->genre);
- if(_dst->audio_meta->genre == NULL)
- {
+ if (_dst->audio_meta->genre == NULL) {
media_content_error("OUT_OF_MEMORY(0x%08x)", MEDIA_CONTENT_ERROR_OUT_OF_MEMORY);
media_info_destroy((media_info_h)_dst);
return MEDIA_CONTENT_ERROR_OUT_OF_MEMORY;
}
}
- if(STRING_VALID(_src->audio_meta->composer))
- {
+ if (STRING_VALID(_src->audio_meta->composer)) {
_dst->audio_meta->composer = strdup(_src->audio_meta->composer);
- if(_dst->audio_meta->composer == NULL)
- {
+ if (_dst->audio_meta->composer == NULL) {
media_content_error("OUT_OF_MEMORY(0x%08x)", MEDIA_CONTENT_ERROR_OUT_OF_MEMORY);
media_info_destroy((media_info_h)_dst);
return MEDIA_CONTENT_ERROR_OUT_OF_MEMORY;
}
}
- if(STRING_VALID(_src->audio_meta->year))
- {
+ if (STRING_VALID(_src->audio_meta->year)) {
_dst->audio_meta->year = strdup(_src->audio_meta->year);
- if(_dst->audio_meta->year == NULL)
- {
+ if (_dst->audio_meta->year == NULL) {
media_content_error("OUT_OF_MEMORY(0x%08x)", MEDIA_CONTENT_ERROR_OUT_OF_MEMORY);
media_info_destroy((media_info_h)_dst);
return MEDIA_CONTENT_ERROR_OUT_OF_MEMORY;
}
}
- if(STRING_VALID(_src->audio_meta->recorded_date))
- {
+ if (STRING_VALID(_src->audio_meta->recorded_date)) {
_dst->audio_meta->recorded_date = strdup(_src->audio_meta->recorded_date);
- if(_dst->audio_meta->recorded_date == NULL)
- {
+ if (_dst->audio_meta->recorded_date == NULL) {
media_content_error("OUT_OF_MEMORY(0x%08x)", MEDIA_CONTENT_ERROR_OUT_OF_MEMORY);
media_info_destroy((media_info_h)_dst);
return MEDIA_CONTENT_ERROR_OUT_OF_MEMORY;
}
}
- if(STRING_VALID(_src->audio_meta->copyright))
- {
+ if (STRING_VALID(_src->audio_meta->copyright)) {
_dst->audio_meta->copyright = strdup(_src->audio_meta->copyright);
- if(_dst->audio_meta->copyright == NULL)
- {
+ if (_dst->audio_meta->copyright == NULL) {
media_content_error("OUT_OF_MEMORY(0x%08x)", MEDIA_CONTENT_ERROR_OUT_OF_MEMORY);
media_info_destroy((media_info_h)_dst);
return MEDIA_CONTENT_ERROR_OUT_OF_MEMORY;
}
}
- if(STRING_VALID(_src->audio_meta->track_num))
- {
+ if (STRING_VALID(_src->audio_meta->track_num)) {
_dst->audio_meta->track_num = strdup(_src->audio_meta->track_num);
- if(_dst->audio_meta->track_num == NULL)
- {
+ if (_dst->audio_meta->track_num == NULL) {
media_content_error("OUT_OF_MEMORY(0x%08x)", MEDIA_CONTENT_ERROR_OUT_OF_MEMORY);
media_info_destroy((media_info_h)_dst);
return MEDIA_CONTENT_ERROR_OUT_OF_MEMORY;
*dst = (media_info_h)_dst;
ret = MEDIA_CONTENT_ERROR_NONE;
- }
- else
- {
+ } else {
media_content_error("INVALID_PARAMETER(0x%08x)", MEDIA_CONTENT_ERROR_INVALID_PARAMETER);
ret = MEDIA_CONTENT_ERROR_INVALID_PARAMETER;
}
{
int ret = MEDIA_CONTENT_ERROR_NONE;
- if (media_count == NULL)
- {
+ if (media_count == NULL) {
media_content_error("INVALID_PARAMETER(0x%08x)", MEDIA_CONTENT_ERROR_INVALID_PARAMETER);
ret = MEDIA_CONTENT_ERROR_INVALID_PARAMETER;
{
int ret = MEDIA_CONTENT_ERROR_NONE;
- if (STRING_VALID(media_id) && tag_count)
- {
+ if (STRING_VALID(media_id) && tag_count) {
ret = _media_db_get_group_item_count(media_id, filter, MEDIA_GROUP_TAG_BY_MEDIA_ID, tag_count);
- }
- else
- {
+ } else {
media_content_error("INVALID_PARAMETER(0x%08x)", MEDIA_CONTENT_ERROR_INVALID_PARAMETER);
return MEDIA_CONTENT_ERROR_INVALID_PARAMETER;
}
{
int ret = MEDIA_CONTENT_ERROR_NONE;
- if ((callback != NULL) && STRING_VALID(media_id))
- {
+ if ((callback != NULL) && STRING_VALID(media_id)) {
ret = _media_db_get_tag(media_id, filter, callback, user_data);
- }
- else
- {
+ } else {
media_content_error("INVALID_PARAMETER(0x%08x)", MEDIA_CONTENT_ERROR_INVALID_PARAMETER);
ret = MEDIA_CONTENT_ERROR_INVALID_PARAMETER;
}
{
int ret = MEDIA_CONTENT_ERROR_NONE;
- if (STRING_VALID(media_id) && bookmark_count)
- {
+ if (STRING_VALID(media_id) && bookmark_count) {
ret = _media_db_get_group_item_count(media_id, filter, MEDIA_GROUP_BOOKMARK_BY_MEDIA_ID, bookmark_count);
- }
- else
- {
+ } else {
media_content_error("INVALID_PARAMETER(0x%08x)", MEDIA_CONTENT_ERROR_INVALID_PARAMETER);
ret = MEDIA_CONTENT_ERROR_INVALID_PARAMETER;
}
return ret;
}
-int media_info_foreach_bookmark_from_db (const char *media_id, filter_h filter, media_bookmark_cb callback, void *user_data)
+int media_info_foreach_bookmark_from_db(const char *media_id, filter_h filter, media_bookmark_cb callback, void *user_data)
{
int ret = MEDIA_CONTENT_ERROR_NONE;
- if ((callback != NULL) && STRING_VALID(media_id))
- {
+ if ((callback != NULL) && STRING_VALID(media_id)) {
ret = _media_db_get_bookmark(media_id, filter, callback, user_data);
- }
- else
- {
+ } else {
media_content_error("INVALID_PARAMETER(0x%08x)", MEDIA_CONTENT_ERROR_INVALID_PARAMETER);
ret = MEDIA_CONTENT_ERROR_INVALID_PARAMETER;
}
{
int ret = MEDIA_CONTENT_ERROR_NONE;
- if (STRING_VALID(media_id) && face_count)
- {
+ if (STRING_VALID(media_id) && face_count) {
ret = _media_db_get_group_item_count(media_id, filter, MEDIA_GROUP_FACE_BY_MEDIA_ID, face_count);
- }
- else
- {
+ } else {
media_content_error("INVALID_PARAMETER(0x%08x)", MEDIA_CONTENT_ERROR_INVALID_PARAMETER);
ret = MEDIA_CONTENT_ERROR_INVALID_PARAMETER;
}
return ret;
}
-int media_info_foreach_face_from_db (const char *media_id, filter_h filter, media_face_cb callback, void *user_data)
+int media_info_foreach_face_from_db(const char *media_id, filter_h filter, media_face_cb callback, void *user_data)
{
int ret = MEDIA_CONTENT_ERROR_NONE;
- if ((callback != NULL) && STRING_VALID(media_id))
- {
+ if ((callback != NULL) && STRING_VALID(media_id)) {
ret = _media_db_get_face(media_id, filter, callback, user_data);
- }
- else
- {
+ } else {
media_content_error("INVALID_PARAMETER(0x%08x)", MEDIA_CONTENT_ERROR_INVALID_PARAMETER);
ret = MEDIA_CONTENT_ERROR_INVALID_PARAMETER;
}
int ret = MEDIA_CONTENT_ERROR_NONE;
media_info_s *_media = (media_info_s*)media;
- if (_media && media_id)
- {
- if (STRING_VALID(_media->media_id))
- {
+ if (_media && media_id) {
+ if (STRING_VALID(_media->media_id)) {
*media_id = strdup(_media->media_id);
media_content_retvm_if(*media_id == NULL, MEDIA_CONTENT_ERROR_OUT_OF_MEMORY, "OUT_OF_MEMORY");
- }
- else
- {
+ } else {
*media_id = NULL;
}
ret = MEDIA_CONTENT_ERROR_NONE;
- }
- else
- {
+ } else {
media_content_error("INVALID_PARAMETER(0x%08x)", MEDIA_CONTENT_ERROR_INVALID_PARAMETER);
ret = MEDIA_CONTENT_ERROR_INVALID_PARAMETER;
}
int ret = MEDIA_CONTENT_ERROR_NONE;
media_info_s *_media = (media_info_s*)media;
- if (_media && path)
- {
- if (STRING_VALID(_media->file_path))
- {
+ if (_media && path) {
+ if (STRING_VALID(_media->file_path)) {
*path = strdup(_media->file_path);
media_content_retvm_if(*path == NULL, MEDIA_CONTENT_ERROR_OUT_OF_MEMORY, "OUT_OF_MEMORY");
- }
- else
- {
+ } else {
*path = NULL;
}
ret = MEDIA_CONTENT_ERROR_NONE;
- }
- else
- {
+ } else {
media_content_error("INVALID_PARAMETER(0x%08x)", MEDIA_CONTENT_ERROR_INVALID_PARAMETER);
ret = MEDIA_CONTENT_ERROR_INVALID_PARAMETER;
}
{
int ret = MEDIA_CONTENT_ERROR_NONE;
media_info_s *_media = (media_info_s*)media;
- if (_media && name)
- {
- if (STRING_VALID(_media->display_name))
- {
+ if (_media && name) {
+ if (STRING_VALID(_media->display_name)) {
*name = strdup(_media->display_name);
media_content_retvm_if(*name == NULL, MEDIA_CONTENT_ERROR_OUT_OF_MEMORY, "OUT_OF_MEMORY");
- }
- else
- {
+ } else {
*name = NULL;
}
ret = MEDIA_CONTENT_ERROR_NONE;
- }
- else
- {
+ } else {
media_content_error("INVALID_PARAMETER(0x%08x)", MEDIA_CONTENT_ERROR_INVALID_PARAMETER);
ret = MEDIA_CONTENT_ERROR_INVALID_PARAMETER;
}
{
int ret = MEDIA_CONTENT_ERROR_NONE;
media_info_s *_media = (media_info_s*)media;
- if (_media && type)
- {
+ if (_media && type) {
*type = _media->media_type;
ret = MEDIA_CONTENT_ERROR_NONE;
- }
- else
- {
+ } else {
media_content_error("INVALID_PARAMETER(0x%08x)", MEDIA_CONTENT_ERROR_INVALID_PARAMETER);
ret = MEDIA_CONTENT_ERROR_INVALID_PARAMETER;
}
int ret = MEDIA_CONTENT_ERROR_NONE;
media_info_s *_media = (media_info_s*)media;
- if (_media && mime_type)
- {
- if (STRING_VALID(_media->mime_type))
- {
+ if (_media && mime_type) {
+ if (STRING_VALID(_media->mime_type)) {
*mime_type = strdup(_media->mime_type);
media_content_retvm_if(*mime_type == NULL, MEDIA_CONTENT_ERROR_OUT_OF_MEMORY, "OUT_OF_MEMORY");
- }
- else
- {
+ } else {
*mime_type = NULL;
}
ret = MEDIA_CONTENT_ERROR_NONE;
- }
- else
- {
+ } else {
media_content_error("INVALID_PARAMETER(0x%08x)", MEDIA_CONTENT_ERROR_INVALID_PARAMETER);
ret = MEDIA_CONTENT_ERROR_INVALID_PARAMETER;
}
int ret = MEDIA_CONTENT_ERROR_NONE;
media_info_s *_media = (media_info_s*)media;
- if (_media && size)
- {
+ if (_media && size) {
*size = _media->size;
ret = MEDIA_CONTENT_ERROR_NONE;
- }
- else
- {
+ } else {
media_content_error("INVALID_PARAMETER(0x%08x)", MEDIA_CONTENT_ERROR_INVALID_PARAMETER);
ret = MEDIA_CONTENT_ERROR_INVALID_PARAMETER;
}
{
int ret = MEDIA_CONTENT_ERROR_NONE;
media_info_s *_media = (media_info_s*)media;
- if (_media && added_time)
- {
+ if (_media && added_time) {
*added_time = _media->added_time;
ret = MEDIA_CONTENT_ERROR_NONE;
- }
- else
- {
+ } else {
media_content_error("INVALID_PARAMETER(0x%08x)", MEDIA_CONTENT_ERROR_INVALID_PARAMETER);
ret = MEDIA_CONTENT_ERROR_INVALID_PARAMETER;
}
{
int ret = MEDIA_CONTENT_ERROR_NONE;
media_info_s *_media = (media_info_s*)media;
- if (_media && time)
- {
+ if (_media && time) {
*time = _media->modified_time;
ret = MEDIA_CONTENT_ERROR_NONE;
- }
- else
- {
+ } else {
media_content_error("INVALID_PARAMETER(0x%08x)", MEDIA_CONTENT_ERROR_INVALID_PARAMETER);
ret = MEDIA_CONTENT_ERROR_INVALID_PARAMETER;
}
{
int ret = MEDIA_CONTENT_ERROR_NONE;
media_info_s *_media = (media_info_s*)media;
- if (_media && time)
- {
+ if (_media && time) {
*time = _media->timeline;
ret = MEDIA_CONTENT_ERROR_NONE;
- }
- else
- {
+ } else {
media_content_error("INVALID_PARAMETER(0x%08x)", MEDIA_CONTENT_ERROR_INVALID_PARAMETER);
ret = MEDIA_CONTENT_ERROR_INVALID_PARAMETER;
}
{
int ret = MEDIA_CONTENT_ERROR_NONE;
media_info_s *_media = (media_info_s*)media;
- if (_media && path)
- {
- if(STRING_VALID(_media->thumbnail_path))
- {
+ if (_media && path) {
+ if (STRING_VALID(_media->thumbnail_path)) {
*path = strdup(_media->thumbnail_path);
media_content_retvm_if(*path == NULL, MEDIA_CONTENT_ERROR_OUT_OF_MEMORY, "OUT_OF_MEMORY");
- }
- else
- {
+ } else {
*path = NULL;
}
ret = MEDIA_CONTENT_ERROR_NONE;
- }
- else
- {
+ } else {
media_content_error("INVALID_PARAMETER(0x%08x)", MEDIA_CONTENT_ERROR_INVALID_PARAMETER);
ret = MEDIA_CONTENT_ERROR_INVALID_PARAMETER;
}
int ret = MEDIA_CONTENT_ERROR_NONE;
media_info_s *_media = (media_info_s*)media;
- if (_media && title) /*title can be empty string*/
- {
- if(STRING_VALID(_media->title))
- {
+ if (_media && title) { /*title can be empty string*/
+ if (STRING_VALID(_media->title)) {
*title = strdup(_media->title);
media_content_retvm_if(*title == NULL, MEDIA_CONTENT_ERROR_OUT_OF_MEMORY, "OUT_OF_MEMORY");
- }
- else
- {
+ } else {
*title = NULL;
}
ret = MEDIA_CONTENT_ERROR_NONE;
- }
- else
- {
+ } else {
media_content_error("INVALID_PARAMETER(0x%08x)", MEDIA_CONTENT_ERROR_INVALID_PARAMETER);
ret = MEDIA_CONTENT_ERROR_INVALID_PARAMETER;
}
int ret = MEDIA_CONTENT_ERROR_NONE;
media_info_s *_media = (media_info_s*)media;
- if (_media && description)
- {
- if(STRING_VALID(_media->description))
- {
+ if (_media && description) {
+ if (STRING_VALID(_media->description)) {
*description = strdup(_media->description);
media_content_retvm_if(*description == NULL, MEDIA_CONTENT_ERROR_OUT_OF_MEMORY, "OUT_OF_MEMORY");
- }
- else
- {
+ } else {
*description = NULL;
}
ret = MEDIA_CONTENT_ERROR_NONE;
- }
- else
- {
+ } else {
media_content_error("INVALID_PARAMETER(0x%08x)", MEDIA_CONTENT_ERROR_INVALID_PARAMETER);
ret = MEDIA_CONTENT_ERROR_INVALID_PARAMETER;
}
int ret = MEDIA_CONTENT_ERROR_NONE;
media_info_s *_media = (media_info_s*)media;
- if (_media && longitude)
- {
+ if (_media && longitude) {
*longitude = _media->longitude;
ret = MEDIA_CONTENT_ERROR_NONE;
- }
- else
- {
+ } else {
media_content_error("INVALID_PARAMETER(0x%08x)", MEDIA_CONTENT_ERROR_INVALID_PARAMETER);
ret = MEDIA_CONTENT_ERROR_INVALID_PARAMETER;
}
int ret = MEDIA_CONTENT_ERROR_NONE;
media_info_s *_media = (media_info_s*)media;
- if (_media && latitude)
- {
+ if (_media && latitude) {
*latitude = _media->latitude;
ret = MEDIA_CONTENT_ERROR_NONE;
- }
- else
- {
+ } else {
media_content_error("INVALID_PARAMETER(0x%08x)", MEDIA_CONTENT_ERROR_INVALID_PARAMETER);
ret = MEDIA_CONTENT_ERROR_INVALID_PARAMETER;
}
int ret = MEDIA_CONTENT_ERROR_NONE;
media_info_s *_media = (media_info_s*)media;
- if (_media && altitude)
- {
+ if (_media && altitude) {
*altitude = _media->altitude;
ret = MEDIA_CONTENT_ERROR_NONE;
- }
- else
- {
+ } else {
media_content_error("INVALID_PARAMETER(0x%08x)", MEDIA_CONTENT_ERROR_INVALID_PARAMETER);
ret = MEDIA_CONTENT_ERROR_INVALID_PARAMETER;
}
int ret = MEDIA_CONTENT_ERROR_NONE;
media_info_s *_media = (media_info_s*)media;
- if (_media && weather)
- {
- if(STRING_VALID(_media->weather))
- {
+ if (_media && weather) {
+ if (STRING_VALID(_media->weather)) {
*weather = strdup(_media->weather);
media_content_retvm_if(*weather == NULL, MEDIA_CONTENT_ERROR_OUT_OF_MEMORY, "OUT_OF_MEMORY");
- }
- else
- {
+ } else {
*weather = NULL;
}
ret = MEDIA_CONTENT_ERROR_NONE;
- }
- else
- {
+ } else {
media_content_error("INVALID_PARAMETER(0x%08x)", MEDIA_CONTENT_ERROR_INVALID_PARAMETER);
ret = MEDIA_CONTENT_ERROR_INVALID_PARAMETER;
}
int ret = MEDIA_CONTENT_ERROR_NONE;
media_info_s *_media = (media_info_s*)media;
- if (_media && rating)
- {
+ if (_media && rating) {
*rating = _media->rating;
ret = MEDIA_CONTENT_ERROR_NONE;
- }
- else
- {
+ } else {
media_content_error("INVALID_PARAMETER(0x%08x)", MEDIA_CONTENT_ERROR_INVALID_PARAMETER);
ret = MEDIA_CONTENT_ERROR_INVALID_PARAMETER;
}
int ret = MEDIA_CONTENT_ERROR_NONE;
media_info_s *_media = (media_info_s*)media;
- if (_media && favorite)
- {
-
+ if (_media && favorite) {
*favorite = _media->favourite;
ret = MEDIA_CONTENT_ERROR_NONE;
- }
- else
- {
+ } else {
media_content_error("INVALID_PARAMETER(0x%08x)", MEDIA_CONTENT_ERROR_INVALID_PARAMETER);
ret = MEDIA_CONTENT_ERROR_INVALID_PARAMETER;
}
int ret = MEDIA_CONTENT_ERROR_NONE;
media_info_s *_media = (media_info_s*)media;
- if (_media && author)
- {
- if(STRING_VALID(_media->author))
- {
+ if (_media && author) {
+ if (STRING_VALID(_media->author)) {
*author = strdup(_media->author);
media_content_retvm_if(*author == NULL, MEDIA_CONTENT_ERROR_OUT_OF_MEMORY, "OUT_OF_MEMORY");
- }
- else
- {
+ } else {
*author = NULL;
}
ret = MEDIA_CONTENT_ERROR_NONE;
- }
- else
- {
+ } else {
media_content_error("INVALID_PARAMETER(0x%08x)", MEDIA_CONTENT_ERROR_INVALID_PARAMETER);
ret = MEDIA_CONTENT_ERROR_INVALID_PARAMETER;
}
int ret = MEDIA_CONTENT_ERROR_NONE;
media_info_s *_media = (media_info_s*)media;
- if (_media && provider)
- {
- if(STRING_VALID(_media->provider))
- {
+ if (_media && provider) {
+ if (STRING_VALID(_media->provider)) {
*provider = strdup(_media->provider);
media_content_retvm_if(*provider == NULL, MEDIA_CONTENT_ERROR_OUT_OF_MEMORY, "OUT_OF_MEMORY");
- }
- else
- {
+ } else {
*provider = NULL;
}
ret = MEDIA_CONTENT_ERROR_NONE;
- }
- else
- {
+ } else {
media_content_error("INVALID_PARAMETER(0x%08x)", MEDIA_CONTENT_ERROR_INVALID_PARAMETER);
ret = MEDIA_CONTENT_ERROR_INVALID_PARAMETER;
}
int ret = MEDIA_CONTENT_ERROR_NONE;
media_info_s *_media = (media_info_s*)media;
- if (_media && content_name)
- {
- if(STRING_VALID(_media->content_name))
- {
+ if (_media && content_name) {
+ if (STRING_VALID(_media->content_name)) {
*content_name = strdup(_media->content_name);
media_content_retvm_if(*content_name == NULL, MEDIA_CONTENT_ERROR_OUT_OF_MEMORY, "OUT_OF_MEMORY");
- }
- else
- {
+ } else {
*content_name = NULL;
}
ret = MEDIA_CONTENT_ERROR_NONE;
- }
- else
- {
+ } else {
media_content_error("INVALID_PARAMETER(0x%08x)", MEDIA_CONTENT_ERROR_INVALID_PARAMETER);
ret = MEDIA_CONTENT_ERROR_INVALID_PARAMETER;
}
int ret = MEDIA_CONTENT_ERROR_NONE;
media_info_s *_media = (media_info_s*)media;
- if (_media && category)
- {
- if(STRING_VALID(_media->category))
- {
+ if (_media && category) {
+ if (STRING_VALID(_media->category)) {
*category = strdup(_media->category);
media_content_retvm_if(*category == NULL, MEDIA_CONTENT_ERROR_OUT_OF_MEMORY, "OUT_OF_MEMORY");
- }
- else
- {
+ } else {
*category = NULL;
}
ret = MEDIA_CONTENT_ERROR_NONE;
- }
- else
- {
+ } else {
media_content_error("INVALID_PARAMETER(0x%08x)", MEDIA_CONTENT_ERROR_INVALID_PARAMETER);
ret = MEDIA_CONTENT_ERROR_INVALID_PARAMETER;
}
int ret = MEDIA_CONTENT_ERROR_NONE;
media_info_s *_media = (media_info_s*)media;
- if (_media && location_tag)
- {
- if(STRING_VALID(_media->location_tag))
- {
+ if (_media && location_tag) {
+ if (STRING_VALID(_media->location_tag)) {
*location_tag = strdup(_media->location_tag);
media_content_retvm_if(*location_tag == NULL, MEDIA_CONTENT_ERROR_OUT_OF_MEMORY, "OUT_OF_MEMORY");
- }
- else
- {
+ } else {
*location_tag = NULL;
}
ret = MEDIA_CONTENT_ERROR_NONE;
- }
- else
- {
+ } else {
media_content_error("INVALID_PARAMETER(0x%08x)", MEDIA_CONTENT_ERROR_INVALID_PARAMETER);
ret = MEDIA_CONTENT_ERROR_INVALID_PARAMETER;
}
int ret = MEDIA_CONTENT_ERROR_NONE;
media_info_s *_media = (media_info_s*)media;
- if (_media && age_rating)
- {
- if(STRING_VALID(_media->age_rating))
- {
+ if (_media && age_rating) {
+ if (STRING_VALID(_media->age_rating)) {
*age_rating = strdup(_media->age_rating);
media_content_retvm_if(*age_rating == NULL, MEDIA_CONTENT_ERROR_OUT_OF_MEMORY, "OUT_OF_MEMORY");
- }
- else
- {
+ } else {
*age_rating = NULL;
}
ret = MEDIA_CONTENT_ERROR_NONE;
- }
- else
- {
+ } else {
media_content_error("INVALID_PARAMETER(0x%08x)", MEDIA_CONTENT_ERROR_INVALID_PARAMETER);
ret = MEDIA_CONTENT_ERROR_INVALID_PARAMETER;
}
int ret = MEDIA_CONTENT_ERROR_NONE;
media_info_s *_media = (media_info_s*)media;
- if (_media && keyword)
- {
- if(STRING_VALID(_media->keyword))
- {
+ if (_media && keyword) {
+ if (STRING_VALID(_media->keyword)) {
*keyword = strdup(_media->keyword);
media_content_retvm_if(*keyword == NULL, MEDIA_CONTENT_ERROR_OUT_OF_MEMORY, "OUT_OF_MEMORY");
- }
- else
- {
+ } else {
*keyword = NULL;
}
ret = MEDIA_CONTENT_ERROR_NONE;
- }
- else
- {
+ } else {
media_content_error("INVALID_PARAMETER(0x%08x)", MEDIA_CONTENT_ERROR_INVALID_PARAMETER);
ret = MEDIA_CONTENT_ERROR_INVALID_PARAMETER;
}
int ret = MEDIA_CONTENT_ERROR_NONE;
media_info_s *_media = (media_info_s*)media;
- if (_media && storage_id)
- {
- if (STRING_VALID(_media->storage_uuid))
- {
+ if (_media && storage_id) {
+ if (STRING_VALID(_media->storage_uuid)) {
*storage_id = strdup(_media->storage_uuid);
media_content_retvm_if(*storage_id == NULL, MEDIA_CONTENT_ERROR_OUT_OF_MEMORY, "OUT_OF_MEMORY");
- }
- else
- {
+ } else {
*storage_id = NULL;
}
ret = MEDIA_CONTENT_ERROR_NONE;
- }
- else
- {
+ } else {
media_content_error("INVALID_PARAMETER(0x%08x)", MEDIA_CONTENT_ERROR_INVALID_PARAMETER);
ret = MEDIA_CONTENT_ERROR_INVALID_PARAMETER;
}
int ret = MEDIA_CONTENT_ERROR_NONE;
media_info_s *_media = (media_info_s*)media;
- if (_media)
- {
+ if (_media) {
*is_drm = _media->is_drm;
ret = MEDIA_CONTENT_ERROR_NONE;
- }
- else
- {
+ } else {
media_content_error("INVALID_PARAMETER(0x%08x)", MEDIA_CONTENT_ERROR_INVALID_PARAMETER);
ret = MEDIA_CONTENT_ERROR_INVALID_PARAMETER;
}
int ret = MEDIA_CONTENT_ERROR_NONE;
media_info_s *_media = (media_info_s*)media;
- if (_media && storage_type)
- {
+ if (_media && storage_type) {
*storage_type = _media->storage_type;
ret = MEDIA_CONTENT_ERROR_NONE;
- }
- else
- {
+ } else {
media_content_error("INVALID_PARAMETER(0x%08x)", MEDIA_CONTENT_ERROR_INVALID_PARAMETER);
ret = MEDIA_CONTENT_ERROR_INVALID_PARAMETER;
}
int ret = MEDIA_CONTENT_ERROR_NONE;
media_info_s *_media = (media_info_s*)media;
- if (_media)
- {
+ if (_media) {
*played_count = _media->played_count;
ret = MEDIA_CONTENT_ERROR_NONE;
- }
- else
- {
+ } else {
media_content_error("INVALID_PARAMETER(0x%08x)", MEDIA_CONTENT_ERROR_INVALID_PARAMETER);
ret = MEDIA_CONTENT_ERROR_INVALID_PARAMETER;
}
int ret = MEDIA_CONTENT_ERROR_NONE;
media_info_s *_media = (media_info_s*)media;
- if (_media)
- {
+ if (_media) {
*played_time = _media->played_time;
ret = MEDIA_CONTENT_ERROR_NONE;
- }
- else
- {
+ } else {
media_content_error("INVALID_PARAMETER(0x%08x)", MEDIA_CONTENT_ERROR_INVALID_PARAMETER);
ret = MEDIA_CONTENT_ERROR_INVALID_PARAMETER;
}
media_info_s *_media = (media_info_s*)media;
- if (_media)
- {
+ if (_media) {
_media->played_count += 1;
- }
- else
- {
+ } else {
media_content_error("INVALID_PARAMETER(0x%08x)", MEDIA_CONTENT_ERROR_INVALID_PARAMETER);
ret = MEDIA_CONTENT_ERROR_INVALID_PARAMETER;
}
media_info_s *_media = (media_info_s*)media;
- if (_media != NULL)
- {
+ if (_media != NULL) {
time(¤t_time);
_media->played_time = current_time;
- }
- else
- {
+ } else {
media_content_error("INVALID_PARAMETER(0x%08x)", MEDIA_CONTENT_ERROR_INVALID_PARAMETER);
ret = MEDIA_CONTENT_ERROR_INVALID_PARAMETER;
}
char storage_id[MEDIA_CONTENT_UUID_SIZE+1] = {0, };
sqlite3_stmt *stmt = NULL;
- if (!STRING_VALID(media_id) || (media == NULL))
- {
+ if (!STRING_VALID(media_id) || (media == NULL)) {
media_content_error("INVALID_PARAMETER(0x%08x)", MEDIA_CONTENT_ERROR_INVALID_PARAMETER);
return MEDIA_CONTENT_ERROR_INVALID_PARAMETER;
}
media_info_s *_media = NULL;
- while(sqlite3_step(stmt) == SQLITE_ROW)
- {
+ while (sqlite3_step(stmt) == SQLITE_ROW) {
if (_media)
media_info_destroy((media_info_h)_media);
_media = (media_info_s*)calloc(1, sizeof(media_info_s));
- if (_media == NULL)
- {
+ if (_media == NULL) {
media_content_error("OUT_OF_MEMORY(0x%08x)", MEDIA_CONTENT_ERROR_OUT_OF_MEMORY);
SQLITE3_FINALIZE(stmt);
return MEDIA_CONTENT_ERROR_OUT_OF_MEMORY;
int ret = MEDIA_CONTENT_ERROR_NONE;
media_info_s *_media = (media_info_s*)media;
- if (_media != NULL && STRING_VALID(display_name))
- {
+ if (_media != NULL && STRING_VALID(display_name)) {
SAFE_FREE(_media->display_name);
_media->display_name = strdup(display_name);
media_content_retvm_if(_media->display_name == NULL, MEDIA_CONTENT_ERROR_OUT_OF_MEMORY, "OUT_OF_MEMORY");
- }
- else
- {
+ } else {
media_content_error("INVALID_PARAMETER(0x%08x)", MEDIA_CONTENT_ERROR_INVALID_PARAMETER);
ret = MEDIA_CONTENT_ERROR_INVALID_PARAMETER;
}
int ret = MEDIA_CONTENT_ERROR_NONE;
media_info_s *_media = (media_info_s*)media;
- if (_media != NULL)
- {
+ if (_media != NULL) {
SAFE_FREE(_media->description);
- if (STRING_VALID(description))
- {
+ if (STRING_VALID(description)) {
_media->description = strdup(description);
media_content_retvm_if(_media->description == NULL, MEDIA_CONTENT_ERROR_OUT_OF_MEMORY, "OUT_OF_MEMORY");
- }
- else
- {
+ } else {
_media->description = NULL;
}
- }
- else
- {
+ } else {
media_content_error("INVALID_PARAMETER(0x%08x)", MEDIA_CONTENT_ERROR_INVALID_PARAMETER);
ret = MEDIA_CONTENT_ERROR_INVALID_PARAMETER;
}
int ret = MEDIA_CONTENT_ERROR_NONE;
media_info_s *_media = (media_info_s*)media;
- if (_media != NULL)
- {
+ if (_media != NULL) {
_media->longitude = longitude;
- }
- else
- {
+ } else {
media_content_error("INVALID_PARAMETER(0x%08x)", MEDIA_CONTENT_ERROR_INVALID_PARAMETER);
ret = MEDIA_CONTENT_ERROR_INVALID_PARAMETER;
}
int ret = MEDIA_CONTENT_ERROR_NONE;
media_info_s *_media = (media_info_s*)media;
- if (_media != NULL)
- {
+ if (_media != NULL) {
_media->latitude = latitude;
- }
- else
- {
+ } else {
media_content_error("INVALID_PARAMETER(0x%08x)", MEDIA_CONTENT_ERROR_INVALID_PARAMETER);
ret = MEDIA_CONTENT_ERROR_INVALID_PARAMETER;
}
int ret = MEDIA_CONTENT_ERROR_NONE;
media_info_s *_media = (media_info_s*)media;
- if (_media != NULL)
- {
+ if (_media != NULL) {
_media->altitude = altitude;
- }
- else
- {
+ } else {
media_content_error("INVALID_PARAMETER(0x%08x)", MEDIA_CONTENT_ERROR_INVALID_PARAMETER);
ret = MEDIA_CONTENT_ERROR_INVALID_PARAMETER;
}
int ret = MEDIA_CONTENT_ERROR_NONE;
media_info_s *_media = (media_info_s*)media;
- if (_media != NULL)
- {
+ if (_media != NULL) {
SAFE_FREE(_media->weather);
- if (STRING_VALID(weather))
- {
+ if (STRING_VALID(weather)) {
_media->weather = strdup(weather);
media_content_retvm_if(_media->weather == NULL, MEDIA_CONTENT_ERROR_OUT_OF_MEMORY, "OUT_OF_MEMORY");
- }
- else
- {
+ } else {
_media->weather = NULL;
}
- }
- else
- {
+ } else {
media_content_error("INVALID_PARAMETER(0x%08x)", MEDIA_CONTENT_ERROR_INVALID_PARAMETER);
ret = MEDIA_CONTENT_ERROR_INVALID_PARAMETER;
}
int ret = MEDIA_CONTENT_ERROR_NONE;
media_info_s *_media = (media_info_s*)media;
- if (_media != NULL)
- {
+ if (_media != NULL) {
_media->rating = rating;
- }
- else
- {
+ } else {
media_content_error("INVALID_PARAMETER(0x%08x)", MEDIA_CONTENT_ERROR_INVALID_PARAMETER);
ret = MEDIA_CONTENT_ERROR_INVALID_PARAMETER;
}
media_info_s *_media = (media_info_s*)media;
- if ((_media != NULL) && (added_time >= 0))
- {
+ if ((_media != NULL) && (added_time >= 0)) {
_media->added_time = added_time;
- }
- else
- {
+ } else {
media_content_error("INVALID_PARAMETER(0x%08x)", MEDIA_CONTENT_ERROR_INVALID_PARAMETER);
ret = MEDIA_CONTENT_ERROR_INVALID_PARAMETER;
}
int ret = MEDIA_CONTENT_ERROR_NONE;
media_info_s *_media = (media_info_s*)media;
- if (_media != NULL)
- {
+ if (_media != NULL) {
if (favorite == TRUE)
- {
time(&_media->favourite);
- }
else
- {
_media->favourite = 0;
- }
- }
- else
- {
+ } else {
media_content_error("INVALID_PARAMETER(0x%08x)", MEDIA_CONTENT_ERROR_INVALID_PARAMETER);
ret = MEDIA_CONTENT_ERROR_INVALID_PARAMETER;
}
int ret = MEDIA_CONTENT_ERROR_NONE;
media_info_s *_media = (media_info_s*)media;
- if (_media != NULL)
- {
- if (STRING_VALID(author))
- {
+ if (_media != NULL) {
+ if (STRING_VALID(author)) {
_media->author = strdup(author);
media_content_retvm_if(_media->author == NULL, MEDIA_CONTENT_ERROR_OUT_OF_MEMORY, "OUT_OF_MEMORY");
- }
- else
- {
+ } else {
_media->author = NULL;
}
- }
- else
- {
+ } else {
media_content_error("INVALID_PARAMETER(0x%08x)", MEDIA_CONTENT_ERROR_INVALID_PARAMETER);
ret = MEDIA_CONTENT_ERROR_INVALID_PARAMETER;
}
int ret = MEDIA_CONTENT_ERROR_NONE;
media_info_s *_media = (media_info_s*)media;
- if (_media != NULL)
- {
+ if (_media != NULL) {
SAFE_FREE(_media->provider);
- if (STRING_VALID(provider))
- {
+ if (STRING_VALID(provider)) {
_media->provider = strdup(provider);
media_content_retvm_if(_media->provider == NULL, MEDIA_CONTENT_ERROR_OUT_OF_MEMORY, "OUT_OF_MEMORY");
- }
- else
- {
+ } else {
_media->provider = NULL;
}
- }
- else
- {
+ } else {
media_content_error("INVALID_PARAMETER(0x%08x)", MEDIA_CONTENT_ERROR_INVALID_PARAMETER);
ret = MEDIA_CONTENT_ERROR_INVALID_PARAMETER;
}
int ret = MEDIA_CONTENT_ERROR_NONE;
media_info_s *_media = (media_info_s*)media;
- if (_media != NULL)
- {
+ if (_media != NULL) {
SAFE_FREE(_media->content_name);
- if (STRING_VALID(content_name))
- {
+ if (STRING_VALID(content_name)) {
_media->content_name = strdup(content_name);
media_content_retvm_if(_media->content_name == NULL, MEDIA_CONTENT_ERROR_OUT_OF_MEMORY, "OUT_OF_MEMORY");
- }
- else
- {
+ } else {
_media->content_name = NULL;
}
- }
- else
- {
+ } else {
media_content_error("INVALID_PARAMETER(0x%08x)", MEDIA_CONTENT_ERROR_INVALID_PARAMETER);
ret = MEDIA_CONTENT_ERROR_INVALID_PARAMETER;
}
int ret = MEDIA_CONTENT_ERROR_NONE;
media_info_s *_media = (media_info_s*)media;
- if (_media != NULL)
- {
+ if (_media != NULL) {
SAFE_FREE(_media->category);
- if (STRING_VALID(category))
- {
+ if (STRING_VALID(category)) {
_media->category = strdup(category);
media_content_retvm_if(_media->category == NULL, MEDIA_CONTENT_ERROR_OUT_OF_MEMORY, "OUT_OF_MEMORY");
- }
- else
- {
+ } else {
_media->category = NULL;
}
- }
- else
- {
+ } else {
media_content_error("INVALID_PARAMETER(0x%08x)", MEDIA_CONTENT_ERROR_INVALID_PARAMETER);
ret = MEDIA_CONTENT_ERROR_INVALID_PARAMETER;
}
int ret = MEDIA_CONTENT_ERROR_NONE;
media_info_s *_media = (media_info_s*)media;
- if (_media != NULL)
- {
+ if (_media != NULL) {
SAFE_FREE(_media->location_tag);
- if (STRING_VALID(location_tag))
- {
+ if (STRING_VALID(location_tag)) {
_media->location_tag = strdup(location_tag);
media_content_retvm_if(_media->location_tag == NULL, MEDIA_CONTENT_ERROR_OUT_OF_MEMORY, "OUT_OF_MEMORY");
- }
- else
- {
+ } else {
_media->location_tag = NULL;
}
- }
- else
- {
+ } else {
media_content_error("INVALID_PARAMETER(0x%08x)", MEDIA_CONTENT_ERROR_INVALID_PARAMETER);
ret = MEDIA_CONTENT_ERROR_INVALID_PARAMETER;
}
int ret = MEDIA_CONTENT_ERROR_NONE;
media_info_s *_media = (media_info_s*)media;
- if (_media != NULL)
- {
+ if (_media != NULL) {
SAFE_FREE(_media->age_rating);
- if (STRING_VALID(age_rating))
- {
+ if (STRING_VALID(age_rating)) {
_media->age_rating = strdup(age_rating);
media_content_retvm_if(_media->age_rating == NULL, MEDIA_CONTENT_ERROR_OUT_OF_MEMORY, "OUT_OF_MEMORY");
- }
- else
- {
+ } else {
_media->age_rating = NULL;
}
- }
- else
- {
+ } else {
media_content_error("INVALID_PARAMETER(0x%08x)", MEDIA_CONTENT_ERROR_INVALID_PARAMETER);
ret = MEDIA_CONTENT_ERROR_INVALID_PARAMETER;
}
int ret = MEDIA_CONTENT_ERROR_NONE;
media_info_s *_media = (media_info_s*)media;
- if (_media != NULL)
- {
+ if (_media != NULL) {
SAFE_FREE(_media->keyword);
- if (STRING_VALID(keyword))
- {
+ if (STRING_VALID(keyword)) {
_media->keyword = strdup(keyword);
media_content_retvm_if(_media->keyword == NULL, MEDIA_CONTENT_ERROR_OUT_OF_MEMORY, "OUT_OF_MEMORY");
- }
- else
- {
+ } else {
_media->keyword = NULL;
}
- }
- else
- {
+ } else {
media_content_error("INVALID_PARAMETER(0x%08x)", MEDIA_CONTENT_ERROR_INVALID_PARAMETER);
ret = MEDIA_CONTENT_ERROR_INVALID_PARAMETER;
}
char *set_sql = NULL;
char *sql = NULL;
- if (_media != NULL && STRING_VALID(_media->media_id))
- {
+ if (_media != NULL && STRING_VALID(_media->media_id)) {
/* This sql is due to sqlite3_mprintf's wrong operation when using floating point in the text format */
/* This code will be removed when sqlite3_mprintf works clearly */
char *test_sql = sqlite3_mprintf("%f, %f, %f", _media->longitude, _media->latitude, _media->altitude);
/*Update Pinyin If Support Pinyin*/
media_svc_check_pinyin_support(&pinyin_support);
- if (pinyin_support)
- {
+ if (pinyin_support) {
if (STRING_VALID(_media->display_name))
media_svc_get_pinyin(_content_get_db_handle(), _media->display_name, &file_name_pinyin);
if (STRING_VALID(_media->description))
SAFE_FREE(age_rating_pinyin);
SAFE_FREE(keyword_pinyin);
- if (_media->storage_type == MEDIA_CONTENT_STORAGE_CLOUD)
- {
+ if (_media->storage_type == MEDIA_CONTENT_STORAGE_CLOUD) {
set_sql = NULL;
sql = NULL;
- if (_media->media_type == MEDIA_CONTENT_TYPE_VIDEO)
- {
+ if (_media->media_type == MEDIA_CONTENT_TYPE_VIDEO) {
set_sql = sqlite3_mprintf("title=%Q, album=%Q, artist=%Q, genre=%Q, duration=%d, width=%d, height=%d", \
_media->title, _media->video_meta->album, _media->video_meta->artist, _media->video_meta->genre, _media->video_meta->duration, _media->video_meta->width, _media->video_meta->height);
- }
- else if ((_media->media_type == MEDIA_CONTENT_TYPE_MUSIC) || (_media->media_type == MEDIA_CONTENT_TYPE_SOUND))
- {
+ } else if ((_media->media_type == MEDIA_CONTENT_TYPE_MUSIC) || (_media->media_type == MEDIA_CONTENT_TYPE_SOUND)) {
set_sql = sqlite3_mprintf("title=%Q, album=%Q, artist=%Q, genre=%Q, duration=%d", \
_media->title, _media->audio_meta->album, _media->audio_meta->artist, _media->audio_meta->genre, _media->audio_meta->duration);
- }
- else if (_media->media_type == MEDIA_CONTENT_TYPE_IMAGE)
- {
+ } else if (_media->media_type == MEDIA_CONTENT_TYPE_IMAGE) {
set_sql = sqlite3_mprintf("title=%Q, width=%d, height=%d", _media->title, _media->image_meta->width, _media->image_meta->height);
- }
- else
- {
+ } else {
set_sql = sqlite3_mprintf("title=%Q", _media->title);
}
if (ret == MEDIA_CONTENT_ERROR_NONE) {
/* Send notification for this update */
media_content_debug("Update is successfull. Send notification for this");
- if (_media->file_path && _media->mime_type) {
+ if (_media->file_path && _media->mime_type)
media_svc_publish_noti(_content_get_db_handle(), MS_MEDIA_ITEM_FILE, MS_MEDIA_ITEM_UPDATE, _media->file_path, _media->media_type, _media->media_id, _media->mime_type);
- } else {
+ else
media_content_error("Can't Send Noti : path or mime type is NULL");
- }
}
- }
- else
- {
+ } else {
media_content_error("INVALID_PARAMETER(0x%08x)", MEDIA_CONTENT_ERROR_INVALID_PARAMETER);
ret = MEDIA_CONTENT_ERROR_INVALID_PARAMETER;
}
media_content_storage_e storage_type = 0;
char storage_id[MEDIA_CONTENT_UUID_SIZE+1] = {0, };
- if (!STRING_VALID(media_id))
- {
+ if (!STRING_VALID(media_id)) {
media_content_error("INVALID_PARAMETER(0x%08x)", MEDIA_CONTENT_ERROR_INVALID_PARAMETER);
return MEDIA_CONTENT_ERROR_INVALID_PARAMETER;
}
ret = media_info_get_media_from_db(media_id, &media);
- if (ret != MEDIA_CONTENT_ERROR_NONE)
- {
+ if (ret != MEDIA_CONTENT_ERROR_NONE) {
media_info_destroy(media);
return ret;
}
ret = media_info_get_storage_type(media, &storage_type);
- if (ret != MEDIA_CONTENT_ERROR_NONE)
- {
+ if (ret != MEDIA_CONTENT_ERROR_NONE) {
media_info_destroy(media);
return ret;
}
- if (storage_type == MEDIA_CONTENT_STORAGE_CLOUD)
- {
+ if (storage_type == MEDIA_CONTENT_STORAGE_CLOUD) {
media_info_destroy(media);
media_content_error("Can't refresh cloud content!!");
return MEDIA_CONTENT_ERROR_INVALID_PARAMETER;
}
ret = media_info_get_file_path(media, &file_path);
- if (ret != MEDIA_CONTENT_ERROR_NONE)
- {
+ if (ret != MEDIA_CONTENT_ERROR_NONE) {
media_info_destroy(media);
return ret;
}
memset(storage_id, 0x00, sizeof(storage_id));
ret = media_svc_get_storage_id(_content_get_db_handle(), file_path, storage_id);
- if (ret != MS_MEDIA_ERR_NONE)
- {
+ if (ret != MS_MEDIA_ERR_NONE) {
media_content_error("media_svc_get_storage_id failed : %d", ret);
SAFE_FREE(file_path);
media_info_destroy(media);
ret = media_svc_refresh_item(_content_get_db_handle(), storage_id, storage_type, file_path, tzplatform_getuid(TZ_USER_NAME));
if (ret != MS_MEDIA_ERR_NONE)
- {
ret = _content_error_capi(MEDIA_CONTENT_TYPE, ret);
- }
SAFE_FREE(file_path);
media_info_destroy(media);
media_content_retvm_if(ignore_dir == TRUE, MEDIA_CONTENT_ERROR_INVALID_PARAMETER, "Invalid folder path");
ret = media_svc_get_storage_type(_media->file_path, &src_storage_type, tzplatform_getuid(TZ_USER_NAME));
- if (ret != MS_MEDIA_ERR_NONE)
- {
+ if (ret != MS_MEDIA_ERR_NONE) {
media_content_sec_error("media_svc_get_storage_type failed : %d", ret);
return _content_error_capi(MEDIA_CONTENT_TYPE, ret);
}
ret = media_svc_get_storage_type(dst_path, &dst_storage_type, tzplatform_getuid(TZ_USER_NAME));
- if (ret != MS_MEDIA_ERR_NONE)
- {
+ if (ret != MS_MEDIA_ERR_NONE) {
media_content_sec_error("media_svc_get_storage_type failed : %d", ret);
return _content_error_capi(MEDIA_CONTENT_TYPE, ret);
}
memset(storage_id, 0x00, sizeof(storage_id));
ret = media_svc_get_storage_id(_content_get_db_handle(), _media->file_path, storage_id);
- if (ret != MS_MEDIA_ERR_NONE)
- {
+ if (ret != MS_MEDIA_ERR_NONE) {
media_content_error("media_svc_get_storage_id failed : %d", ret);
return _content_error_capi(MEDIA_CONTENT_TYPE, ret);
}
int ret = MEDIA_CONTENT_ERROR_NONE;
media_info_s *_media = (media_info_s*)media;
- if (_media != NULL && STRING_VALID(_media->media_id) && STRING_VALID(_media->file_path))
- {
+ if (_media != NULL && STRING_VALID(_media->media_id) && STRING_VALID(_media->file_path)) {
media_thumbnail_cb_s *_thumb_cb = (media_thumbnail_cb_s*)calloc(1, sizeof(media_thumbnail_cb_s));
media_content_retvm_if(_thumb_cb == NULL, MEDIA_CONTENT_ERROR_OUT_OF_MEMORY, "OUT_OF_MEMORY");
ret = thumbnail_request_from_db_async(_media->file_path, (ThumbFunc)__media_info_thumbnail_completed_cb, (void *)_thumb_cb, tzplatform_getuid(TZ_USER_NAME));
ret = _content_error_capi(MEDIA_THUMBNAIL_TYPE, ret);
- }
- else
- {
+ } else {
media_content_error("INVALID_PARAMETER(0x%08x)", MEDIA_CONTENT_ERROR_INVALID_PARAMETER);
ret = MEDIA_CONTENT_ERROR_INVALID_PARAMETER;
}
int ret = MEDIA_CONTENT_ERROR_NONE;
media_info_s *_media = (media_info_s*)media;
- if (_media != NULL && STRING_VALID(_media->media_id) && STRING_VALID(_media->file_path))
- {
+ if (_media != NULL && STRING_VALID(_media->media_id) && STRING_VALID(_media->file_path)) {
ret = thumbnail_request_cancel_media(_media->file_path);
ret = _content_error_capi(MEDIA_THUMBNAIL_TYPE, ret);
- }
- else
- {
+ } else {
media_content_error("INVALID_PARAMETER(0x%08x)", MEDIA_CONTENT_ERROR_INVALID_PARAMETER);
ret = MEDIA_CONTENT_ERROR_INVALID_PARAMETER;
}
svc_content_info->modified_time = media->modified_time;
svc_content_info->thumbnail_path = g_strdup(media->thumbnail_path);
svc_content_info->is_drm = media->is_drm;
- svc_content_info->last_played_time= media->played_time;
- svc_content_info->played_count= media->played_count;
- svc_content_info->favourate= media->favourite;
+ svc_content_info->last_played_time = media->played_time;
+ svc_content_info->played_count = media->played_count;
+ svc_content_info->favourate = media->favourite;
svc_content_info->media_meta.title = g_strdup(media->title);
svc_content_info->media_meta.rating = media->rating;
svc_content_info->media_meta.recorded_date = g_strdup(media->audio_meta->recorded_date);
if (storage_type == MEDIA_CONTENT_STORAGE_CLOUD) {
- switch(media->media_type)
- {
- case MEDIA_CONTENT_TYPE_IMAGE:
- svc_content_info->media_meta.width = media->image_meta->width;
- svc_content_info->media_meta.height = media->image_meta->height;
- svc_content_info->media_meta.datetaken = g_strdup(media->image_meta->date_taken);
- svc_content_info->media_meta.orientation = media->image_meta->orientation;
- break;
- case MEDIA_CONTENT_TYPE_VIDEO:
- svc_content_info->media_meta.album_artist = g_strdup(media->audio_meta->album_artist);
- svc_content_info->media_meta.composer = g_strdup(media->audio_meta->composer);
- svc_content_info->media_meta.year = g_strdup(media->audio_meta->year);
- svc_content_info->media_meta.copyright = g_strdup(media->audio_meta->copyright);
- svc_content_info->media_meta.track_num = g_strdup(media->audio_meta->track_num);
- svc_content_info->media_meta.bitrate = media->audio_meta->bitrate;
- svc_content_info->media_meta.duration = media->audio_meta->duration;
- svc_content_info->media_meta.width = media->image_meta->width;
- svc_content_info->media_meta.height = media->image_meta->height;
- break;
- case MEDIA_CONTENT_TYPE_SOUND:
- case MEDIA_CONTENT_TYPE_MUSIC:
- svc_content_info->media_meta.album_artist = g_strdup(media->audio_meta->album_artist);
- svc_content_info->media_meta.composer = g_strdup(media->audio_meta->composer);
- svc_content_info->media_meta.year = g_strdup(media->audio_meta->year);
- svc_content_info->media_meta.copyright = g_strdup(media->audio_meta->copyright);
- svc_content_info->media_meta.track_num = g_strdup(media->audio_meta->track_num);
- svc_content_info->media_meta.bitrate = media->audio_meta->bitrate;
- svc_content_info->media_meta.duration = media->audio_meta->duration;
- svc_content_info->media_meta.channel = media->audio_meta->channel;
- svc_content_info->media_meta.samplerate = media->audio_meta->samplerate;
- break;
- case MEDIA_CONTENT_TYPE_OTHERS:
- default:
- break;
+ switch (media->media_type) {
+ case MEDIA_CONTENT_TYPE_IMAGE:
+ svc_content_info->media_meta.width = media->image_meta->width;
+ svc_content_info->media_meta.height = media->image_meta->height;
+ svc_content_info->media_meta.datetaken = g_strdup(media->image_meta->date_taken);
+ svc_content_info->media_meta.orientation = media->image_meta->orientation;
+ break;
+ case MEDIA_CONTENT_TYPE_VIDEO:
+ svc_content_info->media_meta.album_artist = g_strdup(media->audio_meta->album_artist);
+ svc_content_info->media_meta.composer = g_strdup(media->audio_meta->composer);
+ svc_content_info->media_meta.year = g_strdup(media->audio_meta->year);
+ svc_content_info->media_meta.copyright = g_strdup(media->audio_meta->copyright);
+ svc_content_info->media_meta.track_num = g_strdup(media->audio_meta->track_num);
+ svc_content_info->media_meta.bitrate = media->audio_meta->bitrate;
+ svc_content_info->media_meta.duration = media->audio_meta->duration;
+ svc_content_info->media_meta.width = media->image_meta->width;
+ svc_content_info->media_meta.height = media->image_meta->height;
+ break;
+ case MEDIA_CONTENT_TYPE_SOUND:
+ case MEDIA_CONTENT_TYPE_MUSIC:
+ svc_content_info->media_meta.album_artist = g_strdup(media->audio_meta->album_artist);
+ svc_content_info->media_meta.composer = g_strdup(media->audio_meta->composer);
+ svc_content_info->media_meta.year = g_strdup(media->audio_meta->year);
+ svc_content_info->media_meta.copyright = g_strdup(media->audio_meta->copyright);
+ svc_content_info->media_meta.track_num = g_strdup(media->audio_meta->track_num);
+ svc_content_info->media_meta.bitrate = media->audio_meta->bitrate;
+ svc_content_info->media_meta.duration = media->audio_meta->duration;
+ svc_content_info->media_meta.channel = media->audio_meta->channel;
+ svc_content_info->media_meta.samplerate = media->audio_meta->samplerate;
+ break;
+ case MEDIA_CONTENT_TYPE_OTHERS:
+ default:
+ break;
}
}
media_content_retvm_if(_media == NULL, MEDIA_CONTENT_ERROR_INVALID_PARAMETER, "Invalid media");
- switch(data_type)
- {
- case MEDIA_INFO_PATH:
- SAFE_FREE(_media->file_path);
- if (STRING_VALID(str_data))
- {
- _media->file_path = strdup(str_data);
- media_content_retvm_if(_media->file_path == NULL, MEDIA_CONTENT_ERROR_OUT_OF_MEMORY, "OUT_OF_MEMORY");
- }
- else
- {
- _media->file_path = NULL;
- }
- break;
- case MEDIA_INFO_MIME_TYPE:
- SAFE_FREE(_media->mime_type);
- if (STRING_VALID(str_data))
- {
- _media->mime_type = strdup(str_data);
- media_content_retvm_if(_media->mime_type == NULL, MEDIA_CONTENT_ERROR_OUT_OF_MEMORY, "OUT_OF_MEMORY");
- }
- else
- {
- _media->mime_type = NULL;
- }
- break;
- case MEDIA_INFO_THUMBNAIL_PATH:
- SAFE_FREE(_media->thumbnail_path);
- if (STRING_VALID(str_data))
- {
- _media->thumbnail_path = strdup(str_data);
- media_content_retvm_if(_media->thumbnail_path == NULL, MEDIA_CONTENT_ERROR_OUT_OF_MEMORY, "OUT_OF_MEMORY");
- }
- else
- {
- _media->thumbnail_path = NULL;
- }
- break;
- case MEDIA_INFO_TITLE:
- SAFE_FREE(_media->title);
- if (STRING_VALID(str_data))
- {
- _media->title = strdup(str_data);
- media_content_retvm_if(_media->title == NULL, MEDIA_CONTENT_ERROR_OUT_OF_MEMORY, "OUT_OF_MEMORY");
- }
- else
- {
- _media->title = NULL;
- }
- break;
- case MEDIA_INFO_STORAGE_UUID:
- SAFE_FREE(_media->storage_uuid);
- if (STRING_VALID(str_data))
- {
- _media->storage_uuid = strdup(str_data);
- media_content_retvm_if(_media->storage_uuid == NULL, MEDIA_CONTENT_ERROR_OUT_OF_MEMORY, "OUT_OF_MEMORY");
- }
- else
- {
- _media->storage_uuid = NULL;
- }
- break;
- case MEDIA_INFO_ALBUM:
- //if (_media->media_type == MEDIA_CONTENT_TYPE_VIDEO)
- {
- SAFE_FREE(_media->video_meta->album);
- if (STRING_VALID(str_data))
- {
- _media->video_meta->album = strdup(str_data);
- media_content_retvm_if(_media->video_meta->album == NULL, MEDIA_CONTENT_ERROR_OUT_OF_MEMORY, "OUT_OF_MEMORY");
- }
- else
- {
- _media->video_meta->album = NULL;
- }
+ switch (data_type) {
+ case MEDIA_INFO_PATH:
+ SAFE_FREE(_media->file_path);
+ if (STRING_VALID(str_data)) {
+ _media->file_path = strdup(str_data);
+ media_content_retvm_if(_media->file_path == NULL, MEDIA_CONTENT_ERROR_OUT_OF_MEMORY, "OUT_OF_MEMORY");
+ } else {
+ _media->file_path = NULL;
+ }
+ break;
+ case MEDIA_INFO_MIME_TYPE:
+ SAFE_FREE(_media->mime_type);
+ if (STRING_VALID(str_data)) {
+ _media->mime_type = strdup(str_data);
+ media_content_retvm_if(_media->mime_type == NULL, MEDIA_CONTENT_ERROR_OUT_OF_MEMORY, "OUT_OF_MEMORY");
+ } else {
+ _media->mime_type = NULL;
+ }
+ break;
+ case MEDIA_INFO_THUMBNAIL_PATH:
+ SAFE_FREE(_media->thumbnail_path);
+ if (STRING_VALID(str_data)) {
+ _media->thumbnail_path = strdup(str_data);
+ media_content_retvm_if(_media->thumbnail_path == NULL, MEDIA_CONTENT_ERROR_OUT_OF_MEMORY, "OUT_OF_MEMORY");
+ } else {
+ _media->thumbnail_path = NULL;
+ }
+ break;
+ case MEDIA_INFO_TITLE:
+ SAFE_FREE(_media->title);
+ if (STRING_VALID(str_data)) {
+ _media->title = strdup(str_data);
+ media_content_retvm_if(_media->title == NULL, MEDIA_CONTENT_ERROR_OUT_OF_MEMORY, "OUT_OF_MEMORY");
+ } else {
+ _media->title = NULL;
+ }
+ break;
+ case MEDIA_INFO_STORAGE_UUID:
+ SAFE_FREE(_media->storage_uuid);
+ if (STRING_VALID(str_data)) {
+ _media->storage_uuid = strdup(str_data);
+ media_content_retvm_if(_media->storage_uuid == NULL, MEDIA_CONTENT_ERROR_OUT_OF_MEMORY, "OUT_OF_MEMORY");
+ } else {
+ _media->storage_uuid = NULL;
+ }
+ break;
+ case MEDIA_INFO_ALBUM:
+ /* if (_media->media_type == MEDIA_CONTENT_TYPE_VIDEO) */
+ {
+ SAFE_FREE(_media->video_meta->album);
+ if (STRING_VALID(str_data)) {
+ _media->video_meta->album = strdup(str_data);
+ media_content_retvm_if(_media->video_meta->album == NULL, MEDIA_CONTENT_ERROR_OUT_OF_MEMORY, "OUT_OF_MEMORY");
+ } else {
+ _media->video_meta->album = NULL;
}
- //else if ((_media->media_type == MEDIA_CONTENT_TYPE_MUSIC) || (_media->media_type == MEDIA_CONTENT_TYPE_SOUND))
- {
- SAFE_FREE(_media->audio_meta->album);
- if (STRING_VALID(str_data))
- {
- _media->audio_meta->album = strdup(str_data);
- media_content_retvm_if(_media->audio_meta->album == NULL, MEDIA_CONTENT_ERROR_OUT_OF_MEMORY, "OUT_OF_MEMORY");
- }
- else
- {
- _media->audio_meta->album = NULL;
- }
+ }
+ /* else if ((_media->media_type == MEDIA_CONTENT_TYPE_MUSIC) || (_media->media_type == MEDIA_CONTENT_TYPE_SOUND)) */
+ {
+ SAFE_FREE(_media->audio_meta->album);
+ if (STRING_VALID(str_data)) {
+ _media->audio_meta->album = strdup(str_data);
+ media_content_retvm_if(_media->audio_meta->album == NULL, MEDIA_CONTENT_ERROR_OUT_OF_MEMORY, "OUT_OF_MEMORY");
+ } else {
+ _media->audio_meta->album = NULL;
}
- break;
- case MEDIA_INFO_ARTIST:
- //if (_media->media_type == MEDIA_CONTENT_TYPE_VIDEO)
- {
- SAFE_FREE(_media->video_meta->artist);
- if (STRING_VALID(str_data))
- {
- _media->video_meta->artist = strdup(str_data);
- media_content_retvm_if(_media->video_meta->artist == NULL, MEDIA_CONTENT_ERROR_OUT_OF_MEMORY, "OUT_OF_MEMORY");
- }
- else
- {
- _media->video_meta->artist = NULL;
- }
+ }
+ break;
+ case MEDIA_INFO_ARTIST:
+ /* if (_media->media_type == MEDIA_CONTENT_TYPE_VIDEO) */
+ {
+ SAFE_FREE(_media->video_meta->artist);
+ if (STRING_VALID(str_data)) {
+ _media->video_meta->artist = strdup(str_data);
+ media_content_retvm_if(_media->video_meta->artist == NULL, MEDIA_CONTENT_ERROR_OUT_OF_MEMORY, "OUT_OF_MEMORY");
+ } else {
+ _media->video_meta->artist = NULL;
}
- //else if ((_media->media_type == MEDIA_CONTENT_TYPE_MUSIC) || (_media->media_type == MEDIA_CONTENT_TYPE_SOUND))
- {
- SAFE_FREE(_media->audio_meta->artist);
- if (STRING_VALID(str_data))
- {
- _media->audio_meta->artist = strdup(str_data);
- media_content_retvm_if(_media->audio_meta->artist == NULL, MEDIA_CONTENT_ERROR_OUT_OF_MEMORY, "OUT_OF_MEMORY");
- }
- else
- {
- _media->audio_meta->artist = NULL;
- }
+ }
+ /* else if ((_media->media_type == MEDIA_CONTENT_TYPE_MUSIC) || (_media->media_type == MEDIA_CONTENT_TYPE_SOUND)) */
+ {
+ SAFE_FREE(_media->audio_meta->artist);
+ if (STRING_VALID(str_data)) {
+ _media->audio_meta->artist = strdup(str_data);
+ media_content_retvm_if(_media->audio_meta->artist == NULL, MEDIA_CONTENT_ERROR_OUT_OF_MEMORY, "OUT_OF_MEMORY");
+ } else {
+ _media->audio_meta->artist = NULL;
}
- break;
- case MEDIA_INFO_GENRE:
- //if (_media->media_type == MEDIA_CONTENT_TYPE_VIDEO)
- {
- SAFE_FREE(_media->video_meta->genre);
- if (STRING_VALID(str_data))
- {
- _media->video_meta->genre = strdup(str_data);
- media_content_retvm_if(_media->video_meta->genre == NULL, MEDIA_CONTENT_ERROR_OUT_OF_MEMORY, "OUT_OF_MEMORY");
- }
- else
- {
- _media->video_meta->genre = NULL;
- }
+ }
+ break;
+ case MEDIA_INFO_GENRE:
+ /* if (_media->media_type == MEDIA_CONTENT_TYPE_VIDEO) */
+ {
+ SAFE_FREE(_media->video_meta->genre);
+ if (STRING_VALID(str_data)) {
+ _media->video_meta->genre = strdup(str_data);
+ media_content_retvm_if(_media->video_meta->genre == NULL, MEDIA_CONTENT_ERROR_OUT_OF_MEMORY, "OUT_OF_MEMORY");
+ } else {
+ _media->video_meta->genre = NULL;
}
- //else if ((_media->media_type == MEDIA_CONTENT_TYPE_MUSIC) || (_media->media_type == MEDIA_CONTENT_TYPE_SOUND))
- {
- SAFE_FREE(_media->audio_meta->genre);
- if (STRING_VALID(str_data))
- {
- _media->audio_meta->genre = strdup(str_data);
- media_content_retvm_if(_media->audio_meta->genre == NULL, MEDIA_CONTENT_ERROR_OUT_OF_MEMORY, "OUT_OF_MEMORY");
- }
- else
- {
- _media->audio_meta->genre = NULL;
- }
+ }
+ /* else if ((_media->media_type == MEDIA_CONTENT_TYPE_MUSIC) || (_media->media_type == MEDIA_CONTENT_TYPE_SOUND)) */
+ {
+ SAFE_FREE(_media->audio_meta->genre);
+ if (STRING_VALID(str_data)) {
+ _media->audio_meta->genre = strdup(str_data);
+ media_content_retvm_if(_media->audio_meta->genre == NULL, MEDIA_CONTENT_ERROR_OUT_OF_MEMORY, "OUT_OF_MEMORY");
+ } else {
+ _media->audio_meta->genre = NULL;
}
- break;
- case MEDIA_INFO_RECORDED_DATE:
- //if (_media->media_type == MEDIA_CONTENT_TYPE_VIDEO)
- {
- SAFE_FREE(_media->video_meta->recorded_date);
- if (STRING_VALID(str_data))
- {
- _media->video_meta->recorded_date = strdup(str_data);
- media_content_retvm_if(_media->video_meta->recorded_date == NULL, MEDIA_CONTENT_ERROR_OUT_OF_MEMORY, "OUT_OF_MEMORY");
- }
- else
- {
- _media->video_meta->recorded_date = NULL;
- }
+ }
+ break;
+ case MEDIA_INFO_RECORDED_DATE:
+ /* if (_media->media_type == MEDIA_CONTENT_TYPE_VIDEO) */
+ {
+ SAFE_FREE(_media->video_meta->recorded_date);
+ if (STRING_VALID(str_data)) {
+ _media->video_meta->recorded_date = strdup(str_data);
+ media_content_retvm_if(_media->video_meta->recorded_date == NULL, MEDIA_CONTENT_ERROR_OUT_OF_MEMORY, "OUT_OF_MEMORY");
+ } else {
+ _media->video_meta->recorded_date = NULL;
}
- //else if ((_media->media_type == MEDIA_CONTENT_TYPE_MUSIC) || (_media->media_type == MEDIA_CONTENT_TYPE_SOUND))
- {
- SAFE_FREE(_media->audio_meta->recorded_date);
- if (STRING_VALID(str_data))
- {
- _media->audio_meta->recorded_date = strdup(str_data);
- media_content_retvm_if(_media->audio_meta->recorded_date == NULL, MEDIA_CONTENT_ERROR_OUT_OF_MEMORY, "OUT_OF_MEMORY");
- }
- else
- {
- _media->audio_meta->recorded_date = NULL;
- }
+ }
+ /* else if ((_media->media_type == MEDIA_CONTENT_TYPE_MUSIC) || (_media->media_type == MEDIA_CONTENT_TYPE_SOUND)) */
+ {
+ SAFE_FREE(_media->audio_meta->recorded_date);
+ if (STRING_VALID(str_data)) {
+ _media->audio_meta->recorded_date = strdup(str_data);
+ media_content_retvm_if(_media->audio_meta->recorded_date == NULL, MEDIA_CONTENT_ERROR_OUT_OF_MEMORY, "OUT_OF_MEMORY");
+ } else {
+ _media->audio_meta->recorded_date = NULL;
}
- break;
- default:
- media_content_error("INVALID_PARAMETER(0x%08x)", MEDIA_CONTENT_ERROR_INVALID_PARAMETER);
- return MEDIA_CONTENT_ERROR_INVALID_PARAMETER;
+ }
+ break;
+ default:
+ media_content_error("INVALID_PARAMETER(0x%08x)", MEDIA_CONTENT_ERROR_INVALID_PARAMETER);
+ return MEDIA_CONTENT_ERROR_INVALID_PARAMETER;
}
return MEDIA_CONTENT_ERROR_NONE;
int ret = MEDIA_CONTENT_ERROR_NONE;
media_info_s *_media = (media_info_s*)media;
- if (_media)
- {
+ if (_media) {
SAFE_FREE(_media->media_id);
SAFE_FREE(_media->file_path);
SAFE_FREE(_media->display_name);
}
ret = MEDIA_CONTENT_ERROR_NONE;
- }
- else
- {
+ } else {
media_content_error("INVALID_PARAMETER(0x%08x)", MEDIA_CONTENT_ERROR_INVALID_PARAMETER);
ret = MEDIA_CONTENT_ERROR_INVALID_PARAMETER;
}
media_content_retvm_if(_media->size <= 0, MEDIA_CONTENT_ERROR_INVALID_PARAMETER, "Invalid size [%d]", _media->size);
media_content_retvm_if(_media->modified_time <= 0, MEDIA_CONTENT_ERROR_INVALID_PARAMETER, "Invalid modified_time [%d]", _media->modified_time);
- if ((_media->media_type < MEDIA_CONTENT_TYPE_IMAGE) || (_media->media_type > MEDIA_CONTENT_TYPE_OTHERS))
- {
+ if ((_media->media_type < MEDIA_CONTENT_TYPE_IMAGE) || (_media->media_type > MEDIA_CONTENT_TYPE_OTHERS)) {
media_content_error("invalid media type [%d]", _media->media_type);
return MEDIA_CONTENT_ERROR_INVALID_PARAMETER;
}
media_svc_destroy_content_info(svc_content_info);
SAFE_FREE(svc_content_info);
- if (info != NULL)
- {
+ if (info != NULL) {
media_info_s *_get_media = (media_info_s*)calloc(1, sizeof(media_info_s));
media_content_retvm_if(_get_media == NULL, MEDIA_CONTENT_ERROR_OUT_OF_MEMORY, "OUT_OF_MEMORY");
media_content_retvm_if(ignore_dir == TRUE, MEDIA_CONTENT_ERROR_INVALID_PARAMETER, "Invalid folder path");
ret = media_svc_get_storage_id(_content_get_db_handle(), path, storage_id);
- if (ret != MS_MEDIA_ERR_NONE)
- {
+ if (ret != MS_MEDIA_ERR_NONE) {
media_content_error("media_svc_get_storage_id failed : %d", ret);
return _content_error_capi(MEDIA_CONTENT_TYPE, ret);
}
}
}
- media_info_s *_media = (media_info_s*)calloc(1,sizeof(media_info_s));
+ media_info_s *_media = (media_info_s*)calloc(1, sizeof(media_info_s));
media_content_retvm_if(_media == NULL, MEDIA_CONTENT_ERROR_OUT_OF_MEMORY, "OUT_OF_MEMORY");
_media->audio_meta = (audio_meta_s *)calloc(1, sizeof(audio_meta_s));
- if (_media->audio_meta == NULL)
- {
+ if (_media->audio_meta == NULL) {
SAFE_FREE(_media);
media_content_error("OUT_OF_MEMORY(0x%08x)", MEDIA_CONTENT_ERROR_OUT_OF_MEMORY);
return MEDIA_CONTENT_ERROR_OUT_OF_MEMORY;
}
_media->video_meta = (video_meta_s *)calloc(1, sizeof(video_meta_s));
- if (_media->video_meta == NULL)
- {
+ if (_media->video_meta == NULL) {
SAFE_FREE(_media->audio_meta);
SAFE_FREE(_media);
media_content_error("OUT_OF_MEMORY(0x%08x)", MEDIA_CONTENT_ERROR_OUT_OF_MEMORY);
}
_media->image_meta = (image_meta_s *)calloc(1, sizeof(image_meta_s));
- if (_media->image_meta == NULL)
- {
+ if (_media->image_meta == NULL) {
SAFE_FREE(_media->audio_meta);
SAFE_FREE(_media->video_meta);
SAFE_FREE(_media);
_media->media_type = 0;
_media->modified_time = 0;
_media->size = 0;
- _media->longitude= MEDIA_SVC_DEFAULT_GPS_VALUE;
+ _media->longitude = MEDIA_SVC_DEFAULT_GPS_VALUE;
_media->latitude = MEDIA_SVC_DEFAULT_GPS_VALUE;
- _media->altitude= MEDIA_SVC_DEFAULT_GPS_VALUE;
+ _media->altitude = MEDIA_SVC_DEFAULT_GPS_VALUE;
if (STRING_VALID(storage_id)) {
_media->storage_uuid = g_strdup(storage_id);
media_content_retvm_if(media == NULL, MEDIA_CONTENT_ERROR_INVALID_PARAMETER, "Invalid handle");
- media_info_s *_media = (media_info_s*)calloc(1,sizeof(media_info_s));
+ media_info_s *_media = (media_info_s*)calloc(1, sizeof(media_info_s));
media_content_retvm_if(_media == NULL, MEDIA_CONTENT_ERROR_OUT_OF_MEMORY, "OUT_OF_MEMORY");
_media->audio_meta = (audio_meta_s *)calloc(1, sizeof(audio_meta_s));
- if (_media->audio_meta == NULL)
- {
+ if (_media->audio_meta == NULL) {
SAFE_FREE(_media);
media_content_error("OUT_OF_MEMORY(0x%08x)", MEDIA_CONTENT_ERROR_OUT_OF_MEMORY);
return MEDIA_CONTENT_ERROR_OUT_OF_MEMORY;
}
_media->video_meta = (video_meta_s *)calloc(1, sizeof(video_meta_s));
- if (_media->video_meta == NULL)
- {
+ if (_media->video_meta == NULL) {
SAFE_FREE(_media->audio_meta);
SAFE_FREE(_media);
media_content_error("OUT_OF_MEMORY(0x%08x)", MEDIA_CONTENT_ERROR_OUT_OF_MEMORY);
}
_media->image_meta = (image_meta_s *)calloc(1, sizeof(image_meta_s));
- if (_media->image_meta == NULL)
- {
+ if (_media->image_meta == NULL) {
SAFE_FREE(_media->audio_meta);
SAFE_FREE(_media->video_meta);
SAFE_FREE(_media);
_media->video_meta->duration = duration;
else if ((_media->media_type == MEDIA_CONTENT_TYPE_MUSIC) || (_media->media_type == MEDIA_CONTENT_TYPE_SOUND))
_media->audio_meta->duration = duration;
- else
- {
+ else {
media_content_error("Invalid media type");
return MEDIA_CONTENT_ERROR_INVALID_PARAMETER;
}
_media->video_meta->width = width;
else if (_media->media_type == MEDIA_CONTENT_TYPE_IMAGE)
_media->image_meta->width = width;
- else
- {
+ else {
media_content_error("Invalid media type");
return MEDIA_CONTENT_ERROR_INVALID_PARAMETER;
}
_media->video_meta->height = height;
else if (_media->media_type == MEDIA_CONTENT_TYPE_IMAGE)
_media->image_meta->height = height;
- else
- {
+ else {
media_content_error("Invalid media type");
return MEDIA_CONTENT_ERROR_INVALID_PARAMETER;
}