1 #ifndef DEMUX_H 2 #define DEMUX_H 3 4 #ifdef _WIN32 5 #include "stdint_win.h" 6 #else 7 #include <stdint.h> 8 #endif 9 10 #include "stream.h" 11 12 typedef uint32_t fourcc_t; 13 14 typedef struct 15 { 16 int format_read; 17 18 uint16_t num_channels; 19 uint16_t sample_size; 20 uint32_t sample_rate; 21 fourcc_t format; 22 void *buf; 23 24 struct { 25 uint32_t sample_count; 26 uint32_t sample_duration; 27 } *time_to_sample; 28 uint32_t num_time_to_samples; 29 30 uint32_t *sample_byte_size; 31 uint32_t num_sample_byte_sizes; 32 33 uint32_t codecdata_len; 34 char codecdata[64]; 35 36 uint32_t mdat_len; 37 #if 0 38 void *mdat; 39 #endif 40 } demux_res_t; 41 42 int qtmovie_read(stream_t *stream, demux_res_t *demux_res); 43 44 #ifndef MAKEFOURCC 45 #define MAKEFOURCC(ch0, ch1, ch2, ch3) ( \ 46 ( (int32_t)(char)(ch0) << 24 ) | \ 47 ( (int32_t)(char)(ch1) << 16 ) | \ 48 ( (int32_t)(char)(ch2) << 8 ) | \ 49 ( (int32_t)(char)(ch3) ) ) 50 #endif 51 52 #ifndef SLPITFOURCC 53 /* splits it into ch0, ch1, ch2, ch3 - use for printf's */ 54 #define SPLITFOURCC(code) \ 55 (char)((int32_t)code >> 24), \ 56 (char)((int32_t)code >> 16), \ 57 (char)((int32_t)code >> 8), \ 58 (char)code 59 #endif 60 61 void qtmovie_free_demux (demux_res_t *demux_res); 62 63 #endif /* DEMUX_H */ 64 65