/*
 * Emunation Plugin for MD-API 
 *
 * This code is free software; you can redistribute it and/or
 * modify it under the terms of the GNU General Public License
 * as published by the Free Software Foundation; either version 2
 * of the License, or (at your option) any later version.
 *
 * This code is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
 * Or, point your browser to http://www.gnu.org/copyleft/gpl.html
 */
 
#ifndef __DVBPARSER_H
#define __DVBPARSER_H
#include "modeparser.h"
#include "..\vdr\tools.h"

//DVB Parser Interface
#define MAX_MODEPARSER 20

class cDVBParser
{
public:      
        static const int DVB_PACKETMODE_SECTION=0x0000;
        static const int DVB_PACKETTYPE_TS=0x0101;
        static const int DVB_PACKETTYPE_MDAPI=0x0100;
       
        cDVBParser();
        ~cDVBParser();
        void SetBuffer(unsigned char* buffer,int length,int type);
        bool AnalyzePacket(int packetmode);
        cListBase* GetPacketData();
        cDVBModeParser* FindModeParser(int);
       
private:
        unsigned char* m_buf;
        int m_buflength;
        int m_buftype;
        cDVBModeParser* m_modeparsers[MAX_MODEPARSER];
        cDVBModeParser* m_curmodep;
        
};
#endif
