Methods Summary |
---|
public AudioSpecificConfig | getAudioSpecificInfo()
return audioSpecificInfo;
|
public long | getAvgBitRate()
return avgBitRate;
|
public int | getBufferSizeDB()
return bufferSizeDB;
|
public DecoderSpecificInfo | getDecoderSpecificInfo()
return decoderSpecificInfo;
|
public long | getMaxBitRate()
return maxBitRate;
|
public int | getObjectTypeIndication()
return objectTypeIndication;
|
public java.util.List | getProfileLevelIndicationDescriptors()
return profileLevelIndicationDescriptors;
|
public int | getStreamType()
return streamType;
|
public int | getUpStream()
return upStream;
|
public void | parseDetail(java.nio.ByteBuffer bb)
objectTypeIndication = IsoTypeReader.readUInt8(bb);
int data = IsoTypeReader.readUInt8(bb);
streamType = data >>> 2;
upStream = (data >> 1) & 0x1;
bufferSizeDB = IsoTypeReader.readUInt24(bb);
maxBitRate = IsoTypeReader.readUInt32(bb);
avgBitRate = IsoTypeReader.readUInt32(bb);
BaseDescriptor descriptor;
if (bb.remaining() > 2) { //1byte tag + at least 1byte size
final int begin = bb.position();
descriptor = ObjectDescriptorFactory.createFrom(objectTypeIndication, bb);
final int read = bb.position() - begin;
log.finer(descriptor + " - DecoderConfigDescr1 read: " + read + ", size: " + (descriptor != null ? descriptor.getSize() : null));
if (descriptor != null) {
final int size = descriptor.getSize();
if (read < size) {
//skip
configDescriptorDeadBytes = new byte[size - read];
bb.get(configDescriptorDeadBytes);
}
}
if (descriptor instanceof DecoderSpecificInfo) {
decoderSpecificInfo = (DecoderSpecificInfo) descriptor;
}
if (descriptor instanceof AudioSpecificConfig) {
audioSpecificInfo = (AudioSpecificConfig) descriptor;
}
}
while (bb.remaining() > 2) {
final long begin = bb.position();
descriptor = ObjectDescriptorFactory.createFrom(objectTypeIndication, bb);
final long read = bb.position() - begin;
log.finer(descriptor + " - DecoderConfigDescr2 read: " + read + ", size: " + (descriptor != null ? descriptor.getSize() : null));
if (descriptor instanceof ProfileLevelIndicationDescriptor) {
profileLevelIndicationDescriptors.add((ProfileLevelIndicationDescriptor) descriptor);
}
}
|
public java.nio.ByteBuffer | serialize()
ByteBuffer out = ByteBuffer.allocate(serializedSize());
IsoTypeWriter.writeUInt8(out, 4);
IsoTypeWriter.writeUInt8(out, serializedSize() - 2);
IsoTypeWriter.writeUInt8(out, objectTypeIndication);
int flags = (streamType << 2) | (upStream << 1) | 1;
IsoTypeWriter.writeUInt8(out, flags);
IsoTypeWriter.writeUInt24(out, bufferSizeDB);
IsoTypeWriter.writeUInt32(out, maxBitRate);
IsoTypeWriter.writeUInt32(out, avgBitRate);
out.put(audioSpecificInfo.serialize().array());
return out;
|
public int | serializedSize()
return 15 + audioSpecificInfo.serializedSize();
|
public void | setAudioSpecificInfo(AudioSpecificConfig audioSpecificInfo)
this.audioSpecificInfo = audioSpecificInfo;
|
public void | setAvgBitRate(long avgBitRate)
this.avgBitRate = avgBitRate;
|
public void | setBufferSizeDB(int bufferSizeDB)
this.bufferSizeDB = bufferSizeDB;
|
public void | setMaxBitRate(long maxBitRate)
this.maxBitRate = maxBitRate;
|
public void | setObjectTypeIndication(int objectTypeIndication)
this.objectTypeIndication = objectTypeIndication;
|
public void | setStreamType(int streamType)
this.streamType = streamType;
|
public void | setUpStream(int upStream)
this.upStream = upStream;
|
public java.lang.String | toString()
final StringBuilder sb = new StringBuilder();
sb.append("DecoderConfigDescriptor");
sb.append("{objectTypeIndication=").append(objectTypeIndication);
sb.append(", streamType=").append(streamType);
sb.append(", upStream=").append(upStream);
sb.append(", bufferSizeDB=").append(bufferSizeDB);
sb.append(", maxBitRate=").append(maxBitRate);
sb.append(", avgBitRate=").append(avgBitRate);
sb.append(", decoderSpecificInfo=").append(decoderSpecificInfo);
sb.append(", audioSpecificInfo=").append(audioSpecificInfo);
sb.append(", configDescriptorDeadBytes=").append(Hex.encodeHex(configDescriptorDeadBytes != null ? configDescriptorDeadBytes : new byte[]{}));
sb.append(", profileLevelIndicationDescriptors=").append(profileLevelIndicationDescriptors == null ? "null" : Arrays.asList(profileLevelIndicationDescriptors).toString());
sb.append('}");
return sb.toString();
|