1 #ifndef LIBRARIES_MPEGA_H 2 #define LIBRARIES_MPEGA_H 3 4 /* 5 mpega.library include 6 7 Copyright © 2007 The MorphOS Development Team, All Rights Reserved. 8 */ 9 10 #ifndef EXEC_TYPES_H 11 # include <exec/types.h> 12 #endif 13 14 #ifndef UTILITY_HOOKS_H 15 # include <utility/hooks.h> 16 #endif 17 18 #pragma pack(2) 19 20 21 #define MPEGA_VERSION 2 22 23 #define MPEGA_QUALITY_LOW 0 24 #define MPEGA_QUALITY_MEDIUM 1 25 #define MPEGA_QUALITY_HIGH 2 26 27 #define MPEGA_BSFUNC_OPEN 0 28 #define MPEGA_BSFUNC_CLOSE 1 29 #define MPEGA_BSFUNC_READ 2 30 #define MPEGA_BSFUNC_SEEK 3 31 32 #define MPEGA_MODE_STEREO 0 33 #define MPEGA_MODE_J_STEREO 1 34 #define MPEGA_MODE_DUAL 2 35 #define MPEGA_MODE_MONO 3 36 37 #define MPEGA_MAX_CHANNELS 2 38 39 #define MPEGA_PCM_SIZE 1152 40 41 42 typedef struct 43 { 44 LONG func; 45 46 union 47 { 48 struct 49 { 50 char *stream_name; 51 LONG buffer_size; 52 LONG stream_size; 53 } open; 54 55 struct 56 { 57 void *buffer; 58 LONG num_bytes; 59 } read; 60 61 struct 62 { 63 LONG abs_byte_seek_pos; 64 } seek; 65 } data; 66 } MPEGA_ACCESS; 67 68 typedef struct 69 { 70 WORD freq_div; 71 WORD quality; 72 LONG freq_max; 73 } MPEGA_OUTPUT; 74 75 typedef struct 76 { 77 WORD force_mono; 78 MPEGA_OUTPUT mono; 79 MPEGA_OUTPUT stereo; 80 } MPEGA_LAYER; 81 82 typedef struct 83 { 84 struct Hook *bs_access; 85 MPEGA_LAYER layer_1_2; 86 MPEGA_LAYER layer_3; 87 WORD check_mpeg; 88 LONG stream_buffer_size; 89 } MPEGA_CTRL; 90 91 typedef struct 92 { 93 WORD norm; 94 WORD layer; 95 WORD mode; 96 WORD bitrate; 97 LONG frequency; 98 WORD channels; 99 ULONG ms_duration; 100 WORD private_bit; 101 WORD copyright; 102 WORD original; 103 WORD dec_channels; 104 WORD dec_quality; 105 LONG dec_frequency; 106 void *handle; 107 } MPEGA_STREAM; 108 109 110 #define MPEGA_ERR_BASE 0 111 #define MPEGA_ERR_NONE (MPEGA_ERR_BASE) 112 #define MPEGA_ERR_EOF (MPEGA_ERR_BASE-1) 113 #define MPEGA_ERR_BADFRAME (MPEGA_ERR_BASE-2) 114 #define MPEGA_ERR_MEM (MPEGA_ERR_BASE-3) 115 #define MPEGA_ERR_NO_SYNC (MPEGA_ERR_BASE-4) 116 #define MPEGA_ERR_BADVALUE (MPEGA_ERR_BASE-5) 117 118 119 #pragma pack() 120 121 #endif /* LIBRARIES_MPEGA_H */