Skip to content

Commit

Permalink
Merge pull request #80 from paulhiggs/master
Browse files Browse the repository at this point in the history
Add support for AVS3 audio and video in a transport stream
  • Loading branch information
EricBerendsen authored Nov 24, 2024
2 parents c634327 + a15be19 commit bc766a6
Show file tree
Hide file tree
Showing 11 changed files with 488 additions and 59 deletions.
2 changes: 2 additions & 0 deletions build.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
rem use maven to build the distribution jar
mvn -B package --file pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -607,6 +607,9 @@ public static String getComponentType0x09String(final int stream_content_ext, fi
case 0x1c -> "DTS-UHD receiver-mix audio description, mono, for the visually impaired ";
case 0x1d -> "DTS-UHD receiver-mix audio description, stereo, for the visually impaired ";
case 0x1e -> "DTS-UHD NGA Audio";
case 0x20 -> "AVS3-P3 Next Generation Audio (NGA)";
case 0x21 -> "AVS3-P3 broadcast-mix accessibility components";
case 0x22 -> "AVS3-P3 receiver-mix accessibility components";
default -> "reserved for future use";
};
case 0x02 ->
Expand Down Expand Up @@ -637,7 +640,7 @@ public static String getNextGenerationAudioComponentTypeString(final int compone
res.append("content contains spoken subtitles, ");
}
if((component_type & 0b0000_0100) != 0) {
res.append("ccontent contains audio description, ");
res.append("content contains audio description, ");
}
res.append("preferred reproduction channel layout: ");
switch (component_type & 0b0000_0011) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -295,12 +295,18 @@ private static Descriptor getPrivateDVBSIDescriptor(final byte[] data, final Tab
return new nl.digitalekabeltelevisie.data.mpeg.descriptors.privatedescriptors.au.LogicalChannelDescriptor(data, 0, tableSection, descriptorContext);
}

} else if (private_data_specifier == 0x41565356) { // AVS
} else if (private_data_specifier == 0x41565356) { // AVS Video
switch (descriptor_tag) {
case 0xD1:
return new AVS3VideoDescriptor(data, 0, tableSection);
}
}
else if (private_data_specifier == 0x41565341) { // AVS Audio
switch (descriptor_tag) {
case 0xD2:
return new AVS3AudioDescriptor(data, 0, tableSection);
}
}
logger.info("Unimplemented private descriptor, private_data_specifier=" + private_data_specifier
+ ", descriptortag=" + descriptor_tag + ", tableSection=" + tableSection);
return new Descriptor(data, 0, tableSection);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,16 +42,30 @@ public class URILinkageDescriptor extends DVBExtensionDescriptor {
add(0x00,"Online SDT (OSDT) for CI Plus").
add(0x01,"DVB-IPTV SD&S").
add(0x02,"Material Resolution Server (MRS) for companion screen applications").
add(0x03,0x7F,"Reserved for future use").
add(0x03,"DVB-I").
add(0x04,0x7F,"Reserved for future use").
add(0x80,0xFF,"User defined").
build();

private static LookUpList dvb_i_endpoint_type_list = new LookUpList.Builder().
add(0x00,"Not used").
add(0x01,"DVB-I Serice List").
add(0x02,"Service List Registry query").
add(0x03,"Named DVB-I Service List").
add(0x04,0xFF,"Reserved for future use").
build();

private final int uri_linkage_type;
private final int uri_length;
private final byte[] uri_char;
private int min_polling_interval;
private byte[] private_data_byte = null;

private int dvb_i_endpoint_type = 0;
private int dvb_i_service_list_name_length = 0;
private String dvb_i_service_list_name = "";
private int dvb_i_service_list_provider_name_length = 0;
private String dvb_i_service_list_provider_name = "";

public URILinkageDescriptor(final byte[] b, final int offset, final TableSection parent) {
super(b, parent);
Expand All @@ -66,6 +80,17 @@ public URILinkageDescriptor(final byte[] b, final int offset, final TableSection
localOffset += 2;
}
if ((PRIVATE_DATA_OFFSET + descriptorLength) < localOffset) {
if (uri_linkage_type == 0x03) { // for DVB-I. Refer to clause 5.1.3.3 of DVB A177
dvb_i_endpoint_type = getInt(b, localOffset++, 1, MASK_8BITS);
if (dvb_i_endpoint_type == 0x03) {
dvb_i_service_list_name_length = getInt(b, localOffset++, 1, MASK_8BITS);
dvb_i_service_list_name = getString(b, localOffset, dvb_i_service_list_name_length);
localOffset += dvb_i_service_list_name_length;
dvb_i_service_list_provider_name_length = getInt(b, localOffset++, 1, MASK_8BITS);
dvb_i_service_list_provider_name = getString(b, localOffset, dvb_i_service_list_provider_name_length);
localOffset += dvb_i_service_list_provider_name_length;
}
}
private_data_byte = copyOfRange(b, localOffset, localOffset + descriptorLength + 2);
}
}
Expand All @@ -80,6 +105,13 @@ public DefaultMutableTreeNode getJTreeNode(final int modus) {
if ((uri_linkage_type == 0x00) || (uri_linkage_type == 0x01)) {
t.add(new KVP("min_polling_interval", min_polling_interval));
}
if (uri_linkage_type == 0x03) {
t.add(new KVP("dvb-i endpoint_type", dvb_i_endpoint_type).setDescription(getDVBIEndpointType(dvb_i_endpoint_type)));
if (dvb_i_endpoint_type == 0x03) {
t.add(new KVP("dvb-i service_list_name", dvb_i_service_list_name));
t.add(new KVP("dvb-i service_list_provider_name", dvb_i_service_list_provider_name));
}
}
if (private_data_byte != null) {
t.add(new KVP("private_data_byte", private_data_byte));
}
Expand All @@ -90,4 +122,8 @@ private static String getURILinkageTypeString(int uri_linkage_type) {
return uri_linkage_type_list.get(uri_linkage_type);
}

private static String getDVBIEndpointType(int dvb_i_endpoint_type) {
return dvb_i_endpoint_type_list.get(dvb_i_endpoint_type);
}

}
Loading

0 comments on commit bc766a6

Please sign in to comment.