public class VideoStreamManager extends BaseSubManager
ERROR, internalInterface, LIMITED, READY, SETTING_UP, SHUTDOWN| Constructor and Description |
|---|
VideoStreamManager(ISdl internalInterface) |
| Modifier and Type | Method and Description |
|---|---|
int |
currentVideoStreamState()
Gets the current video streaming state as defined in @StreamingStateMachine
|
void |
dispose()
Stops streaming, ends video streaming service and removes service listeners.
|
VideoStreamingParameters |
getLastCachedStreamingParameters() |
boolean |
isPaused()
Check if video streaming has been paused due to app moving to background or manually stopped
|
boolean |
isServiceActive()
Check if a video service is currently active
|
boolean |
isStreaming()
Check if video is currently streaming and visible
|
protected void |
onTransportUpdate(List<TransportRecord> connectedTransports,
boolean audioStreamTransportAvail,
boolean videoStreamTransportAvail)
Transport status has been updated
|
void |
resumeStreaming()
Resumes streaming after calling
|
void |
start(CompletionListener listener)
Starts up a BaseSubManager, and calls provided callback once BaseSubManager is done setting up or failed setup.
|
void |
startRemoteDisplayStream(Context context,
Class<? extends SdlRemoteDisplay> remoteDisplayClass,
VideoStreamingParameters parameters,
boolean encrypted)
Deprecated.
|
void |
startRemoteDisplayStream(Context context,
Class<? extends SdlRemoteDisplay> remoteDisplayClass,
VideoStreamingParameters parameters,
boolean encrypted,
VideoStreamingRange supportedLandscapeStreamingRange,
VideoStreamingRange supportedPortraitStreamingRange)
Starts streaming a remote display to the module if there is a connected session.
|
protected void |
startStreaming(VideoStreamingParameters parameters,
boolean encrypted)
Starts video service, sets up encoder, haptic manager, and remote display.
|
protected IVideoStreamListener |
startVideoStream(VideoStreamingParameters params,
SdlSession session) |
void |
stopStreaming()
Stops streaming from the remote display.
|
protected boolean |
stopVideoStream() |
getState, handleTransportUpdated, transitionToStatepublic VideoStreamManager(ISdl internalInterface)
public void start(CompletionListener listener)
BaseSubManagerstart in class BaseSubManagerlistener - CompletionListener that is called once the BaseSubManager's state is READY, LIMITED, or ERRORpublic void startRemoteDisplayStream(Context context, Class<? extends SdlRemoteDisplay> remoteDisplayClass, VideoStreamingParameters parameters, boolean encrypted, VideoStreamingRange supportedLandscapeStreamingRange, VideoStreamingRange supportedPortraitStreamingRange)
context - a context that can be used to create the remote displayremoteDisplayClass - 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 moduleparameters - 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.@Deprecated public void startRemoteDisplayStream(Context context, Class<? extends SdlRemoteDisplay> remoteDisplayClass, VideoStreamingParameters parameters, boolean encrypted)
context - a context that can be used to create the remote displayremoteDisplayClass - 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 moduleparameters - 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.protected void startStreaming(VideoStreamingParameters parameters, boolean encrypted)
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 encryptedpublic void stopStreaming()
resumeStreaming()public void resumeStreaming()
followed by a call to,
stopStreaming()public void dispose()
dispose in class BaseSubManagerpublic boolean isServiceActive()
public boolean isStreaming()
public boolean isPaused()
public int currentVideoStreamState()
protected void onTransportUpdate(List<TransportRecord> connectedTransports, boolean audioStreamTransportAvail, boolean videoStreamTransportAvail)
BaseSubManageronTransportUpdate in class BaseSubManagerconnectedTransports - currently connected transportsaudioStreamTransportAvail - if there is a transport that could be used to carry the
audio servicevideoStreamTransportAvail - if there is a transport that could be used to carry the
video servicepublic VideoStreamingParameters getLastCachedStreamingParameters()
protected IVideoStreamListener startVideoStream(VideoStreamingParameters params, SdlSession session)
protected boolean stopVideoStream()