⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 consumer.h

📁 1、简介 此代码是IS0 13818-5 MPEG2系统层协议分析代码
💻 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.*//* Consumer class */#ifndef consumer_h#define consumer_h#include "InputPort.H"class Decoder;  typedef int CState;#define CSTART 0
#define IGNORE -1
class Consumer {public:  Consumer (Decoder*);  void connect (InputPort*);  virtual int read_partial (int);  virtual void set_cstate (CState);  virtual CState get_cstate ();  virtual void flush ();protected:  Decoder* decoder;  InputPort* iport;  CState cstate;};/* DOCUMENTATION Consumers read things from InputPorts. Typical subclasses are TSConsumer, PESConsumer, PATConsumer, MapConsumer, etc.  Although some of these classes define methods for reading directly from the InputPort and parsing immediately (e.g. TSConsumer), Consumers can also be set up to read bytes from the InputPort into a buffer, buf. In this case parsing/analysis is deferred until the complete syntactic unit (e.g. a PES packet or PAT Section) is in the buffer. As streams are read and analysed various events are triggered (e.g. TSParsedEvent, UnexpectedPid, etc.) Public members are:  Consumer (Decoder*);    The only constructor.  All Consumers have a Decoder object    available.  This is used to access or manipulate information    related to the overall transport stream.  The Decoder object is    also used to access the EventManager for the geneation of events.   void connect (InputPort*);    To connect to the InputPort.  virtual void flush ();    A virtual function defined by subclasses.  PESConsumer, for    example, flushes it's elementary stream port.        virtual int read_partial (int);    Will read a specified number of bytes from the InputPort.    The specifics are different in each subclass.   virtual void set_cstate (CState);  virtual CState get_cstate ();    These two functions get and set the Consumer's state.  A Consumer    may be in state CSTART or it may be in one of the states that are    specific to one of the subclasses.  This is set to CSTART, for    example, by a TSConsumer when a payload_unit_start_indicator is    found to be '1'.  In the subclasses it is manaaged and utilized in    subsequent calls to read_partial.*/#endif

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -