Expand Minimize Picture-in-picture Power Device Status Voice Recognition Skip Back Skip Forward Minus Plus Play Search
Internet Explorer alert
This browser is not recommended for use with smartdevicelink.com, and may not function properly. Upgrade to a different browser to guarantee support of all features.
close alert
To Top Created with Sketch. To Top
To Bottom Created with Sketch. To Bottom
iOS Documentation
SDLStreamingMediaManager

SDLStreamingMediaManager Class Reference

Section Contents

Overview

Manager to help control streaming (video and audio) media services.

touchManager

Touch Manager responsible for providing touch event notifications.

Objective-C

@property (nonatomic, strong, readonly) SDLTouchManager *_Nonnull touchManager;

Swift

var touchManager: SDLTouchManager { get }

audioManager

Audio Manager responsible for managing streaming audio.

Objective-C

@property (nonatomic, strong, readonly) SDLAudioStreamManager *_Nonnull audioManager;

Swift

var audioManager: SDLAudioStreamManager { get }

rootViewController

This property is used for SDLCarWindow, the ability to stream any view controller. To start, you must set an initial view controller on SDLStreamingMediaConfiguration rootViewController. After streaming begins, you can replace that view controller with a new root by placing the new view controller into this property.

Objective-C

@property (nonatomic, strong, nullable) UIViewController *rootViewController;

Swift

var rootViewController: UIViewController? { get set }

focusableItemManager

A haptic interface that can be updated to reparse views within the window you’ve provided. Send a SDLDidUpdateProjectionView notification or call the updateInterfaceLayout method to reparse. The “output” of this haptic interface occurs in the touchManager property where it will call the delegate.

Objective-C

@property (nonatomic, strong, readonly, nullable) id<SDLFocusableItemLocatorType> focusableItemManager;

streamingSupported

Whether or not video streaming is supported

See

SDLRegisterAppInterface SDLDisplayCapabilities

Objective-C

@property (nonatomic, assign, unsafe_unretained, readonly,
          getter=isStreamingSupported) BOOL streamingSupported;

Swift

var isStreamingSupported: Bool { get }

videoConnected

Whether or not the video session is connected.

Objective-C

@property (nonatomic, assign, unsafe_unretained, readonly,
          getter=isVideoConnected) BOOL videoConnected;

Swift

var isVideoConnected: Bool { get }

videoEncrypted

Whether or not the video session is encrypted. This may be different than the requestedEncryptionType.

Objective-C

@property (nonatomic, assign, unsafe_unretained, readonly,
          getter=isVideoEncrypted) BOOL videoEncrypted;

Swift

var isVideoEncrypted: Bool { get }

audioConnected

Whether or not the audio session is connected.

Objective-C

@property (nonatomic, assign, unsafe_unretained, readonly,
          getter=isAudioConnected) BOOL audioConnected;

Swift

var isAudioConnected: Bool { get }

audioEncrypted

Whether or not the audio session is encrypted. This may be different than the requestedEncryptionType.

Objective-C

@property (nonatomic, assign, unsafe_unretained, readonly,
          getter=isAudioEncrypted) BOOL audioEncrypted;

Swift

var isAudioEncrypted: Bool { get }

videoStreamingPaused

Whether or not the video stream is paused due to either the application being backgrounded, the HMI state being either NONE or BACKGROUND, or the video stream not being ready.

Objective-C

@property (nonatomic, assign, unsafe_unretained, readonly,
          getter=isVideoStreamingPaused) BOOL videoStreamingPaused;

Swift

var isVideoStreamingPaused: Bool { get }

screenSize

The current screen resolution of the connected display in pixels.

Objective-C

@property (nonatomic, readonly) CGSize screenSize;

Swift

var screenSize: CGSize { get }

videoFormat

This is the agreed upon format of video encoder that is in use, or nil if not currently connected.

Objective-C

@property (nonatomic, strong, readonly, nullable) SDLVideoStreamingFormat *videoFormat;

Swift

var videoFormat: SDLVideoStreamingFormat? { get }

supportedFormats

A list of all supported video formats by this manager

Objective-C

@property (nonatomic, strong, readonly) NSArray<SDLVideoStreamingFormat *> *_Nonnull supportedFormats;

Swift

var supportedFormats: [SDLVideoStreamingFormat] { get }

pixelBufferPool

The pixel buffer pool reference returned back from an active VTCompressionSessionRef encoder.

Warning

This will only return a valid pixel buffer pool after the encoder has been initialized (when the video session has started). @discussion Clients may call this once and retain the resulting pool, this call is cheap enough that it’s OK to call it once per frame.

Objective-C

@property (nonatomic, readonly, nullable) CVPixelBufferPoolRef pixelBufferPool;

Swift

unowned(unsafe) var pixelBufferPool: CVPixelBufferPool? { get }

requestedEncryptionType

The requested encryption type when a session attempts to connect. This setting applies to both video and audio sessions.

DEFAULT: SDLStreamingEncryptionFlagAuthenticateAndEncrypt

Objective-C

@property (nonatomic) SDLStreamingEncryptionFlag requestedEncryptionType;

Swift

var requestedEncryptionType: SDLStreamingEncryptionFlag { get set }

showVideoBackgroundDisplay

When YES, the StreamingMediaManager will send a black screen with “Video Backgrounded String”. Defaults to YES.

Objective-C

@property (nonatomic) BOOL showVideoBackgroundDisplay;

Swift

var showVideoBackgroundDisplay: Bool { get set }

-init

Initializer unavailable

Objective-C

- (nonnull instancetype)init;

-initWithConnectionManager:configuration:systemCapabilityManager:

Create a new streaming media manager for navigation and projection apps with a specified configuration.

Objective-C

- (nonnull instancetype)
    initWithConnectionManager:
        (nonnull id<SDLConnectionManagerType>)connectionManager
                configuration:(nonnull SDLConfiguration *)configuration
      systemCapabilityManager:
          (nullable SDLSystemCapabilityManager *)systemCapabilityManager;

Parameters

connectionManager

The pass-through for RPCs

configuration

This session’s configuration

systemCapabilityManager

The system capability manager object for reading window capabilities

-startWithProtocol:

Start the manager. This is used internally. To use an SDLStreamingMediaManager, you should use the manager found on SDLManager.

Objective-C

- (void)startWithProtocol:(nonnull SDLProtocol *)protocol;

Swift

func start(with protocol: SDLProtocol)

-stop

Stop the manager. This method is used internally.

Objective-C

- (void)stop;

Swift

func stop()

-stopAudio

Stop the audio feature of the manager. This method is used internally.

Objective-C

- (void)stopAudio;

Swift

func stopAudio()

-stopVideo

Stop the video feature of the manager. This method is used internally.

Objective-C

- (void)stopVideo;

Swift

func stopVideo()

-sendVideoData:

This method receives raw image data and will run iOS8+‘s hardware video encoder to turn the data into a video stream, which will then be passed to the connected head unit.

Objective-C

- (BOOL)sendVideoData:(nonnull CVImageBufferRef)imageBuffer;

Swift

func sendVideoData(_ imageBuffer: CVImageBuffer) -> Bool

Parameters

imageBuffer

A CVImageBufferRef to be encoded by Video Toolbox

Return Value

Whether or not the data was successfully encoded and sent.

-sendVideoData:presentationTimestamp:

This method receives raw image data and will run iOS8+‘s hardware video encoder to turn the data into a video stream, which will then be passed to the connected head unit.

Objective-C

- (BOOL)sendVideoData:(nonnull CVImageBufferRef)imageBuffer
    presentationTimestamp:(CMTime)presentationTimestamp;

Swift

func sendVideoData(_ imageBuffer: CVImageBuffer, presentationTimestamp: CMTime) -> Bool

Parameters

imageBuffer

A CVImageBufferRef to be encoded by Video Toolbox

presentationTimestamp

A presentation timestamp for the frame, or kCMTimeInvalid if timestamp is unknown. If it’s valid, it must be greater than the previous one.

Return Value

Whether or not the data was successfully encoded and sent.

-sendAudioData:

This method receives PCM audio data and will attempt to send that data across to the head unit for immediate playback.

NOTE: See the .audioManager (SDLAudioStreamManager) pushWithData: method for a more modern API.

Objective-C

- (BOOL)sendAudioData:(nonnull NSData *)audioData;

Swift

func sendAudioData(_ audioData: Data) -> Bool

Parameters

audioData

The data in PCM audio format, to be played

Return Value

Whether or not the data was successfully sent.

View on GitHub.com
Previous Section Next Section