00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020 #ifndef LIBMPEG3_H
00021 #define LIBMPEG3_H
00022
00023 #include "mpeg3private.h"
00024
00025 #if defined(__cplusplus)
00026 extern "C" {
00027 #endif
00028
00029
00030 #define MPEG3_RGB565 2
00031 #define MPEG3_BGR888 0
00032 #define MPEG3_BGRA8888 1
00033 #define MPEG3_RGB888 3
00034 #define MPEG3_RGBA8888 4
00035 #define MPEG3_RGBA16161616 5
00036
00037
00038
00039 #define MPEG3_601_RGB565 11
00040 #define MPEG3_601_BGR888 7
00041 #define MPEG3_601_BGRA8888 8
00042 #define MPEG3_601_RGB888 9
00043 #define MPEG3_601_RGBA8888 10
00044
00045
00046 LIBMPEG_EXPORT int mpeg3_check_sig(char *path);
00047
00048
00049 LIBMPEG_EXPORT mpeg3_t* mpeg3_open(char *path);
00050
00051
00052
00053 LIBMPEG_EXPORT mpeg3_t* mpeg3_open_copy(char *path, mpeg3_t *old_file);
00054 LIBMPEG_EXPORT int mpeg3_close(mpeg3_t *file);
00055
00056
00057 LIBMPEG_EXPORT int mpeg3_set_cpus(mpeg3_t *file, int cpus);
00058 LIBMPEG_EXPORT int mpeg3_set_mmx(mpeg3_t *file, int use_mmx);
00059
00060
00061 LIBMPEG_EXPORT int mpeg3_has_audio(mpeg3_t *file);
00062 LIBMPEG_EXPORT int mpeg3_total_astreams(mpeg3_t *file);
00063 LIBMPEG_EXPORT int mpeg3_audio_channels(mpeg3_t *file, int stream);
00064 LIBMPEG_EXPORT int mpeg3_sample_rate(mpeg3_t *file, int stream);
00065
00066
00067
00068 LIBMPEG_EXPORT long mpeg3_audio_samples(mpeg3_t *file, int stream);
00069 LIBMPEG_EXPORT int mpeg3_set_sample(mpeg3_t *file, long sample, int stream);
00070 LIBMPEG_EXPORT long mpeg3_get_sample(mpeg3_t *file, int stream);
00071
00072
00073
00074
00075 LIBMPEG_EXPORT int mpeg3_read_audio(mpeg3_t *file,
00076 mpeg3_real_t *output_f,
00077 short *output_i,
00078 int sampleSpacing,
00079 int channel,
00080 long samples,
00081 int stream);
00082
00083
00084 LIBMPEG_EXPORT int mpeg3_reread_audio(mpeg3_t *file,
00085 mpeg3_real_t *output_f,
00086 short *output_i,
00087 int sampleSpacing,
00088 int channel,
00089 long samples,
00090 int stream);
00091
00092
00093
00094
00095 LIBMPEG_EXPORT int mpeg3_read_audio_chunk(mpeg3_t *file,
00096 unsigned char *output,
00097 long *size,
00098 long max_size,
00099 int stream);
00100
00101
00102 LIBMPEG_EXPORT int mpeg3_has_video(mpeg3_t *file);
00103 LIBMPEG_EXPORT int mpeg3_total_vstreams(mpeg3_t *file);
00104 LIBMPEG_EXPORT int mpeg3_video_width(mpeg3_t *file, int stream);
00105 LIBMPEG_EXPORT int mpeg3_video_height(mpeg3_t *file, int stream);
00106 LIBMPEG_EXPORT float mpeg3_frame_rate(mpeg3_t *file, int stream);
00107
00108
00109
00110 LIBMPEG_EXPORT long mpeg3_video_frames(mpeg3_t *file, int stream);
00111 LIBMPEG_EXPORT int mpeg3_set_frame(mpeg3_t *file, long frame, int stream);
00112 LIBMPEG_EXPORT int mpeg3_skip_frames();
00113 LIBMPEG_EXPORT long mpeg3_get_frame(mpeg3_t *file, int stream);
00114
00115
00116
00117
00118
00119
00120 LIBMPEG_EXPORT int mpeg3_seek_percentage(mpeg3_t *file, double percentage);
00121 LIBMPEG_EXPORT double mpeg3_tell_percentage(mpeg3_t *file);
00122 LIBMPEG_EXPORT int mpeg3_previous_frame(mpeg3_t *file, int stream);
00123 LIBMPEG_EXPORT int mpeg3_end_of_audio(mpeg3_t *file, int stream);
00124 LIBMPEG_EXPORT int mpeg3_end_of_video(mpeg3_t *file, int stream);
00125
00126
00127 LIBMPEG_EXPORT double mpeg3_get_time(mpeg3_t *file);
00128
00129
00130
00131
00132
00133 LIBMPEG_EXPORT int mpeg3_read_frame(mpeg3_t *file,
00134 unsigned char **output_rows,
00135 int in_x,
00136 int in_y,
00137 int in_w,
00138 int in_h,
00139 int out_w,
00140 int out_h,
00141 int color_model,
00142 int stream);
00143
00144
00145
00146 LIBMPEG_EXPORT int mpeg3_read_yuvframe(mpeg3_t *file,
00147 char *y_output,
00148 char *u_output,
00149 char *v_output,
00150 int in_x,
00151 int in_y,
00152 int in_w,
00153 int in_h,
00154 int stream);
00155
00156 LIBMPEG_EXPORT int mpeg3_drop_frames(mpeg3_t *file, long frames, int stream);
00157
00158
00159
00160
00161 LIBMPEG_EXPORT int mpeg3_read_video_chunk(mpeg3_t *file,
00162 unsigned char *output,
00163 long *size,
00164 long max_size,
00165 int stream);
00166
00167
00168 LIBMPEG_EXPORT int mpeg3_total_programs();
00169 LIBMPEG_EXPORT int mpeg3_set_program(int program);
00170
00171 #if defined(__cplusplus)
00172 }
00173 #endif
00174
00175 #endif