|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectfi.helsinki.cs.ohtu.mpeg2.PESPacket
public class PESPacket
Represents a MPEG PES packet. Data from elementary MPEG streams is encapsulated to PES packets for multiplexing in a transport or program stream. Each PES packet carries data from a single stream. PES packets have a short header common to all stream types, and may have additional type-specific header fields. This class represents the common part - subclasses exist for the different stream types with additional fields and semantics.
Nested Class Summary | |
---|---|
private class |
PESPacket.ByteAppenderOutputStream
|
Field Summary | |
---|---|
private java.util.ArrayList<java.lang.Integer> |
bytes
|
private java.util.ArrayList<PESPacketAboutToResetListener> |
resetListeners
|
private BitOutputStream |
stream
|
private StreamID |
streamID
|
Constructor Summary | |
---|---|
PESPacket(StreamID streamID)
Class constructor. |
Method Summary | |
---|---|
void |
addAboutToResetListener(PESPacketAboutToResetListener listener)
Adds an about-to-reset listener. |
PESPacketAboutToResetListener[] |
getAboutToResetListeners()
Returns an array of all the about-to-reset listeners registered on this packet. |
int |
getPacketLength()
Gets the packet length (not counting the common header part). |
BitOutputStream |
getStream()
Gets a bit-by-bit output stream for writing the payload to the packet. |
StreamID |
getStreamID()
Gets the ID of the stream the data in the packet belongs to. |
int |
getTotalLength()
Returns the packet total length, including the common header. |
protected void |
insertTemplateBytes()
Inserts any stream-type specific header fields to the byte stream. |
void |
removeAboutToResetListener(PESPacketAboutToResetListener listener)
Removes the specified about-to-reset listener so that it no longer receives events from this packet. |
void |
reset()
Resets the packet to its initial state. |
void |
writeTo(BitOutputStream stream)
Writes the packet to a stream. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private final StreamID streamID
private final java.util.ArrayList<java.lang.Integer> bytes
private BitOutputStream stream
private java.util.ArrayList<PESPacketAboutToResetListener> resetListeners
Constructor Detail |
---|
public PESPacket(StreamID streamID)
streamID
- ID of the stream the data in the packet belongs to.Method Detail |
---|
public final StreamID getStreamID()
public final int getPacketLength()
public final int getTotalLength()
getPacketLength()
public final BitOutputStream getStream()
public final void reset()
public final void writeTo(BitOutputStream stream) throws java.io.IOException
stream
- The stream to write to.
java.io.IOException
- Propagated from the stream write.public final void addAboutToResetListener(PESPacketAboutToResetListener listener)
listener
- A class implementing the #PESPacketAboutToResetListener interface to register as the listener.public final PESPacketAboutToResetListener[] getAboutToResetListeners()
public final void removeAboutToResetListener(PESPacketAboutToResetListener listener)
listener
- The listener to remove.protected void insertTemplateBytes()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |