Class: Ariblib::EventGroupDescriptor

Inherits:
Descriptor 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



125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
# File 'lib/ariblib/Descriptor.rb', line 125

def parse(h,bs,tag,descriptor_length)
  list=[]
  #event_group_descriptor (){
  group_type   = bs.read 4 #uimsbf
  event_count  = bs.read 4 #uimsbf
  event_count.times do 
    service_id = bs.read 16 #uimsbf
    event_id   = bs.read 16 #uimsbf
    list <<[service_id,event_id]
  end
  if(group_type == 4 || group_type ==5)
    len=(descriptor_length-1-event_count*4)/8
    len.times do
      original_network_id  = bs.read 16 #uimsbf
      transport_stream_id  = bs.read 16 #uimsbf
      service_id           = bs.read 16 #uimsbf
      event_id             = bs.read 16 #uimsbf
    end
  else
    len=(descriptor_length-1-event_count*4)
    private_data_byte = bs.str len #uimsbf
  end
  h[:event_group]=[group_type,list]
end