我正在制作一个客户端原型,该客户端通过 quicktime 客户端显示来自 HaiVision Barracuda 的流式视频。我一直无法将缓冲区大小减少到 3.0 秒以下......对于这个应用程序,我们需要网络允许的尽可能低的延迟,并且更喜欢视频丢失而不是延迟。我正在执行以下操作:
- (void)applicationDidFinishLaunching:(NSNotification *)aNotification {
NSString *path = [[NSBundle mainBundle] pathForResource:@"haivision" ofType:@"sdp"];
NSError *error = nil;
QTMovie *qtmovie = [QTMovie movieWithFile:path error:&error];
if( error != nil ) {
NSLog(@"error: %@", [error localizedDescription]);
}
Movie movie = [qtmovie quickTimeMovie];
long trackCount = GetMovieTrackCount(movie);
Track theTrack = GetMovieTrack(movie,1);
Media theMedia = GetTrackMedia(theTrack);
MediaHandler theMediaHandler = GetMediaHandler(theMedia);
QTSMediaPresentationParams myPres;
ComponentResult c = QTSMediaGetIndStreamInfo(theMediaHandler, 1,kQTSMediaPresentationInfo,
&myPres);
Fixed shortdelay = 1<<15;
OSErr theErr = QTSPresSetInfo (myPres.presentationID,
kQTSAllStreams,
kQTSTargetBufferDurationInfo,
&shortdelay );
NSLog(@"OSErr %d", theErr);
[movieView setMovie:qtmovie];
[movieView play:self];
}
尽管 ComponentResult 和 OSErr 都返回 -50,但我似乎一直在获取有效的对象/结构直到 QTSPres。流式视频播放正常,但缓冲区仍为 3.0 秒。任何帮助/见解表示赞赏。
Ĵ