コード例 #1
0
void eit_section_filter::do_handle_section(
    context& c,
    const char* section_buffer,
    size_t section_length) {
  section s;
  s.unpack(section_buffer, section_length);
  event_information_table eit;
  s.convert(eit);

  if(s.header.table_id == 0x4E) //FIXME
  c.get_view().print(
      c.get_packet_num(),
      s.header,
      eit,
      subtable_is_changed(s.header, eit));

  if(s.header.table_id == 0x4E &&
     s.header.section_number == 0) {
    if(subtable_is_changed(s.header, eit)){
      c.signal_eit();
    }
  }

  // FIXME
  if(s.header.section_number == s.header.last_section_number) {
    version_
      [s.header.table_id]
      [s.header.table_id_extension]
      [eit.transport_stream_id]
      [eit.original_network_id]
        = s.header.version;
  }
}
コード例 #2
0
void pat_section_filter::do_handle_section(
      context& c,
      const char* section_buffer,
      size_t section_length) {
  section s;
  s.unpack(section_buffer, section_length);
  program_association_table pat;
  s.convert<program_association_table>(pat);

  c.get_view().print(
      c.get_packet_num(),
      s.header,
      pat,
      last_version_ != s.header.version);

  if(last_version_ == s.header.version)
    return;

  c.pat = pat;

  for(auto& i : pat.association) {
    if(i.program_number != 0) {
      if(!c.is_opened(i.pmt_pid)) {
        c.open_section_filter(
            i.pmt_pid,
            std::unique_ptr<section_filter>(
              new pmt_section_filter()));
      }
    }
  }

  last_version_ = s.header.version;
}