📄 mpeg4_odf.h
字号:
/*field type for OD/QoS/IPMPX/etc*/enum{ /*regular type*/ GF_ODF_FT_DEFAULT = 0, /*single descriptor type*/ GF_ODF_FT_OD = 1, /*descriptor list type*/ GF_ODF_FT_OD_LIST = 2, /*IPMP Data type*/ GF_ODF_FT_IPMPX = 3, /*IPMP Data list type*/ GF_ODF_FT_IPMPX_LIST = 4, /*IPMP ByteArray type*/ GF_ODF_FT_IPMPX_BA = 5, /*IPMP ByteArray list type*/ GF_ODF_FT_IPMPX_BA_LIST = 6,};u32 gf_odf_get_field_type(GF_Descriptor *desc, char *fieldName);/*set non-descriptor field value - value string shall be presented without ' or " characters*/GF_Err gf_odf_set_field(GF_Descriptor *desc, char *fieldName, char *val);/* IPMPX extensions - IPMP Data only (messages are not supported yet)*/typedef struct{ u32 length; char *data;} GF_IPMPX_ByteArray;/*IPMPX authentication descriptors*/#define GF_IPMPX_AUTH_DESC \ u8 tag; \typedef struct{ GF_IPMPX_AUTH_DESC} GF_IPMPX_Authentication;enum{ GF_IPMPX_AUTH_Forbidden_Tag = 0x00, GF_IPMPX_AUTH_AlgorithmDescr_Tag = 0x01, GF_IPMPX_AUTH_KeyDescr_Tag = 0x02,};typedef struct{ GF_IPMPX_AUTH_DESC char *keyBody; u32 keyBodyLength;} GF_IPMPX_AUTH_KeyDescriptor;typedef struct{ GF_IPMPX_AUTH_DESC /*used if no specAlgoID*/ u16 regAlgoID; GF_IPMPX_ByteArray *specAlgoID; GF_IPMPX_ByteArray *OpaqueData;} GF_IPMPX_AUTH_AlgorithmDescriptor;/*IPMP data messages*/enum { GF_IPMPX_OPAQUE_DATA_TAG = 0x01, GF_IPMPX_AUDIO_WM_INIT_TAG = 0x02, GF_IPMPX_VIDEO_WM_INIT_TAG = 0x03, GF_IPMPX_SEL_DEC_INIT_TAG = 0x04, GF_IPMPX_KEY_DATA_TAG = 0x05, GF_IPMPX_AUDIO_WM_SEND_TAG = 0x06, GF_IPMPX_VIDEO_WM_SEND_TAG = 0x07, GF_IPMPX_RIGHTS_DATA_TAG = 0x08, GF_IPMPX_SECURE_CONTAINER_TAG = 0x09, GF_IPMPX_ADD_TOOL_LISTENER_TAG = 0x0A, GF_IPMPX_REMOVE_TOOL_LISTENER_TAG = 0x0B, GF_IPMPX_INIT_AUTHENTICATION_TAG = 0x0C, GF_IPMPX_MUTUAL_AUTHENTICATION_TAG = 0x0D, GF_IPMPX_USER_QUERY_TAG = 0x0E, GF_IPMPX_USER_RESPONSE_TAG = 0x0F, GF_IPMPX_PARAMETRIC_DESCRIPTION_TAG = 0x10, GF_IPMPX_PARAMETRIC_CAPS_QUERY_TAG = 0x11, GF_IPMPX_PARAMETRIC_CAPS_RESPONSE_TAG = 0x12, /*NO ASSOCIATED STRUCTURE*/ GF_IPMPX_GET_TOOLS_TAG = 0x13, GF_IPMPX_GET_TOOLS_RESPONSE_TAG = 0x14, GF_IPMPX_GET_TOOL_CONTEXT_TAG = 0x15, GF_IPMPX_GET_TOOL_CONTEXT_RESPONSE_TAG = 0x16, GF_IPMPX_CONNECT_TOOL_TAG = 0x17, GF_IPMPX_DISCONNECT_TOOL_TAG = 0x18, GF_IPMPX_NOTIFY_TOOL_EVENT_TAG = 0x19, GF_IPMPX_CAN_PROCESS_TAG = 0x1A, GF_IPMPX_TRUST_SECURITY_METADATA_TAG = 0x1B, GF_IPMPX_TOOL_API_CONFIG_TAG = 0x1C, /*ISMA*/ GF_IPMPX_ISMACRYP_TAG = 0xD0, /*intern ones for parsing (not real datas)*/ GF_IPMPX_TRUSTED_TOOL_TAG = 0xA1, GF_IPMPX_TRUST_SPECIFICATION_TAG = 0xA2, /*emulate algo descriptors as base IPMP classes for parsing...*/ GF_IPMPX_ALGORITHM_DESCRIPTOR_TAG = 0xA3, GF_IPMPX_KEY_DESCRIPTOR_TAG = 0xA4, GF_IPMPX_PARAM_DESCRIPTOR_ITEM_TAG = 0xA5, GF_IPMPX_SEL_ENC_BUFFER_TAG = 0xA6, GF_IPMPX_SEL_ENC_FIELD_TAG = 0xA7,};typedef char GF_IPMPX_Date[5];#define GF_IPMPX_DATA_BASE \ u8 tag; \ u8 Version; \ u8 dataID; \typedef struct{ GF_IPMPX_DATA_BASE} GF_IPMPX_Data;typedef struct{ GF_IPMPX_DATA_BASE u32 Context; u8 AuthType;} GF_IPMPX_InitAuthentication;/*NOT a real DATA, only used as data for parsing*/typedef struct{ GF_IPMPX_DATA_BASE GF_IPMPX_Date startDate; u8 attackerProfile; u32 trustedDuration; GF_IPMPX_ByteArray *CCTrustMetadata;} GF_IPMPX_TrustSpecification;/*NOT a real DATA, only used as data for parsing*/typedef struct{ GF_IPMPX_DATA_BASE bin128 toolID; GF_IPMPX_Date AuditDate; GF_List *trustSpecifications;} GF_IPMPX_TrustedTool;typedef struct _ipmpx_TrustSecurityMetadata{ GF_IPMPX_DATA_BASE GF_List *TrustedTools;} GF_IPMPX_TrustSecurityMetadata;typedef struct{ GF_IPMPX_DATA_BASE Bool failedNegotiation; GF_List *candidateAlgorithms; GF_List *agreedAlgorithms; GF_IPMPX_ByteArray *AuthenticationData; /*inclAuthCodes will be set if any of the members is set (cf spec...)*/ u32 certType; /*GF_IPMPX_ByteArray list*/ GF_List *certificates; GF_IPMPX_AUTH_KeyDescriptor *publicKey; GF_IPMPX_ByteArray *opaque; GF_IPMPX_TrustSecurityMetadata *trustData; GF_IPMPX_ByteArray *authCodes;} GF_IPMPX_MutualAuthentication;typedef struct{ GF_IPMPX_DATA_BASE /*if set MAC is part of the encrypted data*/ Bool isMACEncrypted; GF_IPMPX_ByteArray *encryptedData; GF_IPMPX_Data *protectedMsg; GF_IPMPX_ByteArray *MAC;} GF_IPMPX_SecureContainer;typedef struct{ GF_List *ipmp_tools;} GF_IPMPX_GetToolsResponse;typedef struct{ GF_IPMPX_DATA_BASE GF_IPMPX_ByteArray *main_class; GF_IPMPX_ByteArray *subClass; GF_IPMPX_ByteArray *typeData; GF_IPMPX_ByteArray *type; GF_IPMPX_ByteArray *addedData;} GF_IPMPX_ParametricDescriptionItem;typedef struct _tagIPMPXParamDesc{ GF_IPMPX_DATA_BASE GF_IPMPX_ByteArray *descriptionComment; u8 majorVersion; u8 minorVersion; /*list of GF_IPMPX_ParametricDescriptionItem*/ GF_List *descriptions;} GF_IPMPX_ParametricDescription;typedef struct{ GF_IPMPX_DATA_BASE GF_IPMPX_ParametricDescription *description;} GF_IPMPX_ToolParamCapabilitiesQuery;typedef struct{ GF_IPMPX_DATA_BASE Bool capabilitiesSupported;} GF_IPMPX_ToolParamCapabilitiesResponse;typedef struct{ GF_IPMPX_DATA_BASE GF_IPMP_Descriptor *toolDescriptor;} GF_IPMPX_ConnectTool;typedef struct{ GF_IPMPX_DATA_BASE u32 IPMP_ToolContextID;} GF_IPMPX_DisconnectTool;typedef struct{ GF_IPMPX_DATA_BASE u8 scope; u16 IPMP_DescriptorIDEx;} GF_IPMPX_GetToolContext;typedef struct{ GF_IPMPX_DATA_BASE u16 OD_ID; u16 ESD_ID; u32 IPMP_ToolContextID;} GF_IPMPX_GetToolContextResponse;/*GF_IPMPX_LISTEN_Types*/enum{ GF_IPMPX_LISTEN_CONNECTED = 0x00, GF_IPMPX_LISTEN_CONNECTIONFAILED = 0x01, GF_IPMPX_LISTEN_DISCONNECTED = 0x02, GF_IPMPX_LISTEN_DISCONNECTIONFAILED = 0x03, GF_IPMPX_LISTEN_WATERMARKDETECTED = 0x04,};typedef struct{ GF_IPMPX_DATA_BASE u8 scope; /*events to listen to*/ u8 eventTypeCount; u8 eventType[10];} GF_IPMPX_AddToolNotificationListener;typedef struct{ GF_IPMPX_DATA_BASE u8 eventTypeCount; u8 eventType[10];} GF_IPMPX_RemoveToolNotificationListener;typedef struct{ GF_IPMPX_DATA_BASE u16 OD_ID; u16 ESD_ID; u8 eventType; u32 IPMP_ToolContextID;} GF_IPMPX_NotifyToolEvent;typedef struct{ GF_IPMPX_DATA_BASE Bool canProcess;} GF_IPMPX_CanProcess;typedef struct{ GF_IPMPX_DATA_BASE GF_IPMPX_ByteArray *opaqueData;} GF_IPMPX_OpaqueData;typedef struct{ GF_IPMPX_DATA_BASE GF_IPMPX_ByteArray *keyBody; /*flags meaning hasStartDTS = 1; hasStartPacketID = 1<<1; hasExpireDTS = 1<<2; hasExpirePacketID = 1<<3 */ u32 flags; u64 startDTS; u32 startPacketID; u64 expireDTS; u32 expirePacketID; GF_IPMPX_ByteArray *OpaqueData;} GF_IPMPX_KeyData;typedef struct{ GF_IPMPX_DATA_BASE GF_IPMPX_ByteArray *rightsInfo; } GF_IPMPX_RightsData;/*not a real GF_IPMPX_Data in spec, but emulated as if for parsing*/typedef struct{ GF_IPMPX_DATA_BASE bin128 cipher_Id; u8 syncBoundary; /*block mode if stream cypher info is NULL*/ u8 mode; u16 blockSize; u16 keySize; GF_IPMPX_ByteArray *Stream_Cipher_Specific_Init_Info; } GF_IPMPX_SelEncBuffer;/*not a real GF_IPMPX_Data in spec, but emulated as if for parsing*/typedef struct{ GF_IPMPX_DATA_BASE u8 field_Id; u8 field_Scope; u8 buf; u16 mappingTableSize; u16 *mappingTable; GF_IPMPX_ByteArray *shuffleSpecificInfo;} GF_IPMPX_SelEncField;/*mediaTypeExtension*/enum{ GF_IPMPX_SE_MT_ISO_IEC = 0x00, GF_IPMPX_SE_MT_ITU = 0x01 /*the rest is reserved or forbidden*/};/*compliance*/enum{ GF_IPMPX_SE_COMP_FULLY = 0x00, GF_IPMPX_SE_COMP_VIDEO_PACKETS = 0x01, GF_IPMPX_SE_COMP_VIDEO_VOP = 0x02, GF_IPMPX_SE_COMP_VIDEO_NONE = 0x03, GF_IPMPX_SE_COMP_VIDEO_GOB = 0x04, /*0x05-2F ISO Reserved for video*/ GF_IPMPX_SE_COMP_AAC_DF = 0x30, GF_IPMPX_SE_COMP_AAC_NONE = 0x31, /* 0x32 - 0x5F ISO Reserved for audio 0x60 - 0xCF ISO Reserved 0xD0 - 0xFE User Defined 0xFF Forbidden */};/*syncBoundary*/enum{ GF_IPMPX_SE_SYNC_VID7EO_PACKETS = 0x00, GF_IPMPX_SE_SYNC_VIDEO_VOP = 0x01, GF_IPMPX_SE_SYNC_VIDEO_GOV = 0x02, /*0x03-2F ISO Reserved for video,*/ GF_IPMPX_SE_SYNC_AAC_DF = 0x30, /*0x31 - 0x5F ISO Reserved for audio 0x60 - 0xCF ISO Reserved 0xD0 - 0xFE User Defined 0xFF Forbidden */};/*field_Id*/enum{ GF_IPMPX_SE_FID_VIDEO_MV = 0x00, GF_IPMPX_SE_FID_VIDEO_DC = 0x01, GF_IPMPX_SE_FID_VIDEO_DCT_SIGN = 0x02, GF_IPMPX_SE_FID_VIDEO_DQUANT = 0x03, GF_IPMPX_SE_FID_VIDEO_DCT_COEF = 0x04, GF_IPMPX_SE_FID_VIDEO_ALL = 0x05, /*0x06-2F ISO Reserved for video*/ GF_IPMPX_SE_FID_AAC_SIGN = 0x30, GF_IPMPX_SE_FID_AAC_CODEWORDS = 0x31, GF_IPMPX_SE_FID_AAC_SCALE = 0x32, /*0x32 - 0x5F ISO Reserved for audio 0x60 - 0xCF ISO Reserved 0xD0 - 0xFE User Defined 0xFF Forbidden*/};typedef struct{ GF_IPMPX_DATA_BASE u8 mediaTypeExtension; u8 mediaTypeIndication; u8 profileLevelIndication; u8 compliance; GF_List *SelEncBuffer; GF_List *SelEncFields; u16 RLE_DataLength; u16 *RLE_Data;} GF_IPMPX_SelectiveDecryptionInit;/*watermark init ops*/enum{ GF_IPMPX_WM_INSERT = 0, GF_IPMPX_WM_EXTRACT = 1, GF_IPMPX_WM_REMARK = 2, GF_IPMPX_WM_DETECT_COMPRESSION = 3,};/*used for both audio and video WM init*/typedef struct{ GF_IPMPX_DATA_BASE /* for audio: PCM defined (0x01) and all audio objectTypeIndications for video: YUV defined (0x01) and all visual objectTypeIndications */ u8 inputFormat; u8 requiredOp; /*valid for audio WM, inputFormat=0x01*/ u8 nChannels; u8 bitPerSample; u32 frequency; /*valid for video WM, inputFormat=0x01*/ u16 frame_horizontal_size; u16 frame_vertical_size; u8 chroma_format; u32 wmPayloadLen; char *wmPayload; u16 wmRecipientId; u32 opaqueDataSize; char *opaqueData;} GF_IPMPX_WatermarkingInit;/*WM status*/enum{ GF_IPMPX_WM_PAYLOAD = 0, GF_IPMPX_WM_NOPAYLOAD = 1, GF_IPMPX_WM_NONE = 2, GF_IPMPX_WM_UNKNOWN = 3};/*compression status*/enum{ GF_IPMPX_WM_COMPRESSION = 0, GF_IPMPX_WM_NO_COMPRESSION = 1, GF_IPMPX_WM_COMPRESSION_UNKNOWN = 2,};typedef struct{ GF_IPMPX_DATA_BASE u8 wm_status; u8 compression_status; /*if payload is set, status is FORCED to AUDIO_GF_IPMPX_WM_PAYLOAD*/ GF_IPMPX_ByteArray *payload; GF_IPMPX_ByteArray *opaqueData;} GF_IPMPX_SendWatermark;typedef struct{ GF_IPMPX_DATA_BASE /*GPAC only supports non-0 IDs*/ u32 Instantiation_API_ID; u32 Messaging_API_ID; GF_IPMPX_ByteArray *opaqueData;} GF_IPMPX_ToolAPI_Config;typedef struct{ GF_IPMPX_DATA_BASE u8 cryptoSuite; u8 IV_length; Bool use_selective_encryption; u8 key_indicator_length;} GF_IPMPX_ISMACryp;/*constructor/destructor*/GF_IPMPX_Data *gf_ipmpx_data_new(u8 tag);void gf_ipmpx_data_del(GF_IPMPX_Data *p);/*parse from bitstream*/GF_Err gf_ipmpx_data_parse(GF_BitStream *bs, GF_IPMPX_Data **out_data);/*get IPMP_Data contained size (eg without tag & sizeofinstance)*/u32 gf_ipmpx_data_size(GF_IPMPX_Data *p);/*get fulml IPMP_Data encoded size (eg with tag & sizeofinstance)*/u32 gf_ipmpx_data_full_size(GF_IPMPX_Data *p);/*writes IPMP_Data to buffer*/GF_Err gf_ipmpx_data_write(GF_BitStream *bs, GF_IPMPX_Data *_p);/*returns GF_IPMPX_Tag based on name*/u8 gf_ipmpx_get_tag(char *dataName);/*return values: cf above */u32 gf_ipmpx_get_field_type(GF_IPMPX_Data *p, char *fieldName);GF_Err gf_ipmpx_set_field(GF_IPMPX_Data *desc, char *fieldName, char *val);/*assign subdata*/GF_Err gf_ipmpx_set_sub_data(GF_IPMPX_Data *desc, char *fieldName, GF_IPMPX_Data *subdesc);/*assign bytearray*/GF_Err gf_ipmpx_set_byte_array(GF_IPMPX_Data *p, char *field, char *str);/*ipmpx dumper*/GF_Err gf_ipmpx_dump_data(GF_IPMPX_Data *_p, FILE *trace, u32 indent, Bool XMTDump);#ifdef __cplusplus}#endif#endif /*_GF_MPEG4_ODF_H_*/
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -