, __title(L"")
, __albumName(L"")
, __artist(L"")
+ , __albumArtist(L"")
, __composer(L"")
, __genre(L"")
, __copyright(L"")
}
String
+_AudioContentInfoImpl::GetAlbumArtist(void) const
+{
+ return __albumArtist;
+}
+
+String
_AudioContentInfoImpl::GetComposer(void) const
{
if (__composer.IsEmpty())
}
void
+_AudioContentInfoImpl::SetAlbumArtist(const Tizen::Base::String& albumArtist)
+{
+ __albumArtist = albumArtist;
+}
+
+void
_AudioContentInfoImpl::SetComposer(const Tizen::Base::String& composer)
{
__composer = composer;
SysLog(NID_CNT, "META: artist[%ls]", (String(pStrValue.get())).GetPointer());
}
+ // album artist
+ val = audio_meta_get_album_artist(*(pAudioMeta.get()), &pTempValue);
+ SysTryReturnResult(NID_CNT, val == MEDIA_CONTENT_ERROR_NONE, ConvertError(val),
+ "audio_meta_get_album_artist failed[%d].", val);
+
+ if (pTempValue != null)
+ {
+ pStrValue.reset(pTempValue);
+
+ pAudioContentInfoImpl->SetAlbumArtist(String(pStrValue.get()));
+
+ SysLog(NID_CNT, "META: album artist[%ls]", (String(pStrValue.get())).GetPointer());
+ }
+
// composer
val = audio_meta_get_composer(*(pAudioMeta.get()), &pTempValue);
SysTryReturnResult(NID_CNT, val == MEDIA_CONTENT_ERROR_NONE, ConvertError(val),
pVideoContentInfoImpl->SetDuration(intValue);
SysLog(NID_CNT, "META: duration[%d]", intValue);
+ // recorded date
+ val = video_meta_get_recorded_date(*(pVideoMeta.get()), &pTempValue);
+ SysTryReturnResult(NID_CNT, val == MEDIA_CONTENT_ERROR_NONE, ConvertError(val),
+ "video_meta_get_recorded_date failed[%d].", val);
+
+ DateTime dt;
+
+ if (pTempValue != null)
+ {
+ pStrValue.reset(pTempValue);
+ String recordedDate(pStrValue.get());
+ String newRecordedDate(L"");
+
+ // detour the unexpected recorded date format
+ String tempDelim(L"+-Z");
+ String token;
+
+ StringTokenizer tempStrTok(recordedDate, tempDelim);
+
+ result r = tempStrTok.GetNextToken(token);
+ SysTryReturnResult(NID_CNT, !IsFailed(r), E_INVALID_ARG, "Failed to perform GetNextToken operation.");
+
+ recordedDate = token;
+
+ String delim(L": ");
+ String year(L"");
+
+ StringTokenizer strTok(recordedDate, delim);
+
+ r = strTok.SetDelimiters(delim);
+ SysTryReturnResult(NID_CNT, !IsFailed(r), E_INVALID_ARG, "Failed to perform SetDelimiters operation.");
+
+ r = strTok.GetNextToken(token);
+ SysTryReturnResult(NID_CNT, !IsFailed(r), E_INVALID_ARG, "Failed to perform GetNextToken operation.");
+
+ year = token;
+
+ // Append month
+ r = strTok.GetNextToken(token);
+ SysTryReturnResult(NID_CNT, !IsFailed(r), E_INVALID_ARG, "Failed to perform GetNextToken operation.");
+
+ r = newRecordedDate.Append(token);
+ SysTryReturnResult(NID_CNT, !IsFailed(r), E_OUT_OF_MEMORY, "Failed to perform Append operation.");
+
+ r = newRecordedDate.Append(L"/");
+ SysTryReturnResult(NID_CNT, !IsFailed(r), E_OUT_OF_MEMORY, "Failed to perform Append operation.");
+
+ // Append day
+ r = strTok.GetNextToken(token);
+ SysTryReturnResult(NID_CNT, !IsFailed(r), E_INVALID_ARG, "Failed to perform GetNextToken operation.");
+
+ r = newRecordedDate.Append(token);
+ SysTryReturnResult(NID_CNT, !IsFailed(r), E_OUT_OF_MEMORY, "Failed to perform Append operation.");
+
+ r = newRecordedDate.Append(L"/");
+ SysTryReturnResult(NID_CNT, !IsFailed(r), E_OUT_OF_MEMORY, "Failed to perform Append operation.");
+
+ // Append year
+ r = newRecordedDate.Append(year);
+ SysTryReturnResult(NID_CNT, !IsFailed(r), E_OUT_OF_MEMORY, "Failed to perform Append operation.");
+
+ r = newRecordedDate.Append(L" ");
+ SysTryReturnResult(NID_CNT, !IsFailed(r), E_OUT_OF_MEMORY, "Failed to perform Append operation.");
+
+ String newDelim(L" ");
+
+ r = strTok.SetDelimiters(newDelim);
+ SysTryReturnResult(NID_CNT, !IsFailed(r), E_INVALID_ARG, "Failed to perform SetDelimiters operation.");
+
+ r = strTok.GetNextToken(token);
+ SysTryReturnResult(NID_CNT, !IsFailed(r), E_INVALID_ARG, "Failed to perform GetNextToken operation.");
+
+ r = newRecordedDate.Append(token);
+ SysTryReturnResult(NID_CNT, !IsFailed(r), E_OUT_OF_MEMORY, "Failed to perform Append operation.");
+
+ r = DateTime::Parse(newRecordedDate, dt);
+ SysTryReturnResult(NID_CNT, !IsFailed(r), E_INVALID_ARG, "Failed to perform Parse operation for DateTime.");
+ }
+ else
+ {
+ dt = DateTime::GetMinValue();
+ }
+
+ pVideoContentInfoImpl->SetVideoRecordedDate(dt);
+ SysLog(NID_CNT, "META: recorded date[%ls]", dt.ToString().GetPointer());
+
// Get some information from metadata extractor when calling VideoContentInfo (framerate, audio bitrate, video bitrate)
return E_SUCCESS;
ret = media_info_get_size(mediaHandle, &contentSize);
SysTryReturnResult(NID_CNT, ret == MEDIA_CONTENT_ERROR_NONE, MapCoreErrorToNativeResult(ret), "Failed to perform media_info_get_size operation.");
-
ret = media_info_get_latitude(mediaHandle, &latitude);
SysTryReturnResult(NID_CNT, ret == MEDIA_CONTENT_ERROR_NONE, MapCoreErrorToNativeResult(ret), "Failed to perform media_info_get_latitude operation.");
std::unique_ptr<char, UtilCharDeleter> pTitle;
std::unique_ptr<char, UtilCharDeleter> pAlbumName;
std::unique_ptr<char, UtilCharDeleter> pArtistName;
+ std::unique_ptr<char, UtilCharDeleter> pAlbumArtistName;
std::unique_ptr<char, UtilCharDeleter> pGenreName;
std::unique_ptr<char, UtilCharDeleter> pComposerName;
std::unique_ptr<char, UtilCharDeleter> pYear;
SysTryReturnResult(NID_CNT, ret == MEDIA_CONTENT_ERROR_NONE, MapCoreErrorToNativeResult(ret), "Failed to perform audio_meta_get_artist operation.");
}
+ ret = audio_meta_get_album_artist(pAudioHandle.get(), &pAudioMetaValue);
+ if (pAudioMetaValue != null)
+ {
+ pAlbumArtistName.reset(pAudioMetaValue);
+ }
+ else
+ {
+ SysTryReturnResult(NID_CNT, ret == MEDIA_CONTENT_ERROR_NONE, MapCoreErrorToNativeResult(ret), "Failed to perform audio_meta_get_album_artist operation.");
+ }
+
ret = audio_meta_get_genre(pAudioHandle.get(), &pAudioMetaValue);
if (pAudioMetaValue != null)
{
SysLog(NID_CNT, "pAudioContentInfoImpl->pArtist = %ls", (pAudioContentInfoImpl->GetArtist()).GetPointer());
}
+ if (pAlbumArtistName.get() != NULL)
+ {
+ pAudioContentInfoImpl->SetAlbumArtist(String(pAlbumArtistName.get()));
+ SysLog(NID_CNT, "pAudioContentInfoImpl->pAlbumArtist = %ls", (pAudioContentInfoImpl->GetAlbumArtist()).GetPointer());
+ }
+
+
if (pGenreName.get() != NULL)
{
pAudioContentInfoImpl->SetGenre(String(pGenreName.get()));
std::unique_ptr<char, UtilCharDeleter> pGenreName;
std::unique_ptr<char, UtilCharDeleter> pTitle;
std::unique_ptr<char, UtilCharDeleter> pAlbumName;
+ std::unique_ptr<char, UtilCharDeleter> pRecordedDate;
int duration = 0;
video_meta_h tempMeta = NULL;
pVideoContentInfoImpl->SetDuration(duration);
SysLog(NID_CNT,"pVideoContentInfoImpl->duration = %d", pVideoContentInfoImpl->GetDuration());
+ // recorded date
+ ret = video_meta_get_recorded_date(pVideoHandle.get(), &pVideoMetaValue);
+ SysTryReturnResult(NID_CNT, ret == MEDIA_CONTENT_ERROR_NONE, MapCoreErrorToNativeResult(ret),
+ "Failed to perform video_meta_get_recorded_date operation.");
+
+ DateTime dt;
+
+ if (pVideoMetaValue != NULL)
+ {
+ pRecordedDate.reset(pVideoMetaValue);
+ String recordedDate(pRecordedDate.get());
+ String newRecordedDate(L"");
+
+ // detour the unexpected recorded date format
+ String tempDelim(L"+-Z");
+ String token;
+
+ StringTokenizer tempStrTok(recordedDate, tempDelim);
+
+ r = tempStrTok.GetNextToken(token);
+ SysTryReturnResult(NID_CNT, !IsFailed(r), E_INVALID_ARG, "Failed to perform GetNextToken operation.");
+
+ recordedDate = token;
+
+ String delim(L": ");
+ String year(L"");
+
+ StringTokenizer strTok(recordedDate, delim);
+
+ r = strTok.SetDelimiters(delim);
+ SysTryReturnResult(NID_CNT, !IsFailed(r), E_INVALID_ARG, "Failed to perform SetDelimiters operation.");
+
+ r = strTok.GetNextToken(token);
+ SysTryReturnResult(NID_CNT, !IsFailed(r), E_INVALID_ARG, "Failed to perform GetNextToken operation.");
+
+ year = token;
+
+ // Append month
+ r = strTok.GetNextToken(token);
+ SysTryReturnResult(NID_CNT, !IsFailed(r), E_INVALID_ARG, "Failed to perform GetNextToken operation.");
+
+ r = newRecordedDate.Append(token);
+ SysTryReturnResult(NID_CNT, !IsFailed(r), E_OUT_OF_MEMORY, "Failed to perform Append operation.");
+
+ r = newRecordedDate.Append(L"/");
+ SysTryReturnResult(NID_CNT, !IsFailed(r), E_OUT_OF_MEMORY, "Failed to perform Append operation.");
+
+ // Append day
+ r = strTok.GetNextToken(token);
+ SysTryReturnResult(NID_CNT, !IsFailed(r), E_INVALID_ARG, "Failed to perform GetNextToken operation.");
+
+ r = newRecordedDate.Append(token);
+ SysTryReturnResult(NID_CNT, !IsFailed(r), E_OUT_OF_MEMORY, "Failed to perform Append operation.");
+
+ r = newRecordedDate.Append(L"/");
+ SysTryReturnResult(NID_CNT, !IsFailed(r), E_OUT_OF_MEMORY, "Failed to perform Append operation.");
+
+ // Append year
+ r = newRecordedDate.Append(year);
+ SysTryReturnResult(NID_CNT, !IsFailed(r), E_OUT_OF_MEMORY, "Failed to perform Append operation.");
+
+ r = newRecordedDate.Append(L" ");
+ SysTryReturnResult(NID_CNT, !IsFailed(r), E_OUT_OF_MEMORY, "Failed to perform Append operation.");
+
+ String newDelim(L" ");
+
+ r = strTok.SetDelimiters(newDelim);
+ SysTryReturnResult(NID_CNT, !IsFailed(r), E_INVALID_ARG, "Failed to perform SetDelimiters operation.");
+
+ r = strTok.GetNextToken(token);
+ SysTryReturnResult(NID_CNT, !IsFailed(r), E_INVALID_ARG, "Failed to perform GetNextToken operation.");
+
+ r = newRecordedDate.Append(token);
+ SysTryReturnResult(NID_CNT, !IsFailed(r), E_OUT_OF_MEMORY, "Failed to perform Append operation.");
+
+ r = DateTime::Parse(newRecordedDate, dt);
+ SysTryReturnResult(NID_CNT, !IsFailed(r), E_INVALID_ARG, "Failed to perform Parse operation for DateTime.");
+ }
+ else
+ {
+ dt = DateTime::GetMinValue();
+ }
+
+ pVideoContentInfoImpl->SetVideoRecordedDate(dt);
+ SysLog(NID_CNT, "pVideoContentInfoImpl->recordedDate = %ls", dt.ToString().GetPointer());
+
return r;
}
return __duration;
}
+DateTime
+_VideoContentInfoImpl::GetVideoRecordedDate(void) const
+{
+ return __recordedDate;
+}
+
void
_VideoContentInfoImpl::SetGenre(const Tizen::Base::String& genre)
{
__duration = duration;
}
+void
+_VideoContentInfoImpl::SetVideoRecordedDate(const DateTime& recordedDate)
+{
+ __recordedDate = recordedDate;
+}
+
result
_VideoContentInfoImpl::GetVideoMetadata(void) const
{
Tizen::Base::String GetArtist(void) const;
+ Tizen::Base::String GetAlbumArtist(void) const;
+
Tizen::Base::String GetComposer(void) const;
Tizen::Base::String GetAlbumName(void) const;
void SetArtist(const Tizen::Base::String& artist);
+ void SetAlbumArtist(const Tizen::Base::String& albumArtist);
+
void SetComposer(const Tizen::Base::String& composer);
void SetAlbumName(const Tizen::Base::String& albumName);
Tizen::Base::String __title;
Tizen::Base::String __albumName;
Tizen::Base::String __artist;
+ Tizen::Base::String __albumArtist;
Tizen::Base::String __composer;
Tizen::Base::String __genre;
Tizen::Base::String __copyright;
long GetDuration(void) const;
+ Tizen::Base::DateTime GetVideoRecordedDate(void) const;
+
void SetGenre(const Tizen::Base::String& genre);
void SetArtist(const Tizen::Base::String& artist);
void SetDuration(long duration);
+ void SetVideoRecordedDate(const Tizen::Base::DateTime& recordedDate);
+
static _VideoContentInfoImpl* GetInstance(VideoContentInfo& videoContentInfo);
static const _VideoContentInfoImpl* GetInstance(const VideoContentInfo& videoContentInfo);
Tizen::Base::String __genre;
Tizen::Base::String __title;
Tizen::Base::String __albumName;
+ Tizen::Base::DateTime __recordedDate;
}; // _VideoContentInfoImpl