fi.helsinki.cs.ohtu.mpeg2
Class SystemHeader

java.lang.Object
  extended by fi.helsinki.cs.ohtu.mpeg2.SystemHeader

public class SystemHeader
extends java.lang.Object

Represents the system header in program streams.


Nested Class Summary
private static class SystemHeader.StreamInfo
           
 
Field Summary
private  int audioBound
           
private  boolean audioLocked
           
private  boolean fixedRate
           
private  int rateBound
           
private  java.util.HashMap<StreamID,SystemHeader.StreamInfo> streams
           
private  int videoBound
           
private  boolean videoLocked
           
 
Constructor Summary
SystemHeader(int rateBound, int audioBound, int videoBound)
          Creates a new instance of class SystemHeader.
SystemHeader(int rateBound, int audioBound, int videoBound, boolean fixedRate, boolean audioLocked, boolean videoLocked)
          Creates a new instance of class SystemHeader.
 
Method Summary
 void addStream(StreamID sid, boolean pstdScale, int pstdBufBound)
           
 void addStream(StreamID sid, int bufSize)
           
 int getAudioBound()
          Gets the maximum number of simultaneously decoding audio streams.
 int getHeaderLength()
          Returns the length of this SystemHeader, in bytes.
 int getRateBound()
          Gets the value of the rate bound.
 int getStreamBufferSize(StreamID sid)
           
 int getVideoBound()
          Gets the maximum number of simultaneously decoding video streams.
 boolean isAudioLocked()
          Gets the value of the audio locked flag.
 boolean isFixedRate()
          Gets the value of the fixed rate flag.
 boolean isVideoLocked()
          Gets the value of the video locked flag.
 void removeStream(StreamID sid)
           
 void setAudioBound(int audioBound)
          Sets the maximum number of audio streams for which the decoding processes are simultaneously active.
 void setAudioLocked(boolean audioLocked)
          Sets the audio locked flag.
 void setFixedRate(boolean fixedRate)
          Sets the fixed rate flag.
 void setRateBound(int rateBound)
          Sets the maximum expected value of program mux rate.
 void setVideoBound(int videoBound)
          Sets the maximum number of video streams for which the decoding processes are simultaneously active.
 void setVideoLocked(boolean videoLocked)
          Sets the video locked flag.
 void writeTo(BitOutputStream stream)
          Writes this System Header to stream stream.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

rateBound

private int rateBound

videoBound

private int videoBound

audioBound

private int audioBound

fixedRate

private boolean fixedRate

audioLocked

private boolean audioLocked

videoLocked

private boolean videoLocked

streams

private java.util.HashMap<StreamID,SystemHeader.StreamInfo> streams
Constructor Detail

SystemHeader

public SystemHeader(int rateBound,
                    int audioBound,
                    int videoBound,
                    boolean fixedRate,
                    boolean audioLocked,
                    boolean videoLocked)
Creates a new instance of class SystemHeader.

Parameters:
rateBound - Rate bound
audioBound - Audio bound
videoBound - Video bound
See Also:
setRateBound(int), setAudioBound(int), setVideoBound(int), setFixedRate(boolean), setAudioLocked(boolean), setVideoLocked(boolean)

SystemHeader

public SystemHeader(int rateBound,
                    int audioBound,
                    int videoBound)
Creates a new instance of class SystemHeader. The fixed rate, audio locked and video locked flags are not set.

See Also:
SystemHeader(int, int, int, boolean, boolean, boolean)
Method Detail

getRateBound

public int getRateBound()
Gets the value of the rate bound.

Returns:
Value of the rate bound

getAudioBound

public int getAudioBound()
Gets the maximum number of simultaneously decoding audio streams.

Returns:
The maximum number of simultaneously deconding audio streams

getVideoBound

public int getVideoBound()
Gets the maximum number of simultaneously decoding video streams.

Returns:
The maximum number of simultaneously deconding video streams

isFixedRate

public boolean isFixedRate()
Gets the value of the fixed rate flag.

Returns:
Value of the fixed rate flag

isAudioLocked

public boolean isAudioLocked()
Gets the value of the audio locked flag.

Returns:
Value of the audio locked flag

isVideoLocked

public boolean isVideoLocked()
Gets the value of the video locked flag.

Returns:
Value of the video locked flag

setFixedRate

public void setFixedRate(boolean fixedRate)
Sets the fixed rate flag.

Parameters:
fixedRate - true if the rate is fixed; false otherwise

setAudioLocked

public void setAudioLocked(boolean audioLocked)
Sets the audio locked flag.

Parameters:
audioLocked - true if the audio sampling rate is locked to the system clock; false otherwise

setVideoLocked

public void setVideoLocked(boolean videoLocked)
Sets the video locked flag.

Parameters:
videoLocked - true if the video frame rate is locked to the system clock; false otherwise

setRateBound

public void setRateBound(int rateBound)
Sets the maximum expected value of program mux rate.

Parameters:
rateBound - Rate bound, in the range from 0 to 2**22 - 1

setAudioBound

public void setAudioBound(int audioBound)
Sets the maximum number of audio streams for which the decoding processes are simultaneously active.

Parameters:
audioBound - Audio bound, in the range from 0 to 32

setVideoBound

public void setVideoBound(int videoBound)
Sets the maximum number of video streams for which the decoding processes are simultaneously active.

Parameters:
videoBound - Video bound, in the range from 0 to 16

addStream

public void addStream(StreamID sid,
                      boolean pstdScale,
                      int pstdBufBound)

addStream

public void addStream(StreamID sid,
                      int bufSize)

removeStream

public void removeStream(StreamID sid)

getStreamBufferSize

public int getStreamBufferSize(StreamID sid)

writeTo

public void writeTo(BitOutputStream stream)
             throws java.io.IOException
Writes this System Header to stream stream.

Parameters:
stream - Stream to write this header to
Throws:
java.io.IOException

getHeaderLength

public int getHeaderLength()
Returns the length of this SystemHeader, in bytes.

Returns:
the length in bytes