00001 #ifndef LIBMPEG3_H
00002 #define LIBMPEG3_H
00003
00004 #ifdef __cplusplus
00005 extern "C" {
00006 #endif
00007
00008
00009 #include "mpeg3private.h"
00010
00011
00012
00013 #define MPEG3_RGB565 2
00014 #define MPEG3_BGR888 0
00015 #define MPEG3_BGRA8888 1
00016 #define MPEG3_RGB888 3
00017 #define MPEG3_RGBA8888 4
00018 #define MPEG3_RGBA16161616 5
00019
00020
00021
00022 #define MPEG3_601_RGB565 11
00023 #define MPEG3_601_BGR888 7
00024 #define MPEG3_601_BGRA8888 8
00025 #define MPEG3_601_RGB888 9
00026 #define MPEG3_601_RGBA8888 10
00027
00028
00029 #define MPEG3_YUV420P 12
00030 #define MPEG3_YUV422P 13
00031
00032
00033
00034 #define MPEG3_UNDEFINED_ERROR 1
00035 #define MPEG3_INVALID_TOC_VERSION 2
00036 #define MPEG3_TOC_DATE_MISMATCH 3
00037
00038
00039 int mpeg3_major();
00040 int mpeg3_minor();
00041 int mpeg3_release();
00042
00043
00044
00045 int mpeg3_check_sig(char *path);
00046
00047
00048
00049 mpeg3_t* mpeg3_open(char *path, int *error_return);
00050
00051
00052
00053
00054 mpeg3_t* mpeg3_open_copy(char *path, mpeg3_t *old_file, int *error_return);
00055 int mpeg3_close(mpeg3_t *file);
00056
00057
00058
00059
00060
00061 int mpeg3_set_cpus(mpeg3_t *file, int cpus);
00062
00063
00064 int mpeg3_has_audio(mpeg3_t *file);
00065 int mpeg3_total_astreams(mpeg3_t *file);
00066 int mpeg3_audio_channels(mpeg3_t *file, int stream);
00067 int mpeg3_sample_rate(mpeg3_t *file, int stream);
00068 char* mpeg3_audio_format(mpeg3_t *file, int stream);
00069
00070
00071
00072 long mpeg3_audio_samples(mpeg3_t *file, int stream);
00073 int mpeg3_set_sample(mpeg3_t *file, long sample, int stream);
00074 long mpeg3_get_sample(mpeg3_t *file, int stream);
00075
00076
00077
00078
00079
00080 int mpeg3_read_audio(mpeg3_t *file,
00081 float *output_f,
00082 short *output_i,
00083 int channel,
00084 long samples,
00085 int stream);
00086
00087
00088 int mpeg3_reread_audio(mpeg3_t *file,
00089 float *output_f,
00090 short *output_i,
00091 int channel,
00092 long samples,
00093 int stream);
00094
00095
00096
00097
00098 int mpeg3_read_audio_chunk(mpeg3_t *file,
00099 unsigned char *output,
00100 long *size,
00101 long max_size,
00102 int stream);
00103
00104
00105 int mpeg3_has_video(mpeg3_t *file);
00106 int mpeg3_total_vstreams(mpeg3_t *file);
00107 int mpeg3_video_width(mpeg3_t *file, int stream);
00108 int mpeg3_video_height(mpeg3_t *file, int stream);
00109 float mpeg3_aspect_ratio(mpeg3_t *file, int stream);
00110 double mpeg3_frame_rate(mpeg3_t *file, int stream);
00111
00112
00113
00114
00115 long mpeg3_video_frames(mpeg3_t *file, int stream);
00116 int mpeg3_set_frame(mpeg3_t *file, long frame, int stream);
00117 int mpeg3_skip_frames();
00118 long mpeg3_get_frame(mpeg3_t *file, int stream);
00119
00120
00121 int64_t mpeg3_get_bytes(mpeg3_t *file);
00122
00123
00124
00125
00126 int mpeg3_seek_byte(mpeg3_t *file, int64_t byte);
00127 int64_t mpeg3_tell_byte(mpeg3_t *file);
00128
00129
00130
00131
00132
00133
00134
00135
00136
00137
00138
00139 int mpeg3_previous_frame(mpeg3_t *file, int stream);
00140 int mpeg3_end_of_audio(mpeg3_t *file, int stream);
00141 int mpeg3_end_of_video(mpeg3_t *file, int stream);
00142
00143
00144 double mpeg3_get_time(mpeg3_t *file);
00145
00146
00147
00148
00149
00150 int mpeg3_read_frame(mpeg3_t *file,
00151 unsigned char **output_rows,
00152 int in_x,
00153 int in_y,
00154 int in_w,
00155 int in_h,
00156 int out_w,
00157 int out_h,
00158 int color_model,
00159 int stream);
00160
00161
00162 int mpeg3_colormodel(mpeg3_t *file, int stream);
00163
00164 int mpeg3_set_rowspan(mpeg3_t *file, int bytes, int stream);
00165
00166
00167
00168
00169
00170 int mpeg3_read_yuvframe(mpeg3_t *file,
00171 char *y_output,
00172 char *u_output,
00173 char *v_output,
00174 int in_x,
00175 int in_y,
00176 int in_w,
00177 int in_h,
00178 int stream);
00179
00180
00181
00182
00183 int mpeg3_read_yuvframe_ptr(mpeg3_t *file,
00184 char **y_output,
00185 char **u_output,
00186 char **v_output,
00187 int stream);
00188
00189
00190 int mpeg3_drop_frames(mpeg3_t *file, long frames, int stream);
00191
00192
00193
00194
00195 int mpeg3_read_video_chunk(mpeg3_t *file,
00196 unsigned char *output,
00197 long *size,
00198 long max_size,
00199 int stream);
00200
00201
00202 int mpeg3_total_programs();
00203 int mpeg3_set_program(int program);
00204
00205
00206 int64_t mpeg3_memory_usage(mpeg3_t *file);
00207
00208
00209
00210
00211
00212
00213
00214
00215
00216 int mpeg3_subtitle_tracks(mpeg3_t *file);
00217
00218
00219
00220
00221 void mpeg3_show_subtitle(mpeg3_t *file, int track);
00222
00223
00224
00225
00226
00227
00228
00229
00230
00231
00232 mpeg3_t* mpeg3_start_toc(char *path, char *toc_path, int64_t *total_bytes);
00233
00234 void mpeg3_set_index_bytes(mpeg3_t *file, int64_t bytes);
00235
00236 int mpeg3_do_toc(mpeg3_t *file, int64_t *bytes_processed);
00237
00238 void mpeg3_stop_toc(mpeg3_t *file);
00239
00240
00241
00242 int64_t mpeg3_get_source_date(mpeg3_t *file);
00243
00244 int64_t mpeg3_calculate_source_date(char *path);
00245
00246
00247
00248
00249
00250
00251
00252
00253 int mpeg3_index_tracks(mpeg3_t *file);
00254
00255 int mpeg3_index_channels(mpeg3_t *file, int track);
00256
00257 int mpeg3_index_zoom(mpeg3_t *file);
00258
00259 int mpeg3_index_size(mpeg3_t *file, int track);
00260
00261 float* mpeg3_index_data(mpeg3_t *file, int track, int channel);
00262
00263 int mpeg3_has_toc(mpeg3_t *file);
00264
00265 char* mpeg3_title_path(mpeg3_t *file, int number);
00266
00267
00268 #ifdef __cplusplus
00269 }
00270 #endif
00271
00272 #endif