I've been developing a new Movie Import component. Wanting to make
the component able to deal with 64-bit timing, I started using the
new QTSampleTable APIs instead of the old-style AddMediaSampleRef
APIs. The basic loop I use is:
QTSampleTableCreateMutable
QTSampleTableAddSampleReferences for each sample
AddSampleTableToMedia
QTSampleTableRelease
The problem I ran into is that for large sets of samples (>10000),
everything gets incredibly slow. After running through Shark, I
noticed that about 95% of my the time was being spent doing memory
opertations (memcpy, malloc, etc.) by
QTSampleTableAddSampleReferences. What seems to be happening is that
QTSampleTable is not making the table big enough, so when I add a
sample the table often needs to reallocate itself to be larger, then
copy over the old table. This is a really bad situation, because it
essentially makes adding a lot of samples an O(n^2) operation.
Is there some way to speed this up? I noticed
QTSampleTableCreateMutable() has a "hints" which is currently
documented as "reserved". Is there some secret way to pass an
expected sample count here so that the sample table can properly pre-
allocate itself?
-Henry
_______________________________________________
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