if (delta <1 / videoFrameRate) {
// Video in sync with audio
syncStatus = SYNC_READY;
}
if (delta <1 / videoFrameRate) {
// Video in sync with audio
syncStatus = SYNC_READY;
}
In reference to this thread:
https://developer.vuforia.com/forum/ios/ios-8-video-playback-frame-rate-0
the suggested code change ( ...[[NSThread currentThread] setThreadPriority:0.5] ...) is meant to give a "hint" to the OS, so that the video timer thread is not "left behind" other tasks;
however, setting the thread priority does not provide a deterministic guarantee of the actual execution timing; for example, if your Application is running additional CPU-intensive tasks, the OS may pick up your timer at a lower frequency than in a case where the CPU load is low;
this may also vary from one device (CPU) to another, for example, a faster and/or multi-core CPU might be able to handle many more tasks simultaneously without impacting the average callback rate of your timer.
You mention:
- I implements other process with AR marker finding.This process will take a load on the CPU (more than Vuforia Playback Sample.)
this sounds like you are probably loading your device CPU (and possibly other resources, such as memory and GPU) more severely than in the VP sample app, with a resulting side effect on the video timer execution rate.
Have you checked if there are any opportunities of code optimization in your App, that could save or reduce some of the CPU load ?
Another thing to consider is the video format and resolution; for example, if the resolution of your video is very large, it could take a lot more time and a lot more CPU to upload each frame to the video texture.
See also latest comment here:
https://developer.vuforia.com/forum/unity-extension-technical-discussion/videoplayback-video-freeze-after-first-frames-xcode-71-io
it seems some combination of device + iOS version may be subject to a more severe CPU overhead (as you also observed), in general, but in particular when running connected to Xcode; on the other hand, accoridng to the thread above, if you run disconnected from Xcode, things should run much smoother; also worth comparing debug mode with release mode