annotate libmpdemux/asf.h @ 28511:db19e31a2c7c

Add a calc_src_dst_rects that calculates from window size, panscan etc. which part of the video source must be scaled onto which part of the window. Direct3D and (future) VDPAU need this, for XvMC it makes it easier to add cropping support and Xv is changed to keep the diff to XvMC small.
author reimar
date Thu, 12 Feb 2009 17:40:53 +0000
parents 536dbf7632ea
children d643e4643313
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
26029
4129c8cfa742 Add MPLAYER_ prefix to multiple inclusion guards.
diego
parents: 25535
diff changeset
1 #ifndef MPLAYER_ASF_H
4129c8cfa742 Add MPLAYER_ prefix to multiple inclusion guards.
diego
parents: 25535
diff changeset
2 #define MPLAYER_ASF_H
833
b8cecdc0c67f Starting implementation of ASF network streaming.
bertrand
parents:
diff changeset
3
2555
66837325b929 config.h cleanup, few things added to steram/demuxer headers
arpi
parents: 2489
diff changeset
4 //#include "config.h" /* for WORDS_BIGENDIAN */
833
b8cecdc0c67f Starting implementation of ASF network streaming.
bertrand
parents:
diff changeset
5 #include <inttypes.h>
21372
1767c271d710 Remove bswap.h, use libavutil/bswap.h instead.
diego
parents: 19961
diff changeset
6 #include "libavutil/common.h"
21507
fa99b3d31d13 Hack around libavutil/bswap.h compilation problems due to always_inline undefined.
reimar
parents: 21372
diff changeset
7 #include "mpbswap.h"
904
11879db9d4cc Added some functions prototypes.
bertrand
parents: 871
diff changeset
8
833
b8cecdc0c67f Starting implementation of ASF network streaming.
bertrand
parents:
diff changeset
9 ///////////////////////
b8cecdc0c67f Starting implementation of ASF network streaming.
bertrand
parents:
diff changeset
10 // ASF Object Header
b8cecdc0c67f Starting implementation of ASF network streaming.
bertrand
parents:
diff changeset
11 ///////////////////////
b8cecdc0c67f Starting implementation of ASF network streaming.
bertrand
parents:
diff changeset
12 typedef struct __attribute__((packed)) {
b8cecdc0c67f Starting implementation of ASF network streaming.
bertrand
parents:
diff changeset
13 uint8_t guid[16];
b8cecdc0c67f Starting implementation of ASF network streaming.
bertrand
parents:
diff changeset
14 uint64_t size;
b8cecdc0c67f Starting implementation of ASF network streaming.
bertrand
parents:
diff changeset
15 } ASF_obj_header_t;
b8cecdc0c67f Starting implementation of ASF network streaming.
bertrand
parents:
diff changeset
16
b8cecdc0c67f Starting implementation of ASF network streaming.
bertrand
parents:
diff changeset
17 ////////////////
b8cecdc0c67f Starting implementation of ASF network streaming.
bertrand
parents:
diff changeset
18 // ASF Header
b8cecdc0c67f Starting implementation of ASF network streaming.
bertrand
parents:
diff changeset
19 ////////////////
b8cecdc0c67f Starting implementation of ASF network streaming.
bertrand
parents:
diff changeset
20 typedef struct __attribute__((packed)) {
b8cecdc0c67f Starting implementation of ASF network streaming.
bertrand
parents:
diff changeset
21 ASF_obj_header_t objh;
b8cecdc0c67f Starting implementation of ASF network streaming.
bertrand
parents:
diff changeset
22 uint32_t cno; // number of subchunks
b8cecdc0c67f Starting implementation of ASF network streaming.
bertrand
parents:
diff changeset
23 uint8_t v1; // unknown (0x01)
b8cecdc0c67f Starting implementation of ASF network streaming.
bertrand
parents:
diff changeset
24 uint8_t v2; // unknown (0x02)
b8cecdc0c67f Starting implementation of ASF network streaming.
bertrand
parents:
diff changeset
25 } ASF_header_t;
b8cecdc0c67f Starting implementation of ASF network streaming.
bertrand
parents:
diff changeset
26
b8cecdc0c67f Starting implementation of ASF network streaming.
bertrand
parents:
diff changeset
27 /////////////////////
b8cecdc0c67f Starting implementation of ASF network streaming.
bertrand
parents:
diff changeset
28 // ASF File Header
b8cecdc0c67f Starting implementation of ASF network streaming.
bertrand
parents:
diff changeset
29 /////////////////////
4288
b84e9861461c Changed the asf_file_header_t struct to read all the fields properly.
bertrand
parents: 3719
diff changeset
30 typedef struct __attribute__((packed)) {
b84e9861461c Changed the asf_file_header_t struct to read all the fields properly.
bertrand
parents: 3719
diff changeset
31 uint8_t stream_id[16]; // stream GUID
b84e9861461c Changed the asf_file_header_t struct to read all the fields properly.
bertrand
parents: 3719
diff changeset
32 uint64_t file_size;
b84e9861461c Changed the asf_file_header_t struct to read all the fields properly.
bertrand
parents: 3719
diff changeset
33 uint64_t creation_time; //File creation time FILETIME 8
b84e9861461c Changed the asf_file_header_t struct to read all the fields properly.
bertrand
parents: 3719
diff changeset
34 uint64_t num_packets; //Number of packets UINT64 8
b84e9861461c Changed the asf_file_header_t struct to read all the fields properly.
bertrand
parents: 3719
diff changeset
35 uint64_t play_duration; //Timestamp of the end position UINT64 8
b84e9861461c Changed the asf_file_header_t struct to read all the fields properly.
bertrand
parents: 3719
diff changeset
36 uint64_t send_duration; //Duration of the playback UINT64 8
b84e9861461c Changed the asf_file_header_t struct to read all the fields properly.
bertrand
parents: 3719
diff changeset
37 uint64_t preroll; //Time to bufferize before playing UINT32 4
b84e9861461c Changed the asf_file_header_t struct to read all the fields properly.
bertrand
parents: 3719
diff changeset
38 uint32_t flags; //Unknown, maybe flags ( usually contains 2 ) UINT32 4
b84e9861461c Changed the asf_file_header_t struct to read all the fields properly.
bertrand
parents: 3719
diff changeset
39 uint32_t min_packet_size; //Min size of the packet, in bytes UINT32 4
b84e9861461c Changed the asf_file_header_t struct to read all the fields properly.
bertrand
parents: 3719
diff changeset
40 uint32_t max_packet_size; //Max size of the packet UINT32 4
b84e9861461c Changed the asf_file_header_t struct to read all the fields properly.
bertrand
parents: 3719
diff changeset
41 uint32_t max_bitrate; //Maximum bitrate of the media (sum of all the stream)
b84e9861461c Changed the asf_file_header_t struct to read all the fields properly.
bertrand
parents: 3719
diff changeset
42 } ASF_file_header_t;
833
b8cecdc0c67f Starting implementation of ASF network streaming.
bertrand
parents:
diff changeset
43
b8cecdc0c67f Starting implementation of ASF network streaming.
bertrand
parents:
diff changeset
44 ///////////////////////
b8cecdc0c67f Starting implementation of ASF network streaming.
bertrand
parents:
diff changeset
45 // ASF Stream Header
b8cecdc0c67f Starting implementation of ASF network streaming.
bertrand
parents:
diff changeset
46 ///////////////////////
b8cecdc0c67f Starting implementation of ASF network streaming.
bertrand
parents:
diff changeset
47 typedef struct __attribute__((packed)) {
b8cecdc0c67f Starting implementation of ASF network streaming.
bertrand
parents:
diff changeset
48 uint8_t type[16]; // Stream type (audio/video) GUID 16
b8cecdc0c67f Starting implementation of ASF network streaming.
bertrand
parents:
diff changeset
49 uint8_t concealment[16]; // Audio error concealment type GUID 16
b8cecdc0c67f Starting implementation of ASF network streaming.
bertrand
parents:
diff changeset
50 uint64_t unk1; // Unknown, maybe reserved ( usually contains 0 ) UINT64 8
b8cecdc0c67f Starting implementation of ASF network streaming.
bertrand
parents:
diff changeset
51 uint32_t type_size; //Total size of type-specific data UINT32 4
b8cecdc0c67f Starting implementation of ASF network streaming.
bertrand
parents:
diff changeset
52 uint32_t stream_size; //Size of stream-specific data UINT32 4
b8cecdc0c67f Starting implementation of ASF network streaming.
bertrand
parents:
diff changeset
53 uint16_t stream_no; //Stream number UINT16 2
b8cecdc0c67f Starting implementation of ASF network streaming.
bertrand
parents:
diff changeset
54 uint32_t unk2; //Unknown UINT32 4
b8cecdc0c67f Starting implementation of ASF network streaming.
bertrand
parents:
diff changeset
55 } ASF_stream_header_t;
b8cecdc0c67f Starting implementation of ASF network streaming.
bertrand
parents:
diff changeset
56
b8cecdc0c67f Starting implementation of ASF network streaming.
bertrand
parents:
diff changeset
57 ///////////////////////////
b8cecdc0c67f Starting implementation of ASF network streaming.
bertrand
parents:
diff changeset
58 // ASF Content Description
b8cecdc0c67f Starting implementation of ASF network streaming.
bertrand
parents:
diff changeset
59 ///////////////////////////
b8cecdc0c67f Starting implementation of ASF network streaming.
bertrand
parents:
diff changeset
60 typedef struct __attribute__((packed)) {
b8cecdc0c67f Starting implementation of ASF network streaming.
bertrand
parents:
diff changeset
61 uint16_t title_size;
b8cecdc0c67f Starting implementation of ASF network streaming.
bertrand
parents:
diff changeset
62 uint16_t author_size;
b8cecdc0c67f Starting implementation of ASF network streaming.
bertrand
parents:
diff changeset
63 uint16_t copyright_size;
b8cecdc0c67f Starting implementation of ASF network streaming.
bertrand
parents:
diff changeset
64 uint16_t comment_size;
b8cecdc0c67f Starting implementation of ASF network streaming.
bertrand
parents:
diff changeset
65 uint16_t rating_size;
b8cecdc0c67f Starting implementation of ASF network streaming.
bertrand
parents:
diff changeset
66 } ASF_content_description_t;
b8cecdc0c67f Starting implementation of ASF network streaming.
bertrand
parents:
diff changeset
67
b8cecdc0c67f Starting implementation of ASF network streaming.
bertrand
parents:
diff changeset
68 ////////////////////////
b8cecdc0c67f Starting implementation of ASF network streaming.
bertrand
parents:
diff changeset
69 // ASF Segment Header
b8cecdc0c67f Starting implementation of ASF network streaming.
bertrand
parents:
diff changeset
70 ////////////////////////
b8cecdc0c67f Starting implementation of ASF network streaming.
bertrand
parents:
diff changeset
71 typedef struct __attribute__((packed)) {
b8cecdc0c67f Starting implementation of ASF network streaming.
bertrand
parents:
diff changeset
72 uint8_t streamno;
b8cecdc0c67f Starting implementation of ASF network streaming.
bertrand
parents:
diff changeset
73 uint8_t seq;
b8cecdc0c67f Starting implementation of ASF network streaming.
bertrand
parents:
diff changeset
74 uint32_t x;
b8cecdc0c67f Starting implementation of ASF network streaming.
bertrand
parents:
diff changeset
75 uint8_t flag;
b8cecdc0c67f Starting implementation of ASF network streaming.
bertrand
parents:
diff changeset
76 } ASF_segmhdr_t;
b8cecdc0c67f Starting implementation of ASF network streaming.
bertrand
parents:
diff changeset
77
b8cecdc0c67f Starting implementation of ASF network streaming.
bertrand
parents:
diff changeset
78 //////////////////////
b8cecdc0c67f Starting implementation of ASF network streaming.
bertrand
parents:
diff changeset
79 // ASF Stream Chunck
b8cecdc0c67f Starting implementation of ASF network streaming.
bertrand
parents:
diff changeset
80 //////////////////////
b8cecdc0c67f Starting implementation of ASF network streaming.
bertrand
parents:
diff changeset
81 typedef struct __attribute__((packed)) {
b8cecdc0c67f Starting implementation of ASF network streaming.
bertrand
parents:
diff changeset
82 uint16_t type;
871
ab94c4cf96d8 Continue implementation of ASF streaming.
bertrand
parents: 833
diff changeset
83 uint16_t size;
833
b8cecdc0c67f Starting implementation of ASF network streaming.
bertrand
parents:
diff changeset
84 uint32_t sequence_number;
b8cecdc0c67f Starting implementation of ASF network streaming.
bertrand
parents:
diff changeset
85 uint16_t unknown;
871
ab94c4cf96d8 Continue implementation of ASF streaming.
bertrand
parents: 833
diff changeset
86 uint16_t size_confirm;
833
b8cecdc0c67f Starting implementation of ASF network streaming.
bertrand
parents:
diff changeset
87 } ASF_stream_chunck_t;
b8cecdc0c67f Starting implementation of ASF network streaming.
bertrand
parents:
diff changeset
88
5616
8cfce21c6013 Added big endian macro for asf_chunk_t and added defines for the ASF chunk type.
bertrand
parents: 4310
diff changeset
89 // Definition of the stream type
8cfce21c6013 Added big endian macro for asf_chunk_t and added defines for the ASF chunk type.
bertrand
parents: 4310
diff changeset
90 #ifdef WORDS_BIGENDIAN
8cfce21c6013 Added big endian macro for asf_chunk_t and added defines for the ASF chunk type.
bertrand
parents: 4310
diff changeset
91 #define ASF_STREAMING_CLEAR 0x2443 // $C
8cfce21c6013 Added big endian macro for asf_chunk_t and added defines for the ASF chunk type.
bertrand
parents: 4310
diff changeset
92 #define ASF_STREAMING_DATA 0x2444 // $D
8cfce21c6013 Added big endian macro for asf_chunk_t and added defines for the ASF chunk type.
bertrand
parents: 4310
diff changeset
93 #define ASF_STREAMING_END_TRANS 0x2445 // $E
8cfce21c6013 Added big endian macro for asf_chunk_t and added defines for the ASF chunk type.
bertrand
parents: 4310
diff changeset
94 #define ASF_STREAMING_HEADER 0x2448 // $H
8cfce21c6013 Added big endian macro for asf_chunk_t and added defines for the ASF chunk type.
bertrand
parents: 4310
diff changeset
95 #else
8cfce21c6013 Added big endian macro for asf_chunk_t and added defines for the ASF chunk type.
bertrand
parents: 4310
diff changeset
96 #define ASF_STREAMING_CLEAR 0x4324 // $C
8cfce21c6013 Added big endian macro for asf_chunk_t and added defines for the ASF chunk type.
bertrand
parents: 4310
diff changeset
97 #define ASF_STREAMING_DATA 0x4424 // $D
8cfce21c6013 Added big endian macro for asf_chunk_t and added defines for the ASF chunk type.
bertrand
parents: 4310
diff changeset
98 #define ASF_STREAMING_END_TRANS 0x4524 // $E
8cfce21c6013 Added big endian macro for asf_chunk_t and added defines for the ASF chunk type.
bertrand
parents: 4310
diff changeset
99 #define ASF_STREAMING_HEADER 0x4824 // $H
8cfce21c6013 Added big endian macro for asf_chunk_t and added defines for the ASF chunk type.
bertrand
parents: 4310
diff changeset
100 #endif
833
b8cecdc0c67f Starting implementation of ASF network streaming.
bertrand
parents:
diff changeset
101
b8cecdc0c67f Starting implementation of ASF network streaming.
bertrand
parents:
diff changeset
102 // Definition of the differents type of ASF streaming
b8cecdc0c67f Starting implementation of ASF network streaming.
bertrand
parents:
diff changeset
103 typedef enum {
b8cecdc0c67f Starting implementation of ASF network streaming.
bertrand
parents:
diff changeset
104 ASF_Unknown_e,
b8cecdc0c67f Starting implementation of ASF network streaming.
bertrand
parents:
diff changeset
105 ASF_Live_e,
b8cecdc0c67f Starting implementation of ASF network streaming.
bertrand
parents:
diff changeset
106 ASF_Prerecorded_e,
2489
0ecc1b4f7cf8 Added ASF http server streaming (Not mms streaming).
bertrand
parents: 2310
diff changeset
107 ASF_Redirector_e,
6676
a957cc0b89a4 Added ASF_Authenticate as an asf stream type.
bertrand
parents: 6644
diff changeset
108 ASF_PlainText_e,
a957cc0b89a4 Added ASF_Authenticate as an asf stream type.
bertrand
parents: 6644
diff changeset
109 ASF_Authenticate_e
833
b8cecdc0c67f Starting implementation of ASF network streaming.
bertrand
parents:
diff changeset
110 } ASF_StreamType_e;
b8cecdc0c67f Starting implementation of ASF network streaming.
bertrand
parents:
diff changeset
111
6644
f3153f8d4fbe Moved the asf_http_streaming_ctrl_t struct from asf_streaming.c
bertrand
parents: 5616
diff changeset
112 typedef struct {
f3153f8d4fbe Moved the asf_http_streaming_ctrl_t struct from asf_streaming.c
bertrand
parents: 5616
diff changeset
113 ASF_StreamType_e streaming_type;
f3153f8d4fbe Moved the asf_http_streaming_ctrl_t struct from asf_streaming.c
bertrand
parents: 5616
diff changeset
114 int request;
f3153f8d4fbe Moved the asf_http_streaming_ctrl_t struct from asf_streaming.c
bertrand
parents: 5616
diff changeset
115 int packet_size;
f3153f8d4fbe Moved the asf_http_streaming_ctrl_t struct from asf_streaming.c
bertrand
parents: 5616
diff changeset
116 int *audio_streams,n_audio,*video_streams,n_video;
f3153f8d4fbe Moved the asf_http_streaming_ctrl_t struct from asf_streaming.c
bertrand
parents: 5616
diff changeset
117 int audio_id, video_id;
f3153f8d4fbe Moved the asf_http_streaming_ctrl_t struct from asf_streaming.c
bertrand
parents: 5616
diff changeset
118 } asf_http_streaming_ctrl_t;
f3153f8d4fbe Moved the asf_http_streaming_ctrl_t struct from asf_streaming.c
bertrand
parents: 5616
diff changeset
119
904
11879db9d4cc Added some functions prototypes.
bertrand
parents: 871
diff changeset
120
1342
baf646413408 ASF support for non-x86 cpus
jkeil
parents: 1000
diff changeset
121 /*
baf646413408 ASF support for non-x86 cpus
jkeil
parents: 1000
diff changeset
122 * Some macros to swap little endian structures read from an ASF file
baf646413408 ASF support for non-x86 cpus
jkeil
parents: 1000
diff changeset
123 * into machine endian format
baf646413408 ASF support for non-x86 cpus
jkeil
parents: 1000
diff changeset
124 */
baf646413408 ASF support for non-x86 cpus
jkeil
parents: 1000
diff changeset
125 #ifdef WORDS_BIGENDIAN
baf646413408 ASF support for non-x86 cpus
jkeil
parents: 1000
diff changeset
126 #define le2me_ASF_obj_header_t(h) { \
baf646413408 ASF support for non-x86 cpus
jkeil
parents: 1000
diff changeset
127 (h)->size = le2me_64((h)->size); \
baf646413408 ASF support for non-x86 cpus
jkeil
parents: 1000
diff changeset
128 }
baf646413408 ASF support for non-x86 cpus
jkeil
parents: 1000
diff changeset
129 #define le2me_ASF_header_t(h) { \
baf646413408 ASF support for non-x86 cpus
jkeil
parents: 1000
diff changeset
130 le2me_ASF_obj_header_t(&(h)->objh); \
baf646413408 ASF support for non-x86 cpus
jkeil
parents: 1000
diff changeset
131 (h)->cno = le2me_32((h)->cno); \
baf646413408 ASF support for non-x86 cpus
jkeil
parents: 1000
diff changeset
132 }
baf646413408 ASF support for non-x86 cpus
jkeil
parents: 1000
diff changeset
133 #define le2me_ASF_stream_header_t(h) { \
baf646413408 ASF support for non-x86 cpus
jkeil
parents: 1000
diff changeset
134 (h)->unk1 = le2me_64((h)->unk1); \
baf646413408 ASF support for non-x86 cpus
jkeil
parents: 1000
diff changeset
135 (h)->type_size = le2me_32((h)->type_size); \
baf646413408 ASF support for non-x86 cpus
jkeil
parents: 1000
diff changeset
136 (h)->stream_size = le2me_32((h)->stream_size); \
baf646413408 ASF support for non-x86 cpus
jkeil
parents: 1000
diff changeset
137 (h)->stream_no = le2me_16((h)->stream_no); \
baf646413408 ASF support for non-x86 cpus
jkeil
parents: 1000
diff changeset
138 (h)->unk2 = le2me_32((h)->unk2); \
baf646413408 ASF support for non-x86 cpus
jkeil
parents: 1000
diff changeset
139 }
4288
b84e9861461c Changed the asf_file_header_t struct to read all the fields properly.
bertrand
parents: 3719
diff changeset
140 #define le2me_ASF_file_header_t(h) { \
b84e9861461c Changed the asf_file_header_t struct to read all the fields properly.
bertrand
parents: 3719
diff changeset
141 (h)->file_size = le2me_64((h)->file_size); \
b84e9861461c Changed the asf_file_header_t struct to read all the fields properly.
bertrand
parents: 3719
diff changeset
142 (h)->creation_time = le2me_64((h)->creation_time); \
b84e9861461c Changed the asf_file_header_t struct to read all the fields properly.
bertrand
parents: 3719
diff changeset
143 (h)->num_packets = le2me_64((h)->num_packets); \
b84e9861461c Changed the asf_file_header_t struct to read all the fields properly.
bertrand
parents: 3719
diff changeset
144 (h)->play_duration = le2me_64((h)->play_duration); \
b84e9861461c Changed the asf_file_header_t struct to read all the fields properly.
bertrand
parents: 3719
diff changeset
145 (h)->send_duration = le2me_64((h)->send_duration); \
b84e9861461c Changed the asf_file_header_t struct to read all the fields properly.
bertrand
parents: 3719
diff changeset
146 (h)->preroll = le2me_64((h)->preroll); \
b84e9861461c Changed the asf_file_header_t struct to read all the fields properly.
bertrand
parents: 3719
diff changeset
147 (h)->flags = le2me_32((h)->flags); \
b84e9861461c Changed the asf_file_header_t struct to read all the fields properly.
bertrand
parents: 3719
diff changeset
148 (h)->min_packet_size = le2me_32((h)->min_packet_size); \
b84e9861461c Changed the asf_file_header_t struct to read all the fields properly.
bertrand
parents: 3719
diff changeset
149 (h)->max_packet_size = le2me_32((h)->max_packet_size); \
b84e9861461c Changed the asf_file_header_t struct to read all the fields properly.
bertrand
parents: 3719
diff changeset
150 (h)->max_bitrate = le2me_32((h)->max_bitrate); \
b84e9861461c Changed the asf_file_header_t struct to read all the fields properly.
bertrand
parents: 3719
diff changeset
151 }
1342
baf646413408 ASF support for non-x86 cpus
jkeil
parents: 1000
diff changeset
152 #define le2me_ASF_content_description_t(h) { \
baf646413408 ASF support for non-x86 cpus
jkeil
parents: 1000
diff changeset
153 (h)->title_size = le2me_16((h)->title_size); \
baf646413408 ASF support for non-x86 cpus
jkeil
parents: 1000
diff changeset
154 (h)->author_size = le2me_16((h)->author_size); \
baf646413408 ASF support for non-x86 cpus
jkeil
parents: 1000
diff changeset
155 (h)->copyright_size = le2me_16((h)->copyright_size); \
baf646413408 ASF support for non-x86 cpus
jkeil
parents: 1000
diff changeset
156 (h)->comment_size = le2me_16((h)->comment_size); \
baf646413408 ASF support for non-x86 cpus
jkeil
parents: 1000
diff changeset
157 (h)->rating_size = le2me_16((h)->rating_size); \
baf646413408 ASF support for non-x86 cpus
jkeil
parents: 1000
diff changeset
158 }
1485
b895f95e7657 AVI demuxer cleanups, fileformat-dependent stuff moved to priv_t
arpi
parents: 1342
diff changeset
159 #define le2me_BITMAPINFOHEADER(h) { \
b895f95e7657 AVI demuxer cleanups, fileformat-dependent stuff moved to priv_t
arpi
parents: 1342
diff changeset
160 (h)->biSize = le2me_32((h)->biSize); \
b895f95e7657 AVI demuxer cleanups, fileformat-dependent stuff moved to priv_t
arpi
parents: 1342
diff changeset
161 (h)->biWidth = le2me_32((h)->biWidth); \
b895f95e7657 AVI demuxer cleanups, fileformat-dependent stuff moved to priv_t
arpi
parents: 1342
diff changeset
162 (h)->biHeight = le2me_32((h)->biHeight); \
b895f95e7657 AVI demuxer cleanups, fileformat-dependent stuff moved to priv_t
arpi
parents: 1342
diff changeset
163 (h)->biPlanes = le2me_16((h)->biPlanes); \
b895f95e7657 AVI demuxer cleanups, fileformat-dependent stuff moved to priv_t
arpi
parents: 1342
diff changeset
164 (h)->biBitCount = le2me_16((h)->biBitCount); \
b895f95e7657 AVI demuxer cleanups, fileformat-dependent stuff moved to priv_t
arpi
parents: 1342
diff changeset
165 (h)->biCompression = le2me_32((h)->biCompression); \
b895f95e7657 AVI demuxer cleanups, fileformat-dependent stuff moved to priv_t
arpi
parents: 1342
diff changeset
166 (h)->biSizeImage = le2me_32((h)->biSizeImage); \
b895f95e7657 AVI demuxer cleanups, fileformat-dependent stuff moved to priv_t
arpi
parents: 1342
diff changeset
167 (h)->biXPelsPerMeter = le2me_32((h)->biXPelsPerMeter); \
b895f95e7657 AVI demuxer cleanups, fileformat-dependent stuff moved to priv_t
arpi
parents: 1342
diff changeset
168 (h)->biYPelsPerMeter = le2me_32((h)->biYPelsPerMeter); \
b895f95e7657 AVI demuxer cleanups, fileformat-dependent stuff moved to priv_t
arpi
parents: 1342
diff changeset
169 (h)->biClrUsed = le2me_32((h)->biClrUsed); \
b895f95e7657 AVI demuxer cleanups, fileformat-dependent stuff moved to priv_t
arpi
parents: 1342
diff changeset
170 (h)->biClrImportant = le2me_32((h)->biClrImportant); \
b895f95e7657 AVI demuxer cleanups, fileformat-dependent stuff moved to priv_t
arpi
parents: 1342
diff changeset
171 }
b895f95e7657 AVI demuxer cleanups, fileformat-dependent stuff moved to priv_t
arpi
parents: 1342
diff changeset
172 #define le2me_WAVEFORMATEX(h) { \
b895f95e7657 AVI demuxer cleanups, fileformat-dependent stuff moved to priv_t
arpi
parents: 1342
diff changeset
173 (h)->wFormatTag = le2me_16((h)->wFormatTag); \
b895f95e7657 AVI demuxer cleanups, fileformat-dependent stuff moved to priv_t
arpi
parents: 1342
diff changeset
174 (h)->nChannels = le2me_16((h)->nChannels); \
b895f95e7657 AVI demuxer cleanups, fileformat-dependent stuff moved to priv_t
arpi
parents: 1342
diff changeset
175 (h)->nSamplesPerSec = le2me_32((h)->nSamplesPerSec); \
b895f95e7657 AVI demuxer cleanups, fileformat-dependent stuff moved to priv_t
arpi
parents: 1342
diff changeset
176 (h)->nAvgBytesPerSec = le2me_32((h)->nAvgBytesPerSec); \
b895f95e7657 AVI demuxer cleanups, fileformat-dependent stuff moved to priv_t
arpi
parents: 1342
diff changeset
177 (h)->nBlockAlign = le2me_16((h)->nBlockAlign); \
b895f95e7657 AVI demuxer cleanups, fileformat-dependent stuff moved to priv_t
arpi
parents: 1342
diff changeset
178 (h)->wBitsPerSample = le2me_16((h)->wBitsPerSample); \
b895f95e7657 AVI demuxer cleanups, fileformat-dependent stuff moved to priv_t
arpi
parents: 1342
diff changeset
179 (h)->cbSize = le2me_16((h)->cbSize); \
b895f95e7657 AVI demuxer cleanups, fileformat-dependent stuff moved to priv_t
arpi
parents: 1342
diff changeset
180 }
5616
8cfce21c6013 Added big endian macro for asf_chunk_t and added defines for the ASF chunk type.
bertrand
parents: 4310
diff changeset
181 #define le2me_ASF_stream_chunck_t(h) { \
8cfce21c6013 Added big endian macro for asf_chunk_t and added defines for the ASF chunk type.
bertrand
parents: 4310
diff changeset
182 (h)->size = le2me_16((h)->size); \
8cfce21c6013 Added big endian macro for asf_chunk_t and added defines for the ASF chunk type.
bertrand
parents: 4310
diff changeset
183 (h)->sequence_number = le2me_32((h)->sequence_number); \
8cfce21c6013 Added big endian macro for asf_chunk_t and added defines for the ASF chunk type.
bertrand
parents: 4310
diff changeset
184 (h)->unknown = le2me_16((h)->unknown); \
8cfce21c6013 Added big endian macro for asf_chunk_t and added defines for the ASF chunk type.
bertrand
parents: 4310
diff changeset
185 (h)->size_confirm = le2me_16((h)->size_confirm); \
8cfce21c6013 Added big endian macro for asf_chunk_t and added defines for the ASF chunk type.
bertrand
parents: 4310
diff changeset
186 }
1342
baf646413408 ASF support for non-x86 cpus
jkeil
parents: 1000
diff changeset
187 #else
baf646413408 ASF support for non-x86 cpus
jkeil
parents: 1000
diff changeset
188 #define le2me_ASF_obj_header_t(h) /**/
baf646413408 ASF support for non-x86 cpus
jkeil
parents: 1000
diff changeset
189 #define le2me_ASF_header_t(h) /**/
baf646413408 ASF support for non-x86 cpus
jkeil
parents: 1000
diff changeset
190 #define le2me_ASF_stream_header_t(h) /**/
baf646413408 ASF support for non-x86 cpus
jkeil
parents: 1000
diff changeset
191 #define le2me_ASF_file_header_t(h) /**/
baf646413408 ASF support for non-x86 cpus
jkeil
parents: 1000
diff changeset
192 #define le2me_ASF_content_description_t(h) /**/
1485
b895f95e7657 AVI demuxer cleanups, fileformat-dependent stuff moved to priv_t
arpi
parents: 1342
diff changeset
193 #define le2me_BITMAPINFOHEADER(h) /**/
b895f95e7657 AVI demuxer cleanups, fileformat-dependent stuff moved to priv_t
arpi
parents: 1342
diff changeset
194 #define le2me_WAVEFORMATEX(h) /**/
5616
8cfce21c6013 Added big endian macro for asf_chunk_t and added defines for the ASF chunk type.
bertrand
parents: 4310
diff changeset
195 #define le2me_ASF_stream_chunck_t(h) /**/
1342
baf646413408 ASF support for non-x86 cpus
jkeil
parents: 1000
diff changeset
196 #endif
baf646413408 ASF support for non-x86 cpus
jkeil
parents: 1000
diff changeset
197
17992
2545bbd91450 Move global vars used for header parsing, etc to dewux->priv as it should
albeu
parents: 8957
diff changeset
198 // priv struct for the demuxer
2545bbd91450 Move global vars used for header parsing, etc to dewux->priv as it should
albeu
parents: 8957
diff changeset
199 struct asf_priv {
2545bbd91450 Move global vars used for header parsing, etc to dewux->priv as it should
albeu
parents: 8957
diff changeset
200 ASF_header_t header;
2545bbd91450 Move global vars used for header parsing, etc to dewux->priv as it should
albeu
parents: 8957
diff changeset
201 unsigned char* packet;
18001
a2683ee7cb5a fix descrambling of asf file,
iive
parents: 17992
diff changeset
202 int scrambling_h;
a2683ee7cb5a fix descrambling of asf file,
iive
parents: 17992
diff changeset
203 int scrambling_w;
a2683ee7cb5a fix descrambling of asf file,
iive
parents: 17992
diff changeset
204 int scrambling_b;
17992
2545bbd91450 Move global vars used for header parsing, etc to dewux->priv as it should
albeu
parents: 8957
diff changeset
205 unsigned packetsize;
2545bbd91450 Move global vars used for header parsing, etc to dewux->priv as it should
albeu
parents: 8957
diff changeset
206 double packetrate;
2545bbd91450 Move global vars used for header parsing, etc to dewux->priv as it should
albeu
parents: 8957
diff changeset
207 unsigned movielength;
18609
bb7042d74855 Patch from John Donaghy: "fix for audio and video in dvr-ms asf files"
pacman
parents: 18001
diff changeset
208 int asf_is_dvr_ms;
bb7042d74855 Patch from John Donaghy: "fix for audio and video in dvr-ms asf files"
pacman
parents: 18001
diff changeset
209 uint32_t asf_frame_state;
bb7042d74855 Patch from John Donaghy: "fix for audio and video in dvr-ms asf files"
pacman
parents: 18001
diff changeset
210 int asf_frame_start_found;
19961
9f011e6892e8 interpolate real fps of dvr-ms files using the extended stream properties.
nicodvb
parents: 18609
diff changeset
211 double dvr_last_vid_pts;
23239
cc01eab9f3a9 For DVR-MS:
nicodvb
parents: 22378
diff changeset
212 uint64_t vid_frame_ct;
cc01eab9f3a9 For DVR-MS:
nicodvb
parents: 22378
diff changeset
213 uint64_t play_duration;
cc01eab9f3a9 For DVR-MS:
nicodvb
parents: 22378
diff changeset
214 uint64_t num_packets;
cc01eab9f3a9 For DVR-MS:
nicodvb
parents: 22378
diff changeset
215 int new_vid_frame_seg;
cc01eab9f3a9 For DVR-MS:
nicodvb
parents: 22378
diff changeset
216 int *vid_repdata_sizes;
cc01eab9f3a9 For DVR-MS:
nicodvb
parents: 22378
diff changeset
217 int *aud_repdata_sizes;
cc01eab9f3a9 For DVR-MS:
nicodvb
parents: 22378
diff changeset
218 int vid_repdata_count;
cc01eab9f3a9 For DVR-MS:
nicodvb
parents: 22378
diff changeset
219 int aud_repdata_count;
cc01eab9f3a9 For DVR-MS:
nicodvb
parents: 22378
diff changeset
220 uint64_t avg_vid_frame_time;
cc01eab9f3a9 For DVR-MS:
nicodvb
parents: 22378
diff changeset
221 uint64_t last_key_payload_time;
cc01eab9f3a9 For DVR-MS:
nicodvb
parents: 22378
diff changeset
222 uint64_t last_aud_pts;
cc01eab9f3a9 For DVR-MS:
nicodvb
parents: 22378
diff changeset
223 uint64_t last_aud_diff;
cc01eab9f3a9 For DVR-MS:
nicodvb
parents: 22378
diff changeset
224 int found_first_key_frame;
cc01eab9f3a9 For DVR-MS:
nicodvb
parents: 22378
diff changeset
225 uint32_t last_vid_seq;
cc01eab9f3a9 For DVR-MS:
nicodvb
parents: 22378
diff changeset
226 int vid_ext_timing_index;
cc01eab9f3a9 For DVR-MS:
nicodvb
parents: 22378
diff changeset
227 int aud_ext_timing_index;
cc01eab9f3a9 For DVR-MS:
nicodvb
parents: 22378
diff changeset
228 int vid_ext_frame_index;
cc01eab9f3a9 For DVR-MS:
nicodvb
parents: 22378
diff changeset
229 int know_frame_time;
23357
ab5ff1c5ccaa Set i_bps for ASF video streams according to extended stream properties
zuxy
parents: 23239
diff changeset
230 unsigned bps;
17992
2545bbd91450 Move global vars used for header parsing, etc to dewux->priv as it should
albeu
parents: 8957
diff changeset
231 };
2545bbd91450 Move global vars used for header parsing, etc to dewux->priv as it should
albeu
parents: 8957
diff changeset
232
26029
4129c8cfa742 Add MPLAYER_ prefix to multiple inclusion guards.
diego
parents: 25535
diff changeset
233 #endif /* MPLAYER_ASF_H */