www.pudn.com > MPEG2systemsrc.rar > Section.H


/* Copyright (C) 1995, Tektronix Inc. All Rights Reserved.
 *
 *   Usage Restrictions
 *
 * License is granted to copy, to use, and to make and to use derivative
 * works for research and evaluation purposes only.
 *
 *   Disclaimer of Warranty
 *
 * These software programs are available to the user without any license
 * fee or royalty on an "as is" basis.  Tektronix Inc. disclaims any and
 * all warranties, whether express, implied, or statuary, including any
 * implied warranties or merchantability or of fitness for a particular
 * purpose.  In no event shall the copyright-holder be liable for any 
 * incidental, punitive, or consequential damages of any kind whatsoever
 * arising from the use of these programs.
 *
 * This disclaimer of warranty extends to the user of these programs and
 * user's customers, employees, agents, transferees, successors, and
 * assigns.
 *
 * The Tektronix Inc. does not represent or warrant that the programs
 * furnished hereunder are free of infringement of any third-party
 * patents.
*/

/* Section class */
#ifndef section_h
#define section_h

class Section
{
public:
  Section ();
  int pointer;                      // offset into TP payload
  int table_id;                     // table_id
  char section_syntax_code;         // (S,L) - Short or Long
  int section_length;               // 0..1024
  int version_number;               // 0..31
  char current_next_code;           // (C,N) - Current table or Next table
  int section_number;               // 0..255
  int last_section_number;          // 0..255
  void print_a ();
  void print_b ();  
};

/* PATSection class */

class PATSection : public Section
{
public:
  PATSection ();
  int transport_stream_id;          // 16 bits, app specific
  void print ();
};

/* MapSection class */

#include "Directory.H"

class MapSection : public Section
{
public:
  MapSection (Program*);
  Program* program;                 // from directory
  int program_number;               // 16 bits
  int pcr_pid;                      // 13 bits
  int program_info_length;          // 12 bits
  void print ();
};

class CASection : public Section
{
public:
  CASection ();
  void print ();
};

/* PriSection class */

class PriSection : public Section
{
public:
  PriSection ();
  int table_id_extension;           // 16 bits, user defined
};

/*
 DOCUMENTATION

 The Section class and its subclasses are syntax classes; their
 objects objects encapsulate the structure of the various PSI sections.
 When generating packets (say in an encoder application) these
 objects are used as templates.  Changing the template will change the
 structure of the sections being generated.  When parsing sections (say
 in a decoder application) these objects are set to reflect the structure
 of the packet being parsed and can then be examined by the
 application.

 Mnemonic chars are used to represent the various values of the fields
 (e.g.  the current_next_code can be 'C' or 'N').  These are listed in
 the above comments.

 All the fields are exposed as public members.
*/

#endif