| 1 |
/* |
| 2 |
* Copyright (C) 2006 Team MediaPortal |
| 3 |
* http://www.team-mediaportal.com |
| 4 |
* |
| 5 |
* This Program is free software; you can redistribute it and/or modify |
| 6 |
* it under the terms of the GNU General Public License as published by |
| 7 |
* the Free Software Foundation; either version 2, or (at your option) |
| 8 |
* any later version. |
| 9 |
* |
| 10 |
* This Program is distributed in the hope that it will be useful, |
| 11 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 12 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 13 |
* GNU General Public License for more details. |
| 14 |
* |
| 15 |
* You should have received a copy of the GNU General Public License |
| 16 |
* along with GNU Make; see the file COPYING. If not, write to |
| 17 |
* the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, |
| 18 |
* MA 02110-1335 USA |
| 19 |
* http://www.gnu.org/copyleft/gpl.html |
| 20 |
* |
| 21 |
*/ |
| 22 |
#pragma once |
| 23 |
#include "SectionDecoder.h" |
| 24 |
#include "TSHeader.h" |
| 25 |
#include "PidTable.h" |
| 26 |
#include <map> |
| 27 |
|
| 28 |
#define SERVICE_TYPE_VIDEO_UNKNOWN -1 |
| 29 |
#define SERVICE_TYPE_VIDEO_MPEG1 0x01 |
| 30 |
#define SERVICE_TYPE_VIDEO_MPEG2 0x02 |
| 31 |
#define SERVICE_TYPE_DCII_OR_LPCM 0x80 // can be DC-II MPEG2 Video OR LPCM Audio if registration descriptor=HDMV |
| 32 |
#define SERVICE_TYPE_VIDEO_MPEG4 0x10 |
| 33 |
#define SERVICE_TYPE_VIDEO_H264 0x1b |
| 34 |
#define SERVICE_TYPE_AUDIO_UNKNOWN -1 |
| 35 |
#define SERVICE_TYPE_AUDIO_MPEG1 0x03 |
| 36 |
#define SERVICE_TYPE_AUDIO_MPEG2 0x04 |
| 37 |
#define SERVICE_TYPE_AUDIO_AC3 0x81 //fake |
| 38 |
#define SERVICE_TYPE_AUDIO_AAC 0x0f |
| 39 |
#define SERVICE_TYPE_AUDIO_LATM_AAC 0x11 //LATM AAC audio |
| 40 |
|
| 41 |
#define SERVICE_TYPE_AUDIO_DD_PLUS 0x84 |
| 42 |
#define SERVICE_TYPE_DVB_SUBTITLES1 0x05 |
| 43 |
#define SERVICE_TYPE_DVB_SUBTITLES2 0x06 |
| 44 |
|
| 45 |
#define DESCRIPTOR_REGISTRATION 0x05 |
| 46 |
#define DESCRIPTOR_VBI_TELETEXT 0x46 |
| 47 |
#define DESCRIPTOR_DVB_AC3 0x6a |
| 48 |
#define DESCRIPTOR_DVB_E_AC3 0x7a |
| 49 |
#define DESCRIPTOR_DVB_TELETEXT 0x56 |
| 50 |
#define DESCRIPTOR_DVB_SUBTITLING 0x59 |
| 51 |
#define DESCRIPTOR_MPEG_ISO639_Lang 0x0a |
| 52 |
|
| 53 |
namespace MPTV |
| 54 |
{ |
| 55 |
class IPmtCallBack |
| 56 |
{ |
| 57 |
public: |
| 58 |
virtual void OnPmtReceived(int pmtPid) = 0; |
| 59 |
virtual void OnPidsReceived(const CPidTable& info) = 0; |
| 60 |
}; |
| 61 |
|
| 62 |
class CPmtParser : public CSectionDecoder |
| 63 |
{ |
| 64 |
public: |
| 65 |
CPmtParser(void); |
| 66 |
virtual ~CPmtParser(void); |
| 67 |
void OnNewSection(CSection& section); |
| 68 |
void SetPmtCallBack(IPmtCallBack* callback); |
| 69 |
bool IsReady(); |
| 70 |
CPidTable& GetPidInfo(); |
| 71 |
|
| 72 |
private: |
| 73 |
bool m_isFound; |
| 74 |
IPmtCallBack* m_pmtCallback; |
| 75 |
CTsHeader m_tsHeader; |
| 76 |
CPidTable m_pidInfo; |
| 77 |
}; |
| 78 |
} |
| 79 |
|