annotate stream/realrtsp/rmff.h @ 33578:8860c936e5ce

Add forgotten void.
author reimar
date Sun, 19 Jun 2011 16:52:51 +0000
parents 0f1b5b68af32
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
9922
6cb7a295ab0e Real rstp:// streaming support, ported from xine
rtognimp
parents:
diff changeset
1 /*
6cb7a295ab0e Real rstp:// streaming support, ported from xine
rtognimp
parents:
diff changeset
2 * This file was ported to MPlayer from xine CVS rmff.h,v 1.3 2003/02/10 22:11:10
6cb7a295ab0e Real rstp:// streaming support, ported from xine
rtognimp
parents:
diff changeset
3 */
6cb7a295ab0e Real rstp:// streaming support, ported from xine
rtognimp
parents:
diff changeset
4
6cb7a295ab0e Real rstp:// streaming support, ported from xine
rtognimp
parents:
diff changeset
5 /*
6cb7a295ab0e Real rstp:// streaming support, ported from xine
rtognimp
parents:
diff changeset
6 * Copyright (C) 2002 the xine project
6cb7a295ab0e Real rstp:// streaming support, ported from xine
rtognimp
parents:
diff changeset
7 *
6cb7a295ab0e Real rstp:// streaming support, ported from xine
rtognimp
parents:
diff changeset
8 * This file is part of xine, a free video player.
6cb7a295ab0e Real rstp:// streaming support, ported from xine
rtognimp
parents:
diff changeset
9 *
6cb7a295ab0e Real rstp:// streaming support, ported from xine
rtognimp
parents:
diff changeset
10 * xine is free software; you can redistribute it and/or modify
6cb7a295ab0e Real rstp:// streaming support, ported from xine
rtognimp
parents:
diff changeset
11 * it under the terms of the GNU General Public License as published by
6cb7a295ab0e Real rstp:// streaming support, ported from xine
rtognimp
parents:
diff changeset
12 * the Free Software Foundation; either version 2 of the License, or
6cb7a295ab0e Real rstp:// streaming support, ported from xine
rtognimp
parents:
diff changeset
13 * (at your option) any later version.
6cb7a295ab0e Real rstp:// streaming support, ported from xine
rtognimp
parents:
diff changeset
14 *
6cb7a295ab0e Real rstp:// streaming support, ported from xine
rtognimp
parents:
diff changeset
15 * xine is distributed in the hope that it will be useful,
6cb7a295ab0e Real rstp:// streaming support, ported from xine
rtognimp
parents:
diff changeset
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
6cb7a295ab0e Real rstp:// streaming support, ported from xine
rtognimp
parents:
diff changeset
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
6cb7a295ab0e Real rstp:// streaming support, ported from xine
rtognimp
parents:
diff changeset
18 * GNU General Public License for more details.
6cb7a295ab0e Real rstp:// streaming support, ported from xine
rtognimp
parents:
diff changeset
19 *
6cb7a295ab0e Real rstp:// streaming support, ported from xine
rtognimp
parents:
diff changeset
20 * You should have received a copy of the GNU General Public License
6cb7a295ab0e Real rstp:// streaming support, ported from xine
rtognimp
parents:
diff changeset
21 * along with this program; if not, write to the Free Software
6cb7a295ab0e Real rstp:// streaming support, ported from xine
rtognimp
parents:
diff changeset
22 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
6cb7a295ab0e Real rstp:// streaming support, ported from xine
rtognimp
parents:
diff changeset
23 *
6cb7a295ab0e Real rstp:// streaming support, ported from xine
rtognimp
parents:
diff changeset
24 *
6cb7a295ab0e Real rstp:// streaming support, ported from xine
rtognimp
parents:
diff changeset
25 * some functions for real media file headers
6cb7a295ab0e Real rstp:// streaming support, ported from xine
rtognimp
parents:
diff changeset
26 * adopted from joschkas real tools
6cb7a295ab0e Real rstp:// streaming support, ported from xine
rtognimp
parents:
diff changeset
27 */
6cb7a295ab0e Real rstp:// streaming support, ported from xine
rtognimp
parents:
diff changeset
28
26029
4129c8cfa742 Add MPLAYER_ prefix to multiple inclusion guards.
diego
parents: 25535
diff changeset
29 #ifndef MPLAYER_RMFF_H
4129c8cfa742 Add MPLAYER_ prefix to multiple inclusion guards.
diego
parents: 25535
diff changeset
30 #define MPLAYER_RMFF_H
4129c8cfa742 Add MPLAYER_ prefix to multiple inclusion guards.
diego
parents: 25535
diff changeset
31
9922
6cb7a295ab0e Real rstp:// streaming support, ported from xine
rtognimp
parents:
diff changeset
32 #include <sys/types.h>
10281
54bcbf28698a Networking support under MinGW.
diego
parents: 9946
diff changeset
33 #include "config.h"
28402
c884d17bd005 Convert HAVE_WINSOCK2_H into a 0/1 definition.
diego
parents: 27461
diff changeset
34 #if !HAVE_WINSOCK2_H
9922
6cb7a295ab0e Real rstp:// streaming support, ported from xine
rtognimp
parents:
diff changeset
35 #include <sys/socket.h>
6cb7a295ab0e Real rstp:// streaming support, ported from xine
rtognimp
parents:
diff changeset
36 #include <netinet/in.h>
6cb7a295ab0e Real rstp:// streaming support, ported from xine
rtognimp
parents:
diff changeset
37 #include <netdb.h>
10281
54bcbf28698a Networking support under MinGW.
diego
parents: 9946
diff changeset
38 #else
54bcbf28698a Networking support under MinGW.
diego
parents: 9946
diff changeset
39 #include <winsock2.h>
54bcbf28698a Networking support under MinGW.
diego
parents: 9946
diff changeset
40 #endif
9922
6cb7a295ab0e Real rstp:// streaming support, ported from xine
rtognimp
parents:
diff changeset
41 #include <unistd.h>
6cb7a295ab0e Real rstp:// streaming support, ported from xine
rtognimp
parents:
diff changeset
42 #include <stdio.h>
6cb7a295ab0e Real rstp:// streaming support, ported from xine
rtognimp
parents:
diff changeset
43 #include <fcntl.h>
6cb7a295ab0e Real rstp:// streaming support, ported from xine
rtognimp
parents:
diff changeset
44 #include <stdlib.h>
6cb7a295ab0e Real rstp:// streaming support, ported from xine
rtognimp
parents:
diff changeset
45 #include <string.h>
9939
6b88f67564ce Fix compilation for *BSD, Mac OS X and maybe others (info by Steven M. Schultz and Dan Christiansen)
rtognimp
parents: 9922
diff changeset
46 #include <inttypes.h>
9922
6cb7a295ab0e Real rstp:// streaming support, ported from xine
rtognimp
parents:
diff changeset
47
6cb7a295ab0e Real rstp:// streaming support, ported from xine
rtognimp
parents:
diff changeset
48
6cb7a295ab0e Real rstp:// streaming support, ported from xine
rtognimp
parents:
diff changeset
49 #define RMFF_HEADER_SIZE 0x12
6cb7a295ab0e Real rstp:// streaming support, ported from xine
rtognimp
parents:
diff changeset
50
22803
4401909aac98 Check buffer size in header dump functions
rtogni
parents: 19271
diff changeset
51 #define RMFF_FILEHEADER_SIZE 18
4401909aac98 Check buffer size in header dump functions
rtogni
parents: 19271
diff changeset
52 #define RMFF_PROPHEADER_SIZE 50
4401909aac98 Check buffer size in header dump functions
rtogni
parents: 19271
diff changeset
53 #define RMFF_MDPRHEADER_SIZE 46
4401909aac98 Check buffer size in header dump functions
rtogni
parents: 19271
diff changeset
54 #define RMFF_CONTHEADER_SIZE 18
4401909aac98 Check buffer size in header dump functions
rtogni
parents: 19271
diff changeset
55 #define RMFF_DATAHEADER_SIZE 18
4401909aac98 Check buffer size in header dump functions
rtogni
parents: 19271
diff changeset
56
9922
6cb7a295ab0e Real rstp:// streaming support, ported from xine
rtognimp
parents:
diff changeset
57 #define FOURCC_TAG( ch0, ch1, ch2, ch3 ) \
6cb7a295ab0e Real rstp:// streaming support, ported from xine
rtognimp
parents:
diff changeset
58 (((long)(unsigned char)(ch3) ) | \
6cb7a295ab0e Real rstp:// streaming support, ported from xine
rtognimp
parents:
diff changeset
59 ( (long)(unsigned char)(ch2) << 8 ) | \
6cb7a295ab0e Real rstp:// streaming support, ported from xine
rtognimp
parents:
diff changeset
60 ( (long)(unsigned char)(ch1) << 16 ) | \
6cb7a295ab0e Real rstp:// streaming support, ported from xine
rtognimp
parents:
diff changeset
61 ( (long)(unsigned char)(ch0) << 24 ) )
6cb7a295ab0e Real rstp:// streaming support, ported from xine
rtognimp
parents:
diff changeset
62
6cb7a295ab0e Real rstp:// streaming support, ported from xine
rtognimp
parents:
diff changeset
63
6cb7a295ab0e Real rstp:// streaming support, ported from xine
rtognimp
parents:
diff changeset
64 #define RMF_TAG FOURCC_TAG('.', 'R', 'M', 'F')
6cb7a295ab0e Real rstp:// streaming support, ported from xine
rtognimp
parents:
diff changeset
65 #define PROP_TAG FOURCC_TAG('P', 'R', 'O', 'P')
6cb7a295ab0e Real rstp:// streaming support, ported from xine
rtognimp
parents:
diff changeset
66 #define MDPR_TAG FOURCC_TAG('M', 'D', 'P', 'R')
6cb7a295ab0e Real rstp:// streaming support, ported from xine
rtognimp
parents:
diff changeset
67 #define CONT_TAG FOURCC_TAG('C', 'O', 'N', 'T')
6cb7a295ab0e Real rstp:// streaming support, ported from xine
rtognimp
parents:
diff changeset
68 #define DATA_TAG FOURCC_TAG('D', 'A', 'T', 'A')
6cb7a295ab0e Real rstp:// streaming support, ported from xine
rtognimp
parents:
diff changeset
69 #define INDX_TAG FOURCC_TAG('I', 'N', 'D', 'X')
6cb7a295ab0e Real rstp:// streaming support, ported from xine
rtognimp
parents:
diff changeset
70 #define PNA_TAG FOURCC_TAG('P', 'N', 'A', 0 )
6cb7a295ab0e Real rstp:// streaming support, ported from xine
rtognimp
parents:
diff changeset
71
6cb7a295ab0e Real rstp:// streaming support, ported from xine
rtognimp
parents:
diff changeset
72 #define MLTI_TAG FOURCC_TAG('M', 'L', 'T', 'I')
6cb7a295ab0e Real rstp:// streaming support, ported from xine
rtognimp
parents:
diff changeset
73
6cb7a295ab0e Real rstp:// streaming support, ported from xine
rtognimp
parents:
diff changeset
74 /* prop flags */
6cb7a295ab0e Real rstp:// streaming support, ported from xine
rtognimp
parents:
diff changeset
75 #define PN_SAVE_ENABLED 0x01
6cb7a295ab0e Real rstp:// streaming support, ported from xine
rtognimp
parents:
diff changeset
76 #define PN_PERFECT_PLAY_ENABLED 0x02
6cb7a295ab0e Real rstp:// streaming support, ported from xine
rtognimp
parents:
diff changeset
77 #define PN_LIVE_BROADCAST 0x04
6cb7a295ab0e Real rstp:// streaming support, ported from xine
rtognimp
parents:
diff changeset
78
6cb7a295ab0e Real rstp:// streaming support, ported from xine
rtognimp
parents:
diff changeset
79 /*
6cb7a295ab0e Real rstp:// streaming support, ported from xine
rtognimp
parents:
diff changeset
80 * rm header data structs
6cb7a295ab0e Real rstp:// streaming support, ported from xine
rtognimp
parents:
diff changeset
81 */
6cb7a295ab0e Real rstp:// streaming support, ported from xine
rtognimp
parents:
diff changeset
82
6cb7a295ab0e Real rstp:// streaming support, ported from xine
rtognimp
parents:
diff changeset
83 typedef struct {
6cb7a295ab0e Real rstp:// streaming support, ported from xine
rtognimp
parents:
diff changeset
84
6cb7a295ab0e Real rstp:// streaming support, ported from xine
rtognimp
parents:
diff changeset
85 uint32_t object_id;
6cb7a295ab0e Real rstp:// streaming support, ported from xine
rtognimp
parents:
diff changeset
86 uint32_t size;
6cb7a295ab0e Real rstp:// streaming support, ported from xine
rtognimp
parents:
diff changeset
87 uint16_t object_version;
6cb7a295ab0e Real rstp:// streaming support, ported from xine
rtognimp
parents:
diff changeset
88
6cb7a295ab0e Real rstp:// streaming support, ported from xine
rtognimp
parents:
diff changeset
89 uint32_t file_version;
6cb7a295ab0e Real rstp:// streaming support, ported from xine
rtognimp
parents:
diff changeset
90 uint32_t num_headers;
6cb7a295ab0e Real rstp:// streaming support, ported from xine
rtognimp
parents:
diff changeset
91 } rmff_fileheader_t;
6cb7a295ab0e Real rstp:// streaming support, ported from xine
rtognimp
parents:
diff changeset
92
6cb7a295ab0e Real rstp:// streaming support, ported from xine
rtognimp
parents:
diff changeset
93 typedef struct {
6cb7a295ab0e Real rstp:// streaming support, ported from xine
rtognimp
parents:
diff changeset
94
6cb7a295ab0e Real rstp:// streaming support, ported from xine
rtognimp
parents:
diff changeset
95 uint32_t object_id;
6cb7a295ab0e Real rstp:// streaming support, ported from xine
rtognimp
parents:
diff changeset
96 uint32_t size;
6cb7a295ab0e Real rstp:// streaming support, ported from xine
rtognimp
parents:
diff changeset
97 uint16_t object_version;
6cb7a295ab0e Real rstp:// streaming support, ported from xine
rtognimp
parents:
diff changeset
98
6cb7a295ab0e Real rstp:// streaming support, ported from xine
rtognimp
parents:
diff changeset
99 uint32_t max_bit_rate;
6cb7a295ab0e Real rstp:// streaming support, ported from xine
rtognimp
parents:
diff changeset
100 uint32_t avg_bit_rate;
6cb7a295ab0e Real rstp:// streaming support, ported from xine
rtognimp
parents:
diff changeset
101 uint32_t max_packet_size;
6cb7a295ab0e Real rstp:// streaming support, ported from xine
rtognimp
parents:
diff changeset
102 uint32_t avg_packet_size;
6cb7a295ab0e Real rstp:// streaming support, ported from xine
rtognimp
parents:
diff changeset
103 uint32_t num_packets;
6cb7a295ab0e Real rstp:// streaming support, ported from xine
rtognimp
parents:
diff changeset
104 uint32_t duration;
6cb7a295ab0e Real rstp:// streaming support, ported from xine
rtognimp
parents:
diff changeset
105 uint32_t preroll;
6cb7a295ab0e Real rstp:// streaming support, ported from xine
rtognimp
parents:
diff changeset
106 uint32_t index_offset;
6cb7a295ab0e Real rstp:// streaming support, ported from xine
rtognimp
parents:
diff changeset
107 uint32_t data_offset;
6cb7a295ab0e Real rstp:// streaming support, ported from xine
rtognimp
parents:
diff changeset
108 uint16_t num_streams;
6cb7a295ab0e Real rstp:// streaming support, ported from xine
rtognimp
parents:
diff changeset
109 uint16_t flags;
29263
0f1b5b68af32 whitespace cosmetics: Remove all trailing whitespace.
diego
parents: 28402
diff changeset
110
9922
6cb7a295ab0e Real rstp:// streaming support, ported from xine
rtognimp
parents:
diff changeset
111 } rmff_prop_t;
6cb7a295ab0e Real rstp:// streaming support, ported from xine
rtognimp
parents:
diff changeset
112
6cb7a295ab0e Real rstp:// streaming support, ported from xine
rtognimp
parents:
diff changeset
113 typedef struct {
6cb7a295ab0e Real rstp:// streaming support, ported from xine
rtognimp
parents:
diff changeset
114
6cb7a295ab0e Real rstp:// streaming support, ported from xine
rtognimp
parents:
diff changeset
115 uint32_t object_id;
6cb7a295ab0e Real rstp:// streaming support, ported from xine
rtognimp
parents:
diff changeset
116 uint32_t size;
6cb7a295ab0e Real rstp:// streaming support, ported from xine
rtognimp
parents:
diff changeset
117 uint16_t object_version;
6cb7a295ab0e Real rstp:// streaming support, ported from xine
rtognimp
parents:
diff changeset
118
6cb7a295ab0e Real rstp:// streaming support, ported from xine
rtognimp
parents:
diff changeset
119 uint16_t stream_number;
6cb7a295ab0e Real rstp:// streaming support, ported from xine
rtognimp
parents:
diff changeset
120 uint32_t max_bit_rate;
6cb7a295ab0e Real rstp:// streaming support, ported from xine
rtognimp
parents:
diff changeset
121 uint32_t avg_bit_rate;
6cb7a295ab0e Real rstp:// streaming support, ported from xine
rtognimp
parents:
diff changeset
122 uint32_t max_packet_size;
6cb7a295ab0e Real rstp:// streaming support, ported from xine
rtognimp
parents:
diff changeset
123 uint32_t avg_packet_size;
6cb7a295ab0e Real rstp:// streaming support, ported from xine
rtognimp
parents:
diff changeset
124 uint32_t start_time;
6cb7a295ab0e Real rstp:// streaming support, ported from xine
rtognimp
parents:
diff changeset
125 uint32_t preroll;
6cb7a295ab0e Real rstp:// streaming support, ported from xine
rtognimp
parents:
diff changeset
126 uint32_t duration;
6cb7a295ab0e Real rstp:// streaming support, ported from xine
rtognimp
parents:
diff changeset
127 uint8_t stream_name_size;
6cb7a295ab0e Real rstp:// streaming support, ported from xine
rtognimp
parents:
diff changeset
128 char *stream_name;
6cb7a295ab0e Real rstp:// streaming support, ported from xine
rtognimp
parents:
diff changeset
129 uint8_t mime_type_size;
6cb7a295ab0e Real rstp:// streaming support, ported from xine
rtognimp
parents:
diff changeset
130 char *mime_type;
6cb7a295ab0e Real rstp:// streaming support, ported from xine
rtognimp
parents:
diff changeset
131 uint32_t type_specific_len;
6cb7a295ab0e Real rstp:// streaming support, ported from xine
rtognimp
parents:
diff changeset
132 char *type_specific_data;
6cb7a295ab0e Real rstp:// streaming support, ported from xine
rtognimp
parents:
diff changeset
133
6cb7a295ab0e Real rstp:// streaming support, ported from xine
rtognimp
parents:
diff changeset
134 int mlti_data_size;
6cb7a295ab0e Real rstp:// streaming support, ported from xine
rtognimp
parents:
diff changeset
135 char *mlti_data;
6cb7a295ab0e Real rstp:// streaming support, ported from xine
rtognimp
parents:
diff changeset
136
6cb7a295ab0e Real rstp:// streaming support, ported from xine
rtognimp
parents:
diff changeset
137 } rmff_mdpr_t;
6cb7a295ab0e Real rstp:// streaming support, ported from xine
rtognimp
parents:
diff changeset
138
6cb7a295ab0e Real rstp:// streaming support, ported from xine
rtognimp
parents:
diff changeset
139 typedef struct {
6cb7a295ab0e Real rstp:// streaming support, ported from xine
rtognimp
parents:
diff changeset
140
6cb7a295ab0e Real rstp:// streaming support, ported from xine
rtognimp
parents:
diff changeset
141 uint32_t object_id;
6cb7a295ab0e Real rstp:// streaming support, ported from xine
rtognimp
parents:
diff changeset
142 uint32_t size;
6cb7a295ab0e Real rstp:// streaming support, ported from xine
rtognimp
parents:
diff changeset
143 uint16_t object_version;
6cb7a295ab0e Real rstp:// streaming support, ported from xine
rtognimp
parents:
diff changeset
144
6cb7a295ab0e Real rstp:// streaming support, ported from xine
rtognimp
parents:
diff changeset
145 uint16_t title_len;
6cb7a295ab0e Real rstp:// streaming support, ported from xine
rtognimp
parents:
diff changeset
146 char *title;
6cb7a295ab0e Real rstp:// streaming support, ported from xine
rtognimp
parents:
diff changeset
147 uint16_t author_len;
6cb7a295ab0e Real rstp:// streaming support, ported from xine
rtognimp
parents:
diff changeset
148 char *author;
6cb7a295ab0e Real rstp:// streaming support, ported from xine
rtognimp
parents:
diff changeset
149 uint16_t copyright_len;
6cb7a295ab0e Real rstp:// streaming support, ported from xine
rtognimp
parents:
diff changeset
150 char *copyright;
6cb7a295ab0e Real rstp:// streaming support, ported from xine
rtognimp
parents:
diff changeset
151 uint16_t comment_len;
6cb7a295ab0e Real rstp:// streaming support, ported from xine
rtognimp
parents:
diff changeset
152 char *comment;
29263
0f1b5b68af32 whitespace cosmetics: Remove all trailing whitespace.
diego
parents: 28402
diff changeset
153
9922
6cb7a295ab0e Real rstp:// streaming support, ported from xine
rtognimp
parents:
diff changeset
154 } rmff_cont_t;
6cb7a295ab0e Real rstp:// streaming support, ported from xine
rtognimp
parents:
diff changeset
155
6cb7a295ab0e Real rstp:// streaming support, ported from xine
rtognimp
parents:
diff changeset
156 typedef struct {
29263
0f1b5b68af32 whitespace cosmetics: Remove all trailing whitespace.
diego
parents: 28402
diff changeset
157
9922
6cb7a295ab0e Real rstp:// streaming support, ported from xine
rtognimp
parents:
diff changeset
158 uint32_t object_id;
6cb7a295ab0e Real rstp:// streaming support, ported from xine
rtognimp
parents:
diff changeset
159 uint32_t size;
6cb7a295ab0e Real rstp:// streaming support, ported from xine
rtognimp
parents:
diff changeset
160 uint16_t object_version;
6cb7a295ab0e Real rstp:// streaming support, ported from xine
rtognimp
parents:
diff changeset
161
6cb7a295ab0e Real rstp:// streaming support, ported from xine
rtognimp
parents:
diff changeset
162 uint32_t num_packets;
6cb7a295ab0e Real rstp:// streaming support, ported from xine
rtognimp
parents:
diff changeset
163 uint32_t next_data_header; /* rarely used */
6cb7a295ab0e Real rstp:// streaming support, ported from xine
rtognimp
parents:
diff changeset
164 } rmff_data_t;
6cb7a295ab0e Real rstp:// streaming support, ported from xine
rtognimp
parents:
diff changeset
165
6cb7a295ab0e Real rstp:// streaming support, ported from xine
rtognimp
parents:
diff changeset
166 typedef struct {
6cb7a295ab0e Real rstp:// streaming support, ported from xine
rtognimp
parents:
diff changeset
167
6cb7a295ab0e Real rstp:// streaming support, ported from xine
rtognimp
parents:
diff changeset
168 rmff_fileheader_t *fileheader;
6cb7a295ab0e Real rstp:// streaming support, ported from xine
rtognimp
parents:
diff changeset
169 rmff_prop_t *prop;
6cb7a295ab0e Real rstp:// streaming support, ported from xine
rtognimp
parents:
diff changeset
170 rmff_mdpr_t **streams;
6cb7a295ab0e Real rstp:// streaming support, ported from xine
rtognimp
parents:
diff changeset
171 rmff_cont_t *cont;
6cb7a295ab0e Real rstp:// streaming support, ported from xine
rtognimp
parents:
diff changeset
172 rmff_data_t *data;
6cb7a295ab0e Real rstp:// streaming support, ported from xine
rtognimp
parents:
diff changeset
173 } rmff_header_t;
6cb7a295ab0e Real rstp:// streaming support, ported from xine
rtognimp
parents:
diff changeset
174
6cb7a295ab0e Real rstp:// streaming support, ported from xine
rtognimp
parents:
diff changeset
175 typedef struct {
6cb7a295ab0e Real rstp:// streaming support, ported from xine
rtognimp
parents:
diff changeset
176
6cb7a295ab0e Real rstp:// streaming support, ported from xine
rtognimp
parents:
diff changeset
177 uint16_t object_version;
6cb7a295ab0e Real rstp:// streaming support, ported from xine
rtognimp
parents:
diff changeset
178
6cb7a295ab0e Real rstp:// streaming support, ported from xine
rtognimp
parents:
diff changeset
179 uint16_t length;
6cb7a295ab0e Real rstp:// streaming support, ported from xine
rtognimp
parents:
diff changeset
180 uint16_t stream_number;
6cb7a295ab0e Real rstp:// streaming support, ported from xine
rtognimp
parents:
diff changeset
181 uint32_t timestamp;
6cb7a295ab0e Real rstp:// streaming support, ported from xine
rtognimp
parents:
diff changeset
182 uint8_t reserved;
6cb7a295ab0e Real rstp:// streaming support, ported from xine
rtognimp
parents:
diff changeset
183 uint8_t flags;
6cb7a295ab0e Real rstp:// streaming support, ported from xine
rtognimp
parents:
diff changeset
184
6cb7a295ab0e Real rstp:// streaming support, ported from xine
rtognimp
parents:
diff changeset
185 } rmff_pheader_t;
6cb7a295ab0e Real rstp:// streaming support, ported from xine
rtognimp
parents:
diff changeset
186
6cb7a295ab0e Real rstp:// streaming support, ported from xine
rtognimp
parents:
diff changeset
187 /*
6cb7a295ab0e Real rstp:// streaming support, ported from xine
rtognimp
parents:
diff changeset
188 * constructors for header structs
6cb7a295ab0e Real rstp:// streaming support, ported from xine
rtognimp
parents:
diff changeset
189 */
29263
0f1b5b68af32 whitespace cosmetics: Remove all trailing whitespace.
diego
parents: 28402
diff changeset
190
9922
6cb7a295ab0e Real rstp:// streaming support, ported from xine
rtognimp
parents:
diff changeset
191 rmff_fileheader_t *rmff_new_fileheader(uint32_t num_headers);
6cb7a295ab0e Real rstp:// streaming support, ported from xine
rtognimp
parents:
diff changeset
192
6cb7a295ab0e Real rstp:// streaming support, ported from xine
rtognimp
parents:
diff changeset
193 rmff_prop_t *rmff_new_prop (
6cb7a295ab0e Real rstp:// streaming support, ported from xine
rtognimp
parents:
diff changeset
194 uint32_t max_bit_rate,
6cb7a295ab0e Real rstp:// streaming support, ported from xine
rtognimp
parents:
diff changeset
195 uint32_t avg_bit_rate,
6cb7a295ab0e Real rstp:// streaming support, ported from xine
rtognimp
parents:
diff changeset
196 uint32_t max_packet_size,
6cb7a295ab0e Real rstp:// streaming support, ported from xine
rtognimp
parents:
diff changeset
197 uint32_t avg_packet_size,
6cb7a295ab0e Real rstp:// streaming support, ported from xine
rtognimp
parents:
diff changeset
198 uint32_t num_packets,
6cb7a295ab0e Real rstp:// streaming support, ported from xine
rtognimp
parents:
diff changeset
199 uint32_t duration,
6cb7a295ab0e Real rstp:// streaming support, ported from xine
rtognimp
parents:
diff changeset
200 uint32_t preroll,
6cb7a295ab0e Real rstp:// streaming support, ported from xine
rtognimp
parents:
diff changeset
201 uint32_t index_offset,
6cb7a295ab0e Real rstp:// streaming support, ported from xine
rtognimp
parents:
diff changeset
202 uint32_t data_offset,
6cb7a295ab0e Real rstp:// streaming support, ported from xine
rtognimp
parents:
diff changeset
203 uint16_t num_streams,
6cb7a295ab0e Real rstp:// streaming support, ported from xine
rtognimp
parents:
diff changeset
204 uint16_t flags );
6cb7a295ab0e Real rstp:// streaming support, ported from xine
rtognimp
parents:
diff changeset
205
6cb7a295ab0e Real rstp:// streaming support, ported from xine
rtognimp
parents:
diff changeset
206 rmff_mdpr_t *rmff_new_mdpr(
6cb7a295ab0e Real rstp:// streaming support, ported from xine
rtognimp
parents:
diff changeset
207 uint16_t stream_number,
6cb7a295ab0e Real rstp:// streaming support, ported from xine
rtognimp
parents:
diff changeset
208 uint32_t max_bit_rate,
6cb7a295ab0e Real rstp:// streaming support, ported from xine
rtognimp
parents:
diff changeset
209 uint32_t avg_bit_rate,
6cb7a295ab0e Real rstp:// streaming support, ported from xine
rtognimp
parents:
diff changeset
210 uint32_t max_packet_size,
6cb7a295ab0e Real rstp:// streaming support, ported from xine
rtognimp
parents:
diff changeset
211 uint32_t avg_packet_size,
6cb7a295ab0e Real rstp:// streaming support, ported from xine
rtognimp
parents:
diff changeset
212 uint32_t start_time,
6cb7a295ab0e Real rstp:// streaming support, ported from xine
rtognimp
parents:
diff changeset
213 uint32_t preroll,
6cb7a295ab0e Real rstp:// streaming support, ported from xine
rtognimp
parents:
diff changeset
214 uint32_t duration,
6cb7a295ab0e Real rstp:// streaming support, ported from xine
rtognimp
parents:
diff changeset
215 const char *stream_name,
6cb7a295ab0e Real rstp:// streaming support, ported from xine
rtognimp
parents:
diff changeset
216 const char *mime_type,
6cb7a295ab0e Real rstp:// streaming support, ported from xine
rtognimp
parents:
diff changeset
217 uint32_t type_specific_len,
6cb7a295ab0e Real rstp:// streaming support, ported from xine
rtognimp
parents:
diff changeset
218 const char *type_specific_data );
6cb7a295ab0e Real rstp:// streaming support, ported from xine
rtognimp
parents:
diff changeset
219
6cb7a295ab0e Real rstp:// streaming support, ported from xine
rtognimp
parents:
diff changeset
220 rmff_cont_t *rmff_new_cont(
6cb7a295ab0e Real rstp:// streaming support, ported from xine
rtognimp
parents:
diff changeset
221 const char *title,
6cb7a295ab0e Real rstp:// streaming support, ported from xine
rtognimp
parents:
diff changeset
222 const char *author,
6cb7a295ab0e Real rstp:// streaming support, ported from xine
rtognimp
parents:
diff changeset
223 const char *copyright,
6cb7a295ab0e Real rstp:// streaming support, ported from xine
rtognimp
parents:
diff changeset
224 const char *comment);
6cb7a295ab0e Real rstp:// streaming support, ported from xine
rtognimp
parents:
diff changeset
225
6cb7a295ab0e Real rstp:// streaming support, ported from xine
rtognimp
parents:
diff changeset
226 rmff_data_t *rmff_new_dataheader(
6cb7a295ab0e Real rstp:// streaming support, ported from xine
rtognimp
parents:
diff changeset
227 uint32_t num_packets, uint32_t next_data_header);
6cb7a295ab0e Real rstp:// streaming support, ported from xine
rtognimp
parents:
diff changeset
228
6cb7a295ab0e Real rstp:// streaming support, ported from xine
rtognimp
parents:
diff changeset
229 /*
6cb7a295ab0e Real rstp:// streaming support, ported from xine
rtognimp
parents:
diff changeset
230 * reads header infos from data and returns a newly allocated header struct
6cb7a295ab0e Real rstp:// streaming support, ported from xine
rtognimp
parents:
diff changeset
231 */
6cb7a295ab0e Real rstp:// streaming support, ported from xine
rtognimp
parents:
diff changeset
232 rmff_header_t *rmff_scan_header(const char *data);
6cb7a295ab0e Real rstp:// streaming support, ported from xine
rtognimp
parents:
diff changeset
233
6cb7a295ab0e Real rstp:// streaming support, ported from xine
rtognimp
parents:
diff changeset
234 /*
6cb7a295ab0e Real rstp:// streaming support, ported from xine
rtognimp
parents:
diff changeset
235 * scans a data packet header. Notice, that this function does not allocate
6cb7a295ab0e Real rstp:// streaming support, ported from xine
rtognimp
parents:
diff changeset
236 * the header struct itself.
6cb7a295ab0e Real rstp:// streaming support, ported from xine
rtognimp
parents:
diff changeset
237 */
6cb7a295ab0e Real rstp:// streaming support, ported from xine
rtognimp
parents:
diff changeset
238 void rmff_scan_pheader(rmff_pheader_t *h, char *data);
6cb7a295ab0e Real rstp:// streaming support, ported from xine
rtognimp
parents:
diff changeset
239
6cb7a295ab0e Real rstp:// streaming support, ported from xine
rtognimp
parents:
diff changeset
240 /*
6cb7a295ab0e Real rstp:// streaming support, ported from xine
rtognimp
parents:
diff changeset
241 * reads header infos from stream and returns a newly allocated header struct
6cb7a295ab0e Real rstp:// streaming support, ported from xine
rtognimp
parents:
diff changeset
242 */
6cb7a295ab0e Real rstp:// streaming support, ported from xine
rtognimp
parents:
diff changeset
243 rmff_header_t *rmff_scan_header_stream(int fd);
6cb7a295ab0e Real rstp:// streaming support, ported from xine
rtognimp
parents:
diff changeset
244
6cb7a295ab0e Real rstp:// streaming support, ported from xine
rtognimp
parents:
diff changeset
245 /*
6cb7a295ab0e Real rstp:// streaming support, ported from xine
rtognimp
parents:
diff changeset
246 * prints header information in human readible form to stdout
6cb7a295ab0e Real rstp:// streaming support, ported from xine
rtognimp
parents:
diff changeset
247 */
6cb7a295ab0e Real rstp:// streaming support, ported from xine
rtognimp
parents:
diff changeset
248 void rmff_print_header(rmff_header_t *h);
6cb7a295ab0e Real rstp:// streaming support, ported from xine
rtognimp
parents:
diff changeset
249
6cb7a295ab0e Real rstp:// streaming support, ported from xine
rtognimp
parents:
diff changeset
250 /*
6cb7a295ab0e Real rstp:// streaming support, ported from xine
rtognimp
parents:
diff changeset
251 * does some checks and fixes header if possible
6cb7a295ab0e Real rstp:// streaming support, ported from xine
rtognimp
parents:
diff changeset
252 */
6cb7a295ab0e Real rstp:// streaming support, ported from xine
rtognimp
parents:
diff changeset
253 void rmff_fix_header(rmff_header_t *h);
6cb7a295ab0e Real rstp:// streaming support, ported from xine
rtognimp
parents:
diff changeset
254
6cb7a295ab0e Real rstp:// streaming support, ported from xine
rtognimp
parents:
diff changeset
255 /*
6cb7a295ab0e Real rstp:// streaming support, ported from xine
rtognimp
parents:
diff changeset
256 * returns the size of the header (incl. first data-header)
6cb7a295ab0e Real rstp:// streaming support, ported from xine
rtognimp
parents:
diff changeset
257 */
6cb7a295ab0e Real rstp:// streaming support, ported from xine
rtognimp
parents:
diff changeset
258 int rmff_get_header_size(rmff_header_t *h);
29263
0f1b5b68af32 whitespace cosmetics: Remove all trailing whitespace.
diego
parents: 28402
diff changeset
259
9922
6cb7a295ab0e Real rstp:// streaming support, ported from xine
rtognimp
parents:
diff changeset
260 /*
6cb7a295ab0e Real rstp:// streaming support, ported from xine
rtognimp
parents:
diff changeset
261 * dumps the header <h> to <buffer>. <max> is the size of <buffer>
6cb7a295ab0e Real rstp:// streaming support, ported from xine
rtognimp
parents:
diff changeset
262 */
6cb7a295ab0e Real rstp:// streaming support, ported from xine
rtognimp
parents:
diff changeset
263 int rmff_dump_header(rmff_header_t *h, char *buffer, int max);
6cb7a295ab0e Real rstp:// streaming support, ported from xine
rtognimp
parents:
diff changeset
264
6cb7a295ab0e Real rstp:// streaming support, ported from xine
rtognimp
parents:
diff changeset
265 /*
6cb7a295ab0e Real rstp:// streaming support, ported from xine
rtognimp
parents:
diff changeset
266 * dumps a packet header
6cb7a295ab0e Real rstp:// streaming support, ported from xine
rtognimp
parents:
diff changeset
267 */
6cb7a295ab0e Real rstp:// streaming support, ported from xine
rtognimp
parents:
diff changeset
268 void rmff_dump_pheader(rmff_pheader_t *h, char *data);
6cb7a295ab0e Real rstp:// streaming support, ported from xine
rtognimp
parents:
diff changeset
269
6cb7a295ab0e Real rstp:// streaming support, ported from xine
rtognimp
parents:
diff changeset
270 /*
6cb7a295ab0e Real rstp:// streaming support, ported from xine
rtognimp
parents:
diff changeset
271 * frees a header struct
6cb7a295ab0e Real rstp:// streaming support, ported from xine
rtognimp
parents:
diff changeset
272 */
6cb7a295ab0e Real rstp:// streaming support, ported from xine
rtognimp
parents:
diff changeset
273 void rmff_free_header(rmff_header_t *h);
6cb7a295ab0e Real rstp:// streaming support, ported from xine
rtognimp
parents:
diff changeset
274
26029
4129c8cfa742 Add MPLAYER_ prefix to multiple inclusion guards.
diego
parents: 25535
diff changeset
275 #endif /* MPLAYER_RMFF_H */