--- /dev/null
+/*\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 / MPEG-4 Object Descriptor 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
+#ifndef _GF_MPEG4_ODF_H_\r
+#define _GF_MPEG4_ODF_H_\r
+\r
+#ifdef __cplusplus\r
+extern "C" {\r
+#endif\r
+\r
+#include <gpac/list.h>\r
+#include <gpac/bitstream.h>\r
+#include <gpac/sync_layer.h>\r
+\r
+/***************************************\r
+ Descriptors Tag\r
+***************************************/\r
+enum\r
+{\r
+ GF_ODF_OD_TAG = 0x01,\r
+ GF_ODF_IOD_TAG = 0x02,\r
+ GF_ODF_ESD_TAG = 0x03,\r
+ GF_ODF_DCD_TAG = 0x04,\r
+ GF_ODF_DSI_TAG = 0x05,\r
+ GF_ODF_SLC_TAG = 0x06,\r
+ GF_ODF_CI_TAG = 0x07,\r
+ GF_ODF_SCI_TAG = 0x08,\r
+ GF_ODF_IPI_PTR_TAG = 0x09,\r
+ GF_ODF_IPMP_PTR_TAG = 0x0A,\r
+ GF_ODF_IPMP_TAG = 0x0B,\r
+ GF_ODF_QOS_TAG = 0x0C,\r
+ GF_ODF_REG_TAG = 0x0D,\r
+\r
+ /*FILE FORMAT RESERVED IDs - NEVER CREATE / USE THESE DESCRIPTORS*/\r
+ GF_ODF_ESD_INC_TAG = 0x0E,\r
+ GF_ODF_ESD_REF_TAG = 0x0F,\r
+ GF_ODF_ISOM_IOD_TAG = 0x10,\r
+ GF_ODF_ISOM_OD_TAG = 0x11,\r
+ GF_ODF_ISOM_IPI_PTR_TAG = 0x12,\r
+ /*END FILE FORMAT RESERVED*/\r
+ \r
+ GF_ODF_EXT_PL_TAG = 0x13,\r
+ GF_ODF_PL_IDX_TAG = 0x14,\r
+ \r
+ GF_ODF_ISO_BEGIN_TAG = 0x15,\r
+ GF_ODF_ISO_END_TAG = 0x3F,\r
+\r
+ GF_ODF_CC_TAG = 0x40,\r
+ GF_ODF_KW_TAG = 0x41,\r
+ GF_ODF_RATING_TAG = 0x42,\r
+ GF_ODF_LANG_TAG = 0x43,\r
+ GF_ODF_SHORT_TEXT_TAG = 0x44,\r
+ GF_ODF_TEXT_TAG = 0x45,\r
+ GF_ODF_CC_NAME_TAG = 0x46,\r
+ GF_ODF_CC_DATE_TAG = 0x47,\r
+ GF_ODF_OCI_NAME_TAG = 0x48,\r
+ GF_ODF_OCI_DATE_TAG = 0x49,\r
+ GF_ODF_SMPTE_TAG = 0x4A,\r
+\r
+ GF_ODF_SEGMENT_TAG = 0x4B,\r
+ GF_ODF_MEDIATIME_TAG = 0x4C,\r
+\r
+ GF_ODF_IPMP_TL_TAG = 0x60,\r
+ GF_ODF_IPMP_TOOL_TAG = 0x61,\r
+\r
+ GF_ODF_ISO_RES_BEGIN_TAG = 0x62,\r
+ GF_ODF_ISO_RES_END_TAG = 0xBF,\r
+ \r
+ GF_ODF_USER_BEGIN_TAG = 0xC0,\r
+\r
+ /*internal descriptor for mux input description*/\r
+ GF_ODF_MUXINFO_TAG = GF_ODF_USER_BEGIN_TAG,\r
+ /*internal descriptor for bifs config input description*/\r
+ GF_ODF_BIFS_CFG_TAG = GF_ODF_USER_BEGIN_TAG + 1,\r
+ /*internal descriptor for UI config input description*/\r
+ GF_ODF_UI_CFG_TAG = GF_ODF_USER_BEGIN_TAG + 2,\r
+ /*internal descriptor for TextConfig description*/\r
+ GF_ODF_TEXT_CFG_TAG = GF_ODF_USER_BEGIN_TAG + 3,\r
+ GF_ODF_TX3G_TAG = GF_ODF_USER_BEGIN_TAG + 4,\r
+ GF_ODF_ELEM_MASK_TAG = GF_ODF_USER_BEGIN_TAG + 5,\r
+ /*internal descriptor for LASeR config input description*/\r
+ GF_ODF_LASER_CFG_TAG = GF_ODF_USER_BEGIN_TAG + 6,\r
+\r
+ GF_ODF_USER_END_TAG = 0xFE,\r
+\r
+ GF_ODF_OCI_BEGIN_TAG = 0x40,\r
+ GF_ODF_OCI_END_TAG = (GF_ODF_ISO_RES_BEGIN_TAG - 1),\r
+\r
+ GF_ODF_EXT_BEGIN_TAG = 0x80,\r
+ GF_ODF_EXT_END_TAG = 0xFE,\r
+\r
+\r
+ /*descriptor for aucilary video data*/\r
+ GF_ODF_AUX_VIDEO_DATA = GF_ODF_EXT_BEGIN_TAG + 1,\r
+};\r
+\r
+\r
+/***************************************\r
+ Descriptors\r
+***************************************/\r
+\r
+#define BASE_DESCRIPTOR \\r
+ u8 tag;\r
+\r
+typedef struct\r
+{\r
+ BASE_DESCRIPTOR\r
+} GF_Descriptor;\r
+\r
+\r
+/* default descriptor. \r
+ NOTE: The decoderSpecificInfo is used as a default desc with tag 0x05 */\r
+typedef struct\r
+{\r
+ BASE_DESCRIPTOR\r
+ u32 dataLength;\r
+ char *data;\r
+} GF_DefaultDescriptor;\r
+\r
+/*Object Descriptor*/\r
+typedef struct\r
+{\r
+ BASE_DESCRIPTOR\r
+ GF_List *ipmp_tools;\r
+} GF_IPMP_ToolList;\r
+\r
+/*ObjectDescriptor*/\r
+typedef struct\r
+{\r
+ BASE_DESCRIPTOR\r
+ u16 objectDescriptorID;\r
+ char *URLString;\r
+ GF_List *ESDescriptors;\r
+ GF_List *OCIDescriptors;\r
+ /*includes BOTH IPMP_DescriptorPointer (IPMP & IPMPX) and GF_IPMP_Descriptor (IPMPX only)*/\r
+ GF_List *IPMP_Descriptors;\r
+ GF_List *extensionDescriptors;\r
+} GF_ObjectDescriptor;\r
+\r
+/*GF_InitialObjectDescriptor - WARNING: even though the bitstream IOD is not\r
+a bit extension of OD, internally it is a real overclass of OD\r
+we usually typecast IOD to OD when flags are not needed !!!*/\r
+typedef struct\r
+{\r
+ BASE_DESCRIPTOR\r
+ u16 objectDescriptorID;\r
+ char *URLString;\r
+ GF_List *ESDescriptors;\r
+ GF_List *OCIDescriptors;\r
+ /*includes BOTH IPMP_DescriptorPointer (IPMP & IPMPX) and GF_IPMP_Descriptor (IPMPX only)*/\r
+ GF_List *IPMP_Descriptors;\r
+ GF_List *extensionDescriptors;\r
+\r
+ /*IOD extensions*/\r
+ u8 inlineProfileFlag;\r
+ u8 OD_profileAndLevel;\r
+ u8 scene_profileAndLevel;\r
+ u8 audio_profileAndLevel;\r
+ u8 visual_profileAndLevel;\r
+ u8 graphics_profileAndLevel;\r
+\r
+ GF_IPMP_ToolList *IPMPToolList;\r
+} GF_InitialObjectDescriptor;\r
+\r
+/*File Format Object Descriptor*/\r
+typedef struct\r
+{\r
+ BASE_DESCRIPTOR\r
+ u16 objectDescriptorID;\r
+ char *URLString;\r
+ GF_List *ES_ID_RefDescriptors;\r
+ GF_List *OCIDescriptors;\r
+ GF_List *IPMP_Descriptors;\r
+ GF_List *extensionDescriptors;\r
+ GF_List *ES_ID_IncDescriptors;\r
+} GF_IsomObjectDescriptor;\r
+\r
+/*File Format Initial Object Descriptor - same remark as IOD*/\r
+typedef struct\r
+{\r
+ BASE_DESCRIPTOR\r
+ u16 objectDescriptorID;\r
+ char *URLString;\r
+ GF_List *ES_ID_RefDescriptors;\r
+ GF_List *OCIDescriptors;\r
+ GF_List *IPMP_Descriptors;\r
+ GF_List *extensionDescriptors;\r
+ GF_List *ES_ID_IncDescriptors;\r
+\r
+ u8 inlineProfileFlag;\r
+ u8 OD_profileAndLevel;\r
+ u8 scene_profileAndLevel;\r
+ u8 audio_profileAndLevel;\r
+ u8 visual_profileAndLevel;\r
+ u8 graphics_profileAndLevel;\r
+\r
+ GF_IPMP_ToolList *IPMPToolList;\r
+} GF_IsomInitialObjectDescriptor;\r
+\r
+\r
+/*File Format ES Descriptor for IOD*/\r
+typedef struct {\r
+ BASE_DESCRIPTOR\r
+ u32 trackID;\r
+} GF_ES_ID_Inc;\r
+\r
+/*File Format ES Descriptor for OD*/\r
+typedef struct {\r
+ BASE_DESCRIPTOR\r
+ u16 trackRef;\r
+} GF_ES_ID_Ref;\r
+\r
+/*Decoder config Descriptor*/\r
+typedef struct\r
+{\r
+ BASE_DESCRIPTOR\r
+ u8 objectTypeIndication;\r
+ u8 streamType;\r
+ u8 upstream;\r
+ u32 bufferSizeDB;\r
+ u32 maxBitrate;\r
+ u32 avgBitrate;\r
+ GF_DefaultDescriptor *decoderSpecificInfo;\r
+ GF_List *profileLevelIndicationIndexDescriptor;\r
+} GF_DecoderConfig;\r
+\r
+\r
+/*Content Identification Descriptor*/\r
+typedef struct {\r
+ BASE_DESCRIPTOR\r
+ u8 compatibility;\r
+ u8 protectedContent;\r
+ u8 contentTypeFlag;\r
+ u8 contentIdentifierFlag;\r
+ u8 contentType;\r
+ u8 contentIdentifierType;\r
+ /*international code string*/\r
+ char *contentIdentifier; \r
+} GF_CIDesc;\r
+\r
+/*Supplementary Content Identification Descriptor)*/\r
+typedef struct {\r
+ BASE_DESCRIPTOR\r
+ u32 languageCode;\r
+ char *supplContentIdentifierTitle;\r
+ char *supplContentIdentifierValue;\r
+} GF_SCIDesc;\r
+\r
+/*IPI (Intelectual Property Identification) Descriptor Pointer*/\r
+typedef struct {\r
+ BASE_DESCRIPTOR\r
+ u16 IPI_ES_Id;\r
+} GF_IPIPtr;\r
+\r
+/*IPMP Descriptor Pointer*/\r
+typedef struct {\r
+ BASE_DESCRIPTOR\r
+ u8 IPMP_DescriptorID;\r
+ u16 IPMP_DescriptorIDEx;\r
+ u16 IPMP_ES_ID; \r
+} GF_IPMPPtr;\r
+\r
+/*IPMPX control points*/\r
+enum\r
+{\r
+ /*no control point*/\r
+ IPMP_CP_NONE = 0,\r
+ /*control point between DB and decoder*/\r
+ IPMP_CP_DB = 1,\r
+ /*control point between decoder and CB*/\r
+ IPMP_CP_CB = 2,\r
+ /*control point between CB and render*/\r
+ IPMP_CP_CM = 3,\r
+ /*control point in BIFS tree (???)*/\r
+ IPMP_CP_BIFS = 4,\r
+ /*the rest is reserved or forbidden(0xFF)*/\r
+};\r
+\r
+/*IPMPX base classe*/\r
+#define GF_IPMPX_BASE \\r
+ u8 tag; \\r
+ u8 version; \\r
+ u32 dataID; \\r
+\r
+typedef struct \r
+{\r
+ GF_IPMPX_BASE\r
+} GF_GF_IPMPX_Base;\r
+\r
+/*IPMP descriptor*/\r
+typedef struct {\r
+ BASE_DESCRIPTOR\r
+ u8 IPMP_DescriptorID;\r
+ u16 IPMPS_Type;\r
+ /*if IPMPS_Type=0, NULL-terminated URL, else if IPMPS_Type is not IPMPX, opaque data*/\r
+ char *opaque_data;\r
+ /*if IPMPS_Type=0, irrelevant (strlen(URL)), else if IPMPS_Type is not IPMPX, opaque data size*/\r
+ u32 opaque_data_size;\r
+\r
+ /*IPMPX specific*/\r
+ u16 IPMP_DescriptorIDEx;\r
+ bin128 IPMP_ToolID;\r
+ u8 control_point;\r
+ u8 cp_sequence_code;\r
+ GF_List *ipmpx_data;\r
+} GF_IPMP_Descriptor;\r
+\r
+\r
+/*IPMPTool*/\r
+#define MAX_IPMP_ALT_TOOLS 20\r
+typedef struct\r
+{\r
+ BASE_DESCRIPTOR\r
+ bin128 IPMP_ToolID;\r
+ /*if set, this is an alternate tool*/\r
+ u32 num_alternate;\r
+ bin128 specificToolID[MAX_IPMP_ALT_TOOLS];\r
+\r
+ struct _tagIPMPXParamDesc *toolParamDesc;\r
+ char *tool_url;\r
+} GF_IPMP_Tool;\r
+\r
+\r
+/* Elementary Mask of Bifs Config - parsing only */\r
+typedef struct {\r
+ BASE_DESCRIPTOR\r
+ u32 node_id; // referenced nodeID\r
+ char *node_name; // referenced node name\r
+} GF_ElementaryMask;\r
+\r
+/*BIFSConfig - parsing only, STORED IN ESD:DCD:DSI*/\r
+typedef struct __tag_bifs_config\r
+{\r
+ BASE_DESCRIPTOR\r
+ u32 version;\r
+ u16 nodeIDbits;\r
+ u16 routeIDbits;\r
+ u16 protoIDbits;\r
+ Bool pixelMetrics;\r
+ u16 pixelWidth, pixelHeight;\r
+ /*BIFS-Anim stuff*/\r
+ Bool randomAccess;\r
+ GF_List *elementaryMasks;\r
+ /*internal extensions for encoding*/\r
+ Bool useNames;\r
+} GF_BIFSConfig;\r
+\r
+/*flags for style*/\r
+enum\r
+{\r
+ GF_TXT_STYLE_NORMAL = 0,\r
+ GF_TXT_STYLE_BOLD = 1,\r
+ GF_TXT_STYLE_ITALIC = 2,\r
+ GF_TXT_STYLE_UNDERLINED = 4\r
+};\r
+\r
+typedef struct\r
+{\r
+ u16 startCharOffset;\r
+ u16 endCharOffset;\r
+ u16 fontID;\r
+ u8 style_flags;\r
+ u8 font_size;\r
+ /*ARGB*/\r
+ u32 text_color;\r
+} GF_StyleRecord;\r
+\r
+typedef struct\r
+{\r
+ u16 fontID;\r
+ char *fontName;\r
+} GF_FontRecord;\r
+\r
+typedef struct\r
+{\r
+ s16 top, left, bottom, right;\r
+} GF_BoxRecord;\r
+\r
+/*scroll flags*/\r
+enum\r
+{\r
+ GF_TXT_SCROLL_CREDITS = 0,\r
+ GF_TXT_SCROLL_MARQUEE = 1,\r
+ GF_TXT_SCROLL_DOWN = 2,\r
+ GF_TXT_SCROLL_RIGHT = 3\r
+};\r
+\r
+/* display flags*/\r
+enum\r
+{\r
+ GF_TXT_SCROLL_IN = 0x00000020,\r
+ GF_TXT_SCROLL_OUT = 0x00000040,\r
+ /*use one of the scroll flags, eg GF_TXT_SCROLL_DIRECTION | GF_TXT_SCROLL_CREDITS*/\r
+ GF_TXT_SCROLL_DIRECTION = 0x00000180,\r
+ GF_TXT_KARAOKE = 0x00000800,\r
+ GF_TXT_VERTICAL = 0x00020000,\r
+ GF_TXT_FILL_REGION = 0x00040000,\r
+};\r
+\r
+typedef struct\r
+{\r
+ /*this is defined as a descriptor for parsing*/\r
+ BASE_DESCRIPTOR\r
+\r
+ u32 displayFlags;\r
+ /*left, top: 0 - centered: 1 - bottom, right: -1*/\r
+ s8 horiz_justif, vert_justif;\r
+ /*ARGB*/\r
+ u32 back_color;\r
+ GF_BoxRecord default_pos;\r
+ GF_StyleRecord default_style;\r
+\r
+ u32 font_count;\r
+ GF_FontRecord *fonts;\r
+\r
+ /*unused in isomedia but needed for streamingText*/\r
+ u8 sample_index;\r
+} GF_TextSampleDescriptor;\r
+\r
+typedef struct\r
+{\r
+ BASE_DESCRIPTOR\r
+ /*only 0x10 shall be used for 3GP text stream*/\r
+ u8 Base3GPPFormat;\r
+ /*only 0x10 shall be used for StreamingText*/\r
+ u8 MPEGExtendedFormat;\r
+ /*only 0x10 shall be used for StreamingText (base profile, base level)*/\r
+ u8 profileLevel;\r
+ u32 timescale;\r
+ /*0 forbidden, 1: out-of-band desc only, 2: in-band desc only, 3: both*/\r
+ u8 sampleDescriptionFlags;\r
+ /*More negative layer values are towards the viewer*/\r
+ s16 layer;\r
+ /*text track width & height*/\r
+ u16 text_width;\r
+ u16 text_height;\r
+ /*compatible 3GP formats, same coding as 3GPPBaseFormat*/\r
+ u8 nb_compatible_formats;\r
+ u8 compatible_formats[20];\r
+ /*defined in isomedia.h*/\r
+ GF_List *sample_descriptions;\r
+\r
+ /*if true info below are valid (cf 3GPP for their meaning)*/\r
+ Bool has_vid_info;\r
+ u16 video_width;\r
+ u16 video_height;\r
+ s16 horiz_offset;\r
+ s16 vert_offset;\r
+} GF_TextConfig;\r
+\r
+\r
+/*MuxInfo descriptor - parsing only, stored in ESD:extDescr*/\r
+typedef struct {\r
+ BASE_DESCRIPTOR\r
+ /*input location*/\r
+ char *file_name;\r
+ /*input groupID for interleaving*/\r
+ u32 GroupID;\r
+ /*input stream format (not required, guessed from file_name)*/\r
+ char *streamFormat;\r
+ /*time offset in ms from first TS (appends an edit list in mp4)*/\r
+ u32 startTime;\r
+\r
+ /*media length to import in ms (from 0)*/\r
+ u32 duration;\r
+\r
+ /*SRT/SUB import extensions - only support for text and italic style*/\r
+ char *textNode;\r
+ char *fontNode;\r
+\r
+ /*video and SUB import*/\r
+ Double frame_rate;\r
+\r
+ /*same as importer flags, cf media.h*/\r
+ u32 import_flags;\r
+\r
+ /*indicates input file shall be destryed - used during SWF import*/\r
+ Bool delete_file;\r
+} GF_MuxInfo;\r
+\r
+typedef struct\r
+{\r
+ BASE_DESCRIPTOR\r
+ /*input type*/\r
+ char *deviceName;\r
+ /*string sensor terminaison (validation) char*/\r
+ char termChar;\r
+ /*string sensor deletion char*/\r
+ char delChar;\r
+ /*device-specific data*/\r
+ char *ui_data;\r
+ u32 ui_data_length;\r
+} GF_UIConfig;\r
+\r
+/*LASERConfig - parsing only, STORED IN ESD:DCD:DSI*/\r
+typedef struct __tag_laser_config\r
+{\r
+ BASE_DESCRIPTOR\r
+ u8 profile;\r
+ u8 level;\r
+ u8 pointsCodec;\r
+ u8 pathComponents;\r
+ u8 fullRequestHost;\r
+ u16 time_resolution;\r
+ u8 colorComponentBits;\r
+ s8 resolution;\r
+ u8 coord_bits;\r
+ u8 scale_bits_minus_coord_bits;\r
+ u8 newSceneIndicator;\r
+ u8 extensionIDBits;\r
+\r
+ /*the rest of the structure is never coded, only used for the config of GPAC...*/\r
+ Bool force_string_ids;/*forces all nodes to be defined with string IDs*/\r
+} GF_LASERConfig;\r
+\r
+\r
+/***************************************\r
+ QoS Tags\r
+***************************************/\r
+enum\r
+{\r
+ QoSMaxDelayTag = 0x01,\r
+ QoSPrefMaxDelayTag = 0x02,\r
+ QoSLossProbTag = 0x03,\r
+ QoSMaxGapLossTag = 0x04,\r
+ QoSMaxAUSizeTag = 0x41,\r
+ QoSAvgAUSizeTag = 0x42,\r
+ QoSMaxAURateTag = 0x43\r
+};\r
+\r
+/***************************************\r
+ QoS Qualifiers\r
+***************************************/\r
+typedef struct {\r
+ BASE_DESCRIPTOR\r
+ u8 predefined;\r
+ GF_List *QoS_Qualifiers;\r
+} GF_QoS_Descriptor;\r
+\r
+\r
+#define QOS_BASE_QUALIFIER \\r
+ u8 tag; \\r
+ u32 size;\r
+\r
+typedef struct {\r
+ QOS_BASE_QUALIFIER\r
+} GF_QoS_Default;\r
+\r
+typedef struct {\r
+ QOS_BASE_QUALIFIER\r
+ u32 MaxDelay;\r
+} GF_QoS_MaxDelay;\r
+\r
+typedef struct {\r
+ QOS_BASE_QUALIFIER\r
+ u32 PrefMaxDelay;\r
+} GF_QoS_PrefMaxDelay;\r
+\r
+typedef struct {\r
+ QOS_BASE_QUALIFIER\r
+ Float LossProb;\r
+} GF_QoS_LossProb;\r
+\r
+typedef struct {\r
+ QOS_BASE_QUALIFIER\r
+ u32 MaxGapLoss;\r
+} GF_QoS_MaxGapLoss;\r
+\r
+typedef struct {\r
+ QOS_BASE_QUALIFIER\r
+ u32 MaxAUSize;\r
+} GF_QoS_MaxAUSize;\r
+\r
+typedef struct {\r
+ QOS_BASE_QUALIFIER\r
+ u32 AvgAUSize;\r
+} GF_QoS_AvgAUSize;\r
+\r
+typedef struct {\r
+ QOS_BASE_QUALIFIER\r
+ u32 MaxAURate;\r
+} GF_QoS_MaxAURate;\r
+\r
+typedef struct {\r
+ QOS_BASE_QUALIFIER\r
+ u32 DataLength; /*max size class : 2^28 - 1*/\r
+ char *Data;\r
+} GF_QoS_Private;\r
+\r
+\r
+/*Registration Descriptor*/\r
+typedef struct {\r
+ BASE_DESCRIPTOR\r
+ u32 formatIdentifier;\r
+ u32 dataLength;\r
+ char *additionalIdentificationInfo;\r
+} GF_Registration;\r
+\r
+/*Language Descriptor*/\r
+typedef struct {\r
+ BASE_DESCRIPTOR\r
+ u32 langCode;\r
+} GF_Language;\r
+\r
+/*Elementary Stream Descriptor*/\r
+typedef struct\r
+{\r
+ BASE_DESCRIPTOR\r
+ u16 ESID;\r
+ u16 OCRESID;\r
+ u16 dependsOnESID;\r
+ u8 streamPriority;\r
+ char *URLString;\r
+ GF_DecoderConfig *decoderConfig;\r
+ GF_SLConfig *slConfig;\r
+ GF_IPIPtr *ipiPtr;\r
+ GF_QoS_Descriptor *qos;\r
+ GF_Registration *RegDescriptor;\r
+ /*0 or 1 lang desc*/\r
+ GF_Language *langDesc;\r
+ \r
+ GF_List *IPIDataSet;\r
+ GF_List *IPMPDescriptorPointers;\r
+ GF_List *extensionDescriptors;\r
+\r
+} GF_ESD;\r
+\r
+\r
+/*Auxiliary Video Data Descriptor*/\r
+typedef struct {\r
+ BASE_DESCRIPTOR\r
+ u32 aux_video_type;\r
+ u32 position_offset_h;\r
+ u32 position_offset_v;\r
+ u32 knear;\r
+ u32 kfar;\r
+ u32 parallax_zero;\r
+ u32 parallax_scale;\r
+ u32 dref;\r
+ u32 wref;\r
+} GF_AuxVideoDescriptor;\r
+\r
+/*Content Classification Descriptor*/\r
+typedef struct {\r
+ BASE_DESCRIPTOR\r
+ u32 classificationEntity;\r
+ u16 classificationTable;\r
+ u32 dataLength;\r
+ char *contentClassificationData;\r
+} GF_CCDescriptor;\r
+\r
+\r
+/*this structure is used in GF_KeyWord*/\r
+typedef struct {\r
+ char *keyWord;\r
+} GF_KeyWordItem;\r
+\r
+/*Key Word Descriptor*/\r
+typedef struct {\r
+ BASE_DESCRIPTOR\r
+ u32 languageCode;\r
+ u8 isUTF8;\r
+ GF_List *keyWordsList;\r
+} GF_KeyWord;\r
+\r
+/*Rating Descriptor*/\r
+typedef struct {\r
+ BASE_DESCRIPTOR\r
+ u32 ratingEntity;\r
+ u16 ratingCriteria;\r
+ u32 infoLength;\r
+ char *ratingInfo;\r
+} GF_Rating;\r
+\r
+\r
+/*Short Textual Descriptor*/\r
+typedef struct {\r
+ BASE_DESCRIPTOR\r
+ u32 langCode;\r
+ u8 isUTF8;\r
+ char *eventName;\r
+ char *eventText;\r
+} GF_ShortTextual;\r
+\r
+\r
+/*this structure is used in GF_ExpandedTextual*/\r
+typedef struct {\r
+ char *text;\r
+} GF_ETD_ItemText;\r
+\r
+/*Expanded Textual Descriptor*/\r
+typedef struct {\r
+ BASE_DESCRIPTOR\r
+ u32 langCode;\r
+ u8 isUTF8;\r
+ GF_List *itemDescriptionList;\r
+ GF_List *itemTextList;\r
+ char *NonItemText;\r
+} GF_ExpandedTextual;\r
+\r
+/*this structure is used in GF_CC_Name*/\r
+typedef struct {\r
+ u32 langCode;\r
+ u8 isUTF8;\r
+ char *contentCreatorName;\r
+} GF_ContentCreatorInfo;\r
+\r
+/*Content Creator Name GF_Descriptor\r
+NOTE: the desctructor will delete all the items in the list\r
+(GF_ContentCreatorInfo items) */\r
+typedef struct {\r
+ BASE_DESCRIPTOR\r
+ GF_List *ContentCreators;\r
+} GF_CC_Name;\r
+\r
+/*Content Creation Date Descriptor*/\r
+typedef struct {\r
+ BASE_DESCRIPTOR\r
+ char contentCreationDate[5];\r
+} GF_CC_Date;\r
+\r
+\r
+/*this structure is used in GF_OCICreators*/\r
+typedef struct {\r
+ u32 langCode;\r
+ u8 isUTF8;\r
+ char *OCICreatorName;\r
+} GF_OCICreator_item;\r
+\r
+/*OCI Creator Name Descriptor*/\r
+typedef struct {\r
+ BASE_DESCRIPTOR\r
+ GF_List *OCICreators;\r
+} GF_OCICreators;\r
+\r
+/*OCI Creation Date Descriptor*/\r
+typedef struct {\r
+ BASE_DESCRIPTOR\r
+ char OCICreationDate[5];\r
+} GF_OCI_Data;\r
+\r
+\r
+/*this structure is used in GF_SMPTECamera*/\r
+typedef struct {\r
+ u8 paramID;\r
+ u32 param;\r
+} GF_SmpteParam;\r
+\r
+/*Smpte Camera Position Descriptor*/\r
+typedef struct {\r
+ BASE_DESCRIPTOR\r
+ u8 cameraID;\r
+ GF_List *ParamList;\r
+} GF_SMPTECamera;\r
+\r
+\r
+/*Extension Profile Level Descriptor*/\r
+typedef struct {\r
+ BASE_DESCRIPTOR\r
+ u8 profileLevelIndicationIndex;\r
+ u8 ODProfileLevelIndication;\r
+ u8 SceneProfileLevelIndication;\r
+ u8 AudioProfileLevelIndication;\r
+ u8 VisualProfileLevelIndication;\r
+ u8 GraphicsProfileLevelIndication;\r
+ u8 MPEGJProfileLevelIndication;\r
+} GF_PLExt;\r
+\r
+/*Profile Level Indication Index Descriptor*/\r
+typedef struct {\r
+ BASE_DESCRIPTOR\r
+ u8 profileLevelIndicationIndex;\r
+} GF_PL_IDX;\r
+\r
+\r
+/*AVC config descriptor - not a real MPEG-4 descriptor */\r
+/*used for sequenceParameterSetNALUnit and pictureParameterSetNALUnit*/\r
+typedef struct\r
+{\r
+ u16 size;\r
+ char *data;\r
+} GF_AVCConfigSlot;\r
+\r
+typedef struct \r
+{\r
+ u8 configurationVersion;\r
+ u8 AVCProfileIndication;\r
+ u8 profile_compatibility;\r
+ u8 AVCLevelIndication; \r
+ u8 nal_unit_size;\r
+ \r
+ GF_List *sequenceParameterSets;\r
+ GF_List *pictureParameterSets;\r
+} GF_AVCConfig;\r
+\r
+\r
+/************************************************************\r
+ Media Control Extensions\r
+************************************************************/\r
+typedef struct\r
+{\r
+ BASE_DESCRIPTOR\r
+ Double startTime;\r
+ Double Duration;\r
+ char *SegmentName;\r
+} GF_Segment;\r
+\r
+typedef struct\r
+{\r
+ BASE_DESCRIPTOR\r
+ Double mediaTimeStamp;\r
+} GF_MediaTime;\r
+\r
+\r
+/****************************************************************************\r
+\r
+ MPEG-4 SYSTEM - OBJECT DESCRIPTORS COMMANDS DECLARATION\r
+\r
+****************************************************************************/\r
+\r
+\r
+/***************************************\r
+ Commands Tags\r
+***************************************/\r
+enum\r
+{\r
+ GF_ODF_OD_UPDATE_TAG = 0x01,\r
+ GF_ODF_OD_REMOVE_TAG = 0x02,\r
+ GF_ODF_ESD_UPDATE_TAG = 0x03,\r
+ GF_ODF_ESD_REMOVE_TAG = 0x04,\r
+ GF_ODF_IPMP_UPDATE_TAG = 0x05,\r
+ GF_ODF_IPMP_REMOVE_TAG = 0x06,\r
+\r
+ /*file format reserved*/\r
+ GF_ODF_ESD_REMOVE_REF_TAG = 0x07,\r
+\r
+ GF_ODF_COM_ISO_BEGIN_TAG = 0x0D,\r
+ GF_ODF_COM_ISO_END_TAG = 0xBF,\r
+ \r
+ GF_ODF_COM_USER_BEGIN_TAG = 0xC0,\r
+ GF_ODF_COM_USER_END_TAG = 0xFE\r
+};\r
+\r
+/***************************************\r
+ OD commands\r
+***************************************/\r
+#define BASE_OD_COMMAND \\r
+ u8 tag;\r
+\r
+/*the (abstract) base command. */\r
+typedef struct {\r
+ BASE_OD_COMMAND\r
+} GF_ODCom;\r
+\r
+/*the default bcommand*/\r
+typedef struct {\r
+ BASE_OD_COMMAND\r
+ u32 dataSize;\r
+ char *data;\r
+} GF_BaseODCom;\r
+\r
+/*Object Descriptor Update\r
+NB: the list can contain OD or IOD, except internally in the File Format (only MP4_OD)*/\r
+typedef struct\r
+{\r
+ BASE_OD_COMMAND\r
+ GF_List *objectDescriptors;\r
+} GF_ODUpdate;\r
+\r
+/*Object Descriptor Remove*/\r
+typedef struct\r
+{\r
+ BASE_OD_COMMAND\r
+ u32 NbODs;\r
+ u16 *OD_ID;\r
+} GF_ODRemove;\r
+\r
+/*Elementary Stream Descriptor Update*/\r
+typedef struct\r
+{\r
+ BASE_OD_COMMAND\r
+ u16 ODID;\r
+ GF_List *ESDescriptors;\r
+} GF_ESDUpdate;\r
+\r
+/*Elementary Stream Descriptor Remove*/\r
+typedef struct {\r
+ BASE_OD_COMMAND\r
+ u16 ODID;\r
+ u32 NbESDs;\r
+ u16 *ES_ID;\r
+} GF_ESDRemove;\r
+\r
+/*IPMP Descriptor Update*/\r
+typedef struct {\r
+ BASE_OD_COMMAND\r
+ GF_List *IPMPDescList;\r
+} GF_IPMPUpdate;\r
+\r
+/*IPMP Descriptor Remove*/\r
+typedef struct {\r
+ BASE_OD_COMMAND\r
+ u32 NbIPMPDs;\r
+ /*now this is bad: only IPMPv1 descriptors can be removed at run tim...*/\r
+ u8 *IPMPDescID;\r
+} GF_IPMPRemove;\r
+\r
+\r
+\r
+\r
+\r
+\r
+/********************************************************************\r
+ OD Exports\r
+********************************************************************/\r
+\r
+/*OD CODEC object - just a simple reader/writer*/\r
+typedef struct tagODCoDec\r
+{\r
+ GF_BitStream *bs;\r
+ GF_List *CommandList;\r
+} GF_ODCodec;\r
+\r
+/*construction / destruction*/\r
+GF_ODCodec *gf_odf_codec_new();\r
+void gf_odf_codec_del(GF_ODCodec *codec);\r
+/* add a command to the codec command list. */\r
+GF_Err gf_odf_codec_add_com(GF_ODCodec *codec, GF_ODCom *command);\r
+/*encode the current coimmand list - once called the commands are destroyed*/\r
+GF_Err gf_odf_codec_encode(GF_ODCodec *codec, Bool delete_content);\r
+/*get the encoded AU. user is responsible of allocated space*/\r
+GF_Err gf_odf_codec_get_au(GF_ODCodec *codec, char **outAU, u32 *au_length);\r
+/* set the encoded AU to the codec*/\r
+GF_Err gf_odf_codec_set_au(GF_ODCodec *codec, char *au, u32 au_length);\r
+/*decode the previously set-up AU*/\r
+GF_Err gf_odf_codec_decode(GF_ODCodec *codec);\r
+/*get the first OD command in the list. Once called, the command is removed \r
+from the command list. Return NULL when commandList is empty*/\r
+GF_ODCom *gf_odf_codec_get_com(GF_ODCodec *codec);\r
+\r
+/*apply a command to the codec command list. Command is duplicated if needed\r
+This is used for state maintenance and RAP generation.*/\r
+GF_Err gf_odf_codec_apply_com(GF_ODCodec *codec, GF_ODCom *command);\r
+\r
+/************************************************************\r
+ GF_ODCom Functions\r
+************************************************************/\r
+\r
+/*Commands Creation / Destruction*/\r
+GF_ODCom *gf_odf_com_new(u8 tag);\r
+GF_Err gf_odf_com_del(GF_ODCom **com);\r
+\r
+\r
+/************************************************************\r
+ Descriptors Functions\r
+************************************************************/\r
+\r
+/*Descriptors Creation / Destruction*/\r
+GF_Descriptor *gf_odf_desc_new(u8 tag);\r
+void gf_odf_desc_del(GF_Descriptor *desc);\r
+\r
+/*use this function to decode a standalone descriptor\r
+the raw descriptor MUST be formatted with tag and size field!!!\r
+a new desc is created and you must delete it when done*/\r
+GF_Err gf_odf_desc_read(char *raw_desc, u32 descSize, GF_Descriptor * *outDesc);\r
+\r
+/*use this function to encode a standalone descriptor\r
+the desc will be formatted with tag and size field\r
+the output buffer is allocated and you must delete it when done*/\r
+GF_Err gf_odf_desc_write(GF_Descriptor *desc, char **outEncDesc, u32 *outSize);\r
+\r
+/*use this function to get the size of a standalone descriptor (including tag and size fields)\r
+return 0 if error*/\r
+u32 gf_odf_desc_size(GF_Descriptor *desc);\r
+\r
+/*this is usefull to duplicate on the fly a descriptor*/\r
+GF_Err gf_odf_desc_copy(GF_Descriptor *inDesc, GF_Descriptor **outDesc);\r
+\r
+\r
+/*This functions handles internally what desc can be added to another desc\r
+and adds it. NO DUPLICATION of the descriptor, so\r
+once a desc is added to its parent, destroying the parent WILL DESTROY \r
+this descriptor*/\r
+GF_Err gf_odf_desc_add_desc(GF_Descriptor *parentDesc, GF_Descriptor *newDesc);\r
+\r
+\r
+/*this is a helper for building a preformatted GF_ESD with decoderConfig, decoderSpecificInfo with no data and \r
+SLConfig descriptor with predefined*/\r
+GF_ESD *gf_odf_desc_esd_new(u32 sl_predefined);\r
+\r
+\r
+/*Since IPMP V2, we introduce a new set of functions to read / write a list of descriptors\r
+that have no containers (a bit like an OD command, but for descriptors)\r
+This is usefull for IPMPv2 DecoderSpecificInfo which contains a set of IPMP_Declarators\r
+As it could be used for other purposes we keep it generic\r
+you must create the list yourself, the functions just encode/decode from/to the list*/\r
+\r
+/*uncompress an encoded list of descriptors. You must pass an empty GF_List structure\r
+to know exactly what was in the buffer*/\r
+GF_Err gf_odf_desc_list_read(char *raw_list, u32 raw_size, GF_List *descList);\r
+/*compress all descriptors in the list into a single buffer. The buffer is allocated\r
+by the lib and must be destroyed by your app\r
+you must pass (outEncList != NULL && *outEncList == NULL)*/\r
+GF_Err gf_odf_desc_list_write(GF_List *descList, char **outEncList, u32 *outSize);\r
+/*returns size of encoded desc list*/\r
+GF_Err gf_odf_desc_list_size(GF_List *descList, u32 *outSize);\r
+/*destroy the descriptors in a list but not the list*/\r
+GF_Err gf_odf_desc_list_del(GF_List *descList);\r
+\r
+/*retuns NULL if unknown, otherwise value*/\r
+const char *gf_odf_stream_type_name(u32 streamType);\r
+u32 gf_odf_stream_type_by_name(const char *streamType);\r
+\r
+/*special function for authoring - convert DSI to BIFSConfig*/\r
+GF_BIFSConfig *gf_odf_get_bifs_config(GF_DefaultDescriptor *dsi, u8 oti);\r
+/*special function for authoring - convert DSI to LASERConfig*/\r
+GF_Err gf_odf_get_laser_config(GF_DefaultDescriptor *dsi, GF_LASERConfig *cfg);\r
+/*sepcial function for authoring - convert DSI to TextConfig*/\r
+GF_Err gf_odf_get_text_config(GF_DefaultDescriptor *dsi, u8 oti, GF_TextConfig *cfg);\r
+/*special function for authoring - convert DSI to UIConfig*/\r
+GF_Err gf_odf_get_ui_config(GF_DefaultDescriptor *dsi, GF_UIConfig *cfg);\r
+/*converts UIConfig to dsi - does not destroy input descr but does create output one*/\r
+GF_Err gf_odf_encode_ui_config(GF_UIConfig *cfg, GF_DefaultDescriptor **out_dsi);\r
+\r
+/*simple constructor/destructor*/\r
+GF_AVCConfig *gf_odf_avc_cfg_new();\r
+void gf_odf_avc_cfg_del(GF_AVCConfig *cfg);\r
+/*gets GF_AVCConfig from MPEG-4 DSI*/\r
+GF_AVCConfig *gf_odf_avc_cfg_read(char *dsi, u32 dsi_size);\r
+/*writes GF_AVCConfig as MPEG-4 DSI*/\r
+GF_Err gf_odf_avc_cfg_write(GF_AVCConfig *cfg, char **outData, u32 *outSize);\r
+\r
+\r
+\r
+/************************************************************\r
+ QoS Qualifiers Functions\r
+************************************************************/\r
+\r
+/*QoS Qualifiers Creation / Destruction*/\r
+GF_QoS_Default *gf_odf_qos_new(u8 tag);\r
+GF_Err gf_odf_qos_del(GF_QoS_Default **qos);\r
+\r
+/*READ/WRITE functions: QoS qualifiers are special descriptors but follow the same rules as descriptors.\r
+therefore, use gf_odf_desc_read and gf_odf_desc_write for QoS*/\r
+\r
+/*same function, but for QoS, as a Qualifier IS NOT a descriptor*/\r
+GF_Err gf_odf_qos_add_qualif(GF_QoS_Descriptor *desc, GF_QoS_Default *qualif);\r
+\r
+\r
+\r
+/*\r
+ OCI Stream AU is a list of OCI event (like OD AU is a list of OD commands)\r
+*/\r
+\r
+typedef struct __tag_oci_event OCIEvent;\r
+\r
+OCIEvent *gf_oci_event_new(u16 EventID);\r
+void gf_oci_event_del(OCIEvent *event);\r
+\r
+GF_Err gf_oci_event_set_start_time(OCIEvent *event, u8 Hours, u8 Minutes, u8 Seconds, u8 HundredSeconds, u8 IsAbsoluteTime);\r
+GF_Err gf_oci_event_set_duration(OCIEvent *event, u8 Hours, u8 Minutes, u8 Seconds, u8 HundredSeconds);\r
+GF_Err gf_oci_event_add_desc(OCIEvent *event, GF_Descriptor *oci_desc);\r
+\r
+GF_Err gf_oci_event_get_id(OCIEvent *event, u16 *ID);\r
+GF_Err gf_oci_event_get_start_time(OCIEvent *event, u8 *Hours, u8 *Minutes, u8 *Seconds, u8 *HundredSeconds, u8 *IsAbsoluteTime);\r
+GF_Err gf_oci_event_get_duration(OCIEvent *event, u8 *Hours, u8 *Minutes, u8 *Seconds, u8 *HundredSeconds);\r
+u32 gf_oci_event_get_desc_count(OCIEvent *event);\r
+GF_Descriptor *gf_oci_event_get_desc(OCIEvent *event, u32 DescIndex);\r
+GF_Err gf_oci_event_rem_desc(OCIEvent *event, u32 DescIndex);\r
+\r
+\r
+\r
+typedef struct __tag_oci_codec OCICodec;\r
+\r
+/*construction / destruction\r
+IsEncoder specifies an OCI Event encoder\r
+version is for future extensions, and only 0x01 is valid for now*/\r
+OCICodec *gf_oci_codec_new(u8 IsEncoder, u8 Version);\r
+void gf_oci_codec_del(OCICodec *codec);\r
+\r
+/* ENCODER FUNCTIONS\r
+add a command to the codec event list. \r
+The event WILL BE DESTROYED BY THE CODEC after encoding*/\r
+GF_Err gf_oci_codec_add_event(OCICodec *codec, OCIEvent *event);\r
+\r
+/*encode AU. The memory allocation is done in place\r
+WARNING: once this function called, the codec event List is empty \r
+and events destroyed\r
+you must set *outAU = NULL*/\r
+GF_Err gf_oci_codec_encode(OCICodec *codec, char **outAU, u32 *au_length);\r
+\r
+\r
+\r
+/*Decoder: decode the previously set-up AU\r
+the input buffer is cleared once decoded*/\r
+GF_Err gf_oci_codec_decode(OCICodec *codec, char *au, u32 au_length);\r
+\r
+/*get the first OCI Event in the list. Once called, the event is removed \r
+from the event list. Return NULL when the event List is empty\r
+you MUST delete events */\r
+OCIEvent *gf_oci_codec_get_event(OCICodec *codec);\r
+\r
+\r
+/*OD dump tools*/\r
+GF_Err gf_odf_dump_au(char *data, u32 dataLength, FILE *trace, u32 indent, Bool XMTDump);\r
+GF_Err gf_odf_dump_com(void *p, FILE *trace, u32 indent, Bool XMTDump);\r
+GF_Err gf_odf_dump_desc(void *ptr, FILE *trace, u32 indent, Bool XMTDump);\r
+GF_Err gf_odf_dump_com_list(GF_List *commandList, FILE *trace, u32 indent, Bool XMTDump);\r
+\r
+/*OCI dump tools*/\r
+GF_Err gf_oci_dump_event(OCIEvent *ev, FILE *trace, u32 indent, Bool XMTDump);\r
+GF_Err gf_oci_dump_au(u8 version, char *au, u32 au_length, FILE *trace, u32 indent, Bool XMTDump);\r
+\r
+\r
+/*OD parsing tools (XMT/BT)*/\r
+/*returns desc tag based on name*/\r
+u32 gf_odf_get_tag_by_name(char *descName);\r
+/*field type for OD/QoS/IPMPX/etc*/\r
+enum\r
+{\r
+ /*regular type*/\r
+ GF_ODF_FT_DEFAULT = 0,\r
+ /*single descriptor type*/\r
+ GF_ODF_FT_OD = 1,\r
+ /*descriptor list type*/\r
+ GF_ODF_FT_OD_LIST = 2,\r
+ /*IPMP Data type*/\r
+ GF_ODF_FT_IPMPX = 3,\r
+ /*IPMP Data list type*/\r
+ GF_ODF_FT_IPMPX_LIST = 4,\r
+ /*IPMP ByteArray type*/\r
+ GF_ODF_FT_IPMPX_BA = 5,\r
+ /*IPMP ByteArray list type*/\r
+ GF_ODF_FT_IPMPX_BA_LIST = 6,\r
+};\r
+u32 gf_odf_get_field_type(GF_Descriptor *desc, char *fieldName);\r
+/*set non-descriptor field value - value string shall be presented without ' or " characters*/\r
+GF_Err gf_odf_set_field(GF_Descriptor *desc, char *fieldName, char *val);\r
+\r
+\r
+\r
+\r
+/*\r
+ IPMPX extensions - IPMP Data only (messages are not supported yet)\r
+*/\r
+\r
+typedef struct\r
+{\r
+ u32 length;\r
+ char *data;\r
+} GF_IPMPX_ByteArray;\r
+\r
+/*IPMPX authentication descriptors*/\r
+#define GF_IPMPX_AUTH_DESC \\r
+ u8 tag; \\r
+\r
+typedef struct\r
+{\r
+ GF_IPMPX_AUTH_DESC\r
+} GF_IPMPX_Authentication;\r
+\r
+enum\r
+{\r
+ GF_IPMPX_AUTH_Forbidden_Tag = 0x00,\r
+ GF_IPMPX_AUTH_AlgorithmDescr_Tag = 0x01,\r
+ GF_IPMPX_AUTH_KeyDescr_Tag = 0x02,\r
+};\r
+\r
+typedef struct\r
+{\r
+ GF_IPMPX_AUTH_DESC\r
+ char *keyBody;\r
+ u32 keyBodyLength;\r
+} GF_IPMPX_AUTH_KeyDescriptor;\r
+\r
+typedef struct\r
+{\r
+ GF_IPMPX_AUTH_DESC\r
+ /*used if no specAlgoID*/\r
+ u16 regAlgoID;\r
+ GF_IPMPX_ByteArray *specAlgoID;\r
+ GF_IPMPX_ByteArray *OpaqueData;\r
+} GF_IPMPX_AUTH_AlgorithmDescriptor;\r
+\r
+\r
+/*IPMP data messages*/\r
+enum \r
+{\r
+ GF_IPMPX_OPAQUE_DATA_TAG = 0x01,\r
+ GF_IPMPX_AUDIO_WM_INIT_TAG = 0x02,\r
+ GF_IPMPX_VIDEO_WM_INIT_TAG = 0x03,\r
+ GF_IPMPX_SEL_DEC_INIT_TAG = 0x04,\r
+ GF_IPMPX_KEY_DATA_TAG = 0x05,\r
+ GF_IPMPX_AUDIO_WM_SEND_TAG = 0x06,\r
+ GF_IPMPX_VIDEO_WM_SEND_TAG = 0x07,\r
+ GF_IPMPX_RIGHTS_DATA_TAG = 0x08,\r
+ GF_IPMPX_SECURE_CONTAINER_TAG = 0x09,\r
+ GF_IPMPX_ADD_TOOL_LISTENER_TAG = 0x0A,\r
+ GF_IPMPX_REMOVE_TOOL_LISTENER_TAG = 0x0B,\r
+ GF_IPMPX_INIT_AUTHENTICATION_TAG = 0x0C,\r
+ GF_IPMPX_MUTUAL_AUTHENTICATION_TAG = 0x0D,\r
+ GF_IPMPX_USER_QUERY_TAG = 0x0E,\r
+ GF_IPMPX_USER_RESPONSE_TAG = 0x0F,\r
+ GF_IPMPX_PARAMETRIC_DESCRIPTION_TAG = 0x10,\r
+ GF_IPMPX_PARAMETRIC_CAPS_QUERY_TAG = 0x11,\r
+ GF_IPMPX_PARAMETRIC_CAPS_RESPONSE_TAG = 0x12,\r
+ /*NO ASSOCIATED STRUCTURE*/\r
+ GF_IPMPX_GET_TOOLS_TAG = 0x13,\r
+ GF_IPMPX_GET_TOOLS_RESPONSE_TAG = 0x14,\r
+ GF_IPMPX_GET_TOOL_CONTEXT_TAG = 0x15,\r
+ GF_IPMPX_GET_TOOL_CONTEXT_RESPONSE_TAG = 0x16,\r
+ GF_IPMPX_CONNECT_TOOL_TAG = 0x17,\r
+ GF_IPMPX_DISCONNECT_TOOL_TAG = 0x18,\r
+ GF_IPMPX_NOTIFY_TOOL_EVENT_TAG = 0x19,\r
+ GF_IPMPX_CAN_PROCESS_TAG = 0x1A,\r
+ GF_IPMPX_TRUST_SECURITY_METADATA_TAG = 0x1B,\r
+ GF_IPMPX_TOOL_API_CONFIG_TAG = 0x1C,\r
+\r
+ /*ISMA*/\r
+ GF_IPMPX_ISMACRYP_TAG = 0xD0, \r
+\r
+ /*intern ones for parsing (not real datas)*/\r
+ GF_IPMPX_TRUSTED_TOOL_TAG = 0xA1,\r
+ GF_IPMPX_TRUST_SPECIFICATION_TAG = 0xA2,\r
+ /*emulate algo descriptors as base IPMP classes for parsing...*/\r
+ GF_IPMPX_ALGORITHM_DESCRIPTOR_TAG = 0xA3,\r
+ GF_IPMPX_KEY_DESCRIPTOR_TAG = 0xA4,\r
+ GF_IPMPX_PARAM_DESCRIPTOR_ITEM_TAG = 0xA5,\r
+ GF_IPMPX_SEL_ENC_BUFFER_TAG = 0xA6,\r
+ GF_IPMPX_SEL_ENC_FIELD_TAG = 0xA7,\r
+};\r
+\r
+typedef char GF_IPMPX_Date[5];\r
+\r
+\r
+#define GF_IPMPX_DATA_BASE \\r
+ u8 tag; \\r
+ u8 Version; \\r
+ u8 dataID; \\r
+\r
+typedef struct\r
+{\r
+ GF_IPMPX_DATA_BASE\r
+} GF_IPMPX_Data;\r
+\r
+typedef struct\r
+{\r
+ GF_IPMPX_DATA_BASE\r
+ u32 Context;\r
+ u8 AuthType;\r
+} GF_IPMPX_InitAuthentication;\r
+\r
+/*NOT a real DATA, only used as data for parsing*/\r
+typedef struct\r
+{\r
+ GF_IPMPX_DATA_BASE\r
+ GF_IPMPX_Date startDate;\r
+ u8 attackerProfile;\r
+ u32 trustedDuration;\r
+ GF_IPMPX_ByteArray *CCTrustMetadata;\r
+} GF_IPMPX_TrustSpecification;\r
+\r
+/*NOT a real DATA, only used as data for parsing*/\r
+typedef struct\r
+{\r
+ GF_IPMPX_DATA_BASE\r
+ bin128 toolID; \r
+ GF_IPMPX_Date AuditDate;\r
+ GF_List *trustSpecifications;\r
+} GF_IPMPX_TrustedTool;\r
+\r
+typedef struct _ipmpx_TrustSecurityMetadata\r
+{\r
+ GF_IPMPX_DATA_BASE\r
+ GF_List *TrustedTools;\r
+} GF_IPMPX_TrustSecurityMetadata;\r
+\r
+\r
+typedef struct\r
+{\r
+ GF_IPMPX_DATA_BASE\r
+ Bool failedNegotiation;\r
+\r
+ GF_List *candidateAlgorithms;\r
+ GF_List *agreedAlgorithms;\r
+ GF_IPMPX_ByteArray *AuthenticationData;\r
+\r
+ /*inclAuthCodes will be set if any of the members is set (cf spec...)*/\r
+ u32 certType;\r
+ /*GF_IPMPX_ByteArray list*/\r
+ GF_List *certificates;\r
+ GF_IPMPX_AUTH_KeyDescriptor *publicKey;\r
+ GF_IPMPX_ByteArray *opaque;\r
+ GF_IPMPX_TrustSecurityMetadata *trustData;\r
+ GF_IPMPX_ByteArray *authCodes;\r
+} GF_IPMPX_MutualAuthentication;\r
+\r
+typedef struct\r
+{\r
+ GF_IPMPX_DATA_BASE\r
+ /*if set MAC is part of the encrypted data*/\r
+ Bool isMACEncrypted;\r
+\r
+ GF_IPMPX_ByteArray *encryptedData;\r
+ GF_IPMPX_Data *protectedMsg;\r
+ GF_IPMPX_ByteArray *MAC;\r
+} GF_IPMPX_SecureContainer;\r
+\r
+typedef struct\r
+{\r
+ GF_List *ipmp_tools;\r
+} GF_IPMPX_GetToolsResponse;\r
+\r
+typedef struct\r
+{\r
+ GF_IPMPX_DATA_BASE\r
+ GF_IPMPX_ByteArray *main_class;\r
+ GF_IPMPX_ByteArray *subClass;\r
+ GF_IPMPX_ByteArray *typeData;\r
+ GF_IPMPX_ByteArray *type;\r
+ GF_IPMPX_ByteArray *addedData;\r
+} GF_IPMPX_ParametricDescriptionItem;\r
+\r
+typedef struct _tagIPMPXParamDesc\r
+{\r
+ GF_IPMPX_DATA_BASE\r
+ GF_IPMPX_ByteArray *descriptionComment;\r
+ u8 majorVersion;\r
+ u8 minorVersion;\r
+ /*list of GF_IPMPX_ParametricDescriptionItem*/\r
+ GF_List *descriptions;\r
+} GF_IPMPX_ParametricDescription;\r
+\r
+typedef struct\r
+{\r
+ GF_IPMPX_DATA_BASE\r
+ GF_IPMPX_ParametricDescription *description;\r
+} GF_IPMPX_ToolParamCapabilitiesQuery;\r
+\r
+typedef struct\r
+{\r
+ GF_IPMPX_DATA_BASE\r
+ Bool capabilitiesSupported;\r
+} GF_IPMPX_ToolParamCapabilitiesResponse;\r
+\r
+\r
+typedef struct\r
+{\r
+ GF_IPMPX_DATA_BASE\r
+ GF_IPMP_Descriptor *toolDescriptor;\r
+} GF_IPMPX_ConnectTool;\r
+\r
+typedef struct\r
+{\r
+ GF_IPMPX_DATA_BASE\r
+ u32 IPMP_ToolContextID;\r
+} GF_IPMPX_DisconnectTool;\r
+\r
+\r
+typedef struct\r
+{\r
+ GF_IPMPX_DATA_BASE\r
+ u8 scope;\r
+ u16 IPMP_DescriptorIDEx;\r
+} GF_IPMPX_GetToolContext;\r
+\r
+\r
+typedef struct\r
+{\r
+ GF_IPMPX_DATA_BASE\r
+ u16 OD_ID;\r
+ u16 ESD_ID;\r
+ u32 IPMP_ToolContextID;\r
+} GF_IPMPX_GetToolContextResponse;\r
+\r
+/*GF_IPMPX_LISTEN_Types*/\r
+enum\r
+{\r
+ GF_IPMPX_LISTEN_CONNECTED = 0x00,\r
+ GF_IPMPX_LISTEN_CONNECTIONFAILED = 0x01,\r
+ GF_IPMPX_LISTEN_DISCONNECTED = 0x02,\r
+ GF_IPMPX_LISTEN_DISCONNECTIONFAILED = 0x03,\r
+ GF_IPMPX_LISTEN_WATERMARKDETECTED = 0x04,\r
+};\r
+\r
+typedef struct\r
+{\r
+ GF_IPMPX_DATA_BASE\r
+ u8 scope;\r
+ /*events to listen to*/\r
+ u8 eventTypeCount;\r
+ u8 eventType[10];\r
+} GF_IPMPX_AddToolNotificationListener;\r
+\r
+typedef struct\r
+{\r
+ GF_IPMPX_DATA_BASE\r
+ u8 eventTypeCount;\r
+ u8 eventType[10];\r
+} GF_IPMPX_RemoveToolNotificationListener;\r
+\r
+typedef struct\r
+{\r
+ GF_IPMPX_DATA_BASE\r
+ u16 OD_ID;\r
+ u16 ESD_ID;\r
+ u8 eventType;\r
+ u32 IPMP_ToolContextID;\r
+} GF_IPMPX_NotifyToolEvent;\r
+\r
+typedef struct\r
+{\r
+ GF_IPMPX_DATA_BASE\r
+ Bool canProcess;\r
+} GF_IPMPX_CanProcess;\r
+\r
+typedef struct\r
+{\r
+ GF_IPMPX_DATA_BASE\r
+ GF_IPMPX_ByteArray *opaqueData;\r
+} GF_IPMPX_OpaqueData;\r
+\r
+\r
+typedef struct\r
+{\r
+ GF_IPMPX_DATA_BASE\r
+ GF_IPMPX_ByteArray *keyBody;\r
+ /*flags meaning\r
+ hasStartDTS = 1;\r
+ hasStartPacketID = 1<<1;\r
+ hasExpireDTS = 1<<2;\r
+ hasExpirePacketID = 1<<3\r
+ */\r
+ u32 flags;\r
+\r
+ u64 startDTS;\r
+ u32 startPacketID;\r
+ u64 expireDTS;\r
+ u32 expirePacketID;\r
+ GF_IPMPX_ByteArray *OpaqueData;\r
+} GF_IPMPX_KeyData;\r
+\r
+typedef struct\r
+{\r
+ GF_IPMPX_DATA_BASE\r
+ GF_IPMPX_ByteArray *rightsInfo; \r
+} GF_IPMPX_RightsData;\r
+\r
+\r
+/*not a real GF_IPMPX_Data in spec, but emulated as if for parsing*/\r
+typedef struct\r
+{\r
+ GF_IPMPX_DATA_BASE\r
+ bin128 cipher_Id; \r
+ u8 syncBoundary;\r
+ /*block mode if stream cypher info is NULL*/\r
+ u8 mode; \r
+ u16 blockSize;\r
+ u16 keySize;\r
+ GF_IPMPX_ByteArray *Stream_Cipher_Specific_Init_Info; \r
+} GF_IPMPX_SelEncBuffer;\r
+\r
+/*not a real GF_IPMPX_Data in spec, but emulated as if for parsing*/\r
+typedef struct\r
+{\r
+ GF_IPMPX_DATA_BASE\r
+ u8 field_Id; \r
+ u8 field_Scope;\r
+ u8 buf; \r
+\r
+ u16 mappingTableSize;\r
+ u16 *mappingTable;\r
+ GF_IPMPX_ByteArray *shuffleSpecificInfo;\r
+} GF_IPMPX_SelEncField;\r
+\r
+\r
+/*mediaTypeExtension*/\r
+enum\r
+{\r
+ GF_IPMPX_SE_MT_ISO_IEC = 0x00,\r
+ GF_IPMPX_SE_MT_ITU = 0x01\r
+ /*the rest is reserved or forbidden*/\r
+};\r
+\r
+/*compliance*/\r
+enum\r
+{\r
+ GF_IPMPX_SE_COMP_FULLY = 0x00,\r
+ GF_IPMPX_SE_COMP_VIDEO_PACKETS = 0x01,\r
+ GF_IPMPX_SE_COMP_VIDEO_VOP = 0x02,\r
+ GF_IPMPX_SE_COMP_VIDEO_NONE = 0x03,\r
+ GF_IPMPX_SE_COMP_VIDEO_GOB = 0x04,\r
+ /*0x05-2F ISO Reserved for video*/\r
+ GF_IPMPX_SE_COMP_AAC_DF = 0x30,\r
+ GF_IPMPX_SE_COMP_AAC_NONE = 0x31,\r
+ /*\r
+ 0x32 - 0x5F ISO Reserved for audio\r
+ 0x60 - 0xCF ISO Reserved\r
+ 0xD0 - 0xFE User Defined\r
+ 0xFF Forbidden\r
+ */\r
+};\r
+\r
+/*syncBoundary*/\r
+enum\r
+{\r
+ GF_IPMPX_SE_SYNC_VID7EO_PACKETS = 0x00,\r
+ GF_IPMPX_SE_SYNC_VIDEO_VOP = 0x01,\r
+ GF_IPMPX_SE_SYNC_VIDEO_GOV = 0x02,\r
+ /*0x03-2F ISO Reserved for video,*/\r
+ GF_IPMPX_SE_SYNC_AAC_DF = 0x30,\r
+ /*0x31 - 0x5F ISO Reserved for audio\r
+ 0x60 - 0xCF ISO Reserved\r
+ 0xD0 - 0xFE User Defined\r
+ 0xFF Forbidden\r
+ */\r
+};\r
+\r
+/*field_Id*/\r
+enum\r
+{\r
+ GF_IPMPX_SE_FID_VIDEO_MV = 0x00,\r
+ GF_IPMPX_SE_FID_VIDEO_DC = 0x01,\r
+ GF_IPMPX_SE_FID_VIDEO_DCT_SIGN = 0x02,\r
+ GF_IPMPX_SE_FID_VIDEO_DQUANT = 0x03,\r
+ GF_IPMPX_SE_FID_VIDEO_DCT_COEF = 0x04,\r
+ GF_IPMPX_SE_FID_VIDEO_ALL = 0x05,\r
+ /*0x06-2F ISO Reserved for video*/\r
+ GF_IPMPX_SE_FID_AAC_SIGN = 0x30,\r
+ GF_IPMPX_SE_FID_AAC_CODEWORDS = 0x31,\r
+ GF_IPMPX_SE_FID_AAC_SCALE = 0x32,\r
+ /*0x32 - 0x5F ISO Reserved for audio\r
+ 0x60 - 0xCF ISO Reserved\r
+ 0xD0 - 0xFE User Defined\r
+ 0xFF Forbidden*/\r
+};\r
+\r
+\r
+typedef struct\r
+{\r
+ GF_IPMPX_DATA_BASE\r
+ u8 mediaTypeExtension; \r
+ u8 mediaTypeIndication;\r
+ u8 profileLevelIndication; \r
+ u8 compliance;\r
+\r
+ GF_List *SelEncBuffer;\r
+\r
+ GF_List *SelEncFields;\r
+\r
+ u16 RLE_DataLength;\r
+ u16 *RLE_Data;\r
+} GF_IPMPX_SelectiveDecryptionInit;\r
+\r
+\r
+/*watermark init ops*/\r
+enum\r
+{\r
+ GF_IPMPX_WM_INSERT = 0,\r
+ GF_IPMPX_WM_EXTRACT = 1,\r
+ GF_IPMPX_WM_REMARK = 2,\r
+ GF_IPMPX_WM_DETECT_COMPRESSION = 3,\r
+};\r
+\r
+/*used for both audio and video WM init*/\r
+typedef struct\r
+{\r
+ GF_IPMPX_DATA_BASE\r
+ /*\r
+ for audio: PCM defined (0x01) and all audio objectTypeIndications\r
+ for video: YUV defined (0x01) and all visual objectTypeIndications\r
+ */\r
+ u8 inputFormat;\r
+ u8 requiredOp;\r
+\r
+ /*valid for audio WM, inputFormat=0x01*/\r
+ u8 nChannels;\r
+ u8 bitPerSample;\r
+ u32 frequency;\r
+\r
+ /*valid for video WM, inputFormat=0x01*/\r
+ u16 frame_horizontal_size;\r
+ u16 frame_vertical_size;\r
+ u8 chroma_format;\r
+\r
+ u32 wmPayloadLen;\r
+ char *wmPayload;\r
+\r
+ u16 wmRecipientId;\r
+ \r
+ u32 opaqueDataSize;\r
+ char *opaqueData;\r
+} GF_IPMPX_WatermarkingInit;\r
+\r
+\r
+\r
+/*WM status*/\r
+enum\r
+{\r
+ GF_IPMPX_WM_PAYLOAD = 0,\r
+ GF_IPMPX_WM_NOPAYLOAD = 1,\r
+ GF_IPMPX_WM_NONE = 2,\r
+ GF_IPMPX_WM_UNKNOWN = 3\r
+};\r
+\r
+/*compression status*/\r
+enum\r
+{\r
+ GF_IPMPX_WM_COMPRESSION = 0,\r
+ GF_IPMPX_WM_NO_COMPRESSION = 1,\r
+ GF_IPMPX_WM_COMPRESSION_UNKNOWN = 2,\r
+};\r
+\r
+typedef struct\r
+{\r
+ GF_IPMPX_DATA_BASE\r
+ u8 wm_status;\r
+ u8 compression_status;\r
+ /*if payload is set, status is FORCED to AUDIO_GF_IPMPX_WM_PAYLOAD*/\r
+ GF_IPMPX_ByteArray *payload;\r
+ GF_IPMPX_ByteArray *opaqueData;\r
+} GF_IPMPX_SendWatermark;\r
+\r
+\r
+typedef struct\r
+{\r
+ GF_IPMPX_DATA_BASE\r
+ /*GPAC only supports non-0 IDs*/\r
+ u32 Instantiation_API_ID;\r
+ u32 Messaging_API_ID;\r
+ GF_IPMPX_ByteArray *opaqueData;\r
+} GF_IPMPX_ToolAPI_Config;\r
+\r
+typedef struct\r
+{\r
+ GF_IPMPX_DATA_BASE\r
+ u8 cryptoSuite;\r
+ u8 IV_length;\r
+ Bool use_selective_encryption;\r
+ u8 key_indicator_length;\r
+} GF_IPMPX_ISMACryp;\r
+\r
+\r
+/*constructor/destructor*/\r
+GF_IPMPX_Data *gf_ipmpx_data_new(u8 tag);\r
+void gf_ipmpx_data_del(GF_IPMPX_Data *p);\r
+\r
+/*parse from bitstream*/\r
+GF_Err gf_ipmpx_data_parse(GF_BitStream *bs, GF_IPMPX_Data **out_data);\r
+/*get IPMP_Data contained size (eg without tag & sizeofinstance)*/\r
+u32 gf_ipmpx_data_size(GF_IPMPX_Data *p);\r
+/*get fulml IPMP_Data encoded size (eg with tag & sizeofinstance)*/\r
+u32 gf_ipmpx_data_full_size(GF_IPMPX_Data *p);\r
+/*writes IPMP_Data to buffer*/\r
+GF_Err gf_ipmpx_data_write(GF_BitStream *bs, GF_IPMPX_Data *_p);\r
+\r
+/*returns GF_IPMPX_Tag based on name*/\r
+u8 gf_ipmpx_get_tag(char *dataName);\r
+/*return values: cf above */\r
+u32 gf_ipmpx_get_field_type(GF_IPMPX_Data *p, char *fieldName);\r
+GF_Err gf_ipmpx_set_field(GF_IPMPX_Data *desc, char *fieldName, char *val);\r
+/*assign subdata*/\r
+GF_Err gf_ipmpx_set_sub_data(GF_IPMPX_Data *desc, char *fieldName, GF_IPMPX_Data *subdesc);\r
+/*assign bytearray*/\r
+GF_Err gf_ipmpx_set_byte_array(GF_IPMPX_Data *p, char *field, char *str);\r
+\r
+/*ipmpx dumper*/\r
+GF_Err gf_ipmpx_dump_data(GF_IPMPX_Data *_p, FILE *trace, u32 indent, Bool XMTDump);\r
+\r
+\r
+\r
+#ifdef __cplusplus\r
+}\r
+#endif\r
+\r
+#endif /*_GF_MPEG4_ODF_H_*/\r