"x-smaf",
};
-typedef enum {
- MEDIA_SVC_EXTRACTED_FIELD_NONE = 0x00000001,
- MEDIA_SVC_EXTRACTED_FIELD_TITLE = MEDIA_SVC_EXTRACTED_FIELD_NONE << 1,
- MEDIA_SVC_EXTRACTED_FIELD_DESC = MEDIA_SVC_EXTRACTED_FIELD_NONE << 2,
- MEDIA_SVC_EXTRACTED_FIELD_COPYRIGHT = MEDIA_SVC_EXTRACTED_FIELD_NONE << 3,
- MEDIA_SVC_EXTRACTED_FIELD_AUTHOR = MEDIA_SVC_EXTRACTED_FIELD_NONE << 4,
- MEDIA_SVC_EXTRACTED_FIELD_ARTIST = MEDIA_SVC_EXTRACTED_FIELD_NONE << 5,
- MEDIA_SVC_EXTRACTED_FIELD_GENRE = MEDIA_SVC_EXTRACTED_FIELD_NONE << 6,
- MEDIA_SVC_EXTRACTED_FIELD_ALBUM = MEDIA_SVC_EXTRACTED_FIELD_NONE << 7,
- MEDIA_SVC_EXTRACTED_FIELD_TRACKNUM = MEDIA_SVC_EXTRACTED_FIELD_NONE << 8,
- MEDIA_SVC_EXTRACTED_FIELD_YEAR = MEDIA_SVC_EXTRACTED_FIELD_NONE << 9,
- MEDIA_SVC_EXTRACTED_FIELD_CATEGORY = MEDIA_SVC_EXTRACTED_FIELD_NONE << 10,
- MEDIA_SVC_EXTRACTED_FIELD_ALBUM_ARTIST = MEDIA_SVC_EXTRACTED_FIELD_NONE << 11,
-} media_svc_extracted_field_e;
-
char *_media_info_generate_uuid(void)
{
uuid_t uuid_value;
MMHandleType tag = 0;
char *p = NULL;
int size = -1;
- int extracted_field = MEDIA_SVC_EXTRACTED_FIELD_NONE;
int mmf_error = FILEINFO_ERROR_NONE;
char *err_attr_name = NULL;
int album_id = 0;
if (mmf_error == FILEINFO_ERROR_NONE) {
mmf_error = mm_file_get_attrs(tag, &err_attr_name, MM_FILE_TAG_ALBUM, &p, &size, NULL);
- if ((!(extracted_field & MEDIA_SVC_EXTRACTED_FIELD_ALBUM)) && (mmf_error == FILEINFO_ERROR_NONE) && (size > 0)) {
+ if (mmf_error == FILEINFO_ERROR_NONE && size > 0) {
content_info->media_meta.album = g_strdup(p);
} else {
SAFE_FREE(err_attr_name);
}
mmf_error = mm_file_get_attrs(tag, &err_attr_name, MM_FILE_TAG_ARTIST, &p, &size, NULL);
- if ((!(extracted_field & MEDIA_SVC_EXTRACTED_FIELD_ARTIST)) && (mmf_error == FILEINFO_ERROR_NONE) && (size > 0)) {
+ if (mmf_error == FILEINFO_ERROR_NONE && size > 0) {
content_info->media_meta.artist = g_strdup(p);
} else {
SAFE_FREE(err_attr_name);
}
mmf_error = mm_file_get_attrs(tag, &err_attr_name, MM_FILE_TAG_ALBUM_ARTIST, &p, &size, NULL);
- if ((!(extracted_field & MEDIA_SVC_EXTRACTED_FIELD_ALBUM_ARTIST)) && (mmf_error == FILEINFO_ERROR_NONE) && (size > 0)) {
+ if (mmf_error == FILEINFO_ERROR_NONE && size > 0) {
content_info->media_meta.album_artist = g_strdup(p);
} else {
SAFE_FREE(err_attr_name);
}
mmf_error = mm_file_get_attrs(tag, &err_attr_name, MM_FILE_TAG_GENRE, &p, &size, NULL);
- if ((!(extracted_field & MEDIA_SVC_EXTRACTED_FIELD_GENRE)) && (mmf_error == FILEINFO_ERROR_NONE) && (size > 0)) {
+ if (mmf_error == FILEINFO_ERROR_NONE && size > 0) {
content_info->media_meta.genre = g_strdup(p);
/* If genre is Ringtone, it's categorized as sound. But this logic is commented */
}
mmf_error = mm_file_get_attrs(tag, &err_attr_name, MM_FILE_TAG_TITLE, &p, &size, NULL);
- if ((!(extracted_field & MEDIA_SVC_EXTRACTED_FIELD_TITLE)) && (mmf_error == FILEINFO_ERROR_NONE) && (size > 0)) {
+ if (mmf_error == FILEINFO_ERROR_NONE && size > 0) {
if (!isspace(*p)) {
content_info->media_meta.title = g_strdup(p);
-
- extracted_field |= MEDIA_SVC_EXTRACTED_FIELD_TITLE;
} else {
int idx = 0;
}
mmf_error = mm_file_get_attrs(tag, &err_attr_name, MM_FILE_TAG_DESCRIPTION, &p, &size, NULL);
- if ((!(extracted_field & MEDIA_SVC_EXTRACTED_FIELD_DESC)) && (mmf_error == FILEINFO_ERROR_NONE) && (size > 0)) {
+ if (mmf_error == FILEINFO_ERROR_NONE && size > 0) {
content_info->media_meta.description = g_strdup(p);
} else {
SAFE_FREE(err_attr_name);
}
mmf_error = mm_file_get_attrs(tag, &err_attr_name, MM_FILE_TAG_AUTHOR, &p, &size, NULL);
- if ((!(extracted_field & MEDIA_SVC_EXTRACTED_FIELD_AUTHOR)) && (mmf_error == FILEINFO_ERROR_NONE) && (size > 0)) {
+ if (mmf_error == FILEINFO_ERROR_NONE && size > 0) {
content_info->media_meta.composer = g_strdup(p);
- extracted_field |= MEDIA_SVC_EXTRACTED_FIELD_AUTHOR;
} else {
SAFE_FREE(err_attr_name);
}
mmf_error = mm_file_get_attrs(tag, &err_attr_name, MM_FILE_TAG_COPYRIGHT, &p, &size, NULL);
- if ((!(extracted_field & MEDIA_SVC_EXTRACTED_FIELD_COPYRIGHT)) && (mmf_error == FILEINFO_ERROR_NONE) && (size > 0)) {
+ if (mmf_error == FILEINFO_ERROR_NONE && size > 0) {
content_info->media_meta.copyright = g_strdup(p);
- extracted_field |= MEDIA_SVC_EXTRACTED_FIELD_COPYRIGHT;
} else {
SAFE_FREE(err_attr_name);
}
char *p = NULL;
unsigned char *image = NULL;
unsigned int size = 0;
- int extracted_field = MEDIA_SVC_EXTRACTED_FIELD_NONE;
int mmf_error = FILEINFO_ERROR_NONE;
char *err_attr_name = NULL;
bool extract_thumbnail = FALSE;
if (mmf_error == FILEINFO_ERROR_NONE) {
mmf_error = mm_file_get_attrs(tag, &err_attr_name, MM_FILE_TAG_ALBUM, &p, &size, NULL);
- if ((!(extracted_field & MEDIA_SVC_EXTRACTED_FIELD_ALBUM)) && (mmf_error == FILEINFO_ERROR_NONE) && (size > 0)) {
+ if (mmf_error == FILEINFO_ERROR_NONE && size > 0) {
content_info->media_meta.album = g_strdup(p);
} else {
SAFE_FREE(err_attr_name);
}
mmf_error = mm_file_get_attrs(tag, &err_attr_name, MM_FILE_TAG_ARTIST, &p, &size, NULL);
- if ((!(extracted_field & MEDIA_SVC_EXTRACTED_FIELD_ARTIST)) && (mmf_error == FILEINFO_ERROR_NONE) && (size > 0)) {
+ if (mmf_error == FILEINFO_ERROR_NONE && size > 0) {
content_info->media_meta.artist = g_strdup(p);
} else {
SAFE_FREE(err_attr_name);
}
mmf_error = mm_file_get_attrs(tag, &err_attr_name, MM_FILE_TAG_ALBUM_ARTIST, &p, &size, NULL);
- if ((!(extracted_field & MEDIA_SVC_EXTRACTED_FIELD_ALBUM_ARTIST)) && (mmf_error == FILEINFO_ERROR_NONE) && (size > 0)) {
+ if (mmf_error == FILEINFO_ERROR_NONE && size > 0) {
content_info->media_meta.album_artist = g_strdup(p);
} else {
SAFE_FREE(err_attr_name);
}
mmf_error = mm_file_get_attrs(tag, &err_attr_name, MM_FILE_TAG_GENRE, &p, &size, NULL);
- if ((!(extracted_field & MEDIA_SVC_EXTRACTED_FIELD_GENRE)) && (mmf_error == FILEINFO_ERROR_NONE) && (size > 0)) {
+ if (mmf_error == FILEINFO_ERROR_NONE && size > 0) {
content_info->media_meta.genre = g_strdup(p);
/* If genre is Ringtone, it's categorized as sound. But this logic is commented */
}
mmf_error = mm_file_get_attrs(tag, &err_attr_name, MM_FILE_TAG_TITLE, &p, &size, NULL);
- if ((!(extracted_field & MEDIA_SVC_EXTRACTED_FIELD_TITLE)) && (mmf_error == FILEINFO_ERROR_NONE) && (size > 0)) {
+ if (mmf_error == FILEINFO_ERROR_NONE && size > 0) {
if (!isspace(*p)) {
content_info->media_meta.title = g_strdup(p);
- extracted_field |= MEDIA_SVC_EXTRACTED_FIELD_TITLE;
} else {
int idx = 0;
}
mmf_error = mm_file_get_attrs(tag, &err_attr_name, MM_FILE_TAG_DESCRIPTION, &p, &size, NULL);
- if ((!(extracted_field & MEDIA_SVC_EXTRACTED_FIELD_DESC)) && (mmf_error == FILEINFO_ERROR_NONE) && (size > 0)) {
+ if (mmf_error == FILEINFO_ERROR_NONE && size > 0) {
content_info->media_meta.description = g_strdup(p);
} else {
SAFE_FREE(err_attr_name);
}
mmf_error = mm_file_get_attrs(tag, &err_attr_name, MM_FILE_TAG_AUTHOR, &p, &size, NULL);
- if ((!(extracted_field & MEDIA_SVC_EXTRACTED_FIELD_AUTHOR)) && (mmf_error == FILEINFO_ERROR_NONE) && (size > 0)) {
+ if (mmf_error == FILEINFO_ERROR_NONE && size > 0) {
content_info->media_meta.composer = g_strdup(p);
- extracted_field |= MEDIA_SVC_EXTRACTED_FIELD_AUTHOR;
} else {
SAFE_FREE(err_attr_name);
}
mmf_error = mm_file_get_attrs(tag, &err_attr_name, MM_FILE_TAG_COPYRIGHT, &p, &size, NULL);
- if ((!(extracted_field & MEDIA_SVC_EXTRACTED_FIELD_COPYRIGHT)) && (mmf_error == FILEINFO_ERROR_NONE) && (size > 0)) {
+ if (mmf_error == FILEINFO_ERROR_NONE && size > 0) {
content_info->media_meta.copyright = g_strdup(p);
- extracted_field |= MEDIA_SVC_EXTRACTED_FIELD_COPYRIGHT;
} else {
SAFE_FREE(err_attr_name);
}
mmf_error = mm_file_get_attrs(tag, &err_attr_name, MM_FILE_TAG_TRACK_NUM, &p, &size, NULL);
- if ((mmf_error == FILEINFO_ERROR_NONE) && (size > 0)) {
+ if (mmf_error == FILEINFO_ERROR_NONE && size > 0) {
content_info->media_meta.track_num = g_strdup(p);
} else {
SAFE_FREE(err_attr_name);
}
mmf_error = mm_file_get_attrs(tag, &err_attr_name, MM_FILE_TAG_DATE, &p, &size, NULL);
- if ((!(extracted_field & MEDIA_SVC_EXTRACTED_FIELD_YEAR)) && (mmf_error == FILEINFO_ERROR_NONE) && (size == 4)) {
+ if (mmf_error == FILEINFO_ERROR_NONE && size == 4) {
int year = 0;
if ((p != NULL) && ((ret != __media_svc_safe_atoi(p, &year)) == MS_MEDIA_ERR_NONE)) {
content_info->media_meta.year = g_strdup(p);
}
mmf_error = mm_file_get_attrs(tag, &err_attr_name, MM_FILE_TAG_RATING, &p, &size, NULL);
- if ((mmf_error == FILEINFO_ERROR_NONE) && (size > 0)) {
+ if (mmf_error == FILEINFO_ERROR_NONE && size > 0) {
int rate = 0;
if (__media_svc_safe_atoi(p, &rate) == MS_MEDIA_ERR_NONE)
content_info->media_meta.rating = rate;