Class: Ariblib::AudioComponentDescriptor

Inherits:
Descriptor
  • Object
show all
Defined in:
lib/ariblib/Descriptor.rb

Instance Method Summary collapse

Methods inherited from Descriptor

#initialize

Constructor Details

This class inherits a constructor from Ariblib::Descriptor

Instance Method Details

#parse(h, bs, tag, descriptor_length) ⇒ Object



90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
# File 'lib/ariblib/Descriptor.rb', line 90

def parse(h,bs,tag,descriptor_length)
  text_length = descriptor_length - 9#8 uimsbf

  reserved_future_use        = bs.read 4 #bslbf

  stream_content             = bs.read 4 #uimsbf

  component_type             = bs.getc #8 uimsbf

  component_tag              = bs.getc #8 uimsbf

  stream_type                = bs.getc #8 uimsbf

  simulcast_group_tag        = bs.getc #8 bslbf

  es_multi_lingual_flag      = bs.read 1 #bslbf

  main_component_flag        = bs.read 1 #bslbf

  quality_indicator          = bs.read 2 #bslbf

  sampling_rate              = bs.read 3 #uimsbf

  reserved_future_use        = bs.read 1 #bslbf

  iso_639_language_code      = bs.read 24 #bslbf

  if (es_multi_lingual_flag == 1)
    iso_639_language_code_2  = bs.read 24 #bslbf

    text_length-= 3
  end
  text_char = Ariblib::String.new(bs,text_length).to_utf8
  h[:audio_component]=text_char
end