1 /* GStreamer 2 * Copyright (C) <1999> Erik Walthinsen <omega@cse.ogi.edu> 3 * 4 * This library is free software; you can redistribute it and/or 5 * modify it under the terms of the GNU Library General Public 6 * License as published by the Free Software Foundation; either 7 * version 2 of the License, or (at your option) any later version. 8 * 9 * This library is distributed in the hope that it will be useful, 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 * Library General Public License for more details. 13 * 14 * You should have received a copy of the GNU Library General Public 15 * License along with this library; if not, write to the 16 * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, 17 * Boston, MA 02110-1301, USA. 18 */ 19 20 #ifndef __ASFHEADERS_H__ 21 #define __ASFHEADERS_H__ 22 23 G_BEGIN_DECLS 24 25 typedef struct { 26 guint32 v1; 27 guint32 v2; 28 guint32 v3; 29 guint32 v4; 30 } ASFGuid; 31 32 33 34 typedef struct { 35 guint8 obj_id; 36 const gchar *obj_id_str; 37 ASFGuid guid; 38 } ASFGuidHash; 39 40 typedef enum { 41 ASF_OBJ_UNDEFINED = 0, 42 ASF_OBJ_STREAM, 43 ASF_OBJ_DATA, 44 ASF_OBJ_FILE, 45 ASF_OBJ_HEADER, 46 ASF_OBJ_CONCEAL_NONE, 47 ASF_OBJ_COMMENT, 48 ASF_OBJ_CODEC_COMMENT, 49 ASF_OBJ_CODEC_COMMENT1, 50 ASF_OBJ_SIMPLE_INDEX, 51 ASF_OBJ_INDEX, 52 ASF_OBJ_HEAD1, 53 ASF_OBJ_HEAD2, 54 ASF_OBJ_PADDING, 55 ASF_OBJ_BITRATE_PROPS, 56 ASF_OBJ_EXT_CONTENT_DESC, 57 ASF_OBJ_BITRATE_MUTEX, 58 ASF_OBJ_LANGUAGE_LIST, 59 ASF_OBJ_METADATA_OBJECT, 60 ASF_OBJ_EXTENDED_STREAM_PROPS, 61 ASF_OBJ_COMPATIBILITY, 62 ASF_OBJ_INDEX_PLACEHOLDER, 63 ASF_OBJ_INDEX_PARAMETERS, 64 ASF_OBJ_ADVANCED_MUTUAL_EXCLUSION, 65 ASF_OBJ_STREAM_PRIORITIZATION, 66 ASF_OBJ_CONTENT_ENCRYPTION, 67 ASF_OBJ_EXT_CONTENT_ENCRYPTION, 68 ASF_OBJ_DIGITAL_SIGNATURE_OBJECT, 69 ASF_OBJ_SCRIPT_COMMAND, 70 ASF_OBJ_MARKER, 71 ASF_OBJ_UNKNOWN_ENCRYPTION_OBJECT, 72 ASF_OBJ_METADATA_LIBRARY_OBJECT, 73 } AsfObjectID; 74 75 typedef enum { 76 ASF_STREAM_UNDEFINED = 0, 77 ASF_STREAM_VIDEO, 78 ASF_STREAM_AUDIO, 79 ASF_STREAM_EXT_EMBED_HEADER 80 } AsfStreamType; 81 82 typedef enum { 83 ASF_EXT_STREAM_UNDEFINED = 0, 84 ASF_EXT_STREAM_AUDIO 85 } AsfExtStreamType; 86 87 typedef enum { 88 ASF_CORRECTION_UNDEFINED = 0, 89 ASF_CORRECTION_ON, 90 ASF_CORRECTION_OFF 91 } AsfCorrectionType; 92 93 typedef enum { 94 ASF_PAYLOAD_EXTENSION_UNDEFINED = 0, 95 ASF_PAYLOAD_EXTENSION_DURATION, 96 ASF_PAYLOAD_EXTENSION_SYSTEM_CONTENT, 97 ASF_PAYLOAD_EXTENSION_SYSTEM_PIXEL_ASPECT_RATIO, 98 ASF_PAYLOAD_EXTENSION_TIMING 99 } AsfPayloadExtensionID; 100 101 extern const ASFGuidHash asf_payload_ext_guids[]; 102 103 extern const ASFGuidHash asf_correction_guids[]; 104 105 extern const ASFGuidHash asf_stream_guids[]; 106 107 extern const ASFGuidHash asf_ext_stream_guids[]; 108 109 extern const ASFGuidHash asf_object_guids[]; 110 111 /* GUID utilities */ 112 guint32 gst_asf_identify_guid (const ASFGuidHash * guids, 113 ASFGuid * guid); 114 115 const gchar *gst_asf_get_guid_nick (const ASFGuidHash * guids, 116 guint32 obj_id); 117 118 struct _asf_stream_audio { 119 guint16 codec_tag; 120 guint16 channels; 121 guint32 sample_rate; 122 guint32 byte_rate; 123 guint16 block_align; 124 guint16 word_size; 125 guint16 size; 126 }; 127 128 typedef struct _asf_stream_audio asf_stream_audio; 129 130 struct _asf_stream_video { 131 guint32 width; 132 guint32 height; 133 guint8 unknown; 134 guint16 size; 135 }; 136 137 typedef struct _asf_stream_video asf_stream_video; 138 139 struct _asf_stream_video_format { 140 guint32 size; 141 guint32 width; 142 guint32 height; 143 guint16 planes; 144 guint16 depth; 145 guint32 tag; 146 guint32 image_size; 147 guint32 xpels_meter; 148 guint32 ypels_meter; 149 guint32 num_colors; 150 guint32 imp_colors; 151 }; 152 153 typedef struct _asf_stream_video_format asf_stream_video_format; 154 155 struct _asf_obj_data_correction { 156 guint8 type; 157 guint8 cycle; 158 }; 159 160 typedef struct _asf_obj_data_correction asf_obj_data_correction; 161 162 struct _asf_packet_info { 163 guint32 padsize; 164 guint8 replicsizetype; 165 guint8 fragoffsettype; 166 guint8 seqtype; 167 guint8 segsizetype; 168 gboolean multiple; 169 guint32 size_left; 170 }; 171 172 typedef struct _asf_packet_info asf_packet_info; 173 174 struct _asf_segment_info { 175 guint8 stream_number; 176 guint32 chunk_size; 177 guint32 frag_offset; 178 guint32 segment_size; 179 guint32 sequence; 180 guint32 frag_timestamp; 181 gboolean compressed; 182 }; 183 184 typedef struct _asf_segment_info asf_segment_info; 185 186 G_END_DECLS 187 188 #endif /* __ASFHEADERS_H__ */ 189