175 TLinearOrder< THarvestingHandling > cmp( THarvestingHandling::CompareFunction ); |
176 TLinearOrder< THarvestingHandling > cmp( THarvestingHandling::CompareFunction ); |
176 |
177 |
177 // MPEG4 |
178 // MPEG4 |
178 User::LeaveIfError( iMimeTypeMappings.InsertInOrder( THarvestingHandling( |
179 User::LeaveIfError( iMimeTypeMappings.InsertInOrder( THarvestingHandling( |
179 KExtensionMp4(), KNullDesC(), |
180 KExtensionMp4(), KNullDesC(), |
180 TVideoMetadataHandling( TVideoMetadataHandling::EMp4LibHandling, KNullDesC(), |
181 TVideoMetadataHandling( TVideoMetadataHandling::EHexilMetadataHandling, KNullDesC(), |
181 KMimeTypeVideoMp4(), KMimeTypeAudioMp4() ) ), |
182 KMimeTypeVideoMp4(), KMimeTypeAudioMp4() ) ), |
182 cmp ) ); |
183 cmp ) ); |
183 User::LeaveIfError( iMimeTypeMappings.InsertInOrder( THarvestingHandling( |
184 User::LeaveIfError( iMimeTypeMappings.InsertInOrder( THarvestingHandling( |
184 KExtensionMpg4(), KNullDesC(), |
185 KExtensionMpg4(), KNullDesC(), |
185 TVideoMetadataHandling( TVideoMetadataHandling::EMp4LibHandling, KNullDesC(), |
186 TVideoMetadataHandling( TVideoMetadataHandling::EHexilMetadataHandling, KNullDesC(), |
186 KMimeTypeVideoMp4(), KMimeTypeAudioMp4() ) ), |
187 KMimeTypeVideoMp4(), KMimeTypeAudioMp4() ) ), |
187 cmp ) ); |
188 cmp ) ); |
188 User::LeaveIfError( iMimeTypeMappings.InsertInOrder( THarvestingHandling( |
189 User::LeaveIfError( iMimeTypeMappings.InsertInOrder( THarvestingHandling( |
189 KExtensionMpeg4(), KNullDesC(), |
190 KExtensionMpeg4(), KNullDesC(), |
190 TVideoMetadataHandling( TVideoMetadataHandling::EMp4LibHandling, KNullDesC(), |
191 TVideoMetadataHandling( TVideoMetadataHandling::EHexilMetadataHandling, KNullDesC(), |
191 KMimeTypeVideoMp4(), KMimeTypeAudioMp4() ) ), |
192 KMimeTypeVideoMp4(), KMimeTypeAudioMp4() ) ), |
192 cmp ) ); |
193 cmp ) ); |
193 User::LeaveIfError( iMimeTypeMappings.InsertInOrder( THarvestingHandling( |
194 User::LeaveIfError( iMimeTypeMappings.InsertInOrder( THarvestingHandling( |
194 KExtensionM4v(), KMimeTypeVideoMp4(), |
195 KExtensionM4v(), KMimeTypeVideoMp4(), |
195 TVideoMetadataHandling( TVideoMetadataHandling::EMp4LibHandling, KVideo(), |
196 TVideoMetadataHandling( TVideoMetadataHandling::EHexilMetadataHandling, KVideo(), |
196 KMimeTypeVideoMp4(), KMimeTypeAudioMp4() ) ), |
197 KMimeTypeVideoMp4(), KMimeTypeAudioMp4() ) ), |
197 cmp ) ); |
198 cmp ) ); |
198 User::LeaveIfError( iMimeTypeMappings.InsertInOrder( THarvestingHandling( |
199 User::LeaveIfError( iMimeTypeMappings.InsertInOrder( THarvestingHandling( |
199 KExtensionM4a(), KMimeTypeAudioMp4(), |
200 KExtensionM4a(), KMimeTypeAudioMp4(), |
200 TVideoMetadataHandling( TVideoMetadataHandling::EMp4LibHandling, KAudio(), |
201 TVideoMetadataHandling( TVideoMetadataHandling::EHexilMetadataHandling, KAudio(), |
201 KMimeTypeVideoMp4(), KMimeTypeAudioMp4() ) ), |
202 KMimeTypeVideoMp4(), KMimeTypeAudioMp4() ) ), |
202 cmp ) ); |
203 cmp ) ); |
203 |
204 |
204 // 3GP |
205 // 3GP |
205 User::LeaveIfError( iMimeTypeMappings.InsertInOrder( THarvestingHandling( |
206 User::LeaveIfError( iMimeTypeMappings.InsertInOrder( THarvestingHandling( |
206 KExtension3gp(), KNullDesC(), |
207 KExtension3gp(), KNullDesC(), |
207 TVideoMetadataHandling( TVideoMetadataHandling::EMp4LibHandling, KNullDesC(), |
208 TVideoMetadataHandling( TVideoMetadataHandling::EHexilMetadataHandling, KNullDesC(), |
208 KMimeTypeVideo3gpp(), KMimeTypeAudio3gpp() ) ), |
209 KMimeTypeVideo3gpp(), KMimeTypeAudio3gpp() ) ), |
209 cmp ) ); |
210 cmp ) ); |
210 User::LeaveIfError( iMimeTypeMappings.InsertInOrder( THarvestingHandling( |
211 User::LeaveIfError( iMimeTypeMappings.InsertInOrder( THarvestingHandling( |
211 KExtension3gpp(), KNullDesC(), |
212 KExtension3gpp(), KNullDesC(), |
212 TVideoMetadataHandling( TVideoMetadataHandling::EMp4LibHandling, KNullDesC(), |
213 TVideoMetadataHandling( TVideoMetadataHandling::EHexilMetadataHandling, KNullDesC(), |
213 KMimeTypeVideo3gpp(), KMimeTypeAudio3gpp() ) ), |
214 KMimeTypeVideo3gpp(), KMimeTypeAudio3gpp() ) ), |
214 cmp ) ); |
215 cmp ) ); |
215 User::LeaveIfError( iMimeTypeMappings.InsertInOrder( THarvestingHandling( |
216 User::LeaveIfError( iMimeTypeMappings.InsertInOrder( THarvestingHandling( |
216 KExtension3g2(), KNullDesC(), |
217 KExtension3g2(), KNullDesC(), |
217 TVideoMetadataHandling( TVideoMetadataHandling::EMp4LibHandling, KNullDesC(), |
218 TVideoMetadataHandling( TVideoMetadataHandling::EHexilMetadataHandling, KNullDesC(), |
218 KMimeTypeVideo3gpp(), KMimeTypeAudio3gpp() ) ), |
219 KMimeTypeVideo3gpp(), KMimeTypeAudio3gpp() ) ), |
219 cmp ) ); |
220 cmp ) ); |
220 |
221 |
221 // RealMedia |
222 // RealMedia |
222 User::LeaveIfError( iMimeTypeMappings.InsertInOrder( THarvestingHandling( |
223 User::LeaveIfError( iMimeTypeMappings.InsertInOrder( THarvestingHandling( |
1045 } |
1051 } |
1046 } |
1052 } |
1047 } |
1053 } |
1048 |
1054 |
1049 // Copyright |
1055 // Copyright |
1050 if( aVHD.iCopyright ) |
1056 if( aVHD.iCopyright && aVHD.iCopyright->Length() < iMaxTextLength ) |
1051 { |
1057 { |
1052 CMdeObjectWrapper::HandleObjectPropertyL(mdeObject, *iPropDefs->iCopyrightPropertyDef, aVHD.iCopyright, aIsAdd ); |
1058 CMdeObjectWrapper::HandleObjectPropertyL(mdeObject, *iPropDefs->iCopyrightPropertyDef, aVHD.iCopyright, aIsAdd ); |
1053 } |
1059 } |
1054 |
1060 |
1055 // Author |
1061 // Author |
1056 if( aVHD.iAuthor ) |
1062 if( aVHD.iAuthor && aVHD.iAuthor->Length() < iMaxTextLength ) |
1057 { |
1063 { |
1058 CMdeObjectWrapper::HandleObjectPropertyL(mdeObject, *iPropDefs->iAuthorPropertyDef, aVHD.iAuthor, aIsAdd ); |
1064 CMdeObjectWrapper::HandleObjectPropertyL(mdeObject, *iPropDefs->iAuthorPropertyDef, aVHD.iAuthor, aIsAdd ); |
1059 } |
1065 } |
1060 |
1066 |
1061 // Genre |
1067 // Genre |
1062 if( aVHD.iGenre ) |
1068 if( aVHD.iGenre && aVHD.iGenre->Length() < iMaxTextLength ) |
1063 { |
1069 { |
1064 CMdeObjectWrapper::HandleObjectPropertyL(mdeObject, *iPropDefs->iGenrePropertyDef, aVHD.iGenre, aIsAdd ); |
1070 CMdeObjectWrapper::HandleObjectPropertyL(mdeObject, *iPropDefs->iGenrePropertyDef, aVHD.iGenre, aIsAdd ); |
1065 } |
1071 } |
1066 |
1072 |
1067 // Artist |
1073 // Artist |
1068 if( aVHD.iPerformer ) |
1074 if( aVHD.iPerformer && aVHD.iPerformer->Length() < iMaxTextLength ) |
1069 { |
1075 { |
1070 CMdeObjectWrapper::HandleObjectPropertyL(mdeObject, *iPropDefs->iArtistPropertyDef, aVHD.iPerformer, aIsAdd ); |
1076 CMdeObjectWrapper::HandleObjectPropertyL(mdeObject, *iPropDefs->iArtistPropertyDef, aVHD.iPerformer, aIsAdd ); |
1071 } |
1077 } |
1072 |
1078 |
1073 // Description |
1079 // Description |
1074 if( aVHD.iDescription ) |
1080 if( aVHD.iDescription && aVHD.iDescription->Length() < iMaxTextLength ) |
1075 { |
1081 { |
1076 CMdeObjectWrapper::HandleObjectPropertyL(mdeObject, *iPropDefs->iDescriptionPropertyDef, aVHD.iDescription, aIsAdd ); |
1082 CMdeObjectWrapper::HandleObjectPropertyL(mdeObject, *iPropDefs->iDescriptionPropertyDef, aVHD.iDescription, aIsAdd ); |
1077 } |
1083 } |
1078 |
1084 |
1079 // Codec |
1085 // Codec |
1133 aType.Copy( KVideo() ); |
1140 aType.Copy( KVideo() ); |
1134 } |
1141 } |
1135 |
1142 |
1136 MP4ParseClose( handle ); |
1143 MP4ParseClose( handle ); |
1137 } |
1144 } |
|
1145 #else |
|
1146 void CHarvesterVideoPlugin::GetMp4Type( RFile64& /*aFile*/, TDes& /*aType*/ ) |
|
1147 { |
|
1148 } |
|
1149 #endif |
1138 |
1150 |
1139 void CHarvesterVideoPlugin::GetRmTypeL( RFile64& aFile, TDes& aType ) |
1151 void CHarvesterVideoPlugin::GetRmTypeL( RFile64& aFile, TDes& aType ) |
1140 { |
1152 { |
1141 TBool possibleVideo = EFalse; |
1153 TBool possibleVideo = EFalse; |
1142 |
1154 |
1143 CHXMetaDataUtility* helixMetadata = CHXMetaDataUtility::NewL(); |
1155 CHXMetaDataUtility* helixMetadata = CHXMetaDataUtility::NewL(); |
1144 CleanupStack::PushL( helixMetadata ); |
1156 CleanupStack::PushL( helixMetadata ); |
1145 |
1157 |
|
1158 TFileName tempName; |
|
1159 TUint32 mediaId( 0 ); |
|
1160 TInt blackListError( KErrNone ); |
|
1161 |
|
1162 if( iBlacklist ) |
|
1163 { |
|
1164 WRITELOG( "CHarvesterVideoPlugin::GetRmTypeL - Adding URI to blacklist" ); |
|
1165 blackListError = aFile.FullName( tempName ); |
|
1166 if( blackListError == KErrNone ) |
|
1167 { |
|
1168 blackListError = iMediaIdUtil->GetMediaId( tempName, mediaId ); |
|
1169 if( blackListError == KErrNone ) |
|
1170 { |
|
1171 TTime modified ( 0 ); |
|
1172 blackListError = iFs.Modified( tempName, modified ); |
|
1173 if( blackListError == KErrNone ) |
|
1174 { |
|
1175 iBlacklist->AddFile( tempName, mediaId, modified ); |
|
1176 } |
|
1177 } |
|
1178 } |
|
1179 } |
|
1180 |
1146 TRAPD( err, helixMetadata->OpenFileL( aFile ) ); |
1181 TRAPD( err, helixMetadata->OpenFileL( aFile ) ); |
1147 |
1182 |
1148 if( err == KErrNone ) |
1183 if( err == KErrNone ) |
1149 { |
1184 { |
1150 // doesn't own pointers to MIME types |
1185 // doesn't own pointers to MIME types |