Mailing Lists: Apple Mailing Lists

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

FieldInfoImageDescriptionExtension2::detail documentation?




Hi,

I am looking at ways to specify the interlacing properties of DV movies in MOV reference files.
The FieldInfoImageDescriptionExtension2 structure has 2 fields:
fields: interlaced or progressive scan
detail: which can have these values:
  1. temporalTopFirst
  2. temporalBottomFirst
  3. spatialFirstLineEarly
  4. spatialFirstLineLate

Can someone explain what these values mean and to what properties of the DV frames they correspond?
Where is this documented?  What is the difference between temporal and spatial?
Also, are these properties relevant for MPEG2 files?

Thanks
Michael

// Use ICM GetPropertyInfo to access advanced frame description properties.
// http://developer.apple.com/qa/qa2007/qa1547.html
// true = interlaced, false=progressive scan.
OSStatus setInterlaced(ImageDescriptionHandle desc, bool interlaced, FieldDetail fieldDetail)
{
                // get the size of the returned property
                ByteCount propertyValueSize = 0;
                ComponentValueType propertyType = 0;
                UInt32 propertyFlags = 0;

                OSStatus status = ICMImageDescriptionGetPropertyInfo(desc,
                                 kQTPropertyClass_ImageDescription,
                                 kICMImageDescriptionPropertyID_FieldInfo,
                                 &propertyType,
                                 &propertyValueSize,
                                 &propertyFlags);
                if (noErr != status) goto bail;

                // get the FieldInfo property - for more information see ImageCodec.h
                FieldInfoImageDescriptionExtension2 *fieldInfo = NULL;
                fieldInfo = (FieldInfoImageDescriptionExtension2 *)calloc(1, propertyValueSize);
                fieldInfo->fields = (interlaced ? kQTFieldsInterlaced : kQTFieldsProgressiveScan);
                fieldInfo->detail = (UInt8)fieldDetail;
                status = ICMImageDescriptionSetProperty(desc,
                                 kQTPropertyClass_ImageDescription,
                                 kICMImageDescriptionPropertyID_FieldInfo,
                                 propertyValueSize,
                                 fieldInfo);
bail:
                if (NULL != fieldInfo) free(fieldInfo);
                return status;
}

// http://developer.apple.com/qa/qa2007/qa1547.html
bool isInterlaced(Track videoTrack)
{
                Media media = 0;
                bool isInterlaced = false;  // assume progressive
                FieldInfoImageDescriptionExtension2 *fieldInfo = NULL;
                ImageDescriptionHandle desc = NULL;

                if (0 == videoTrack) goto bail;
                // get the tracks media
                media = GetTrackMedia(videoTrack);
                if (0 == media) goto bail;
                // grab the image description
                desc = (ImageDescriptionHandle)NewHandle(0);
                if (NULL == desc) goto bail;
                GetMediaSampleDescription(media, 1, (SampleDescriptionHandle)desc);

                // get the size of the returned property
                ByteCount propertyValueSize = 0;
                ComponentValueType propertyType = 0;
                UInt32 propertyFlags = 0;

                OSStatus status = ICMImageDescriptionGetPropertyInfo(desc,
                                 kQTPropertyClass_ImageDescription,
                                 kICMImageDescriptionPropertyID_FieldInfo,
                                 &propertyType,
                                 &propertyValueSize,
                                 &propertyFlags);
                if (noErr != status) goto bail;

                // get the FieldInfo property - for more information see ImageCodec.h
                fieldInfo = (FieldInfoImageDescriptionExtension2 *)calloc(1, propertyValueSize);

                status = ICMImageDescriptionGetProperty(desc,
                                 kQTPropertyClass_ImageDescription,
                                 kICMImageDescriptionPropertyID_FieldInfo,
                                 propertyValueSize,
                                 fieldInfo,
                                 NULL);
                if (noErr == status) {
                                 isInterlaced = (fieldInfo->fields == kQTFieldsInterlaced);
                }
bail:
                if (NULL != desc) DisposeHandle((Handle)desc);
                if (NULL != fieldInfo) free(fieldInfo);
                return isInterlaced;
}

 _______________________________________________
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



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.