Triton Mobile SDK for Android 3.5.1
This is a custom android player made by Triton Digital
Loading...
Searching...
No Matches
com.tritondigital.net.streaming.proxy.dataprovider.rtp.RtpPacketProviderMpeg4Generic Class Reference

A class to create RTP Packet using the MPEG4-GENERIC profile, based on RFC 3640 (http://www.rfc-editor.org/rfc/rfc3640.txt) More...

Inheritance diagram for com.tritondigital.net.streaming.proxy.dataprovider.rtp.RtpPacketProviderMpeg4Generic:
com.tritondigital.net.streaming.proxy.dataprovider.rtp.RtpPacketProvider com.tritondigital.net.streaming.proxy.dataprovider.DataProvider

Public Member Functions

void onAudioConfigDecoded (AudioConfig audioConfig)
 
- Public Member Functions inherited from com.tritondigital.net.streaming.proxy.dataprovider.rtp.RtpPacketProvider
void onAudioDataDecoded (byte[] audioData, int audioDataLength, int timestamp)
 
String getSdpConfig (String absControlUrl)
 Returns the SDP string to be sent by the RTSP server in response to a Describe request.
 
void stop ()
 In addition to the default stop, Resets the Sdp Config state to make sure to block the next time that this provider is used, until the SdpConfig is ready again.
 
void stopBlockingUntilAudioConfigReady ()
 Unblock the thread waiting on a call to blockUntilReady.
 
boolean isSdpConfigReady ()
 Tells if the SDP strings can be retrieved without blocking.
 
short getFirstPacketSequenceNumber ()
 Gets the sequence number that the first packet in the queue has (or will have when it is inserted).
 
int getFirstPacketTimestamp ()
 Gets the timestamp that the first packet in the queue has (or will have when it is inserted).
 
void setStateChangedListener (StateChangedListener stateChangedListener)
 Sets the listener to be notified by any state change on this provider.
 
- Public Member Functions inherited from com.tritondigital.net.streaming.proxy.dataprovider.DataProvider
Packet getPacket ()
 Returns the next Packet in the stream.
 
void addFreePacketToPool (Packet packet)
 Puts the given packet back in the free pool packets.
 
void clearInternalBuffer ()
 If the provider keeps a buffer of already available packets, clear it immediately.
 

Protected Member Functions

String getProfileSpecificSdpConfig ()
 
int getPayloadSize (int audioDataLength)
 
void createPayload (byte[] audioData, int audioDataLength, byte[] outPayload, int outPayloadOffset)
 Create the payload for RTP Packet with the MPEG4-GENERIC profile.
 
- Protected Member Functions inherited from com.tritondigital.net.streaming.proxy.dataprovider.rtp.RtpPacketProvider
Packet createEmptyPacket ()
 
int getRtpTimestamp (int timestampMS)
 Compute the RTP timestamp, which is the number of samples since the beginning of the stream.
 
void notifyListenerSdpConfigReady ()
 Notifies listener that the SDP Config can now be produced without blocking.
 
void notifyListenerError (ErrorDetail errorDetail)
 Notifies listener that an unrecoverable error has been encountered.
 
- Protected Member Functions inherited from com.tritondigital.net.streaming.proxy.dataprovider.DataProvider
Packet getFreePacket ()
 Returns a free packet to use for the creation of a new packet.
 
void enqueuePacket (Packet packet)
 Enqueue a Packet to be sent to the server.
 

Additional Inherited Members

- Public Attributes inherited from com.tritondigital.net.streaming.proxy.dataprovider.rtp.RtpPacketProvider
final String TAG = "RtpPacketProvider"
 
- Protected Attributes inherited from com.tritondigital.net.streaming.proxy.dataprovider.rtp.RtpPacketProvider
AudioConfig mAudioConfig
 
short mNextPacketSequenceNumber = 0
 Increments by one for each new packet that is pushed in the queue.
 
- Protected Attributes inherited from com.tritondigital.net.streaming.proxy.dataprovider.DataProvider
final ArrayBlockingQueue< PacketmPacketsQueue = new ArrayBlockingQueue<>(QUEUE_SIZE)
 List of all packets that were received from the client and not sent to the server yet.
 
final ArrayBlockingQueue< PacketmFreePacketsPool = new ArrayBlockingQueue<>(QUEUE_SIZE)
 
- Static Protected Attributes inherited from com.tritondigital.net.streaming.proxy.dataprovider.rtp.RtpPacketProvider
static final String LOCALHOST = "127.0.0.1"
 
static final String CRLF = "\r\n"
 

Detailed Description

A class to create RTP Packet using the MPEG4-GENERIC profile, based on RFC 3640 (http://www.rfc-editor.org/rfc/rfc3640.txt)

Member Function Documentation

◆ createPayload()

void com.tritondigital.net.streaming.proxy.dataprovider.rtp.RtpPacketProviderMpeg4Generic.createPayload ( byte[]  audioData,
int  audioDataLength,
byte[]  outPayload,
int  outPayloadOffset 
)
protected

Create the payload for RTP Packet with the MPEG4-GENERIC profile.

Puts the content of the payload in the given preallocated output buffer and the given offset. This helps preventing new buffer copy by reusing the same bytes array for the output.

Parameters
audioDataThe data to put in the payload
audioDataLengthThe part of the AudioData buffer to use (buffer might be bigger if is is reused)
outPayloadReference to a byte array preallocated with enough memory (at least the size returned by getPayloadSize)
outPayloadOffsetOffset at which the payload will be written in outPayload, allowing to create a header before the payload.

Reimplemented from com.tritondigital.net.streaming.proxy.dataprovider.rtp.RtpPacketProvider.

◆ getPayloadSize()

int com.tritondigital.net.streaming.proxy.dataprovider.rtp.RtpPacketProviderMpeg4Generic.getPayloadSize ( int  audioDataLength)
protected

◆ getProfileSpecificSdpConfig()

String com.tritondigital.net.streaming.proxy.dataprovider.rtp.RtpPacketProviderMpeg4Generic.getProfileSpecificSdpConfig ( )
protected

◆ onAudioConfigDecoded()

void com.tritondigital.net.streaming.proxy.dataprovider.rtp.RtpPacketProviderMpeg4Generic.onAudioConfigDecoded ( AudioConfig  audioConfig)

The documentation for this class was generated from the following file: