Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: needs help - changing default compression doesn't work properly in intel mac



All QuickTime atoms in the movie export settings atom containers must be stored Big Endian.  We do this  in order to make them portable.  This explains why your code works on PPC but not on Intel.  On Intel, you are storing your settings little endian.  They are interpreted by the exporter as being big endian, and flipped big to little.  So you need to flip them native to big before calling SetAtomData, etc.

-Brad Ford
QuickTime Engineering

On Mar 26, 2007, at 3:27 AM, sandeep chandran wrote:

 
Hi
the followig code is working perfectly in PPC mac and is not working in intel mac. can
anyone tell me where i went wrong?



ComponentInstance ci = OpenDefaultComponent(MovieExportType, kQTFileTypeMovie);
    if (ci) {
        Boolean canceled;
        CFDataRef theData;
       
        // first time though, set up some default settings
        if (NULL == gExportSettings) {
            SCSpatialSettings ss;
            UInt8 falseSetting = false;                      
         ss.codecType = kMPEG4VisualCodecType;//kH264CodecType;
            ss.codec = NULL;
            ss.depth = 0;
            ss.spatialQuality = codecHighQuality;
                     
          MovieExportGetSettingsAsAtomContainer(ci, &gExportSettings);
      
           // video options
            QTAtom videAtom = QTFindChildByID(gExportSettings, kParentAtomIsContainer,
kQTSettingsVideo, 1, NULL);
            if (videAtom) {
                // spatial
              QTAtom  sptlAtom = QTFindChildByID(gExportSettings, videAtom,
scSpatialSettingsType, 1, NULL);
                if (sptlAtom) {
                    QTSetAtomData(gExportSettings, sptlAtom, sizeof(SCSpatialSettings), &ss);
                }
          }
          QTAtom soundAtom = QTFindChildByID( gExportSettings,
kParentAtomIsContainer, kQTSettingsSound, 1, NULL );
          if (soundAtom == 0)
               QTInsertChild( gExportSettings, kParentAtomIsContainer,
kQTSettingsSound, 1, 0, 0, nil, &soundAtom );
          long aLong = kMPEG4AudioFormat; //kAudioFormatMPEG4AAC
          QTAtom compAtom = QTFindChildByID(gExportSettings, soundAtom,
scSoundCompressionType, 1, NULL);
          QTSetAtomData(gExportSettings, compAtom, sizeof(aLong), &aLong);
     
          }
          
          
      MovieExportSetSettingsFromAtomContainer(ci, gExportSettings);
          
          Handle sourceDataRef = NULL;
          OSType sourceDataRefType;              
          short resId = movieInDataForkResID;
               
          // create data references from the FSRefs
          QTNewDataReferenceFromFSRef(&sourceRef, 0, &sourceDataRef,
&sourceDataRefType);          
          QTNewDataReferenceFromFSRef(&destRef, 0, &destDataRef, &destDataRefType);
          
          NewMovieFromDataRef(&sourceMovie, newMovieActive, &resId, sourceDataRef,
sourceDataRefType);
     
          
          ConvertMovieToDataRef(sourceMovie, 0, destDataRef,
destDataRefType,kQTFileTypeMovie, FOUR_CHAR_CODE
('TVOD'),createMovieFileDeleteCurFile | createMovieFileDontCreateResFile,ci);





regards

Sandeep
          

Sandeep A.C
(Visit me at: http://sandeepcnair.wetpaint.com )







                 

                                                                       

monster
 _______________________________________________
Do not post admin requests to the list. They will be ignored.
QuickTime-API mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

 _______________________________________________
Do not post admin requests to the list. They will be ignored.
QuickTime-API mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/quicktime-api/email@hidden

This email sent to email@hidden

References: 
 >needs help - changing default compression doesn't work properly in intel mac (From: "sandeep chandran" <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.