| Inherits from | |
| Conforms to | |
| Framework | /System/Library/Frameworks/InstantMessage.framework |
| Availability | Available in Mac OS X v10.5 and later. |
| Companion guide | |
| Declared in | IMAVManager.h |
| Related sample code |
The IMAVManager class is used to manage the state and configuration of auxiliary audio/video input to iChat AV—a feature that is called iChat Theater. There is only one shared instance of the IMAVManager class.
The IMAVManager shared object allows clients to provide audio and video to a running conference in iChat AV. Video is provided by supplying a data source object to receive periodic callbacks for individual frames, and audio is provided through an audio device and channel. The state of the shared IMAVManager object allows clients to configure the user interface appropriately.
Returns the shared instance of the IMAVManager object, creating it if the object doesn’t exist yet.
+ (IMAVManager *)sharedAVManager
The shared IMAVManager object.
IMAVManager.hReturns an array of audio device channel numbers used by the receiver.
- (NSArray *)audioDeviceChannels
An array of audio device channel numbers. If the number of audio channels is set to 2, then the first number in the array is the left channel and the second number is the right channel. Returns nil if the receiver is not in the IMAVRunning state. Also returns nil if the setNumberOfAudioChannels: method is not invoked prior to invoking this method with 1 or 2 as the argument.
IMAVManager.hReturns the audio device UID.
- (NSString *)audioDeviceUID
A valid UID when the receiver is in the IMAVRunning state; otherwise, nil. Also returns nil if the setNumberOfAudioChannels: method is not invoked prior to invoking this method with 1 or 2 as the argument.
You can obtain the device by calling the AudioHardwareGetProperty function with the returned UID and the kAudioHardwarePropertyDeviceForUID constant as arguments.
IMAVManager.hReturns the receiver’s control bar.
- (IMAVControlBar *)controlBar
The control bar configured for use by the receiver.
IMAVManager.hReturns the number of audio channels.
- (NSInteger)numberOfAudioChannels
The number of audio channels.
IMAVManager.hSets the number of audio channels.
- (void)setNumberOfAudioChannels:(NSInteger)count
The number of audio channels to configure. The allowed values are 0, 1, and 2. If 0, audio is disabled. If 1, audio is set to mono, and if 2, audio is stereo.
Sets the number of audio channels that are configured after invoking start.
IMAVManager.hSets the receiver’s video data source object that provides video data to iChat AV.
- (void)setVideoDataSource:(id)dataSource
An object that conforms to the IMVideoDataSource informal protocol. The object needs to respond to either the renderIntoPixelBuffer:forTime: and getPixelBufferPixelFormat: methods, or therenderIntoOpenGLBuffer:onScreen:forTime: and getOpenGLBufferContext:pixelFormat: methods for OpenGL content. Any NSView object can also be a video data source. The Instant Message framework adds video rendering capabilities to NSView and all its subclasses. Pass nil to remove the receiver’s video data source. The data source is not retained by the receiver.
IMAVManager.hSets the video optimization options.
- (void)setVideoOptimizationOptions:(IMVideoOptimizationOptions)options
Indicates the characteristics of the video content. Possible values are described in “IMVideoOptimizationOptions”.
Use this method to give hints to the receiver about the type of video content so it can optimize the CPU and bandwidth usage.
IMAVManager.hStarts sending audio and video to iChat AV.
- (void)start
This method should be called when the receiver's state changes to IMAVRequested. If this method is successful, the receiver's state changes to IMAVRunning, after possibly changing momentarily to IMAVStartingUp and IMAVPending.
Before invoking this method, you need to set the video source using the setVideoDataSource: method to provide video content, or set the number of audio channels to greater than 0 using the setNumberOfAudioChannels: method to provide audio content; otherwise, this method raises an exception.
This method has no effect if invoked when the receiver is not in the IMAVRequested state.
IMAVManager.hReturns the current state of the receiver.
- (IMAVManagerState)state
The current state of the receiver set by iChat AV. See “IMAVManagerState” for a description of the possible return values.
IMAVManager.hStops sending audio and video to iChat AV.
- (void)stop
After this method is invoked the state changes to IMAVRequested, after possibly changing momentarily to IMAVShuttingDown.
IMAVManager.hReturns the file URL of the document that the user chose to share over iChat Theater.
- (NSURL *)URLToShare
Returns the file URL of the document or nil if the receiver's state is IMAVInactive. Also returns nil if the user chose this application to share audio/video without a document.
IMAVManager.hReturns the receiver’s video data source object.
- (id)videoDataSource
The receiver’s video data source, or nil if it is not set.
IMAVManager.hReturns the video optimization options.
- (IMVideoOptimizationOptions)videoOptimizationOptions
Video optimization options. Possible values are described in “IMVideoOptimizationOptions”.
IMAVManager.hThe state of an IMAVManager object.
enum {
IMAVInactive = 0,
IMAVRequested = 1,
IMAVShuttingDown = 2,
IMAVStartingUp = 3,
IMAVPending = 4,
IMAVRunning = 5
};
typedef NSUInteger IMAVManagerState;
IMAVInactiveAn IMAVManager object is not available to send audio/video to iChat AV because the user has not started a session.
Available in Mac OS X v10.5 and later.
Declared in IMAVManager.h.
IMAVRequestedThe user selected this client to begin iChat Theater. The client should send start to the IMAVManager object to begin an iChat Theater session.
Available in Mac OS X v10.5 and later.
Declared in IMAVManager.h.
IMAVStartingUpAn IMAVManager object is starting up and will soon change to the IMAVPending or IMAVRunning state.
Available in Mac OS X v10.5 and later.
Declared in IMAVManager.h.
IMAVPendingiChat AV is not ready to receive content from an IMAVManager object.
An IMAVManager object may enter this state after the start method is invoked when iChat AV is not ready to receive audio/video content. This state may be followed by IMAVRunning at any point.
Typically, this state is entered if either the user does not yet have a video chat active or some internal processing or negotiation needs to take place before auxiliary audio/video input can begin. If the user does not have a video chat active, the state changes to IMAVRunning when a chat starts.
Available in Mac OS X v10.5 and later.
Declared in IMAVManager.h.
IMAVRunningAn IMAVManager object is actively sending audio/video content to iChat AV.
You should not send audio/video content to an IMAVManager object until it reaches this state. For example, do not send audio/video content to an IMAVManager object immediately after sending start to the manager unless the manager is in this state.
Available in Mac OS X v10.5 and later.
Declared in IMAVManager.h.
IMAVShuttingDownAn IMAVManager object is shutting down and will soon change to the IMAVInactive state.
Available in Mac OS X v10.5 and later.
Declared in IMAVManager.h.
InstantMessage/IMAVManager.hThe characteristics of the video source to allow for optimization of CPU and bandwidth usage.
enum {
IMVideoOptimizationDefault = 0,
IMVideoOptimizationStills = 1 << 0,
IMVideoOptimizationReplacement = 1 << 1,
};
typedef NSUInteger IMVideoOptimizationOptions;
IMVideoOptimizationDefaultShared video is played alongside the user's local video, and the video is full-motion. This is the default.
Available in Mac OS X v10.5 and later.
Declared in IMAVManager.h.
IMVideoOptimizationStillsSet this flag if video will be largely static. This tells iChat Theater to attempt to optimize the video resolution for still images, rather than rapidly changing video.
Available in Mac OS X v10.5 and later.
Declared in IMAVManager.h.
IMVideoOptimizationReplacementDo not send the user's local video, instead devote full CPU and bandwidth resources to the shared video.
Available in Mac OS X v10.5 and later.
Declared in IMAVManager.h.
InstantMessage/IMAVManager.hPosted by the IMService class custom notification center when the iChat AV input state changes.
The notification object is the shared IMAVManager object. This notification does not have a user information dictionary. Observers of this notification should send state to the shared IMAVManager object to get the new state.
When the user selects this application or one of its documents to share over iChat Theater, the state of the shared IMAVManager object changes to IMAVRequested and this notification is sent.
IMAVManager.hPosted by the IMService class custom notification center when a new document is selected by the user to share over iChat Theater during a running session.
The notification object is the shared IMAVManager object. This notification does not have a user information dictionary. Observers of this notification should send URLToShare to the shared IMAVManager object to get the new document. This notification is not sent the first time the state of the shared IMAVManager object changes to IMAVRequested to begin the session.
IMAVManager.h
Last updated: 2009-05-05