Changeset 166
- Timestamp:
- 07/20/07 22:32:54 (1 year ago)
- Files:
-
- trunk/SapphireMetaData.m (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/SapphireMetaData.m
r164 r166 1115 1115 /*Get the audio track*/ 1116 1116 QTTrack *track = [audioTracks objectAtIndex:0]; 1117 NSString *formatText = [track attributeForKey:@"QTTrackFormatSummaryAttribute"];1118 if(formatText != nil)1119 [fileMeta setObject:formatText forKey:AUDIO_DESC_KEY];1120 1117 QTMedia *media = [track media]; 1121 1118 audioSampleRate = [media attributeForKey:QTMediaTimeScaleAttribute]; … … 1129 1126 ByteCount propSize = 0; 1130 1127 QTSoundDescriptionGetProperty((SoundDescriptionHandle)sampleDesc, kQTPropertyClass_SoundDescription, kQTSoundDescriptionPropertyID_AudioStreamBasicDescription, sizeof(asbd), &asbd, &propSize); 1131 DisposeHandle(sampleDesc);1132 1128 1133 1129 if(propSize != 0) … … 1137 1133 [fileMeta setObject:format forKey:AUDIO_FORMAT_KEY]; 1138 1134 } 1135 1136 CFStringRef userText = nil; 1137 propSize = 0; 1138 QTSoundDescriptionGetProperty((SoundDescriptionHandle)sampleDesc, kQTPropertyClass_SoundDescription, kQTSoundDescriptionPropertyID_UserReadableText, sizeof(userText), &userText, &propSize); 1139 if(userText != nil) 1140 { 1141 /*Set the description*/ 1142 [fileMeta setObject:(NSString *)userText forKey:AUDIO_DESC_KEY]; 1143 CFRelease(userText); 1144 } 1145 DisposeHandle(sampleDesc); 1139 1146 } 1140 1147 } … … 1147 1154 /*Get the video track*/ 1148 1155 QTTrack *track = [videoTracks objectAtIndex:0]; 1149 NSString *formatText = [track attributeForKey:QTTrackDisplayNameAttribute]; 1150 if(formatText != nil) 1151 [fileMeta setObject:formatText forKey:VIDEO_DESC_KEY]; 1156 QTMedia *media = [track media]; 1157 if(media != nil) 1158 { 1159 /*Get the video description*/ 1160 Media qtMedia = [media quickTimeMedia]; 1161 Handle sampleDesc = NewHandle(1); 1162 GetMediaSampleDescription(qtMedia, 1, (SampleDescriptionHandle)sampleDesc); 1163 CFStringRef userText = nil; 1164 ByteCount propSize = 0; 1165 ICMImageDescriptionGetProperty((ImageDescriptionHandle)sampleDesc, kQTPropertyClass_ImageDescription, kICMImageDescriptionPropertyID_SummaryString, sizeof(userText), &userText, &propSize); 1166 DisposeHandle(sampleDesc); 1167 1168 if(userText != nil) 1169 { 1170 /*Set the description*/ 1171 [fileMeta setObject:(NSString *)userText forKey:VIDEO_DESC_KEY]; 1172 CFRelease(userText); 1173 } 1174 } 1152 1175 } 1153 1176 /*Add the meta data*/
