Skip to content

Commit

Permalink
fixed/updated/refactored AACDescriptor, added SAOC_DE_flag
Browse files Browse the repository at this point in the history
  • Loading branch information
EricBerendsen committed Nov 29, 2024
1 parent 36d2834 commit 0d7741f
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 22 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
*
* http://www.digitalekabeltelevisie.nl/dvb_inspector
*
* This code is Copyright 2009-2012 by Eric Berendsen ([email protected])
* This code is Copyright 2009-2024 by Eric Berendsen ([email protected])
*
* This file is part of DVB Inspector.
*
Expand Down Expand Up @@ -38,36 +38,43 @@ public class AACDescriptor extends Descriptor {


private final int profile_and_level;
private final int aac_type_flag;
private int aac_type_flag = 0;
private int saoc_de_flag = 0;
private int aac_type;

private byte[] additional_info;


public AACDescriptor(final byte[] b, final int offset, final TableSection parent) {
super(b, offset,parent);
profile_and_level = getInt(b, offset+2, 1, MASK_8BITS);
aac_type_flag = getInt(b, offset+3, 1, 0x80)>>7;
int t=offset+4;
if(aac_type_flag==1){
aac_type = getInt(b, t++, 1, MASK_8BITS);
}
if(t<descriptorLength){
additional_info=getBytes(b, t, descriptorLength-t);
public AACDescriptor(final byte[] b, final TableSection parent) {
super(b ,parent);
profile_and_level = getInt(b, 2, 1, MASK_8BITS);
if(descriptorLength > 1){
aac_type_flag = getInt(b, 3, 1, 0b1000_0000)>>7;
saoc_de_flag = getInt(b, 3, 1, 0b0100_0000)>>6;

int t = 4;
if(aac_type_flag==1){
aac_type = getInt(b, t++, 1, MASK_8BITS);
}
if(t<descriptorLength){
additional_info=getBytes(b, t, 2 + descriptorLength - t);
}
}
}


@Override
public DefaultMutableTreeNode getJTreeNode(final int modus){

final DefaultMutableTreeNode t = super.getJTreeNode(modus);
t.add(new DefaultMutableTreeNode(new KVP("profile_and_level",profile_and_level,getProfileLevelString(profile_and_level))));
t.add(new DefaultMutableTreeNode(new KVP("aac_type_flag",aac_type_flag,null)));
if(aac_type_flag==1){
t.add(new DefaultMutableTreeNode(new KVP("aac_type",aac_type,getComponentType0x06String(aac_type))));
}
if(additional_info!=null){
t.add(new DefaultMutableTreeNode(new KVP("additional_info",additional_info,null)));
t.add(new KVP("profile_and_level",profile_and_level,getProfileLevelString(profile_and_level)));
if(descriptorLength > 1){
t.add(new KVP("AAC_type_flag",aac_type_flag));
t.add(new KVP("SAOC_DE_flag",saoc_de_flag,saoc_de_flag == 1?"SAOC-DE parametric data shall be present":"SAOC-DE parametric data shall not be present"));
if(aac_type_flag==1){
t.add(new KVP("aac_type",aac_type,getComponentType0x06String(aac_type)));
}
if(additional_info!=null){
t.add(new KVP("additional_info",additional_info));
}
}

return t;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -509,7 +509,7 @@ private static Descriptor getDVBSIDescriptor(final byte[] data, final TableSecti
case 0x7A:
return new EnhancedAC3Descriptor(data, 0, tableSection);
case 0x7C:
return new AACDescriptor(data, 0, tableSection);
return new AACDescriptor(data, tableSection);
case 0x7E:
return new FTAContentManagmentDescriptor(data, 0, tableSection);
case 0x7F:
Expand Down

0 comments on commit 0d7741f

Please sign in to comment.