public class RTPH264Packetizer extends AbstractPacketizer implements IVideoStreamListener, Runnable
_request, _rpcSessionID, _serviceType, _session, _streamListener, _wiproVersion, buffer, bufferSize, is| Constructor and Description |
|---|
RTPH264Packetizer(IStreamListener streamListener,
SessionType serviceType,
byte sessionID,
SdlSession session)
Constructor
|
| Modifier and Type | Method and Description |
|---|---|
void |
pause()
Pauses this packetizer.
|
void |
resume()
Resumes this packetizer.
|
void |
run()
The thread routine.
|
void |
sendFrame(byte[] data,
int offset,
int length,
long presentationTimeUs)
Called by the app and encoder.
|
void |
sendFrame(ByteBuffer data,
long presentationTimeUs)
Called by the app and encoder.
|
void |
setPayloadType(byte type)
Sets the Payload Type (PT) of RTP header field.
|
void |
setSSRC(int ssrc)
Sets the SSRC of RTP header field.
|
void |
start()
Starts this packetizer.
|
void |
stop()
Stops this packetizer.
|
public RTPH264Packetizer(IStreamListener streamListener, SessionType serviceType, byte sessionID, SdlSession session) throws IOException
streamListener - The listener which this packetizer outputs SDL frames toserviceType - The value of "Service Type" field in SDL framessessionID - The value of "Session ID" field in SDL framessession - The SdlSession instance that this packetizer belongs toIOExceptionpublic void setPayloadType(byte type)
Use this method if PT needs to be specified. The value should be between 0 and 127. Otherwise, a default value (96) is used.
type - A value indicating the Payload Typepublic void setSSRC(int ssrc)
Use this method if SSRC needs to be specified. Otherwise, a random value is generated and used.
ssrc - An integer value representing SSRCpublic void start()
throws IOException
It is recommended that the video encoder is started after the packetizer is started.
start in class AbstractPacketizerIOExceptionpublic void stop()
It is recommended that the video encoder is stopped prior to the packetizer.
stop in class AbstractPacketizerpublic void pause()
This pauses the packetizer but does not pause the video encoder.
pause in class AbstractPacketizerpublic void resume()
resume in class AbstractPacketizerpublic void sendFrame(byte[] data,
int offset,
int length,
long presentationTimeUs)
throws ArrayIndexOutOfBoundsException
sendFrame in interface IVideoStreamListenerdata - Byte array containing a video frameoffset - Starting offset in 'data'length - Length of the datapresentationTimeUs - Presentation timestamp (PTS) of this frame, in microseconds.
It must be greater than the previous timestamp.
Specify -1 if unknown.ArrayIndexOutOfBoundsException - When offset does not satisfy
0 <= offset && offset <= data.length
or length does not satisfy
0 < length && offset + length <= data.lengthIVideoStreamListener.sendFrame(byte[], int, int, long)public void sendFrame(ByteBuffer data, long presentationTimeUs)
sendFrame in interface IVideoStreamListenerdata - 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.IVideoStreamListener.sendFrame(ByteBuffer, long)