public class StreamPacketizer extends AbstractPacketizer implements IVideoStreamListener, IAudioStreamListener, Runnable
| Modifier and Type | Field and Description |
|---|---|
static String |
TAG |
_request, _rpcSessionID, _serviceType, _session, _streamListener, _wiproVersion, buffer, bufferSize, is| Constructor and Description |
|---|
StreamPacketizer(IStreamListener streamListener,
InputStream is,
SessionType sType,
byte rpcSessionID,
SdlSession session) |
| Modifier and Type | Method and Description |
|---|---|
void |
pause() |
void |
resume() |
void |
run() |
void |
sendAudio(byte[] data,
int offset,
int length,
long presentationTimeUs)
Called by the app.
|
void |
sendAudio(ByteBuffer data,
long presentationTimeUs,
CompletionListener completionListener)
Called by the app.
|
void |
sendFrame(byte[] data,
int offset,
int length,
long presentationTimeUs)
Called by the app.
|
void |
sendFrame(ByteBuffer data,
long presentationTimeUs)
Called by the app.
|
void |
start() |
void |
stop() |
public static final String TAG
public StreamPacketizer(IStreamListener streamListener, InputStream is, SessionType sType, byte rpcSessionID, SdlSession session) throws IOException
IOExceptionpublic void start()
throws IOException
start in class AbstractPacketizerIOExceptionpublic void stop()
stop in class AbstractPacketizerpublic void pause()
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)public void sendAudio(byte[] data,
int offset,
int length,
long presentationTimeUs)
throws ArrayIndexOutOfBoundsException
sendAudio in interface IAudioStreamListenerdata - Byte array containing audio dataoffset - Starting offset in 'data'length - Length of the datapresentationTimeUs - (Reserved for future use) Presentation timestamp (PTS) of the
last audio sample data included in this chunk, 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.lengthIAudioStreamListener.sendAudio(byte[], int, int, long)public void sendAudio(ByteBuffer data, long presentationTimeUs, CompletionListener completionListener)
sendAudio in interface IAudioStreamListenerdata - Data chunk to send. Its position will be updated upon return.presentationTimeUs - (Reserved for future use) Presentation timestamp (PTS) of the
last audio sample data included in this chunk, in microseconds.
It must be greater than the previous timestamp.
Specify -1 if unknown.completionListener - A completion listener that informs when the audio file is playedIAudioStreamListener.sendAudio(ByteBuffer, long, CompletionListener)