static OSErr SpriteUtils_GetImageGroupID (QTAtomContainer theKeySample, QTAtom theImagesContainerAtom, short theImageIndex, long *theGroupID)
{
	QTAtom			myImageAtom, myImageGroupAtom;
	OSErr			myErr = noErr;

	myImageAtom = QTFindChildByIndex(theKeySample, theImagesContainerAtom, kSpriteImageAtomType, theImageIndex, NULL);
	if (myImageAtom == 0)	{ 
		myErr = cannotFindAtomErr;
		goto bail;
	}

	myImageGroupAtom = QTFindChildByIndex(theKeySample, myImageAtom, kSpriteImageGroupIDAtomType, 1, NULL);
	
	if (myImageGroupAtom == 0)
		*theGroupID = 0;
	else {
		myErr = QTCopyAtomDataToPtr(theKeySample, myImageGroupAtom, false, sizeof(*theGroupID), (Ptr)theGroupID, NULL);
		if (myErr != noErr)
			goto bail;

		*theGroupID = EndianU32_BtoN(*theGroupID);		// return native endian long
	}
	
bail:
	return(myErr);
}
Ejemplo n.º 2
0
void pix_videoDarwin :: brightnessMess(float X)
{

    QTAtomContainer         atomContainer;
    QTAtom                  featureAtom;
    VDIIDCFeatureSettings   settings;
    ComponentDescription    desc;
    ComponentResult         result = paramErr;

    //check if device is IIDC
    GetComponentInfo((Component)m_vdig, &desc, NULL, NULL, NULL);
    if (vdSubtypeIIDC != desc.componentSubType){

        m_brightness = (unsigned short)(65536. * X);
        VDSetBrightness(m_vdig,&m_brightness);

        VDGetBrightness(m_vdig,&m_brightness);
        post("brightness is %d",m_brightness);
    }
    else
    {
    //IIDC stuff
    //these things are as stubborn as they are stupid - find one that conforms to spec!

    //vdIIDCFeatureBrightness
    result = VDIIDCGetFeaturesForSpecifier(m_vdig, vdIIDCFeatureBrightness, &atomContainer);
    if (noErr != result) {
        error("VDIIDCGetFeaturesForSpecifier returned %d",result);
    }

    featureAtom = QTFindChildByIndex(atomContainer, kParentAtomIsContainer,
                                         vdIIDCAtomTypeFeature, 1, NULL);
    if (0 == featureAtom) error("featureAtom not found");

    result = QTCopyAtomDataToPtr(atomContainer,
                                     QTFindChildByID(atomContainer, featureAtom,
                                     vdIIDCAtomTypeFeatureSettings,
                                     vdIIDCAtomIDFeatureSettings, NULL),
                                     true, sizeof(settings), &settings, NULL);

    settings.state.flags = (vdIIDCFeatureFlagOn |
                                        vdIIDCFeatureFlagManual |
                                        vdIIDCFeatureFlagRawControl);

    settings.state.value = X;

    result = QTSetAtomData(atomContainer,
                                       QTFindChildByID(atomContainer, featureAtom,
                                       vdIIDCAtomTypeFeatureSettings,
                                       vdIIDCAtomIDFeatureSettings, NULL),
                                       sizeof(settings), &settings);

    result = VDIIDCSetFeatures(m_vdig, atomContainer);

    }
}
Ejemplo n.º 3
0
void pix_videoDarwin :: gainMess(float X)
{

    QTAtomContainer         atomContainer;
    QTAtom                  featureAtom;
    VDIIDCFeatureSettings   settings;
    ComponentDescription    desc;
    ComponentResult         result = paramErr;

    //check if device is IIDC
    GetComponentInfo((Component)m_vdig, &desc, NULL, NULL, NULL);
    if (vdSubtypeIIDC == desc.componentSubType){

    //IIDC stuff
    //vdIIDCFeatureGain
    result = VDIIDCGetFeaturesForSpecifier(m_vdig, vdIIDCFeatureWhiteBalanceU, &atomContainer);
    if (noErr != result) {
        error("VDIIDCGetFeaturesForSpecifier vdIIDCFeatureExposure returned %d",result);
    }

    featureAtom = QTFindChildByIndex(atomContainer, kParentAtomIsContainer,
                                         vdIIDCAtomTypeFeature, 1, NULL);
    if (0 == featureAtom) error("featureAtom vdIIDCFeatureExposure not found");

    result = QTCopyAtomDataToPtr(atomContainer,
                                     QTFindChildByID(atomContainer, featureAtom,
                                     vdIIDCAtomTypeFeatureSettings,
                                     vdIIDCAtomIDFeatureSettings, NULL),
                                     true, sizeof(settings), &settings, NULL);

    settings.state.flags = (vdIIDCFeatureFlagOn |
                                        vdIIDCFeatureFlagManual |
                                        vdIIDCFeatureFlagRawControl);

    settings.state.value = X;

    result = QTSetAtomData(atomContainer,
                                       QTFindChildByID(atomContainer, featureAtom,
                                       vdIIDCAtomTypeFeatureSettings,
                                       vdIIDCAtomIDFeatureSettings, NULL),
                                       sizeof(settings), &settings);

    result = VDIIDCSetFeatures(m_vdig, atomContainer);

    }
}