Diffstat (limited to 'core/multimedia/opieplayer/libmpeg3/libmpeg3.h') (more/less context) (show whitespace changes)
-rw-r--r-- | core/multimedia/opieplayer/libmpeg3/libmpeg3.h | 175 |
1 files changed, 175 insertions, 0 deletions
diff --git a/core/multimedia/opieplayer/libmpeg3/libmpeg3.h b/core/multimedia/opieplayer/libmpeg3/libmpeg3.h new file mode 100644 index 0000000..f4eced4 --- a/dev/null +++ b/core/multimedia/opieplayer/libmpeg3/libmpeg3.h | |||
@@ -0,0 +1,175 @@ | |||
1 | /********************************************************************** | ||
2 | ** Copyright (C) 2000 Trolltech AS. All rights reserved. | ||
3 | ** | ||
4 | ** This file is part of Qtopia Environment. | ||
5 | ** | ||
6 | ** This file may be distributed and/or modified under the terms of the | ||
7 | ** GNU General Public License version 2 as published by the Free Software | ||
8 | ** Foundation and appearing in the file LICENSE.GPL included in the | ||
9 | ** packaging of this file. | ||
10 | ** | ||
11 | ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE | ||
12 | ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. | ||
13 | ** | ||
14 | ** See http://www.trolltech.com/gpl/ for GPL licensing information. | ||
15 | ** | ||
16 | ** Contact info@trolltech.com if any conditions of this licensing are | ||
17 | ** not clear to you. | ||
18 | ** | ||
19 | **********************************************************************/ | ||
20 | #ifndef LIBMPEG3_H | ||
21 | #define LIBMPEG3_H | ||
22 | |||
23 | #include "mpeg3private.h" | ||
24 | |||
25 | #if defined(__cplusplus) | ||
26 | extern "C" { | ||
27 | #endif | ||
28 | |||
29 | /* Supported color models for mpeg3_read_frame */ | ||
30 | #define MPEG3_RGB565 2 | ||
31 | #define MPEG3_BGR888 0 | ||
32 | #define MPEG3_BGRA8888 1 | ||
33 | #define MPEG3_RGB888 3 | ||
34 | #define MPEG3_RGBA8888 4 | ||
35 | #define MPEG3_RGBA16161616 5 | ||
36 | |||
37 | /* Color models for the 601 to RGB conversion */ | ||
38 | /* 601 not implemented for scalar code */ | ||
39 | #define MPEG3_601_RGB565 11 | ||
40 | #define MPEG3_601_BGR888 7 | ||
41 | #define MPEG3_601_BGRA8888 8 | ||
42 | #define MPEG3_601_RGB888 9 | ||
43 | #define MPEG3_601_RGBA8888 10 | ||
44 | |||
45 | /* Check for file compatibility. Return 1 if compatible. */ | ||
46 | LIBMPEG_EXPORT int mpeg3_check_sig(char *path); | ||
47 | |||
48 | /* Open the MPEG3 stream. */ | ||
49 | LIBMPEG_EXPORT mpeg3_t* mpeg3_open(char *path); | ||
50 | |||
51 | /* Open the MPEG3 stream and copy the tables from an already open stream. */ | ||
52 | /* Eliminates the initial timecode search. */ | ||
53 | LIBMPEG_EXPORT mpeg3_t* mpeg3_open_copy(char *path, mpeg3_t *old_file); | ||
54 | LIBMPEG_EXPORT int mpeg3_close(mpeg3_t *file); | ||
55 | |||
56 | /* Performance */ | ||
57 | LIBMPEG_EXPORT int mpeg3_set_cpus(mpeg3_t *file, int cpus); | ||
58 | LIBMPEG_EXPORT int mpeg3_set_mmx(mpeg3_t *file, int use_mmx); | ||
59 | |||
60 | /* Query the MPEG3 stream about audio. */ | ||
61 | LIBMPEG_EXPORT int mpeg3_has_audio(mpeg3_t *file); | ||
62 | LIBMPEG_EXPORT int mpeg3_total_astreams(mpeg3_t *file); /* Number of multiplexed audio streams */ | ||
63 | LIBMPEG_EXPORT int mpeg3_audio_channels(mpeg3_t *file, int stream); | ||
64 | LIBMPEG_EXPORT int mpeg3_sample_rate(mpeg3_t *file, int stream); | ||
65 | |||
66 | /* Total length obtained from the timecode. */ | ||
67 | /* For DVD files, this is unreliable. */ | ||
68 | LIBMPEG_EXPORT long mpeg3_audio_samples(mpeg3_t *file, int stream); | ||
69 | LIBMPEG_EXPORT int mpeg3_set_sample(mpeg3_t *file, long sample, int stream); /* Seek to a sample */ | ||
70 | LIBMPEG_EXPORT long mpeg3_get_sample(mpeg3_t *file, int stream); /* Tell current position */ | ||
71 | |||
72 | /* Read a PCM buffer of audio from 1 channel and advance the position. */ | ||
73 | /* Return a 1 if error. */ | ||
74 | /* Stream defines the number of the multiplexed stream to read. */ | ||
75 | LIBMPEG_EXPORT int mpeg3_read_audio(mpeg3_t *file, | ||
76 | mpeg3_real_t *output_f, /* Pointer to pre-allocated buffer of floats */ | ||
77 | short *output_i, /* Pointer to pre-allocated buffer of int16's */ | ||
78 | int sampleSpacing, // how many bytes to skip over inbetween samples | ||
79 | int channel, /* Channel to decode */ | ||
80 | long samples, /* Number of samples to decode */ | ||
81 | int stream); /* Stream containing the channel */ | ||
82 | |||
83 | /* Reread the last PCM buffer from a different channel and advance the position */ | ||
84 | LIBMPEG_EXPORT int mpeg3_reread_audio(mpeg3_t *file, | ||
85 | mpeg3_real_t *output_f, /* Pointer to pre-allocated buffer of floats */ | ||
86 | short *output_i, /* Pointer to pre-allocated buffer of int16's */ | ||
87 | int sampleSpacing, // how many bytes to skip over inbetween samples | ||
88 | int channel, /* Channel to decode */ | ||
89 | long samples, /* Number of samples to decode */ | ||
90 | int stream); /* Stream containing the channel */ | ||
91 | |||
92 | /* Read the next compressed audio chunk. Store the size in size and return a */ | ||
93 | /* 1 if error. */ | ||
94 | /* Stream defines the number of the multiplexed stream to read. */ | ||
95 | LIBMPEG_EXPORT int mpeg3_read_audio_chunk(mpeg3_t *file, | ||
96 | unsigned char *output, | ||
97 | long *size, | ||
98 | long max_size, | ||
99 | int stream); | ||
100 | |||
101 | /* Query the stream about video. */ | ||
102 | LIBMPEG_EXPORT int mpeg3_has_video(mpeg3_t *file); | ||
103 | LIBMPEG_EXPORT int mpeg3_total_vstreams(mpeg3_t *file); /* Number of multiplexed video streams */ | ||
104 | LIBMPEG_EXPORT int mpeg3_video_width(mpeg3_t *file, int stream); | ||
105 | LIBMPEG_EXPORT int mpeg3_video_height(mpeg3_t *file, int stream); | ||
106 | LIBMPEG_EXPORT float mpeg3_frame_rate(mpeg3_t *file, int stream); /* Frames/sec */ | ||
107 | |||
108 | /* Total length. */ | ||
109 | /* For DVD files, this is 1 indicating only percentage seeking is available. */ | ||
110 | LIBMPEG_EXPORT long mpeg3_video_frames(mpeg3_t *file, int stream); | ||
111 | LIBMPEG_EXPORT int mpeg3_set_frame(mpeg3_t *file, long frame, int stream); /* Seek to a frame */ | ||
112 | LIBMPEG_EXPORT int mpeg3_skip_frames(); | ||
113 | LIBMPEG_EXPORT long mpeg3_get_frame(mpeg3_t *file, int stream); /* Tell current position */ | ||
114 | |||
115 | /* Seek all the tracks based on a percentage of the total bytes in the */ | ||
116 | /* file or the total */ | ||
117 | /* time in a toc if one exists. Percentage is a 0 to 1 double. */ | ||
118 | /* This eliminates the need for tocs and 64 bit longs but doesn't */ | ||
119 | /* give frame accuracy. */ | ||
120 | LIBMPEG_EXPORT int mpeg3_seek_percentage(mpeg3_t *file, double percentage); | ||
121 | LIBMPEG_EXPORT double mpeg3_tell_percentage(mpeg3_t *file); | ||
122 | LIBMPEG_EXPORT int mpeg3_previous_frame(mpeg3_t *file, int stream); | ||
123 | LIBMPEG_EXPORT int mpeg3_end_of_audio(mpeg3_t *file, int stream); | ||
124 | LIBMPEG_EXPORT int mpeg3_end_of_video(mpeg3_t *file, int stream); | ||
125 | |||
126 | /* Give the seconds time in the last packet read */ | ||
127 | LIBMPEG_EXPORT double mpeg3_get_time(mpeg3_t *file); | ||
128 | |||
129 | /* Read a frame. The dimensions of the input area and output frame must be supplied. */ | ||
130 | /* The frame is taken from the input area and scaled to fit the output frame in 1 step. */ | ||
131 | /* Stream defines the number of the multiplexed stream to read. */ | ||
132 | /* The last row of **output_rows must contain 4 extra bytes for scratch work. */ | ||
133 | LIBMPEG_EXPORT int mpeg3_read_frame(mpeg3_t *file, | ||
134 | unsigned char **output_rows, /* Array of pointers to the start of each output row */ | ||
135 | int in_x, /* Location in input frame to take picture */ | ||
136 | int in_y, | ||
137 | int in_w, | ||
138 | int in_h, | ||
139 | int out_w, /* Dimensions of output_rows */ | ||
140 | int out_h, | ||
141 | int color_model, /* One of the color model #defines */ | ||
142 | int stream); | ||
143 | |||
144 | /* Read a YUV frame. The 3 planes are copied into the y, u, and v buffers provided. */ | ||
145 | /* The input is cropped to the dimensions given but not scaled. */ | ||
146 | LIBMPEG_EXPORT int mpeg3_read_yuvframe(mpeg3_t *file, | ||
147 | char *y_output, | ||
148 | char *u_output, | ||
149 | char *v_output, | ||
150 | int in_x, | ||
151 | int in_y, | ||
152 | int in_w, | ||
153 | int in_h, | ||
154 | int stream); | ||
155 | |||
156 | LIBMPEG_EXPORT int mpeg3_drop_frames(mpeg3_t *file, long frames, int stream); | ||
157 | |||
158 | /* Read the next compressed frame including headers. */ | ||
159 | /* Store the size in size and return a 1 if error. */ | ||
160 | /* Stream defines the number of the multiplexed stream to read. */ | ||
161 | LIBMPEG_EXPORT int mpeg3_read_video_chunk(mpeg3_t *file, | ||
162 | unsigned char *output, | ||
163 | long *size, | ||
164 | long max_size, | ||
165 | int stream); | ||
166 | |||
167 | /* Master control */ | ||
168 | LIBMPEG_EXPORT int mpeg3_total_programs(); | ||
169 | LIBMPEG_EXPORT int mpeg3_set_program(int program); | ||
170 | |||
171 | #if defined(__cplusplus) | ||
172 | } | ||
173 | #endif | ||
174 | |||
175 | #endif | ||