Version: 1.5

Posted: 2008-05-09

Build Requirements: Mac OS X 10.4

Runtime Requirements: QuickTime 7. To insert Audio Effects into the recording chain, Mac OS X 10.4 Tiger is required.

View Source Code:

Download Sample (“WhackedTV.zip”, 320.0K)
Download Sample (“WhackedTV.dmg”, 365.5K)



Description

WhackedTV is a replacement for the venerable Carbon HackTV. It shows how to use the Sequence Grabber API's to capture movies from external video and audio sources, just as HackTV, but adds many important new features, including simultaneous capture from multiple SGChannel's, use of the new SGAudioChannel (including a sample Cocoa audio preferences user interface), video preview using ICMDecompressionSessions and OpenGL.

Document Revision History

Date Notes
2008-05-09Fixed two bugs: (1) "Select Output Format" in the audio dialog failed with error -206 if the source audio were set to 20 or 24 bits on an Intel Mac. The source format is 24-bits aligned low in 32-bits. WhackedTV was setting this as the default output format. But QuickTime movies can only contain packed samples. Added a utility function to conform the output format for movie-safety. (2) Began preferring the kQTSGAudioPropertyID_CodecSpecificSettingsArray property to the kQTSGAudioPropertyID_MagicCookie property. See QuickTimeComponents.h for an explanation of the differences between these properties, and why CodecSpecificSettingsArray should always be preferred over MagicCookie.
2008-01-18Fixed a bug in SGAudioSettings.mm where multiple audio devices with the same name would only be listed once.
2007-08-14Updated code for WhackedTV to 1) demonstrate the .noindex technique for holding off Spotlight from prematurely indexing files being written by Sequence Grabber. This avoids frame droppage. 2) demonstrate the newish GainScalarToDecibels property of SGAudioChannel. 3) clean up some of the threaded code (alert dialogs were being invoked from secondary threads).
2007-03-09Added better handling for notifications, including the use of an AutoreleasePool in the SGAudio listener callback, which may be called on non cocoa threads.
2005-07-22Incorporated a workaround for a bug in the SGAudioChannel's kQTSGAudioPropertyID_SoundDescription SetProperty call. This SetProperty call (as of QT 7.0.1) does not correctly clear the previously set output magic cookie, if one exists. So if you choose an output format of AAC, then go to LPCM, the previous format's magic cookie confuses the SGAudioChannel, and it crashes the next time you preview or record. This bug will be fixed in a future software update, but this revision of WhackedTV shows how to work around the problem by setting the output StreamFormat, ChannelLayout, and MagicCookie separately, rather than setting them in one shot with kQTSGAudioPropertyID_SoundDescription SetProperty.
2005-07-15A Cocoa version of the venerable HackTV sample code, demonstrating usage of the Sequence Grabber API's

Did this document help you?
Yes: Tell us what works for you.
It’s good, but: Report typos, inaccuracies, and so forth.
It wasn’t helpful: Tell us what would have helped.