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
JavaSE Documentation
RTPH264Packetizer

Class RTPH264Packetizer

Hierarchy

java.lang.Object
     com.smartdevicelink.streaming.AbstractPacketizer

Package
com.smartdevicelink.streaming.video
All Implemented Interfaces
com.smartdevicelink.streaming.video.IVideoStreamListener, java.lang.Runnable

Overview

This class receives H.264 byte stream (in Annex-B format), parses it, construct RTP packets from it based on RFC 6184, then frame the packets based on RFC 4571. The primary purpose of using RTP is to carry timestamp information along with the data.

Fields

Inherited Fields

From Class Fields
com.smartdevicelink.streaming.AbstractPacketizer _streamListener, _rpcSessionID, _serviceType, _session, is, bufferSize, buffer, _request, _wiproVersion

Constructors

RTPH264Packetizer( IStreamListener streamListener, SessionType serviceType, byte sessionID, SdlSession session )

Constructor

public RTPH264Packetizer(IStreamListener streamListener,SessionType serviceType,byte sessionID,SdlSession session)

Constructor Parameters

streamListener
The listener which this packetizer outputs SDL frames to
serviceType
The value of "Service Type" field in SDL frames
sessionID
The value of "Session ID" field in SDL frames
session
The SdlSession instance that this packetizer belongs to

Methods

setPayloadType( byte type )

Sets the Payload Type (PT) of RTP header field.

Use this method if PT needs to be specified. The value should be between 0 and 127. Otherwise, a default value (96) is used.

public void setPayloadType(byte type)

Method Parameters

type
A value indicating the Payload Type

setSSRC( int ssrc )

Sets the SSRC of RTP header field.

Use this method if SSRC needs to be specified. Otherwise, a random value is generated and used.

public void setSSRC(int ssrc)

Method Parameters

ssrc
An integer value representing SSRC

start()

Starts this packetizer.

It is recommended that the video encoder is started after the packetizer is started.

public void start() throws java.io.IOException

Throws

  • java.io.IOException

stop()

Stops this packetizer.

It is recommended that the video encoder is stopped prior to the packetizer.

public void stop()

pause()

Pauses this packetizer.

This pauses the packetizer but does not pause the video encoder.

public void pause()

resume()

Resumes this packetizer.

public void resume()

run()

The thread routine.

public void run()

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

Called by the app and encoder.

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

Method Parameters

data
offset
length
presentationTimeUs

Throws

  • java.lang.ArrayIndexOutOfBoundsException

sendFrame( ByteBuffer data, long presentationTimeUs )

Called by the app and encoder.

public void sendFrame(ByteBuffer data,long presentationTimeUs)

Method Parameters

data
presentationTimeUs

Inherited Methods

From Class Methods
com.smartdevicelink.streaming.AbstractPacketizer start, stop, pause, resume
java.lang.Object getClass, hashCode, equals, clone, toString, notify, notifyAll, wait, wait, wait, finalize
View on GitHub.com
Previous Section Next Section