OSDN Git Service

add tstools.
[rec10/rec10-git.git] / tstools / DtsEdit / src / gpac / sync_layer.h
diff --git a/tstools/DtsEdit/src/gpac/sync_layer.h b/tstools/DtsEdit/src/gpac/sync_layer.h
new file mode 100644 (file)
index 0000000..90e8c7c
--- /dev/null
@@ -0,0 +1,125 @@
+/*\r
+ *                     GPAC - Multimedia Framework C SDK\r
+ *\r
+ *                     Copyright (c) Jean Le Feuvre 2000-2005 \r
+ *                                     All rights reserved\r
+ *\r
+ *  This file is part of GPAC / SL header file\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
+#ifndef _GF_SYNC_LAYER_H_\r
+#define _GF_SYNC_LAYER_H_\r
+\r
+#ifdef __cplusplus\r
+extern "C" {\r
+#endif\r
+\r
+       \r
+/*the Sync Layer config descriptor*/\r
+typedef struct\r
+{\r
+       /*base descriptor*/\r
+       u8 tag;\r
+\r
+       u8 predefined;\r
+       u8 useAccessUnitStartFlag;\r
+       u8 useAccessUnitEndFlag;\r
+       u8 useRandomAccessPointFlag;\r
+       u8 hasRandomAccessUnitsOnlyFlag;\r
+       u8 usePaddingFlag;\r
+       u8 useTimestampsFlag;\r
+       u8 useIdleFlag;\r
+       u8 durationFlag;\r
+       u32 timestampResolution;\r
+       u32 OCRResolution;\r
+       u8 timestampLength;\r
+       u8 OCRLength;\r
+       u8 AULength;\r
+       u8 instantBitrateLength;\r
+       u8 degradationPriorityLength;\r
+       u8 AUSeqNumLength;\r
+       u8 packetSeqNumLength;\r
+       u32 timeScale;\r
+       u16 AUDuration;\r
+       u16 CUDuration;\r
+       u64 startDTS;\r
+       u64 startCTS;\r
+} GF_SLConfig;\r
+\r
+/***************************************\r
+                       SLConfig Tag\r
+***************************************/\r
+enum\r
+{\r
+       SLPredef_Null = 0x01,\r
+       SLPredef_MP4 = 0x02,\r
+       /*intern to GPAC, means NO SL at all (for streams unable to handle AU reconstruction a timing)*/\r
+       SLPredef_SkipSL = 0xF0\r
+};\r
+\r
+/*set SL predefined (assign all fields according to sl->predefined value)*/\r
+GF_Err gf_odf_slc_set_pref(GF_SLConfig *sl);\r
+\r
+\r
+typedef struct\r
+{\r
+       u8 accessUnitStartFlag;\r
+       u8 accessUnitEndFlag;\r
+       u8 paddingFlag;\r
+       u8 randomAccessPointFlag;\r
+       u8 OCRflag;\r
+       u8 idleFlag;\r
+       u8 decodingTimeStampFlag;\r
+       u8 compositionTimeStampFlag;\r
+       u8 instantBitrateFlag;\r
+       u8 degradationPriorityFlag;\r
+\r
+       u8 paddingBits;\r
+       u16 packetSequenceNumber;\r
+       u64 objectClockReference;\r
+       u16 AU_sequenceNumber;\r
+       u64 decodingTimeStamp;\r
+       u64 compositionTimeStamp;\r
+       u16 accessUnitLength;\r
+       u32 instantBitrate;\r
+       u16 degradationPriority;\r
+\r
+       /*this is NOT part of standard SL, only used internally: signals duration of access unit if known\r
+       this is usefull for streams with very random updates, to prevent buffering for instance a subtitle stream\r
+       which is likely to have no updates during the first minutes... expressed in media timescale*/\r
+       u32 au_duration;\r
+       /*ISMACryp extensions*/\r
+       u8 isma_encrypted;\r
+       u64 isma_BSO;\r
+} GF_SLHeader;\r
+\r
+\r
+/*packetize SL-PDU. If PDU is NULL or size 0, only writes the SL header*/\r
+void gf_sl_packetize(GF_SLConfig* slConfig, GF_SLHeader *Header, char *PDU, u32 size, char **outPacket, u32 *OutSize);\r
+/*gets SL header size in bytes*/\r
+u32 gf_sl_get_header_size(GF_SLConfig* slConfig, GF_SLHeader *Header);\r
+\r
+/*depacketize SL-PDU*/\r
+void gf_sl_depacketize(GF_SLConfig *slConfig, GF_SLHeader *Header, char *PDU, u32 PDULength, u32 *HeaderLen);\r
+\r
+\r
+#ifdef __cplusplus\r
+}\r
+#endif\r
+\r
+#endif /*_GF_SYNC_LAYER_H_*/\r