#ifndef _GF_MPEG4_ODF_H_
#define _GF_MPEG4_ODF_H_
#ifdef __cplusplus
extern "C" {
#endif
#include <gpac/list.h>
#include <gpac/bitstream.h>
#include <gpac/sync_layer.h>
enum
{
GF_ODF_OD_TAG = 0x01,
GF_ODF_IOD_TAG = 0x02,
GF_ODF_ESD_TAG = 0x03,
GF_ODF_DCD_TAG = 0x04,
GF_ODF_DSI_TAG = 0x05,
GF_ODF_SLC_TAG = 0x06,
GF_ODF_CI_TAG = 0x07,
GF_ODF_SCI_TAG = 0x08,
GF_ODF_IPI_PTR_TAG = 0x09,
GF_ODF_IPMP_PTR_TAG = 0x0A,
GF_ODF_IPMP_TAG = 0x0B,
GF_ODF_QOS_TAG = 0x0C,
GF_ODF_REG_TAG = 0x0D,
GF_ODF_ESD_INC_TAG = 0x0E,
GF_ODF_ESD_REF_TAG = 0x0F,
GF_ODF_ISOM_IOD_TAG = 0x10,
GF_ODF_ISOM_OD_TAG = 0x11,
GF_ODF_ISOM_IPI_PTR_TAG = 0x12,
GF_ODF_EXT_PL_TAG = 0x13,
GF_ODF_PL_IDX_TAG = 0x14,
GF_ODF_ISO_BEGIN_TAG = 0x15,
GF_ODF_ISO_END_TAG = 0x3F,
GF_ODF_CC_TAG = 0x40,
GF_ODF_KW_TAG = 0x41,
GF_ODF_RATING_TAG = 0x42,
GF_ODF_LANG_TAG = 0x43,
GF_ODF_SHORT_TEXT_TAG = 0x44,
GF_ODF_TEXT_TAG = 0x45,
GF_ODF_CC_NAME_TAG = 0x46,
GF_ODF_CC_DATE_TAG = 0x47,
GF_ODF_OCI_NAME_TAG = 0x48,
GF_ODF_OCI_DATE_TAG = 0x49,
GF_ODF_SMPTE_TAG = 0x4A,
GF_ODF_SEGMENT_TAG = 0x4B,
GF_ODF_MEDIATIME_TAG = 0x4C,
GF_ODF_IPMP_TL_TAG = 0x60,
GF_ODF_IPMP_TOOL_TAG = 0x61,
GF_ODF_ISO_RES_BEGIN_TAG = 0x62,
GF_ODF_ISO_RES_END_TAG = 0xBF,
GF_ODF_USER_BEGIN_TAG = 0xC0,
GF_ODF_MUXINFO_TAG = GF_ODF_USER_BEGIN_TAG,
GF_ODF_BIFS_CFG_TAG = GF_ODF_USER_BEGIN_TAG + 1,
GF_ODF_UI_CFG_TAG = GF_ODF_USER_BEGIN_TAG + 2,
GF_ODF_TEXT_CFG_TAG = GF_ODF_USER_BEGIN_TAG + 3,
GF_ODF_TX3G_TAG = GF_ODF_USER_BEGIN_TAG + 4,
GF_ODF_ELEM_MASK_TAG = GF_ODF_USER_BEGIN_TAG + 5,
GF_ODF_LASER_CFG_TAG = GF_ODF_USER_BEGIN_TAG + 6,
GF_ODF_GEN_SUB_CFG_TAG = GF_ODF_USER_BEGIN_TAG + 7,
GF_ODF_USER_END_TAG = 0xFE,
GF_ODF_OCI_BEGIN_TAG = 0x40,
GF_ODF_OCI_END_TAG = (GF_ODF_ISO_RES_BEGIN_TAG - 1),
GF_ODF_EXT_BEGIN_TAG = 0x80,
GF_ODF_EXT_END_TAG = 0xFE,
GF_ODF_AUX_VIDEO_DATA = GF_ODF_EXT_BEGIN_TAG + 1
};
#define BASE_DESCRIPTOR \
u8 tag;
typedef struct
{
BASE_DESCRIPTOR
} GF_Descriptor;
typedef struct
{
BASE_DESCRIPTOR
u32 dataLength;
char *data;
} GF_DefaultDescriptor;
typedef struct
{
BASE_DESCRIPTOR
GF_List *ipmp_tools;
} GF_IPMP_ToolList;
typedef struct
{
BASE_DESCRIPTOR
u16 objectDescriptorID;
char *URLString;
GF_List *ESDescriptors;
GF_List *OCIDescriptors;
GF_List *IPMP_Descriptors;
GF_List *extensionDescriptors;
u16 ServiceID;
void *service_ifce;
} GF_ObjectDescriptor;
typedef struct
{
BASE_DESCRIPTOR
u16 objectDescriptorID;
char *URLString;
GF_List *ESDescriptors;
GF_List *OCIDescriptors;
GF_List *IPMP_Descriptors;
GF_List *extensionDescriptors;
u16 ServiceID;
void *service_ifce;
u8 inlineProfileFlag;
u8 OD_profileAndLevel;
u8 scene_profileAndLevel;
u8 audio_profileAndLevel;
u8 visual_profileAndLevel;
u8 graphics_profileAndLevel;
GF_IPMP_ToolList *IPMPToolList;
} GF_InitialObjectDescriptor;
typedef struct
{
BASE_DESCRIPTOR
u16 objectDescriptorID;
char *URLString;
GF_List *ES_ID_RefDescriptors;
GF_List *OCIDescriptors;
GF_List *IPMP_Descriptors;
GF_List *extensionDescriptors;
GF_List *ES_ID_IncDescriptors;
} GF_IsomObjectDescriptor;
typedef struct
{
BASE_DESCRIPTOR
u16 objectDescriptorID;
char *URLString;
GF_List *ES_ID_RefDescriptors;
GF_List *OCIDescriptors;
GF_List *IPMP_Descriptors;
GF_List *extensionDescriptors;
GF_List *ES_ID_IncDescriptors;
u8 inlineProfileFlag;
u8 OD_profileAndLevel;
u8 scene_profileAndLevel;
u8 audio_profileAndLevel;
u8 visual_profileAndLevel;
u8 graphics_profileAndLevel;
GF_IPMP_ToolList *IPMPToolList;
} GF_IsomInitialObjectDescriptor;
typedef struct {
BASE_DESCRIPTOR
u32 trackID;
} GF_ES_ID_Inc;
typedef struct {
BASE_DESCRIPTOR
u16 trackRef;
} GF_ES_ID_Ref;
typedef struct
{
BASE_DESCRIPTOR
u32 objectTypeIndication;
u8 streamType;
u8 upstream;
u32 bufferSizeDB;
u32 maxBitrate;
u32 avgBitrate;
GF_DefaultDescriptor *decoderSpecificInfo;
u16 predefined_rvc_config;
GF_DefaultDescriptor *rvc_config;
GF_List *profileLevelIndicationIndexDescriptor;
void *udta;
} GF_DecoderConfig;
typedef struct {
BASE_DESCRIPTOR
u8 compatibility;
u8 protectedContent;
u8 contentTypeFlag;
u8 contentIdentifierFlag;
u8 contentType;
u8 contentIdentifierType;
char *contentIdentifier;
} GF_CIDesc;
typedef struct {
BASE_DESCRIPTOR
u32 languageCode;
char *supplContentIdentifierTitle;
char *supplContentIdentifierValue;
} GF_SCIDesc;
typedef struct {
BASE_DESCRIPTOR
u16 IPI_ES_Id;
} GF_IPIPtr;
typedef struct {
BASE_DESCRIPTOR
u8 IPMP_DescriptorID;
u16 IPMP_DescriptorIDEx;
u16 IPMP_ES_ID;
} GF_IPMPPtr;
enum
{
IPMP_CP_NONE = 0,
IPMP_CP_DB = 1,
IPMP_CP_CB = 2,
IPMP_CP_CM = 3,
IPMP_CP_BIFS = 4
};
#define GF_IPMPX_BASE \
u8 tag; \
u8 version; \
u32 dataID; \
typedef struct
{
GF_IPMPX_BASE
} GF_GF_IPMPX_Base;
typedef struct {
BASE_DESCRIPTOR
u8 IPMP_DescriptorID;
u16 IPMPS_Type;
char *opaque_data;
u32 opaque_data_size;
u16 IPMP_DescriptorIDEx;
bin128 IPMP_ToolID;
u8 control_point;
u8 cp_sequence_code;
GF_List *ipmpx_data;
} GF_IPMP_Descriptor;
#define MAX_IPMP_ALT_TOOLS 20
typedef struct
{
BASE_DESCRIPTOR
bin128 IPMP_ToolID;
u32 num_alternate;
bin128 specificToolID[MAX_IPMP_ALT_TOOLS];
struct _tagIPMPXParamDesc *toolParamDesc;
char *tool_url;
} GF_IPMP_Tool;
typedef struct {
BASE_DESCRIPTOR
u32 node_id;
char *node_name;
} GF_ElementaryMask;
typedef struct __tag_bifs_config
{
BASE_DESCRIPTOR
u32 version;
u16 nodeIDbits;
u16 routeIDbits;
u16 protoIDbits;
Bool pixelMetrics;
u16 pixelWidth, pixelHeight;
Bool randomAccess;
GF_List *elementaryMasks;
Bool useNames;
} GF_BIFSConfig;
enum
{
GF_TXT_STYLE_NORMAL = 0,
GF_TXT_STYLE_BOLD = 1,
GF_TXT_STYLE_ITALIC = 2,
GF_TXT_STYLE_UNDERLINED = 4
};
typedef struct
{
u16 startCharOffset;
u16 endCharOffset;
u16 fontID;
u8 style_flags;
u8 font_size;
u32 text_color;
} GF_StyleRecord;
typedef struct
{
u16 fontID;
char *fontName;
} GF_FontRecord;
typedef struct
{
s16 top, left, bottom, right;
} GF_BoxRecord;
enum
{
GF_TXT_SCROLL_CREDITS = 0,
GF_TXT_SCROLL_MARQUEE = 1,
GF_TXT_SCROLL_DOWN = 2,
GF_TXT_SCROLL_RIGHT = 3
};
enum
{
GF_TXT_SCROLL_IN = 0x00000020,
GF_TXT_SCROLL_OUT = 0x00000040,
GF_TXT_SCROLL_DIRECTION = 0x00000180,
GF_TXT_KARAOKE = 0x00000800,
GF_TXT_VERTICAL = 0x00020000,
GF_TXT_FILL_REGION = 0x00040000,
GF_TXT_NO_SCALE = 0x2,
GF_TXT_MOVIE_BACK_COLOR = 0x8,
GF_TXT_CONTINUOUS_SCROLL = 0x200,
GF_TXT_DROP_SHADOW = 0x1000,
GF_TXT_FILL_ANTIALIAS = 0x2000,
GF_TXT_SOME_SAMPLES_FORCED = 0x40000000,
GF_TXT_ALL_SAMPLES_FORCED = 0x80000000,
};
typedef struct
{
BASE_DESCRIPTOR
u32 displayFlags;
s8 horiz_justif, vert_justif;
u32 back_color;
GF_BoxRecord default_pos;
GF_StyleRecord default_style;
u32 font_count;
GF_FontRecord *fonts;
u8 sample_index;
} GF_TextSampleDescriptor;
typedef struct
{
BASE_DESCRIPTOR
u8 Base3GPPFormat;
u8 MPEGExtendedFormat;
u8 profileLevel;
u32 timescale;
u8 sampleDescriptionFlags;
s16 layer;
u16 text_width;
u16 text_height;
u8 nb_compatible_formats;
u8 compatible_formats[20];
GF_List *sample_descriptions;
Bool has_vid_info;
u16 video_width;
u16 video_height;
s16 horiz_offset;
s16 vert_offset;
} GF_TextConfig;
typedef struct
{
BASE_DESCRIPTOR
u8 sample_index;
} GF_GenericSubtitleSampleDescriptor;
typedef struct
{
BASE_DESCRIPTOR
u32 timescale;
s16 layer;
u16 text_width;
u16 text_height;
GF_List *sample_descriptions;
Bool has_vid_info;
u16 video_width;
u16 video_height;
s16 horiz_offset;
s16 vert_offset;
} GF_GenericSubtitleConfig;
typedef struct {
BASE_DESCRIPTOR
char *file_name;
u32 GroupID;
char *streamFormat;
s32 startTime;
u32 duration;
char *textNode;
char *fontNode;
Double frame_rate;
u32 import_flags;
Bool delete_file;
u32 carousel_period_plus_one;
u16 aggregate_on_esid;
char *src_url;
} GF_MuxInfo;
typedef struct
{
BASE_DESCRIPTOR
char *deviceName;
char termChar;
char delChar;
char *ui_data;
u32 ui_data_length;
} GF_UIConfig;
typedef struct __tag_laser_config
{
BASE_DESCRIPTOR
u8 profile;
u8 level;
u8 pointsCodec;
u8 pathComponents;
u8 fullRequestHost;
u16 time_resolution;
u8 colorComponentBits;
s8 resolution;
u8 coord_bits;
u8 scale_bits_minus_coord_bits;
u8 newSceneIndicator;
u8 extensionIDBits;
Bool force_string_ids;
} GF_LASERConfig;
enum
{
QoSMaxDelayTag = 0x01,
QoSPrefMaxDelayTag = 0x02,
QoSLossProbTag = 0x03,
QoSMaxGapLossTag = 0x04,
QoSMaxAUSizeTag = 0x41,
QoSAvgAUSizeTag = 0x42,
QoSMaxAURateTag = 0x43
};
typedef struct {
BASE_DESCRIPTOR
u8 predefined;
GF_List *QoS_Qualifiers;
} GF_QoS_Descriptor;
#define QOS_BASE_QUALIFIER \
u8 tag; \
u32 size;
typedef struct {
QOS_BASE_QUALIFIER
} GF_QoS_Default;
typedef struct {
QOS_BASE_QUALIFIER
u32 MaxDelay;
} GF_QoS_MaxDelay;
typedef struct {
QOS_BASE_QUALIFIER
u32 PrefMaxDelay;
} GF_QoS_PrefMaxDelay;
typedef struct {
QOS_BASE_QUALIFIER
Float LossProb;
} GF_QoS_LossProb;
typedef struct {
QOS_BASE_QUALIFIER
u32 MaxGapLoss;
} GF_QoS_MaxGapLoss;
typedef struct {
QOS_BASE_QUALIFIER
u32 MaxAUSize;
} GF_QoS_MaxAUSize;
typedef struct {
QOS_BASE_QUALIFIER
u32 AvgAUSize;
} GF_QoS_AvgAUSize;
typedef struct {
QOS_BASE_QUALIFIER
u32 MaxAURate;
} GF_QoS_MaxAURate;
typedef struct {
QOS_BASE_QUALIFIER
u32 DataLength;
char *Data;
} GF_QoS_Private;
typedef struct {
BASE_DESCRIPTOR
u32 formatIdentifier;
u32 dataLength;
char *additionalIdentificationInfo;
} GF_Registration;
typedef struct {
BASE_DESCRIPTOR
u32 langCode;
char *full_lang_code;
} GF_Language;
typedef struct
{
BASE_DESCRIPTOR
u16 ESID;
u16 OCRESID;
u16 dependsOnESID;
u8 streamPriority;
char *URLString;
GF_DecoderConfig *decoderConfig;
GF_SLConfig *slConfig;
GF_IPIPtr *ipiPtr;
GF_QoS_Descriptor *qos;
GF_Registration *RegDescriptor;
GF_Language *langDesc;
GF_List *IPIDataSet;
GF_List *IPMPDescriptorPointers;
GF_List *extensionDescriptors;
Bool has_scalable_layers;
const char *service_url;
} GF_ESD;
typedef struct {
BASE_DESCRIPTOR
u32 aux_video_type;
u32 position_offset_h;
u32 position_offset_v;
u32 knear;
u32 kfar;
u32 parallax_zero;
u32 parallax_scale;
u32 dref;
u32 wref;
} GF_AuxVideoDescriptor;
typedef struct {
BASE_DESCRIPTOR
u32 classificationEntity;
u16 classificationTable;
u32 dataLength;
char *contentClassificationData;
} GF_CCDescriptor;
typedef struct {
char *keyWord;
} GF_KeyWordItem;
typedef struct {
BASE_DESCRIPTOR
u32 languageCode;
u8 isUTF8;
GF_List *keyWordsList;
} GF_KeyWord;
typedef struct {
BASE_DESCRIPTOR
u32 ratingEntity;
u16 ratingCriteria;
u32 infoLength;
char *ratingInfo;
} GF_Rating;
typedef struct {
BASE_DESCRIPTOR
u32 langCode;
u8 isUTF8;
char *eventName;
char *eventText;
} GF_ShortTextual;
typedef struct {
char *text;
} GF_ETD_ItemText;
typedef struct {
BASE_DESCRIPTOR
u32 langCode;
u8 isUTF8;
GF_List *itemDescriptionList;
GF_List *itemTextList;
char *NonItemText;
} GF_ExpandedTextual;
typedef struct {
u32 langCode;
u8 isUTF8;
char *contentCreatorName;
} GF_ContentCreatorInfo;
typedef struct {
BASE_DESCRIPTOR
GF_List *ContentCreators;
} GF_CC_Name;
typedef struct {
BASE_DESCRIPTOR
char contentCreationDate[5];
} GF_CC_Date;
typedef struct {
u32 langCode;
u8 isUTF8;
char *OCICreatorName;
} GF_OCICreator_item;
typedef struct {
BASE_DESCRIPTOR
GF_List *OCICreators;
} GF_OCICreators;
typedef struct {
BASE_DESCRIPTOR
char OCICreationDate[5];
} GF_OCI_Data;
typedef struct {
u8 paramID;
u32 param;
} GF_SmpteParam;
typedef struct {
BASE_DESCRIPTOR
u8 cameraID;
GF_List *ParamList;
} GF_SMPTECamera;
typedef struct {
BASE_DESCRIPTOR
u8 profileLevelIndicationIndex;
u8 ODProfileLevelIndication;
u8 SceneProfileLevelIndication;
u8 AudioProfileLevelIndication;
u8 VisualProfileLevelIndication;
u8 GraphicsProfileLevelIndication;
u8 MPEGJProfileLevelIndication;
} GF_PLExt;
typedef struct {
BASE_DESCRIPTOR
u8 profileLevelIndicationIndex;
} GF_PL_IDX;
typedef struct
{
u16 size;
char *data;
s32 id;
} GF_AVCConfigSlot;
typedef struct
{
u8 configurationVersion;
u8 AVCProfileIndication;
u8 profile_compatibility;
u8 AVCLevelIndication;
u8 nal_unit_size;
GF_List *sequenceParameterSets;
GF_List *pictureParameterSets;
u8 complete_representation;
u8 chroma_format;
u8 luma_bit_depth;
u8 chroma_bit_depth;
GF_List *sequenceParameterSetExtensions;
} GF_AVCConfig;
typedef struct
{
u8 type;
u8 array_completeness;
GF_List *nalus;
} GF_HEVCParamArray;
typedef struct
{
u8 configurationVersion;
u8 profile_space;
u8 tier_flag;
u8 profile_idc;
u32 general_profile_compatibility_flags;
u8 progressive_source_flag;
u8 interlaced_source_flag;
u8 non_packed_constraint_flag;
u8 frame_only_constraint_flag;
u64 constraint_indicator_flags;
u8 level_idc;
u16 min_spatial_segmentation_idc;
u8 parallelismType;
u8 chromaFormat;
u8 luma_bit_depth;
u8 chroma_bit_depth;
u16 avgFrameRate;
u8 constantFrameRate;
u8 numTemporalLayers;
u8 temporalIdNested;
u8 nal_unit_size;
GF_List *param_array;
Bool complete_representation;
Bool is_lhvc;
} GF_HEVCConfig;
typedef struct
{
BASE_DESCRIPTOR
Double startTime;
Double Duration;
char *SegmentName;
} GF_Segment;
typedef struct
{
BASE_DESCRIPTOR
Double mediaTimeStamp;
} GF_MediaTime;
enum
{
GF_ODF_OD_UPDATE_TAG = 0x01,
GF_ODF_OD_REMOVE_TAG = 0x02,
GF_ODF_ESD_UPDATE_TAG = 0x03,
GF_ODF_ESD_REMOVE_TAG = 0x04,
GF_ODF_IPMP_UPDATE_TAG = 0x05,
GF_ODF_IPMP_REMOVE_TAG = 0x06,
GF_ODF_ESD_REMOVE_REF_TAG = 0x07,
GF_ODF_COM_ISO_BEGIN_TAG = 0x0D,
GF_ODF_COM_ISO_END_TAG = 0xBF,
GF_ODF_COM_USER_BEGIN_TAG = 0xC0,
GF_ODF_COM_USER_END_TAG = 0xFE
};
#define BASE_OD_COMMAND \
u8 tag;
typedef struct {
BASE_OD_COMMAND
} GF_ODCom;
typedef struct {
BASE_OD_COMMAND
u32 dataSize;
char *data;
} GF_BaseODCom;
typedef struct
{
BASE_OD_COMMAND
GF_List *objectDescriptors;
} GF_ODUpdate;
typedef struct
{
BASE_OD_COMMAND
u32 NbODs;
u16 *OD_ID;
} GF_ODRemove;
typedef struct
{
BASE_OD_COMMAND
u16 ODID;
GF_List *ESDescriptors;
} GF_ESDUpdate;
typedef struct {
BASE_OD_COMMAND
u16 ODID;
u32 NbESDs;
u16 *ES_ID;
} GF_ESDRemove;
typedef struct {
BASE_OD_COMMAND
GF_List *IPMPDescList;
} GF_IPMPUpdate;
typedef struct {
BASE_OD_COMMAND
u32 NbIPMPDs;
u8 *IPMPDescID;
} GF_IPMPRemove;
typedef struct tagODCoDec
{
GF_BitStream *bs;
GF_List *CommandList;
} GF_ODCodec;
GF_ODCodec *gf_odf_codec_new();
void gf_odf_codec_del(GF_ODCodec *codec);
GF_Err gf_odf_codec_add_com(GF_ODCodec *codec, GF_ODCom *command);
GF_Err gf_odf_codec_encode(GF_ODCodec *codec, u32 cleanup_type);
GF_Err gf_odf_codec_get_au(GF_ODCodec *codec, char **outAU, u32 *au_length);
GF_Err gf_odf_codec_set_au(GF_ODCodec *codec, const char *au, u32 au_length);
GF_Err gf_odf_codec_decode(GF_ODCodec *codec);
GF_ODCom *gf_odf_codec_get_com(GF_ODCodec *codec);
GF_Err gf_odf_codec_apply_com(GF_ODCodec *codec, GF_ODCom *command);
GF_ODCom *gf_odf_com_new(u8 tag);
GF_Err gf_odf_com_del(GF_ODCom **com);
GF_Descriptor *gf_odf_desc_new(u8 tag);
void gf_odf_desc_del(GF_Descriptor *desc);
GF_ESD *gf_odf_desc_esd_new(u32 sl_predefined);
GF_BIFSConfig *gf_odf_get_bifs_config(GF_DefaultDescriptor *dsi, u8 oti);
GF_Err gf_odf_get_laser_config(GF_DefaultDescriptor *dsi, GF_LASERConfig *cfg);
GF_Err gf_odf_get_text_config(GF_DefaultDescriptor *dsi, u8 oti, GF_TextConfig *cfg);
GF_Err gf_odf_get_ui_config(GF_DefaultDescriptor *dsi, GF_UIConfig *cfg);
GF_Err gf_odf_encode_ui_config(GF_UIConfig *cfg, GF_DefaultDescriptor **out_dsi);
GF_AVCConfig *gf_odf_avc_cfg_new();
void gf_odf_avc_cfg_del(GF_AVCConfig *cfg);
GF_AVCConfig *gf_odf_avc_cfg_read(char *dsi, u32 dsi_size);
GF_Err gf_odf_avc_cfg_write(GF_AVCConfig *cfg, char **outData, u32 *outSize);
GF_HEVCConfig *gf_odf_hevc_cfg_new();
void gf_odf_hevc_cfg_del(GF_HEVCConfig *cfg);
GF_Err gf_odf_hevc_cfg_write_bs(GF_HEVCConfig *cfg, GF_BitStream *bs);
GF_Err gf_odf_hevc_cfg_write(GF_HEVCConfig *cfg, char **outData, u32 *outSize);
GF_HEVCConfig *gf_odf_hevc_cfg_read_bs(GF_BitStream *bs, Bool is_lhvc);
GF_HEVCConfig *gf_odf_hevc_cfg_read(char *dsi, u32 dsi_size, Bool is_lhvc);
GF_Err gf_odf_desc_list_del(GF_List *descList);
GF_Err gf_odf_desc_read(char *raw_desc, u32 descSize, GF_Descriptor **outDesc);
GF_Err gf_odf_desc_write(GF_Descriptor *desc, char **outEncDesc, u32 *outSize);
GF_Err gf_odf_desc_write_bs(GF_Descriptor *desc, GF_BitStream *bs);
u32 gf_odf_desc_size(GF_Descriptor *desc);
GF_Err gf_odf_desc_copy(GF_Descriptor *inDesc, GF_Descriptor **outDesc);
GF_Err gf_odf_desc_add_desc(GF_Descriptor *parentDesc, GF_Descriptor *newDesc);
const char *gf_esd_get_textual_description(GF_ESD *esd);
const char *gf_afx_get_type_description(u8 afx_code);
const char *gf_odf_stream_type_name(u32 streamType);
u32 gf_odf_stream_type_by_name(const char *streamType);
GF_Err gf_odf_desc_list_read(char *raw_list, u32 raw_size, GF_List *descList);
GF_Err gf_odf_desc_list_write(GF_List *descList, char **outEncList, u32 *outSize);
GF_Err gf_odf_desc_list_size(GF_List *descList, u32 *outSize);
#ifndef GPAC_MINIMAL_ODF
GF_QoS_Default *gf_odf_qos_new(u8 tag);
GF_Err gf_odf_qos_del(GF_QoS_Default **qos);
GF_Err gf_odf_qos_add_qualif(GF_QoS_Descriptor *desc, GF_QoS_Default *qualif);
typedef struct __tag_oci_event OCIEvent;
OCIEvent *gf_oci_event_new(u16 EventID);
void gf_oci_event_del(OCIEvent *event);
GF_Err gf_oci_event_set_start_time(OCIEvent *event, u8 Hours, u8 Minutes, u8 Seconds, u8 HundredSeconds, u8 IsAbsoluteTime);
GF_Err gf_oci_event_set_duration(OCIEvent *event, u8 Hours, u8 Minutes, u8 Seconds, u8 HundredSeconds);
GF_Err gf_oci_event_add_desc(OCIEvent *event, GF_Descriptor *oci_desc);
GF_Err gf_oci_event_get_id(OCIEvent *event, u16 *ID);
GF_Err gf_oci_event_get_start_time(OCIEvent *event, u8 *Hours, u8 *Minutes, u8 *Seconds, u8 *HundredSeconds, u8 *IsAbsoluteTime);
GF_Err gf_oci_event_get_duration(OCIEvent *event, u8 *Hours, u8 *Minutes, u8 *Seconds, u8 *HundredSeconds);
u32 gf_oci_event_get_desc_count(OCIEvent *event);
GF_Descriptor *gf_oci_event_get_desc(OCIEvent *event, u32 DescIndex);
GF_Err gf_oci_event_rem_desc(OCIEvent *event, u32 DescIndex);
typedef struct __tag_oci_codec OCICodec;
OCICodec *gf_oci_codec_new(u8 IsEncoder, u8 Version);
void gf_oci_codec_del(OCICodec *codec);
GF_Err gf_oci_codec_add_event(OCICodec *codec, OCIEvent *event);
GF_Err gf_oci_codec_encode(OCICodec *codec, char **outAU, u32 *au_length);
GF_Err gf_oci_codec_decode(OCICodec *codec, char *au, u32 au_length);
OCIEvent *gf_oci_codec_get_event(OCICodec *codec);
#ifndef GPAC_DISABLE_OD_DUMP
GF_Err gf_odf_dump_au(char *data, u32 dataLength, FILE *trace, u32 indent, Bool XMTDump);
GF_Err gf_odf_dump_com(GF_ODCom *com, FILE *trace, u32 indent, Bool XMTDump);
GF_Err gf_odf_dump_desc(GF_Descriptor *desc, FILE *trace, u32 indent, Bool XMTDump);
GF_Err gf_odf_dump_com_list(GF_List *commandList, FILE *trace, u32 indent, Bool XMTDump);
GF_Err gf_oci_dump_event(OCIEvent *ev, FILE *trace, u32 indent, Bool XMTDump);
GF_Err gf_oci_dump_au(u8 version, char *au, u32 au_length, FILE *trace, u32 indent, Bool XMTDump);
#endif
#endif
u32 gf_odf_get_tag_by_name(char *descName);
typedef enum
{
GF_ODF_FT_DEFAULT = 0,
GF_ODF_FT_OD = 1,
GF_ODF_FT_OD_LIST = 2,
GF_ODF_FT_IPMPX = 3,
GF_ODF_FT_IPMPX_LIST = 4,
GF_ODF_FT_IPMPX_BA = 5,
GF_ODF_FT_IPMPX_BA_LIST = 6
} GF_ODF_FieldType;
GF_ODF_FieldType gf_odf_get_field_type(GF_Descriptor *desc, char *fieldName);
GF_Err gf_odf_set_field(GF_Descriptor *desc, char *fieldName, char *val);
#ifndef GPAC_MINIMAL_ODF
typedef struct
{
u32 length;
char *data;
} GF_IPMPX_ByteArray;
#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
u16 regAlgoID;
GF_IPMPX_ByteArray *specAlgoID;
GF_IPMPX_ByteArray *OpaqueData;
} GF_IPMPX_AUTH_AlgorithmDescriptor;
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,
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,
GF_IPMPX_ISMACRYP_TAG = 0xD0,
GF_IPMPX_TRUSTED_TOOL_TAG = 0xA1,
GF_IPMPX_TRUST_SPECIFICATION_TAG = 0xA2,
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;
typedef struct
{
GF_IPMPX_DATA_BASE
GF_IPMPX_Date startDate;
u8 attackerProfile;
u32 trustedDuration;
GF_IPMPX_ByteArray *CCTrustMetadata;
} GF_IPMPX_TrustSpecification;
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;
u32 certType;
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
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;
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;
typedef 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
} GF_IPMPX_ListenType;
typedef struct
{
GF_IPMPX_DATA_BASE
u8 scope;
u8 eventTypeCount;
GF_IPMPX_ListenType eventType[10];
} GF_IPMPX_AddToolNotificationListener;
typedef struct
{
GF_IPMPX_DATA_BASE
u8 eventTypeCount;
GF_IPMPX_ListenType 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;
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;
typedef struct
{
GF_IPMPX_DATA_BASE
bin128 cipher_Id;
u8 syncBoundary;
u8 mode;
u16 blockSize;
u16 keySize;
GF_IPMPX_ByteArray *Stream_Cipher_Specific_Init_Info;
} GF_IPMPX_SelEncBuffer;
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;
enum
{
GF_IPMPX_SE_MT_ISO_IEC = 0x00,
GF_IPMPX_SE_MT_ITU = 0x01
};
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,
GF_IPMPX_SE_COMP_AAC_DF = 0x30,
GF_IPMPX_SE_COMP_AAC_NONE = 0x31
};
enum
{
GF_IPMPX_SE_SYNC_VID7EO_PACKETS = 0x00,
GF_IPMPX_SE_SYNC_VIDEO_VOP = 0x01,
GF_IPMPX_SE_SYNC_VIDEO_GOV = 0x02,
GF_IPMPX_SE_SYNC_AAC_DF = 0x30
};
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,
GF_IPMPX_SE_FID_AAC_SIGN = 0x30,
GF_IPMPX_SE_FID_AAC_CODEWORDS = 0x31,
GF_IPMPX_SE_FID_AAC_SCALE = 0x32
};
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;
enum
{
GF_IPMPX_WM_INSERT = 0,
GF_IPMPX_WM_EXTRACT = 1,
GF_IPMPX_WM_REMARK = 2,
GF_IPMPX_WM_DETECT_COMPRESSION = 3
};
typedef struct
{
GF_IPMPX_DATA_BASE
u8 inputFormat;
u8 requiredOp;
u8 nChannels;
u8 bitPerSample;
u32 frequency;
u16 frame_horizontal_size;
u16 frame_vertical_size;
u8 chroma_format;
u32 wmPayloadLen;
char *wmPayload;
u16 wmRecipientId;
u32 opaqueDataSize;
char *opaqueData;
} GF_IPMPX_WatermarkingInit;
enum
{
GF_IPMPX_WM_PAYLOAD = 0,
GF_IPMPX_WM_NOPAYLOAD = 1,
GF_IPMPX_WM_NONE = 2,
GF_IPMPX_WM_UNKNOWN = 3
};
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;
GF_IPMPX_ByteArray *payload;
GF_IPMPX_ByteArray *opaqueData;
} GF_IPMPX_SendWatermark;
typedef struct
{
GF_IPMPX_DATA_BASE
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;
GF_IPMPX_Data *gf_ipmpx_data_new(u8 tag);
void gf_ipmpx_data_del(GF_IPMPX_Data *p);
GF_Err gf_ipmpx_data_parse(GF_BitStream *bs, GF_IPMPX_Data **out_data);
u32 gf_ipmpx_data_size(GF_IPMPX_Data *p);
u32 gf_ipmpx_data_full_size(GF_IPMPX_Data *p);
GF_Err gf_ipmpx_data_write(GF_BitStream *bs, GF_IPMPX_Data *_p);
u8 gf_ipmpx_get_tag(char *dataName);
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);
GF_Err gf_ipmpx_set_sub_data(GF_IPMPX_Data *desc, char *fieldName, GF_IPMPX_Data *subdesc);
GF_Err gf_ipmpx_set_byte_array(GF_IPMPX_Data *p, char *field, char *str);
GF_Err gf_ipmpx_dump_data(GF_IPMPX_Data *_p, FILE *trace, u32 indent, Bool XMTDump);
#endif
#ifdef __cplusplus
}
#endif
#endif