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
Android Documentation
VideoStreamManager

Class VideoStreamManager

Hierarchy

java.lang.Object
     com.smartdevicelink.managers.BaseSubManager
         com.smartdevicelink.managers.video.BaseVideoStreamManager

Package
com.smartdevicelink.managers.video

Fields

Inherited Fields

From Class Fields
com.smartdevicelink.managers.BaseSubManager SETTING_UP, READY, LIMITED, SHUTDOWN, ERROR, internalInterface

Constructors

VideoStreamManager( ISdl internalInterface )

public VideoStreamManager(ISdl internalInterface)

Constructor Parameters

internalInterface

Methods

start( CompletionListener listener )

public void start(CompletionListener listener)

Method Parameters

listener

startRemoteDisplayStream( Context context, java.lang.Class<? extends com.smartdevicelink.streaming.video.SdlRemoteDisplay> remoteDisplayClass, VideoStreamingParameters parameters, boolean encrypted, VideoStreamingRange supportedLandscapeStreamingRange, VideoStreamingRange supportedPortraitStreamingRange )

Starts streaming a remote display to the module if there is a connected session. This method of streaming requires the device to be on API level 19 or higher Two ranges (supportedLandscapeStreamingRange and supportedLandscapeStreamingRange) can be provided with image dimension ranges and aspect ratio ranges that your remoteDisplay class supports. If the module's screen size for your app changes during streaming (i.e. to a collapsed view, split screen, preview mode, or picture-in-picture), your remoteDisplay will be resized to the new screen size. If either range is `null`, the default is to support all streaming ranges of that format (landscape or portrait). If you wish to disable support for streaming in a given format (landscape or portrait), set a VideoStreamingRange with all `0` values. NOTE If both supportedLandscapeStreamingRange and supportedLandscapeStreamingRange are disabled then the video will not stream. Any changes to screen size will notify the onViewResized method you have implemented in your remoteDisplay class.

public void startRemoteDisplayStream(Context context,java.lang.Class<? extends com.smartdevicelink.streaming.video.SdlRemoteDisplay> remoteDisplayClass,VideoStreamingParameters parameters,boolean encrypted,VideoStreamingRange supportedLandscapeStreamingRange,VideoStreamingRange supportedPortraitStreamingRange)

Method Parameters

context
a context that can be used to create the remote display
remoteDisplayClass
class object of the remote display. This class will be used to create an instance of the remote display and will be projected to the module
parameters
streaming parameters to be used when streaming. If null is sent in, the default/optimized options will be used. If you are unsure about what parameters to be used it is best to just send null and let the system determine what works best for the currently connected module.
encrypted
a flag of if the stream should be encrypted. Only set if you have a supplied encryption library that the module can understand.
supportedLandscapeStreamingRange
constraints for vehicle display : min/max aspect ratio, min/max resolutions, max diagonal size.
supportedPortraitStreamingRange
constraints for vehicle display : min/max aspect ratio, min/max resolutions, max diagonal size.

startRemoteDisplayStream( Context context, java.lang.Class<? extends com.smartdevicelink.streaming.video.SdlRemoteDisplay> remoteDisplayClass, VideoStreamingParameters parameters, boolean encrypted )

Deprecated
Starts streaming a remote display to the module if there is a connected session. This method of streaming requires the device to be on API level 19 or higher

public void startRemoteDisplayStream(Context context,java.lang.Class<? extends com.smartdevicelink.streaming.video.SdlRemoteDisplay> remoteDisplayClass,VideoStreamingParameters parameters,boolean encrypted)

Method Parameters

context
a context that can be used to create the remote display
remoteDisplayClass
class object of the remote display. This class will be used to create an instance of the remote display and will be projected to the module
parameters
streaming parameters to be used when streaming. If null is sent in, the default/optimized options will be used. If you are unsure about what parameters to be used it is best to just send null and let the system determine what works best for the currently connected module.
encrypted
a flag of if the stream should be encrypted. Only set if you have a supplied encryption library that the module can understand.

startStreaming( VideoStreamingParameters parameters, boolean encrypted )

Starts video service, sets up encoder, haptic manager, and remote display. Begins streaming the remote display.

protected void startStreaming(VideoStreamingParameters parameters,boolean encrypted)

Method Parameters

parameters
Video streaming parameters including: codec which will be used for streaming (currently, only VideoStreamingCodec.H264 is accepted), height and width of the video in pixels.
encrypted
Specify true if packets on this service have to be encrypted

stopStreaming()

Stops streaming from the remote display. To restart, call

public void stopStreaming()

resumeStreaming()

Resumes streaming after calling

public void resumeStreaming()

dispose()

Stops streaming, ends video streaming service and removes service listeners.

public void dispose()

isServiceActive()

Check if a video service is currently active

public boolean isServiceActive()

isStreaming()

Check if video is currently streaming and visible

public boolean isStreaming()

isPaused()

Check if video streaming has been paused due to app moving to background or manually stopped

public boolean isPaused()

currentVideoStreamState()

Gets the current video streaming state as defined in @StreamingStateMachine

public int currentVideoStreamState()

onTransportUpdate( java.util.List<com.smartdevicelink.transport.utl.TransportRecord> connectedTransports, boolean audioStreamTransportAvail, boolean videoStreamTransportAvail )

protected void onTransportUpdate(java.util.List<com.smartdevicelink.transport.utl.TransportRecord> connectedTransports,boolean audioStreamTransportAvail,boolean videoStreamTransportAvail)

Method Parameters

connectedTransports
audioStreamTransportAvail
videoStreamTransportAvail

getLastCachedStreamingParameters()

public com.smartdevicelink.streaming.video.VideoStreamingParameters getLastCachedStreamingParameters()

startVideoStream( VideoStreamingParameters params, SdlSession session )

protected com.smartdevicelink.streaming.video.IVideoStreamListener startVideoStream(VideoStreamingParameters params,SdlSession session)

Method Parameters

params
session

stopVideoStream()

protected boolean stopVideoStream()

Inherited Methods

From Class Methods
com.smartdevicelink.managers.BaseSubManager start, dispose, transitionToState, getState, handleTransportUpdated, onTransportUpdate
java.lang.Object getClass, hashCode, equals, clone, toString, notify, notifyAll, wait, wait, wait, finalize
View on GitHub.com
Previous Section Next Section