📄 decoder.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.*//* Decoder class */#ifndef decoder_h#define decoder_h#include "Consumer.H"#include "TS.H"#include "PES.H"#include "InputPort.H"#include "Directory.H"#include "Events.H"class TSConsumer; class ConsumerRecord;class Decoder{public: Decoder (EventManager*); // connect and read void connect (InputPort*); void read_packet (); void flush (); // access functions void install_netpid (int); void install_dir (Directory*); void install_prog (Program*); Directory* get_dir (); int get_networkpid (); EventManager* get_manager (); TS* get_ts (); TS* get_ts (int); PES* get_pes (int); Consumer* get_cons (int); // utilities int packet_number; void print_pids ();private: EventManager* manager; Directory* dir; InputPort* iport; int net_pid; Consumer* pat_cons; Consumer* ca_cons; TSConsumer* tscons; ConsumerRecord* head_crec; void add_cons (int, Consumer*); void install_prog_on_current_list (Program*); ConsumerRecord* install_prog_on_new_list (Program*, ConsumerRecord*); ConsumerRecord* find_crec (int); ConsumerRecord* find_and_remove_crec (int); };class ConsumerRecord{public: ConsumerRecord (int, Consumer*); TS* ts; int pid; Consumer* cons; ConsumerRecord* next_crec;};/* DOCUMENTATION A Decoder is basically an encapulation of the environment present as a transport stream is read. The Decoder object manages such global information as the Network Table pid value, the current packet number and the number of programs and streams per program (as represented in the Directory structure). Internally a Decoder manages a lookup table associating each active pid value with a Consumer and other pid-specific information. When the pid value is read from a new packet the corresponding record is accessed and installed. The associated Consumer is used to read the payload of the transport packet. An associated TS object is installed as the current TS object in the decoder. This object is examined to determine, for example, whether the continuity counter incremented correctly since the last packet with the same pid value. The Decoder supports the public method: void read_packet (); Called to read a new transport packet. */#endif
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -