• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: syncing core video with core audio
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: syncing core video with core audio


  • Subject: Re: syncing core video with core audio
  • From: Jeff Moore <email@hidden>
  • Date: Fri, 4 May 2007 14:56:30 -0700

CoreVideo and CoreAudio share much of their conception of how time works. You can see this in the commonalities between an AudioTimeStamp and a CVTimeStamp as well as in an AudioDeviceIOProc and a CVDisplayLinkOutputCallback. In fact, much of how the audio HAL's audio devices and CoreVideo's display links operate is very much the same.

The basic principle is that whenever the audio HAL or the display link calls your callback, it provides the time stamp that identifies the point in time when the data you provide is going to go out. These time stamp structures represent the point in time in several different time bases.

By having the same point in time identified in multiple time bases, it makes it easy to convert between the time bases. Indeed, the audio HAL provides the routine AudioDeviceTranslateTime and CoreVideo provides the corresponding CVDisplayLinkTranslateTime routine for just that purpose.


Further, the host time base in both the audio HAL and in CoreVideo is the same. In fact, the underlying API used to provide this time base can be found in <mach/mach_time.h>. The host time base thus becomes the Rosetta Stone for translating between the time base of the video device and the time base of the audio device.


Once you can easily move between the various time bases involved, you can then do the synchronization between the devices using the appropriate scheduling mechanisms for each media.

On May 4, 2007, at 7:43 AM, Chase wrote:

I have a wav file that i'm opening using the "PlayFile" example code in the /Developer/Examples/... folder. I'm also using core video to open a movie file and playing it using a quartz composition. what i need to do is sync them. i want the video to follow the audio clock. How do I set this up

--

Jeff Moore
Core Audio
Apple


_______________________________________________ Do not post admin requests to the list. They will be ignored. Coreaudio-api mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: This email sent to email@hidden
References: 
 >syncing core video with core audio (From: "Chase" <email@hidden>)

  • Prev by Date: Re: Streaming audio to built-in audio device
  • Next by Date: Re: Streaming audio to built-in audio device
  • Previous by thread: syncing core video with core audio
  • Next by thread: Sample times in input procs
  • Index(es):
    • Date
    • Thread