SAFE_FREE(_audio->title);
SAFE_FREE(_audio->album);
SAFE_FREE(_audio->artist);
+ SAFE_FREE(_audio->album_artist);
SAFE_FREE(_audio->genre);
SAFE_FREE(_audio->composer);
SAFE_FREE(_audio->year);
}
}
+ if(STRING_VALID(_src->album_artist))
+ {
+ _dst->album_artist = strdup(_src->album_artist);
+ if(_dst->album_artist == NULL)
+ {
+ audio_meta_destroy((audio_meta_h)_dst);
+ media_content_error("OUT_OF_MEMORY(0x%08x)", MEDIA_CONTENT_ERROR_OUT_OF_MEMORY);
+ return MEDIA_CONTENT_ERROR_OUT_OF_MEMORY;
+ }
+ }
+
if(STRING_VALID(_src->genre))
{
_dst->genre = strdup(_src->genre);
}
_dst->bitrate = _src->bitrate;
+ _dst->bitpersample = _src->bitpersample;
_dst->samplerate = _src->samplerate;
_dst->channel = _src->channel;
_dst->duration = _src->duration;
return ret;
}
+int audio_meta_get_album_artist(audio_meta_h audio, char **album_artist_name)
+{
+ int ret = MEDIA_CONTENT_ERROR_NONE;
+ audio_meta_s *_audio = (audio_meta_s*)audio;
+
+ if(_audio)
+ {
+ if(STRING_VALID(_audio->album_artist))
+ {
+ *album_artist_name = strdup(_audio->album_artist);
+ if(*album_artist_name == NULL)
+ {
+ media_content_error("OUT_OF_MEMORY(0x%08x)", MEDIA_CONTENT_ERROR_OUT_OF_MEMORY);
+ return MEDIA_CONTENT_ERROR_OUT_OF_MEMORY;
+ }
+ }
+ else
+ {
+ *album_artist_name = NULL;
+ }
+ ret = MEDIA_CONTENT_ERROR_NONE;
+
+ }
+ else
+ {
+ media_content_error("INVALID_PARAMETER(0x%08x)", MEDIA_CONTENT_ERROR_INVALID_PARAMETER);
+ ret = MEDIA_CONTENT_ERROR_INVALID_PARAMETER;
+ }
+
+ return ret;
+}
+
int audio_meta_get_genre(audio_meta_h audio, char **genre_name)
{
int ret = MEDIA_CONTENT_ERROR_NONE;
return ret;
}
+int audio_meta_get_bitpersample(audio_meta_h audio, int *bitpersample)
+{
+ int ret = MEDIA_CONTENT_ERROR_NONE;
+ audio_meta_s *_audio = (audio_meta_s*)audio;
+
+ if(_audio && bitpersample)
+ {
+ *bitpersample = _audio->bitpersample;
+ ret = MEDIA_CONTENT_ERROR_NONE;
+ }
+ else
+ {
+ media_content_error("INVALID_PARAMETER(0x%08x)", MEDIA_CONTENT_ERROR_INVALID_PARAMETER);
+ ret = MEDIA_CONTENT_ERROR_INVALID_PARAMETER;
+ }
+
+ return ret;
+}
+
int audio_meta_get_sample_rate(audio_meta_h audio, int *sample_rate)
{
int ret = MEDIA_CONTENT_ERROR_NONE;