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
JavaEE Documentation
IVideoStreamListener

Interface IVideoStreamListener

Package
com.smartdevicelink.streaming.video
All Known Implementing Classes
com.smartdevicelink.streaming.video.RTPH264Packetizer

Overview

A listener that receives video streaming data from app.

Methods

sendFrame( byte[] data, int offset, int length, long presentationTimeUs )

Sends a chunk of data which represents a frame to SDL Core.

The format of the chunk should align with MediaCodec's "Compressed Buffer" format, i.e. it should contain a single video frame, and it should start and end on frame boundaries. Please refer to https://developer.android.com/reference/android/media/MediaCodec.html Also, for H.264 codec case the stream must be in byte-stream format (also known as Annex-B format). This isn't explained in the document above, but MediaCodec does output in this format.

In short, you can just provide MediaCodec's data outputs to this method without tweaking any data.

Note: this method must not be called after SdlProxyBase.endVideoStream() is called.

public void sendFrame(byte[] data,int offset,int length,long presentationTimeUs) throws java.lang.ArrayIndexOutOfBoundsException

Method Parameters

data
Byte array containing a video frame
offset
Starting offset in 'data'
length
Length of the data
presentationTimeUs
Presentation timestamp (PTS) of this frame, in microseconds. It must be greater than the previous timestamp. Specify -1 if unknown.

Throws

  • java.lang.ArrayIndexOutOfBoundsException

sendFrame( ByteBuffer data, long presentationTimeUs )

Sends chunks of data which represent a frame to SDL Core.

The format of the chunk should align with MediaCodec's "Compressed Buffer" format, i.e. it should contain a single video frame, and it should start and end on frame boundaries. Please refer to https://developer.android.com/reference/android/media/MediaCodec.html Also, for H.264 codec case the stream must be in byte-stream format (also known as Annex-B format). This isn't explained in the document above, but MediaCodec does output in this format.

In short, you can just provide MediaCodec's data outputs to this method without tweaking any data.

Note: this method must not be called after SdlProxyBase.endVideoStream() is called.

public void sendFrame(ByteBuffer data,long presentationTimeUs)

Method Parameters

data
Data chunk to send. Its position will be updated upon return.
presentationTimeUs
Presentation timestamp (PTS) of this frame, in microseconds. It must be greater than the previous timestamp. Specify -1 if unknown.
View on GitHub.com
Previous Section Next Section