OSDN Git Service

stop using trunk or dist directory in rec10 project.
[rec10/rec10-git.git] / tstools / DtsEdit / src / gpac / mpegts.h
diff --git a/tstools/DtsEdit/src/gpac/mpegts.h b/tstools/DtsEdit/src/gpac/mpegts.h
deleted file mode 100644 (file)
index c69bb7c..0000000
+++ /dev/null
@@ -1,681 +0,0 @@
-/*\r
- *                     GPAC - Multimedia Framework C SDK\r
- *\r
- *                     Authors: Walid B.H - Jean Le Feuvre\r
- *    Copyright (c)2006-200X ENST - All rights reserved\r
- *\r
- *  This file is part of GPAC / MPEG2-TS sub-project\r
- *\r
- *  GPAC is free software; you can redistribute it and/or modify\r
- *  it under the terms of the GNU Lesser General Public License as published by\r
- *  the Free Software Foundation; either version 2, or (at your option)\r
- *  any later version.\r
- *   \r
- *  GPAC is distributed in the hope that it will be useful,\r
- *  but WITHOUT ANY WARRANTY; without even the implied warranty of\r
- *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\r
- *  GNU Lesser General Public License for more details.\r
- *   \r
- *  You should have received a copy of the GNU Lesser General Public\r
- *  License along with this library; see the file COPYING.  If not, write to\r
- *  the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. \r
- *\r
- */\r
-\r
-\r
-#ifndef _GF_MPEG_TS_H_\r
-#define _GF_MPEG_TS_H_\r
-\r
-#include <gpac/list.h>\r
-#include <gpac/internal/odf_dev.h>\r
-\r
-typedef struct tag_m2ts_demux GF_M2TS_Demuxer;\r
-typedef struct tag_m2ts_es GF_M2TS_ES;\r
-typedef struct tag_m2ts_section_es GF_M2TS_SECTION_ES;\r
-\r
-/*Maximum number of streams in a TS*/\r
-#define GF_M2TS_MAX_STREAMS    8192\r
-\r
-/*MPEG-2 TS Media types*/\r
-enum\r
-{\r
-       GF_M2TS_VIDEO_MPEG1                             = 0x01,\r
-       GF_M2TS_VIDEO_MPEG2                             = 0x02,\r
-       GF_M2TS_AUDIO_MPEG1                             = 0x03,\r
-       GF_M2TS_AUDIO_MPEG2                             = 0x04, \r
-       GF_M2TS_PRIVATE_SECTION                 = 0x05,\r
-       GF_M2TS_PRIVATE_DATA                    = 0x06,\r
-       GF_M2TS_AUDIO_AAC                               = 0x0F,\r
-       GF_M2TS_VIDEO_MPEG4                             = 0x10,\r
-       GF_M2TS_AUDIO_LATM_AAC                  = 0x11,\r
-\r
-       GF_M2TS_SYSTEMS_MPEG4_PES               = 0x12,\r
-       GF_M2TS_SYSTEMS_MPEG4_SECTIONS  = 0x13,\r
-\r
-       GF_M2TS_VIDEO_H264                              = 0x1B,\r
-\r
-       GF_M2TS_AUDIO_AC3                               = 0x81,\r
-       GF_M2TS_AUDIO_DTS                               = 0x8A,\r
-       GF_M2TS_SUBTITLE_DVB                    = 0x100,\r
-};\r
-/*returns readable name for given stream type*/\r
-const char *gf_m2ts_get_stream_name(u32 streamType);\r
-\r
-/*PES data framing modes*/\r
-enum\r
-{\r
-       /*use data framing: recompute start of AUs (data frames)*/\r
-       GF_M2TS_PES_FRAMING_DEFAULT,\r
-       /*don't use data framing: all packets are raw PES packets*/\r
-       GF_M2TS_PES_FRAMING_RAW,\r
-       /*skip pes processing: all transport packets related to this stream are discarded*/\r
-       GF_M2TS_PES_FRAMING_SKIP\r
-};\r
-\r
-/*PES packet flags*/\r
-enum\r
-{\r
-       GF_M2TS_PES_PCK_RAP = 1,\r
-       GF_M2TS_PES_PCK_AU_START = 1<<1,\r
-       /*visual frame starting in this packet is an I frame or IDR (AVC/H264)*/\r
-       GF_M2TS_PES_PCK_I_FRAME = 1<<2,\r
-       /*visual frame starting in this packet is a P frame*/\r
-       GF_M2TS_PES_PCK_P_FRAME = 1<<3,\r
-       /*visual frame starting in this packet is a B frame*/\r
-       GF_M2TS_PES_PCK_B_FRAME = 1<<4\r
-};\r
-\r
-/*Events used by the MPEGTS demuxer*/\r
-enum\r
-{\r
-       /*PAT has been found (service connection) - no assoctiated parameter*/\r
-       GF_M2TS_EVT_PAT_FOUND = 0,\r
-       /*PAT has been updated - no assoctiated parameter*/\r
-       GF_M2TS_EVT_PAT_UPDATE,\r
-       /*repeated PAT has been found (carousel) - no assoctiated parameter*/\r
-       GF_M2TS_EVT_PAT_REPEAT,\r
-       /*PMT has been found (service tune-in) - assoctiated parameter: new PMT*/\r
-       GF_M2TS_EVT_PMT_FOUND,\r
-       /*repeated PMT has been found (carousel) - assoctiated parameter: updated PMT*/\r
-       GF_M2TS_EVT_PMT_REPEAT,\r
-       /*PMT has been changed - assoctiated parameter: updated PMT*/\r
-       GF_M2TS_EVT_PMT_UPDATE,\r
-       /*SDT has been received - assoctiated parameter: none*/\r
-       GF_M2TS_EVT_SDT_FOUND,\r
-       /*repeated SDT has been found (carousel) - assoctiated parameter: none*/\r
-       GF_M2TS_EVT_SDT_REPEAT,\r
-       /*SDT has been received - assoctiated parameter: none*/\r
-       GF_M2TS_EVT_SDT_UPDATE,\r
-       /*INT has been received - assoctiated parameter: none*/\r
-       GF_M2TS_EVT_INT_FOUND,\r
-       /*repeated INT has been found (carousel) - assoctiated parameter: none*/\r
-       GF_M2TS_EVT_INT_REPEAT,\r
-       /*INT has been received - assoctiated parameter: none*/\r
-       GF_M2TS_EVT_INT_UPDATE,\r
-       /*PES packet has been received - assoctiated parameter: PES packet*/\r
-       GF_M2TS_EVT_PES_PCK,\r
-       /*PCR has been received - assoctiated parameter: PES packet with no data*/\r
-       GF_M2TS_EVT_PES_PCR,\r
-       /*An MPEG-4 SL Packet has been received in a section - assoctiated parameter: SL packet */\r
-       GF_M2TS_EVT_SL_PCK,\r
-       /*An IP datagram has been received in a section - assoctiated parameter: IP datagram */\r
-       GF_M2TS_EVT_IP_DATAGRAM,\r
-\r
-       /*AAC config has been extracted - associated parameter: PES Packet with encoded M4ADecSpecInfo in its data\r
-               THIS MUST BE CLEANED UP\r
-       */\r
-       GF_M2TS_EVT_AAC_CFG,\r
-#if 0\r
-       /* An EIT message for the present or following event on this TS has been received */\r
-       GF_M2TS_EVT_EIT_ACTUAL_PF,\r
-       /* An EIT message for the schedule of this TS has been received */\r
-       GF_M2TS_EVT_EIT_ACTUAL_SCHEDULE,\r
-       /* An EIT message for the present or following event of an other TS has been received */\r
-       GF_M2TS_EVT_EIT_OTHER_PF,\r
-       /* An EIT message for the schedule of an other TS has been received */\r
-       GF_M2TS_EVT_EIT_OTHER_SCHEDULE,\r
-       /* A message to inform about the current date and time in the TS */\r
-       GF_M2TS_EVT_TDT,\r
-       /* A message to inform about the current time offset in the TS */\r
-       GF_M2TS_EVT_TOT,\r
-#endif\r
-       /* A generic event message for EIT, TDT, TOT etc */\r
-       GF_M2TS_EVT_DVB_GENERAL,\r
-};\r
-\r
-enum\r
-{\r
-       GF_M2TS_TABLE_START             = 1,\r
-       GF_M2TS_TABLE_END               = 1<<1,\r
-       GF_M2TS_TABLE_FOUND             = 1<<2,\r
-       GF_M2TS_TABLE_UPDATE    = 1<<3,\r
-       GF_M2TS_TABLE_REPEAT    = 1<<4,\r
-};\r
-\r
-typedef void (*gf_m2ts_section_callback)(GF_M2TS_Demuxer *ts, GF_M2TS_SECTION_ES *es, GF_List *sections, u8 table_id, u16 ex_table_id, u8 version_number, u8 last_section_number, u32 status); \r
-\r
-typedef struct __m2ts_demux_section\r
-{\r
-       unsigned char *data;\r
-       u32 data_size;\r
-} GF_M2TS_Section;\r
-\r
-typedef struct __m2ts_demux_table\r
-{\r
-       struct __m2ts_demux_table *next;\r
-\r
-       Bool is_init;\r
-\r
-       /*table id*/\r
-       u8 table_id;\r
-       u16 ex_table_id;\r
-\r
-       /*reassembler state*/\r
-       u8 version_number;\r
-       u8 last_version_number;\r
-\r
-       u8 current_next_indicator;\r
-\r
-       u8 section_number;\r
-       u8 last_section_number;\r
-\r
-       GF_List *sections;\r
-\r
-} GF_M2TS_Table;\r
-\r
-\r
-typedef struct GF_M2TS_SectionFilter\r
-{\r
-       /*section reassembler*/\r
-       s16 cc;\r
-       /*section buffer (max 4096)*/\r
-       char *section;\r
-       /*current section length as indicated in section header*/\r
-       u16 length;\r
-       /*number of bytes received from current section*/\r
-       u16 received;\r
-       /*error indiator when reaggregating sections*/\r
-       u8 had_error;\r
-\r
-       /*section->table aggregator*/\r
-       GF_M2TS_Table *table;\r
-       \r
-       /* indicates that the section and last_section_number do not need to be checked */\r
-       Bool process_individual;\r
-\r
-       /* indicates that the section header with table id and extended table id ... is\r
-          not parsed by the TS demuxer and left for the application  */\r
-       Bool direct_dispatch;\r
-\r
-       gf_m2ts_section_callback process_section; \r
-} GF_M2TS_SectionFilter;\r
-\r
-\r
-\r
-/*MPEG-2 TS program object*/\r
-typedef struct \r
-{\r
-       GF_List *streams;\r
-       u32 pmt_pid;  \r
-       u32 pcr_pid;\r
-       u32 number;\r
-\r
-       GF_InitialObjectDescriptor *pmt_iod;\r
-\r
-       /*list of additional ODs found per program !! used by media importer only , refine this !! \r
-               this list is only created when MPEG-4 over MPEG-2 is detected\r
-               the list AND the ODs contained in it are destroyed when destroying the demuxer\r
-       */\r
-       GF_List *additional_ods;\r
-       /*first dts found on this program - this is used by parsers, but not setup by the lib*/\r
-       u64 first_dts;\r
-} GF_M2TS_Program;\r
-\r
-/*ES flags*/\r
-enum\r
-{\r
-       /*ES is a section stream*/\r
-       GF_M2TS_ES_IS_SECTION = 1,\r
-       /*ES is an mpeg-4 flexmux stream*/\r
-       GF_M2TS_ES_IS_FMC = 1<<1,\r
-       /*ES is an mpeg-4 SL-packetized stream*/\r
-       GF_M2TS_ES_IS_SL = 1<<2,\r
-       /*ES is an mpeg-4 Object Descriptor SL-packetized stream*/\r
-       GF_M2TS_ES_IS_MPEG4_OD = 1<<3,\r
-       \r
-       /*all flags above this mask are used by importers & co*/\r
-       GF_M2TS_ES_STATIC_FLAGS_MASK = 0x0000FFFF,\r
-\r
-       /*Flag used by importers*/\r
-       GF_M2TS_ES_FIRST_DTS = 1<<20,\r
-};\r
-\r
-/*Abstract Section/PES stream object, only used for type casting*/\r
-#define ABSTRACT_ES            \\r
-                       GF_M2TS_Program *program; \\r
-                       u32 flags; \\r
-                       u32 pid; \\r
-                       u32 stream_type; \\r
-                       u32 mpeg4_es_id; \\r
-                       void *user; \\r
-                       u64 first_dts;\r
-\r
-struct tag_m2ts_es\r
-{\r
-       ABSTRACT_ES\r
-};\r
-\r
-/*INT object*/\r
-typedef struct\r
-{\r
-       u32 id;\r
-} GF_M2TS_INT;\r
-\r
-struct tag_m2ts_section_es\r
-{\r
-       ABSTRACT_ES\r
-       GF_M2TS_SectionFilter *sec;\r
-\r
-       /* MPE Frame object, MPE-FEC related data */\r
-       GF_M2TS_INT *ip_mac_not_table;  \r
-};                     \r
-\r
-/*******************************************************************************/\r
-typedef struct tag_m2ts_dvb_sub\r
-{\r
-       char language[3];\r
-       u8 type;\r
-       u16 composition_page_id;\r
-       u16 ancillary_page_id;\r
-} GF_M2TS_DVB_Subtitling_Descriptor;\r
-\r
-typedef struct tag_m2ts_dvb_teletext\r
-{\r
-       char language[3];\r
-       u8 type;\r
-       u8 magazine_number;\r
-       u8 page_number;\r
-} GF_M2TS_DVB_Teletext_Descriptor;\r
-\r
-/*MPEG-2 TS ES object*/\r
-typedef struct tag_m2ts_pes\r
-{\r
-       ABSTRACT_ES\r
-       u32 lang;\r
-\r
-       /*object info*/\r
-       u32 vid_w, vid_h, vid_par, aud_sr, aud_nb_ch;\r
-       /*user private*/\r
-\r
-\r
-       /*mpegts lib private - do not touch :)*/\r
-       /*PES re-assembler*/\r
-       unsigned char *data;\r
-       u32 data_len, pes_len;\r
-       Bool rap;\r
-       u64 PTS, DTS;\r
-       \r
-       /*PES reframer - if NULL, pes processing is skiped*/\r
-       u32 frame_state;\r
-       void (*reframe)(struct tag_m2ts_demux *ts, struct tag_m2ts_pes *pes, u64 DTS, u64 CTS, unsigned char *data, u32 data_len);\r
-       /*LATM stuff - should be moved out of mpegts*/\r
-       unsigned char *buf;\r
-       u32 buf_len;\r
-\r
-       GF_M2TS_DVB_Subtitling_Descriptor sub;\r
-\r
-} GF_M2TS_PES;\r
-\r
-/*SDT information object*/\r
-typedef struct\r
-{\r
-       u16 original_network_id;\r
-       u16 transport_stream_id;\r
-       u32 service_id;\r
-       u32 EIT_schedule;\r
-       u32 EIT_present_following;\r
-       u32 running_status;\r
-       u32 free_CA_mode;\r
-       u8 service_type;\r
-       unsigned char *provider, *service;\r
-} GF_M2TS_SDT;\r
-\r
-typedef struct\r
-{\r
-       u16 network_id;\r
-       unsigned char *network_name;\r
-       u16 original_network_id;\r
-       u16 transport_stream_id;\r
-       u16 service_id;\r
-       u32 service_type;\r
-       u32 logical_channel_number;\r
-} GF_M2TS_NIT;\r
-\r
-#define GF_M2TS_BASE_DESCRIPTOR u32 tag;\r
-\r
-typedef struct {\r
-       u8 content_nibble_level_1, content_nibble_level_2, user_nibble;\r
-} GF_M2TS_DVB_Content_Descriptor;\r
-\r
-typedef struct {\r
-       char country_code[3];\r
-       u8 value;\r
-} GF_M2TS_DVB_Rating_Descriptor;\r
-\r
-typedef struct {\r
-       unsigned char lang[3];\r
-       unsigned char *event_name, *event_text;\r
-} GF_M2TS_DVB_Short_Event_Descriptor;\r
-\r
-typedef struct {\r
-       unsigned char *item;\r
-       unsigned char *description;\r
-} GF_M2TS_DVB_Extended_Event_Item;\r
-\r
-typedef struct {\r
-       unsigned char lang[3];\r
-       u32 last;\r
-       GF_List *items;\r
-       unsigned char *text;\r
-} GF_M2TS_DVB_Extended_Event_Descriptor;\r
-\r
-/*EIT information objects*/\r
-typedef struct\r
-{\r
-       u32 year, month, day, time;\r
-\r
-       /* local time offset descriptor data */\r
-       char country_code[3];\r
-       u8 country_region_id;\r
-       u8 local_time_offset_polarity;\r
-       u16 local_time_offset;\r
-       /*time_of_change*/\r
-       u32 toc_year, toc_month, toc_day, toc_time;\r
-       u16 next_time_offset;\r
-} GF_M2TS_DateTime_Event;\r
-\r
-typedef struct {\r
-       u8 stream_content;\r
-       u8 component_type;\r
-       u8 component_tag;\r
-       char language_code[3];\r
-       unsigned char *text;\r
-} GF_M2TS_Component;\r
-\r
-typedef struct\r
-{\r
-       u16 event_id;\r
-       GF_M2TS_DateTime_Event start;\r
-       u32 duration;\r
-       u8 running_status;\r
-       u8 free_CA_mode;\r
-       GF_List *short_events;\r
-       GF_List *extended_events;\r
-       GF_List *components;\r
-       GF_List *contents;\r
-       GF_List *ratings;\r
-} GF_M2TS_EIT_Event;\r
-\r
-typedef struct\r
-{\r
-       u32 original_network_id;\r
-       u32 transport_stream_id;\r
-       u16 service_id;\r
-       GF_List *events;\r
-} GF_M2TS_EIT;\r
-\r
-void gf_m2ts_decode_mjd_date(u32 date, u32 *year, u32 *month, u32 *day);\r
-\r
-\r
-/*MPEG-2 TS packet*/\r
-typedef struct\r
-{\r
-       char *data;\r
-       u32 data_len;\r
-       u32 flags;\r
-       u64 PTS, DTS;\r
-       /*parent stream*/\r
-       GF_M2TS_PES *stream;\r
-} GF_M2TS_PES_PCK;\r
-\r
-/*MPEG-4 SL packet from MPEG-2 TS*/\r
-typedef struct\r
-{\r
-       char *data;\r
-       u32 data_len;\r
-       /*parent stream */\r
-       GF_M2TS_ES *stream;\r
-} GF_M2TS_SL_PCK;\r
-\r
-/*MPEG-2 TS demuxer*/\r
-struct tag_m2ts_demux\r
-{\r
-       GF_M2TS_ES *ess[GF_M2TS_MAX_STREAMS];\r
-       GF_List *programs;\r
-       /*keep it seperate for now - TODO check if we're sure of the order*/\r
-       GF_List *SDTs;\r
-\r
-       /*user callback - MUST NOT BE NULL*/\r
-       void (*on_event)(struct tag_m2ts_demux *ts, u32 evt_type, void *par);\r
-       /*private user data*/\r
-       void *user;\r
-\r
-       /*private resync buffer*/\r
-       char *buffer;\r
-       u32 buffer_size, alloc_size;\r
-       /*default transport PID filters*/\r
-       GF_M2TS_SectionFilter *pat, *nit, *sdt, *eit, *tdt_tot_st;\r
-\r
-       /* Structure to hold all the INT tables if the TS contains IP streams */\r
-       GF_List *ip_mac_not_tables;\r
-       \r
-       Bool has_4on2;\r
-       /* analyser */\r
-       FILE *pes_out;\r
-\r
-\r
-};\r
-\r
-\r
-GF_M2TS_Demuxer *gf_m2ts_demux_new();\r
-void gf_m2ts_demux_del(GF_M2TS_Demuxer *ts);\r
-void gf_m2ts_reset_parsers(GF_M2TS_Demuxer *ts);\r
-GF_Err gf_m2ts_set_pes_framing(GF_M2TS_PES *pes, u32 mode);\r
-GF_Err gf_m2ts_process_data(GF_M2TS_Demuxer *ts, char *data, u32 data_size);\r
-\r
-u32 gf_m2ts_crc32_check(char *data, u32 len);\r
-\r
-/*MPEG-2 Descriptor tags*/\r
-enum\r
-{\r
-       /* ... */\r
-       GF_M2TS_VIDEO_STREAM_DESCRIPTOR                         = 0x02,\r
-       GF_M2TS_AUDIO_STREAM_DESCRIPTOR                         = 0x03,\r
-       GF_M2TS_HIERARCHY_DESCRIPTOR                            = 0x04,\r
-       GF_M2TS_REGISTRATION_DESCRIPTOR                         = 0x05,\r
-       GF_M2TS_DATA_STREAM_ALIGNEMENT_DESCRIPTOR               = 0x06,\r
-       GF_M2TS_TARGET_BACKGROUND_GRID_DESCRIPTOR               = 0x07,\r
-       GF_M2TS_VIEW_WINDOW_DESCRIPTOR                          = 0x08,\r
-       GF_M2TS_CA_DESCRIPTOR                                   = 0x09,\r
-       GF_M2TS_ISO_639_LANGUAGE_DESCRIPTOR                     = 0x0A,\r
-       /* ... */\r
-       GF_M2TS_STD_DESCRIPTOR                                  = 0x17,\r
-       /* ... */\r
-       GF_M2TS_MPEG4_VIDEO_DESCRIPTOR                          = 0x1B,\r
-       GF_M2TS_MPEG4_AUDIO_DESCRIPTOR                          = 0x1C,\r
-       GF_M2TS_MPEG4_IOD_DESCRIPTOR                            = 0x1D,\r
-       GF_M2TS_MPEG4_SL_DESCRIPTOR                             = 0x1E,\r
-       GF_M2TS_MPEG4_FMC_DESCRIPTOR                            = 0x1F,\r
-       /* ... */\r
-       GF_M2TS_AVC_VIDEO_DESCRIPTOR                            = 0x28,\r
-       /* ... */       \r
-       GF_M2TS_AVC_TIMING_HRD_DESCRIPTOR                       = 0x2A,\r
-       /* ... */\r
-\r
-       /* 0x2D - 0x3F - ISO/IEC 13818-6 values */\r
-       /* 0x40 - 0xFF - User Private values */\r
-       GF_M2TS_DVB_NETWORK_NAME_DESCRIPTOR                     = 0x40,\r
-       GF_M2TS_DVB_SERVICE_LIST_DESCRIPTOR                     = 0x41,\r
-       GF_M2TS_DVB_STUFFING_DESCRIPTOR                         = 0x42,\r
-       GF_M2TS_DVB_SAT_DELIVERY_SYSTEM_DESCRIPTOR              = 0x43,\r
-       GF_M2TS_DVB_CABLE_DELIVERY_SYSTEM_DESCRIPTOR            = 0x44,\r
-       GF_M2TS_DVB_VBI_DATA_DESCRIPTOR                         = 0x45,\r
-       GF_M2TS_DVB_VBI_TELETEXT_DESCRIPTOR                     = 0x46,\r
-       GF_M2TS_DVB_BOUQUET_NAME_DESCRIPTOR                     = 0x47,\r
-       GF_M2TS_DVB_SERVICE_DESCRIPTOR                          = 0x48,\r
-       GF_M2TS_DVB_COUNTRY_AVAILABILITY_DESCRIPTOR             = 0x49,\r
-       GF_M2TS_DVB_LINKAGE_DESCRIPTOR                          = 0x4A,\r
-       GF_M2TS_DVB_NVOD_REFERENCE_DESCRIPTOR                   = 0x4B,\r
-       GF_M2TS_DVB_TIME_SHIFTED_SERVICE_DESCRIPTOR             = 0x4C,\r
-       GF_M2TS_DVB_SHORT_EVENT_DESCRIPTOR                      = 0x4D,\r
-       GF_M2TS_DVB_EXTENDED_EVENT_DESCRIPTOR                   = 0x4E,\r
-       GF_M2TS_DVB_TIME_SHIFTED_EVENT_DESCRIPTOR               = 0x4F,\r
-       GF_M2TS_DVB_COMPONENT_DESCRIPTOR                        = 0x50,\r
-       GF_M2TS_DVB_MOSAIC_DESCRIPTOR                           = 0x51,\r
-       GF_M2TS_DVB_STREAM_IDENTIFIER_DESCRIPTOR                = 0x52,\r
-       GF_M2TS_DVB_CA_IDENTIFIER_DESCRIPTOR                    = 0x53,\r
-       GF_M2TS_DVB_CONTENT_DESCRIPTOR                          = 0x54,\r
-       GF_M2TS_DVB_PARENTAL_RATING_DESCRIPTOR                  = 0x55,\r
-       GF_M2TS_DVB_TELETEXT_DESCRIPTOR                         = 0x56,\r
-       /* ... */\r
-       GF_M2TS_DVB_LOCAL_TIME_OFFSET_DESCRIPTOR                = 0x58,\r
-       GF_M2TS_DVB_SUBTITLING_DESCRIPTOR                       = 0x59,\r
-       /* ... */\r
-       GF_M2TS_DVB_DATA_BROADCAST_DESCRIPTOR                   = 0x64,\r
-       /* ... */\r
-       GF_M2TS_DVB_DATA_BROADCAST_ID_DESCRIPTOR                = 0x66,\r
-       /* ... */\r
-       GF_M2TS_DVB_AC3_DESCRIPTOR                              = 0x6A,\r
-       \r
-};\r
-\r
-/* Reserved PID values */\r
-enum {\r
-       GF_M2TS_PID_PAT                 = 0x0000,\r
-       GF_M2TS_PID_CAT                 = 0x0001,\r
-       GF_M2TS_PID_TSDT                = 0x0002,\r
-       /* reserved 0x0003 to 0x000F */ \r
-       GF_M2TS_PID_NIT_ST              = 0x0010,\r
-       GF_M2TS_PID_SDT_BAT_ST          = 0x0011,\r
-       GF_M2TS_PID_EIT_ST_CIT          = 0x0012,\r
-       GF_M2TS_PID_RST_ST              = 0x0013,\r
-       GF_M2TS_PID_TDT_TOT_ST          = 0x0014,\r
-       GF_M2TS_PID_NET_SYNC            = 0x0015,\r
-       GF_M2TS_PID_RNT                 = 0x0016,\r
-       /* reserved 0x0017 to 0x001B */ \r
-       GF_M2TS_PID_IN_SIG              = 0x001C,\r
-       GF_M2TS_PID_MEAS                = 0x001D,\r
-       GF_M2TS_PID_DIT                 = 0x001E,\r
-       GF_M2TS_PID_SIT                 = 0x001F\r
-};\r
-\r
-/* max size includes first header, second header, payload and CRC */\r
-enum {\r
-       GF_M2TS_TABLE_ID_PAT                    = 0x00,\r
-       GF_M2TS_TABLE_ID_CAT                    = 0x01, \r
-       GF_M2TS_TABLE_ID_PMT                    = 0x02, \r
-       GF_M2TS_TABLE_ID_TSDT                   = 0x03, /* max size for section 1024 */\r
-       GF_M2TS_TABLE_ID_MPEG4_BIFS             = 0x04, /* max size for section 4096 */\r
-       GF_M2TS_TABLE_ID_MPEG4_OD               = 0x05, /* max size for section 4096 */\r
-       GF_M2TS_TABLE_ID_METADATA               = 0x06, \r
-       GF_M2TS_TABLE_ID_IPMP_CONTROL           = 0x07, \r
-       /* 0x08 - 0x37 reserved */\r
-       /* 0x38 - 0x3D DSM-CC defined */\r
-       GF_M2TS_TABLE_ID_DSM_CC_PRIVATE         = 0x3E, /* used for MPE (only, not MPE-FEC) */\r
-       /* 0x3F DSM-CC defined */\r
-       GF_M2TS_TABLE_ID_NIT_ACTUAL             = 0x40, /* max size for section 1024 */\r
-       GF_M2TS_TABLE_ID_NIT_OTHER              = 0x41,\r
-       GF_M2TS_TABLE_ID_SDT_ACTUAL             = 0x42, /* max size for section 1024 */\r
-       /* 0x43 - 0x45 reserved */\r
-       GF_M2TS_TABLE_ID_SDT_OTHER              = 0x46, /* max size for section 1024 */\r
-       /* 0x47 - 0x49 reserved */\r
-       GF_M2TS_TABLE_ID_BAT                    = 0x4a, /* max size for section 1024 */\r
-       /* 0x4b - 0x4d reserved */\r
-       GF_M2TS_TABLE_ID_EIT_ACTUAL_PF          = 0x4E, /* max size for section 4096 */\r
-       GF_M2TS_TABLE_ID_EIT_OTHER_PF           = 0x4F,\r
-       /* 0x50 - 0x6f EIT SCHEDULE */\r
-       GF_M2TS_TABLE_ID_EIT_SCHEDULE_MIN       = 0x50,\r
-       GF_M2TS_TABLE_ID_EIT_SCHEDULE_ACTUAL_MAX= 0x5F,\r
-       GF_M2TS_TABLE_ID_EIT_SCHEDULE_MAX       = 0x6F,\r
-\r
-       GF_M2TS_TABLE_ID_TDT                    = 0x70,\r
-       GF_M2TS_TABLE_ID_RST                    = 0x71, /* max size for section 1024 */\r
-       GF_M2TS_TABLE_ID_ST                     = 0x72, /* max size for section 4096 */\r
-       GF_M2TS_TABLE_ID_TOT                    = 0x73,\r
-       GF_M2TS_TABLE_ID_AI                     = 0x74,\r
-       GF_M2TS_TABLE_ID_CONT                   = 0x75,\r
-       GF_M2TS_TABLE_ID_RC                     = 0x76,\r
-       GF_M2TS_TABLE_ID_CID                    = 0x77,\r
-       GF_M2TS_TABLE_ID_MPE_FEC                = 0x78,\r
-       GF_M2TS_TABLE_ID_RES_NOT                = 0x79,\r
-       /* 0x7A - 0x7D reserved */\r
-       GF_M2TS_TABLE_ID_DIT                    = 0x7E,\r
-       GF_M2TS_TABLE_ID_SIT                    = 0x7F, /* max size for section 4096 */\r
-       /* 0x80 - 0xfe reserved */\r
-       /* 0xff reserved */\r
-};\r
-\r
-enum {\r
-       M2TS_ADAPTATION_RESERVED        = 0,\r
-       M2TS_ADAPTATION_NONE            = 1,\r
-       M2TS_ADAPTATION_ONLY            = 2,\r
-       M2TS_ADAPTATION_AND_PAYLOAD     = 3,\r
-};\r
-\r
-\r
-#define SECTION_HEADER_LENGTH 3 /* header till the last bit of the section_length field */\r
-#define SECTION_ADDITIONAL_HEADER_LENGTH 5 /* header from the last bit of the section_length field to the payload */\r
-#define        CRC_LENGTH 4\r
-\r
-typedef struct\r
-{\r
-       u8 sync;\r
-       u8 error;\r
-       u8 payload_start;\r
-       u8 priority;\r
-       u16 pid;\r
-       u8 scrambling_ctrl;\r
-       u8 adaptation_field;\r
-       u8 continuity_counter;\r
-} GF_M2TS_Header;\r
-\r
-typedef struct\r
-{\r
-       u32 discontinuity_indicator;\r
-       u32 random_access_indicator;\r
-       u32 priority_indicator;\r
-\r
-       u32 PCR_flag;\r
-       u64 PCR_base, PCR_ext;\r
-\r
-       u32 OPCR_flag;\r
-       u64 OPCR_base, OPCR_ext;\r
-\r
-       u32 splicing_point_flag;\r
-       u32 transport_private_data_flag;\r
-       u32 adaptation_field_extension_flag;\r
-/*     \r
-       u32 splice_countdown;\r
-       u32 transport_private_data_length;\r
-       u32 adaptation_field_extension_length;\r
-       u32 ltw_flag;\r
-       u32 piecewise_rate_flag;\r
-       u32 seamless_splice_flag;\r
-       u32 ltw_valid_flag;\r
-       u32 ltw_offset;\r
-       u32 piecewise_rate;\r
-       u32 splice_type;\r
-       u32 DTS_next_AU;\r
-*/\r
-} GF_M2TS_AdaptationField;\r
-\r
-typedef struct \r
-{\r
-       u8 id;\r
-       u16 pck_len;\r
-       u8 data_alignment;\r
-       u64 PTS, DTS;\r
-       u8 hdr_data_len;\r
-} GF_M2TS_PESHeader;\r
-\r
-#endif //_GF_MPEG_TS_H_\r