Changeset 166

Show
Ignore:
Timestamp:
07/20/07 22:32:54 (1 year ago)
Author:
pmerrill
Message:

Seems the "elegant method" doesn't work on the AppleTV, reverted part of [156]

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/SapphireMetaData.m

    r164 r166  
    11151115                        /*Get the audio track*/ 
    11161116                        QTTrack *track = [audioTracks objectAtIndex:0]; 
    1117                         NSString *formatText = [track attributeForKey:@"QTTrackFormatSummaryAttribute"]; 
    1118                         if(formatText != nil) 
    1119                                 [fileMeta setObject:formatText forKey:AUDIO_DESC_KEY]; 
    11201117                        QTMedia *media = [track media]; 
    11211118                        audioSampleRate = [media attributeForKey:QTMediaTimeScaleAttribute]; 
     
    11291126                                ByteCount       propSize = 0; 
    11301127                                QTSoundDescriptionGetProperty((SoundDescriptionHandle)sampleDesc, kQTPropertyClass_SoundDescription, kQTSoundDescriptionPropertyID_AudioStreamBasicDescription, sizeof(asbd), &asbd, &propSize); 
    1131                                 DisposeHandle(sampleDesc); 
    11321128                                 
    11331129                                if(propSize != 0) 
     
    11371133                                        [fileMeta setObject:format forKey:AUDIO_FORMAT_KEY]; 
    11381134                                } 
     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); 
    11391146                        } 
    11401147                } 
     
    11471154                        /*Get the video track*/ 
    11481155                        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                        }  
    11521175                } 
    11531176                /*Add the meta data*/