iOS Reference Library Apple Developer
Search

AV Foundation Framework Reference

Framework
/System/Library/Frameworks/AVFoundation.framework
Header file directories
/System/Library/Frameworks/AVFoundation.framework/Headers
Declared in
AVAnimation.h
AVAsset.h
AVAssetExportSession.h
AVAssetImageGenerator.h
AVAssetTrack.h
AVAssetTrackSegment.h
AVAsynchronousKeyValueLoading.h
AVAudioMix.h
AVAudioPlayer.h
AVAudioRecorder.h
AVAudioSession.h
AVAudioSettings.h
AVCaptureDevice.h
AVCaptureInput.h
AVCaptureOutput.h
AVCaptureSession.h
AVCaptureVideoPreviewLayer.h
AVComposition.h
AVCompositionTrack.h
AVCompositionTrackSegment.h
AVError.h
AVMediaFormat.h
AVMetadataFormat.h
AVMetadataItem.h
AVPlayer.h
AVPlayerItem.h
AVPlayerItemTrack.h
AVPlayerLayer.h
AVSynchronizedLayer.h
AVTime.h
AVUtilities.h
AVVideoComposition.h
AVVideoSettings.h

Introduction

The AV Foundation framework provides an Objective-C interface for managing and playing audio-visual media in your iOS application.

Concurrent Programming with AV Foundation

Callouts from AV Foundation—invocations of blocks, key-value observers, or notification handlers—are not guaranteed to be made on any particular thread or queue. Instead, AV Foundation invokes these handlers on threads or queues on which it performs its internal tasks. You are responsible for testing whether the thread or queue on which a handler is invoked is appropriate for the tasks you want to perform. If it’s not (for example, if you want to update the user interface and the callout is not on the main thread), you must redirect the execution of your tasks to a safe thread or queue that you recognize, or that you create for the purpose.

If you’re writing a multithreaded application, you can use the NSThread method isMainThread or [[NSThread currentThread] isEqual:<#A stored thread reference#>] to testing whether the invocation thread is a thread you expect to perform your work on. You can redirect messages to appropriate threads using methods such as performSelectorOnMainThread:withObject:waitUntilDone: and performSelector:onThread:withObject:waitUntilDone:modes:. You could also use dispatch_async to “bounce” to your blocks on an appropriate queue, either the main queue for UI tasks or a queue you have up for concurrent operations. For more about concurrent operations, see Concurrency Programming Guide; for more about blocks, see Blocks Programming Topics.



Last updated: 2010-07-13

Did this document help you? Yes It's good, but... Not helpful...