xine-lib 1.2.11
asfheader.h
Go to the documentation of this file.
1/*
2 * Copyright (C) 2000-2018 the xine project
3 *
4 * This file is part of xine, a free video player.
5 *
6 * xine is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
10 *
11 * xine is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA
19 *
20 * demultiplexer for asf streams
21 *
22 * based on ffmpeg's
23 * ASF compatible encoder and decoder.
24 * Copyright (c) 2000, 2001 Gerard Lantau.
25 *
26 * GUID list from avifile
27 * some other ideas from MPlayer
28 */
29
30#ifndef ASFHEADER_H
31#define ASFHEADER_H
32
33#include <inttypes.h>
34
35/*
36 * define asf GUIDs (list from avifile)
37 */
38typedef enum {
40 /* base ASF objects */
47 /* header ASF objects */
61 /* stream properties object stream type */
69 /* stream properties object error correction type */
72 /* mutual exclusion object exlusion type */
75 /* header extension */
77 /* script command */
79 /* marker object */
81 /* various */
85
101
102#if 0
103/* asf stream types. currently using asf_guid_t instead. */
104typedef enum {
105 ASF_STREAM_TYPE_UNKNOWN = 0,
106 ASF_STREAM_TYPE_AUDIO,
107 ASF_STREAM_TYPE_VIDEO,
108 ASF_STREAM_TYPE_CONTROL,
109 ASF_STREAM_TYPE_JFIF,
110 ASF_STREAM_TYPE_DEGRADABLE_JPEG,
111 ASF_STREAM_TYPE_FILE_TRANSFER,
112 ASF_STREAM_TYPE_BINARY
113} asf_stream_type_t;
114#endif
115
116#define ASF_MAX_NUM_STREAMS 23
117
118/* TJ. Globally Unique IDentifiction (GUID) is originally defined as
119 * uint32_t Data1; uint16_t Data2; uint16_t Data3; uint8_t Data4[8];
120 * stored in little endian byte order.
121 * This is fine with x86 but inefficient at big endian machines.
122 * We only compare GUIDs against hard-coded constants here,
123 * so lets use plain uint8_t[16] instead.
124 */
125
127typedef struct asf_file_s asf_file_t;
131
136
140 struct { uint32_t x, y; } aspect_ratios[ASF_MAX_NUM_STREAMS];
141};
142
144 uint8_t file_id[16];
145 uint64_t file_size; /* in bytes */
147 uint64_t play_duration; /* in 100 nanoseconds unit */
148 uint64_t send_duration; /* in 100 nanoseconds unit */
149 uint64_t preroll; /* in 100 nanoseconds unit */
150
151 uint32_t packet_size;
152 uint32_t max_bitrate;
153
156};
157
158/* ms unicode strings */
160 char *title;
161 char *author;
164 char *rating;
165};
166
171 uint64_t time_offset;
172
174 uint8_t *private_data;
175
178
180};
181
183 uint64_t start_time;
184 uint64_t end_time;
185 uint32_t data_bitrate;
186 uint32_t buffer_size;
192
197
198 uint16_t language_id;
200
203
205};
206
207asf_guid_t asf_guid_2_num (const uint8_t *guid);
208void asf_guid_2_str (uint8_t *str, const uint8_t *guid);
209const char *asf_guid_name (asf_guid_t num);
210
211asf_header_t *asf_header_new (uint8_t *buffer, int buffer_len) XINE_MALLOC;
212void asf_header_choose_streams (asf_header_t *header, uint32_t bandwidth,
213 int *video_id, int *audio_id);
215 int video_id, int audio_id);
216void asf_header_delete (asf_header_t *header);
217
218
219#endif
asf_guid_t
Definition: asfheader.h:38
@ GUID_INDEX
Definition: asfheader.h:44
@ GUID_GROUP_MUTUAL_EXCLUSION
Definition: asfheader.h:88
@ GUID_ASF_EXTENDED_CONTENT_DESCRIPTION
Definition: asfheader.h:57
@ GUID_COMPATIBILITY
Definition: asfheader.h:98
@ GUID_ASF_VIDEO_MEDIA
Definition: asfheader.h:63
@ GUID_ADVANCED_MUTUAL_EXCLUSION
Definition: asfheader.h:87
@ GUID_ASF_AUDIO_CONCEAL_NONE
Definition: asfheader.h:82
@ GUID_ASF_MUTEX_UKNOWN
Definition: asfheader.h:74
@ GUID_ASF_PADDING
Definition: asfheader.h:60
@ GUID_ASF_CODEC_LIST
Definition: asfheader.h:51
@ GUID_ASF_MARKER
Definition: asfheader.h:53
@ GUID_MEDIA_OBJECT_INDEX_PARAMETERS
Definition: asfheader.h:95
@ GUID_ASF_DATA
Definition: asfheader.h:42
@ GUID_ASF_FILE_PROPERTIES
Definition: asfheader.h:48
@ GUID_ASF_EXTENDED_CONTENT_ENCRYPTION
Definition: asfheader.h:59
@ GUID_MEDIA_OBJECT_INDEX
Definition: asfheader.h:45
@ GUID_ASF_BINARY_MEDIA
Definition: asfheader.h:68
@ GUID_ASF_MUTEX_BITRATE
Definition: asfheader.h:73
@ GUID_ASF_BITRATE_MUTUAL_EXCLUSION
Definition: asfheader.h:54
@ GUID_EXTENDED_STREAM_PROPERTIES
Definition: asfheader.h:86
@ GUID_ASF_RESERVED_SCRIPT_COMMNAND
Definition: asfheader.h:78
@ GUID_ASF_AUDIO_MEDIA
Definition: asfheader.h:62
@ GUID_TIMECODE_INDEX
Definition: asfheader.h:46
@ GUID_ASF_JFIF_MEDIA
Definition: asfheader.h:65
@ GUID_ASF_STREAM_BITRATE_PROPERTIES
Definition: asfheader.h:58
@ GUID_ASF_CONTENT_DESCRIPTION
Definition: asfheader.h:56
@ GUID_ASF_2_0_HEADER
Definition: asfheader.h:84
@ GUID_ASF_SCRIPT_COMMAND
Definition: asfheader.h:52
@ GUID_LANGUAGE_LIST
Definition: asfheader.h:91
@ GUID_STREAM_PRIORITIZATION
Definition: asfheader.h:89
@ GUID_ADVANCED_CONTENT_ENCRYPTION
Definition: asfheader.h:97
@ GUID_ASF_ERROR_CORRECTION
Definition: asfheader.h:55
@ GUID_ASF_CODEC_COMMENT1_HEADER
Definition: asfheader.h:83
@ GUID_ASF_HEADER_EXTENSION
Definition: asfheader.h:50
@ GUID_TIMECODE_INDEX_PARAMETERS
Definition: asfheader.h:96
@ GUID_ASF_RESERVED_MARKER
Definition: asfheader.h:80
@ GUID_ASF_STREAM_PROPERTIES
Definition: asfheader.h:49
@ GUID_ASF_NO_ERROR_CORRECTION
Definition: asfheader.h:70
@ GUID_METADATA
Definition: asfheader.h:92
@ GUID_END
Definition: asfheader.h:99
@ GUID_ASF_FILE_TRANSFER_MEDIA
Definition: asfheader.h:67
@ GUID_ASF_DEGRADABLE_JPEG_MEDIA
Definition: asfheader.h:66
@ GUID_INDEX_PARAMETERS
Definition: asfheader.h:94
@ GUID_ASF_HEADER
Definition: asfheader.h:41
@ GUID_ASF_COMMAND_MEDIA
Definition: asfheader.h:64
@ GUID_ASF_SIMPLE_INDEX
Definition: asfheader.h:43
@ GUID_ASF_RESERVED_1
Definition: asfheader.h:76
@ GUID_METADATA_LIBRARY
Definition: asfheader.h:93
@ GUID_BANDWIDTH_SHARING
Definition: asfheader.h:90
@ GUID_ASF_AUDIO_SPREAD
Definition: asfheader.h:71
@ GUID_ERROR
Definition: asfheader.h:39
void asf_header_disable_streams(asf_header_t *header, int video_id, int audio_id)
Definition: asfheader.c:933
void asf_header_delete(asf_header_t *header)
Definition: asfheader.c:858
#define ASF_MAX_NUM_STREAMS
Definition: asfheader.h:116
asf_header_t * asf_header_new(uint8_t *buffer, int buffer_len)
Definition: asfheader.c:720
const char * asf_guid_name(asf_guid_t num)
Definition: asfheader.c:1188
void asf_header_choose_streams(asf_header_t *header, uint32_t bandwidth, int *video_id, int *audio_id)
Definition: asfheader.c:894
void asf_guid_2_str(uint8_t *str, const uint8_t *guid)
Definition: asfheader.c:1092
asf_guid_t asf_guid_2_num(const uint8_t *guid)
Definition: asfheader.c:1063
#define XINE_MALLOC
Definition: attributes.h:141
Definition: asfheader.h:159
char * copyright
Definition: asfheader.h:162
char * author
Definition: asfheader.h:161
char * rating
Definition: asfheader.h:164
char * description
Definition: asfheader.h:163
char * title
Definition: asfheader.h:160
Definition: asfheader.h:143
uint32_t max_bitrate
Definition: asfheader.h:152
uint64_t send_duration
Definition: asfheader.h:148
uint64_t file_size
Definition: asfheader.h:145
uint8_t seekable_flag
Definition: asfheader.h:155
uint8_t broadcast_flag
Definition: asfheader.h:154
uint64_t play_duration
Definition: asfheader.h:147
uint64_t preroll
Definition: asfheader.h:149
uint8_t file_id[16]
Definition: asfheader.h:144
uint64_t data_packet_count
Definition: asfheader.h:146
uint32_t packet_size
Definition: asfheader.h:151
Definition: asfheader.h:132
asf_stream_extension_t * stream_extensions[23]
Definition: asfheader.h:138
struct asf_header_s::@11 aspect_ratios[23]
uint32_t bitrates[23]
Definition: asfheader.h:139
uint32_t y
Definition: asfheader.h:140
int stream_count
Definition: asfheader.h:135
asf_file_t * file
Definition: asfheader.h:133
uint32_t x
Definition: asfheader.h:140
asf_content_t * content
Definition: asfheader.h:134
asf_stream_t * streams[23]
Definition: asfheader.h:137
Definition: asfheader.h:182
uint32_t initial_buffer_fullness
Definition: asfheader.h:187
uint32_t alternate_buffer_size
Definition: asfheader.h:189
uint16_t payload_extension_system_count
Definition: asfheader.h:202
uint32_t alternate_initial_buffer_fullness
Definition: asfheader.h:190
uint8_t seekable_flag
Definition: asfheader.h:194
uint32_t alternate_data_bitrate
Definition: asfheader.h:188
uint8_t reliable_flag
Definition: asfheader.h:193
uint16_t stream_name_count
Definition: asfheader.h:201
uint32_t max_object_size
Definition: asfheader.h:191
uint64_t average_time_per_frame
Definition: asfheader.h:199
uint8_t no_cleanpoints_flag
Definition: asfheader.h:195
uint8_t resend_live_cleanpoints_flag
Definition: asfheader.h:196
uint32_t data_bitrate
Definition: asfheader.h:185
uint16_t language_id
Definition: asfheader.h:198
uint64_t end_time
Definition: asfheader.h:184
char ** stream_names
Definition: asfheader.h:204
uint32_t buffer_size
Definition: asfheader.h:186
uint64_t start_time
Definition: asfheader.h:183
Definition: asfheader.h:167
asf_guid_t error_correction_type
Definition: asfheader.h:170
uint64_t time_offset
Definition: asfheader.h:171
asf_guid_t stream_type
Definition: asfheader.h:169
uint8_t * private_data
Definition: asfheader.h:174
uint32_t private_data_length
Definition: asfheader.h:173
uint8_t * error_correction_data
Definition: asfheader.h:177
uint8_t encrypted_flag
Definition: asfheader.h:179
uint32_t error_correction_data_length
Definition: asfheader.h:176
uint16_t stream_number
Definition: asfheader.h:168