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: buffering time



You can also use QTSMediaSetInfo.  Here's my code to set the delay.  Kevin,
what are the advantages of using the Presentation API, and what are the
units of the delay (ie, how long is 1 << 16)?

--Brian

I find delay values like 1 << 16, 1 << 15, and 3 << 16 seem to work well.

// In this function, theMovie may be held when the movie is opened
bool SetDelay(Movie theMovie, Fixed delayValue) {
	Track theTrack;
	theTrack  = GetMovieIndTrackType(
		theMovie,
		1, // The "Index" value to be returned by GetMovieIndTrackType
		kQTSStreamMediaType, // The type.
		movieTrackMediaType); // The calling method.
	if ((int)theTrack == -50)  { // paramErr
		printf("Invalid Parameter to SetBufferDelay.");
		return false;
	}
	else if ((int)theTrack == -2010) {
		printf("Invalid Movie in SetBufferDelay.");
		return false;
	}
	else if ((int)theTrack == -2028) {
		printf("Invalid track in SetBufferDelay.");
		return false;
	}

	// Otherwise, we have a track.
	Media theMedia;
	theMedia = GetTrackMedia(theTrack);
	if ((int)theMedia == -2009) {
		printf("Invalid Track.");
		return false;
	}
	MediaHandler theMediaHandler;
	theMediaHandler = GetMediaHandler(theMedia);
	if ((int)theMediaHandler == -2008) {
		printf("Invalid Media passed to GetMediaHandler");
		return false;
	}

	ComponentResult c;
	c = QTSMediaSetInfo(theMediaHandler, kQTSTargetBufferDurationInfo,
&delayValue);
	return true;
}


---------------------------
Brian Rosenthal
Chief Technology Officer
XCiteMedia, Inc.
email@hidden


References: 
 >Re: buffering time (From: Kevin Marks <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.