StreamBitratePropertiesChunkpublic class StreamBitratePropertiesChunk extends Chunk This class represents the "Stream Bitrate Properties" chunk of an ASF media
file.
It is optional, but contains useful information about the streams bitrate.
|
Fields Summary |
---|
private final List | bitRatesFor each call of {@link #addBitrateRecord(int,long)} an {@link Long}
object is appended, which represents the average bitrate. | private final List | streamNumbersFor each call of {@link #addBitrateRecord(int,long)} an {@link Integer}
object is appended, which represents the stream-number. |
Constructors Summary |
---|
public StreamBitratePropertiesChunk(BigInteger chunkLen)Creates an instance.
super(GUID.GUID_STREAM_BITRATE_PROPERTIES, chunkLen);
this.bitRates = new ArrayList<Long>();
this.streamNumbers = new ArrayList<Integer>();
|
Methods Summary |
---|
public void | addBitrateRecord(int streamNum, long averageBitrate)Adds the public values of a stream-record.
this.streamNumbers.add(streamNum);
this.bitRates.add(averageBitrate);
| public long | getAvgBitrate(int streamNumber)Returns the average bitrate of the given stream.
final Integer seach = streamNumber;
final int index = this.streamNumbers.indexOf(seach);
long result;
if (index == -1) {
result = -1;
} else {
result = this.bitRates.get(index);
}
return result;
| public java.lang.String | prettyPrint(java.lang.String prefix)(overridden)
final StringBuilder result = new StringBuilder(super.prettyPrint(prefix));
for (int i = 0; i < this.bitRates.size(); i++) {
result.append(prefix).append(" |-> Stream no. \"").append(
this.streamNumbers.get(i)).append(
"\" has an average bitrate of \"").append(
this.bitRates.get(i)).append('"").append(
Utils.LINE_SEPARATOR);
}
return result.toString();
|
|