|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectfi.helsinki.cs.ohtu.mpeg2.Pack
public class Pack
Represents a pack in the program stream. A pack is a lump of PES packets which share a common PackHeader (mostly contains timing information). There can additionally be an optional system header for the pack, however this is not currently supported. For obvious performance reasons, instances of this class won't contain the actual PES packets in the semantic pack. They are written separately to the ProgramStream, which however handles writing the pack at the correct time in respect to them.
Field Summary | |
---|---|
private java.util.ArrayList<PackDirtiedListener> |
dirtiedListeners
|
private PackHeader |
packHeader
|
private SystemHeader |
systemHeader
|
Constructor Summary | |
---|---|
Pack(double scr,
int muxRate)
Class constructor. |
Method Summary | |
---|---|
void |
addDirtiedListener(PackDirtiedListener listener)
Adds a dirtied listener. |
PackDirtiedListener[] |
getDirtiedListeners()
Returns an array of all the dirtied listeners registered on this pack. |
int |
getProgramMuxRate()
Gets the program mux rate. |
int |
getStuffingLength()
Gets the stuffing length. |
double |
getSystemClockReference()
Gets the system clock reference. |
SystemHeader |
getSystemHeader()
Gets the system header for this pack, if there is one. |
void |
removeDirtiedListener(PackDirtiedListener listener)
Removes the specified dirtied listener so that it no longer receives events from this pack. |
void |
setProgramMuxRate(int rate)
Sets the program mux rate. |
void |
setStuffingLength(int length)
Sets the stuffing length. |
void |
setSystemClockReference(double scr)
Sets the system clock reference. |
void |
setSystemHeader(SystemHeader systemHeader)
Sets a system header for this pack. |
void |
writeTo(BitOutputStream stream)
Writes the pack to a bit stream. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private PackHeader packHeader
private SystemHeader systemHeader
private java.util.ArrayList<PackDirtiedListener> dirtiedListeners
Constructor Detail |
---|
public Pack(double scr, int muxRate)
scr
- The system clock reference, as in #setSystemClockReference().muxRate
- The mux rate, as in #setProgramMuxRate().Method Detail |
---|
public SystemHeader getSystemHeader()
null
if none setpublic void setSystemHeader(SystemHeader systemHeader)
null
removes previously set header.
systemHeader
- System header for this packpublic double getSystemClockReference()
public void setSystemClockReference(double scr)
scr
- The reference, in seconds. Must be non-negative.public int getProgramMuxRate()
public void setProgramMuxRate(int rate)
rate
- The new rate, in bytes/second. Must be in the range [50..50*2^22].public int getStuffingLength()
public void setStuffingLength(int length)
length
- The new length. Must be in range [0..7].public final void addDirtiedListener(PackDirtiedListener listener)
listener
- A class implementing the PackDirtiedListener interface to register as the listener.public final PackDirtiedListener[] getDirtiedListeners()
public final void removeDirtiedListener(PackDirtiedListener listener)
listener
- The listener to remove.public void writeTo(BitOutputStream stream) throws java.io.IOException
stream
- The stream to write to.
java.io.IOException
- Propagated from the stream write.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |