2 * jTsSplitter - java based mpeg2ts splitter.
3 * Copyright (C) 2009-2010 Yukikaze
6 package jtssplitter.data.descriptor;
8 import java.io.UnsupportedEncodingException;
9 import java.util.logging.Level;
10 import java.util.logging.Logger;
16 public class ARIB_Audio_Component_Descriptor extends jtssplitter.data.descriptor.abstract_Descriptor{
17 private int Descriptor;
18 private int compornent_type;
19 private int compornent_tag;
20 private int stream_type;
21 private boolean ES_multi_lingual_flag;
22 private boolean main_component_flag;
23 private int quality_indicator;
24 private int sampling_rate;
25 private int ISO_639_language_code;
26 private int ISO_639_language_code_2;
29 public int getDescriptorTag() {
34 public void analyzeDescriptor(byte[] descriptor) {
35 Descriptor=descriptor[0]&0xFF;
36 compornent_type=descriptor[3]&0xFF;
37 compornent_tag=descriptor[4]&0xFF;
38 stream_type=descriptor[5]&0xFF;
39 ES_multi_lingual_flag=(((descriptor[7]&0x80)>>7)==1);
40 main_component_flag=(((descriptor[7]&0x40)>>6)==1);
41 quality_indicator=(descriptor[7]&0x30>>4);
42 sampling_rate=(descriptor[7]&0xE>>1);
43 ISO_639_language_code=(((descriptor[8]&0xFF)<<16)+((descriptor[9]&0xFF)<<8)+(descriptor[10]&0xFF));
44 if (ES_multi_lingual_flag){
45 ISO_639_language_code_2=(((descriptor[11]&0xFF)<<16)+((descriptor[12]&0xFF)<<8)+(descriptor[13]&0xFF));
47 text = new String(descriptor, 14, descriptor.length - 14, "EUC-JP");
48 } catch (UnsupportedEncodingException ex) {
49 Logger.getLogger(ARIB_Audio_Component_Descriptor.class.getName()).log(Level.SEVERE, null, ex);
53 text = new String(descriptor, 11, descriptor.length - 11, "EUC-JP");
54 } catch (UnsupportedEncodingException ex) {
55 Logger.getLogger(ARIB_Audio_Component_Descriptor.class.getName()).log(Level.SEVERE, null, ex);
62 public void analyzeDescriptor(int DescriptorTag, byte[] descriptor) {
64 throw new UnsupportedOperationException("Not supported yet.");
69 * @return the compornent_type
71 * -2:1/0+1/0(デュアルモノラル)
76 * -9:3/2+LFE (5.1chサラウンド)
78 public int getCompornent_type() {
79 return compornent_type;
83 * @return the compornent_tag
85 public int getCompornent_tag() {
86 return compornent_tag;
90 * @return the stream_type
92 public int getStream_type() {
97 * @return the ES_multi_lingual_flag
99 public boolean isES_multi_lingual_flag() {
100 return ES_multi_lingual_flag;
104 * @return the main_component_flag
106 public boolean isMain_component_flag() {
107 return main_component_flag;
111 * @return the quality_indicator
113 public int getQuality_indicator() {
114 return quality_indicator;
119 * @return the sampling_rate
127 public int getSampling_rate() {
128 return sampling_rate;
132 * @return the ISO_639_language_code
134 public int getISO_639_language_code() {
135 return ISO_639_language_code;
139 * @return the ISO_639_language_code_2
141 public int getISO_639_language_code_2() {
142 return ISO_639_language_code_2;
148 public String getText() {