diff options
author | Dave Chapman <dave@dchapman.com> | 2006-08-17 18:35:11 +0000 |
---|---|---|
committer | Dave Chapman <dave@dchapman.com> | 2006-08-17 18:35:11 +0000 |
commit | 567cb6e615dca698d8ce7a46b8f94ccd8500f428 (patch) | |
tree | 4daf09bb890fab259f858483ca564d56b0c66b76 /apps/plugins/mpegplayer/video_out_rockbox.c | |
parent | f5e78674ffb08fbea9fa56fda0d88c97a7a03041 (diff) | |
download | rockbox-567cb6e615dca698d8ce7a46b8f94ccd8500f428.tar.gz rockbox-567cb6e615dca698d8ce7a46b8f94ccd8500f428.zip |
Clean up the video output code - remove the final traces of libvo (used by mpeg2dec) and remove unused code-paths from the main decoding loop.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@10638 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/plugins/mpegplayer/video_out_rockbox.c')
-rw-r--r-- | apps/plugins/mpegplayer/video_out_rockbox.c | 69 |
1 files changed, 12 insertions, 57 deletions
diff --git a/apps/plugins/mpegplayer/video_out_rockbox.c b/apps/plugins/mpegplayer/video_out_rockbox.c index 7bce6aadaa..258416fcdd 100644 --- a/apps/plugins/mpegplayer/video_out_rockbox.c +++ b/apps/plugins/mpegplayer/video_out_rockbox.c | |||
@@ -45,8 +45,7 @@ static int output_y; | |||
45 | static int output_width; | 45 | static int output_width; |
46 | static int output_height; | 46 | static int output_height; |
47 | 47 | ||
48 | #if (LCD_DEPTH == 16) && \ | 48 | #ifdef SIMULATOR |
49 | ((LCD_PIXELFORMAT == RGB565) || (LCD_PIXELFORMAT == RGB565SWAPPED)) | ||
50 | 49 | ||
51 | #define RYFAC (31*257) | 50 | #define RYFAC (31*257) |
52 | #define GYFAC (63*257) | 51 | #define GYFAC (63*257) |
@@ -59,9 +58,9 @@ static int output_height; | |||
59 | #define ROUNDOFFS (127*257) | 58 | #define ROUNDOFFS (127*257) |
60 | 59 | ||
61 | /* Draw a partial YUV colour bitmap - taken from the Rockbox JPEG viewer */ | 60 | /* Draw a partial YUV colour bitmap - taken from the Rockbox JPEG viewer */ |
62 | void yuv_bitmap_part(unsigned char * const src[3], | 61 | static void yuv_bitmap_part(unsigned char * const src[3], |
63 | int src_x, int src_y, int stride, | 62 | int src_x, int src_y, int stride, |
64 | int x, int y, int width, int height) | 63 | int x, int y, int width, int height) |
65 | { | 64 | { |
66 | fb_data *dst, *dst_end; | 65 | fb_data *dst, *dst_end; |
67 | 66 | ||
@@ -190,25 +189,20 @@ void yuv_bitmap_part(unsigned char * const src[3], | |||
190 | } | 189 | } |
191 | #endif | 190 | #endif |
192 | 191 | ||
193 | static void rockbox_draw_frame (vo_instance_t * instance, | 192 | void vo_draw_frame (uint8_t * const * buf) |
194 | uint8_t * const * buf, void * id) | ||
195 | { | 193 | { |
196 | char str[80]; | 194 | char str[80]; |
197 | static int frame=0; | 195 | static int frame=0; |
198 | int ticks,fps; | 196 | int ticks,fps; |
199 | 197 | ||
200 | (void)id; | 198 | #ifdef SIMULATOR |
201 | (void)instance; | ||
202 | |||
203 | #if defined(HAVE_LCD_COLOR) && !defined(SIMULATOR) | ||
204 | rb->lcd_yuv_blit(buf, | ||
205 | 0,0,image_width, | ||
206 | output_x,output_y,output_width,output_height); | ||
207 | #elif (LCD_DEPTH == 16) && \ | ||
208 | ((LCD_PIXELFORMAT == RGB565) || (LCD_PIXELFORMAT == RGB565SWAPPED)) | ||
209 | yuv_bitmap_part(buf,0,0,image_width, | 199 | yuv_bitmap_part(buf,0,0,image_width, |
210 | output_x,output_y,output_width,output_height); | 200 | output_x,output_y,output_width,output_height); |
211 | rb->lcd_update_rect(output_x,output_y,output_width,output_height); | 201 | rb->lcd_update_rect(output_x,output_y,output_width,output_height); |
202 | #else | ||
203 | rb->lcd_yuv_blit(buf, | ||
204 | 0,0,image_width, | ||
205 | output_x,output_y,output_width,output_height); | ||
212 | #endif | 206 | #endif |
213 | 207 | ||
214 | if (starttick==0) { | 208 | if (starttick==0) { |
@@ -230,41 +224,9 @@ static void rockbox_draw_frame (vo_instance_t * instance, | |||
230 | frame++; | 224 | frame++; |
231 | } | 225 | } |
232 | 226 | ||
233 | vo_instance_t static_instance; | 227 | void vo_setup(unsigned int width, unsigned int height, |
234 | 228 | unsigned int chroma_width, unsigned int chroma_height) | |
235 | static vo_instance_t * internal_open (int setup (vo_instance_t *, unsigned int, | ||
236 | unsigned int, unsigned int, | ||
237 | unsigned int, | ||
238 | vo_setup_result_t *), | ||
239 | void draw (vo_instance_t *, | ||
240 | uint8_t * const *, void *)) | ||
241 | { | ||
242 | vo_instance_t * instance; | ||
243 | |||
244 | instance = (vo_instance_t *) &static_instance; | ||
245 | if (instance == NULL) | ||
246 | return NULL; | ||
247 | |||
248 | instance->setup = setup; | ||
249 | instance->setup_fbuf = NULL; | ||
250 | instance->set_fbuf = NULL; | ||
251 | instance->start_fbuf = NULL; | ||
252 | instance->draw = draw; | ||
253 | instance->discard = NULL; | ||
254 | //instance->close = (void (*) (vo_instance_t *)) free; | ||
255 | |||
256 | return instance; | ||
257 | } | ||
258 | |||
259 | static int rockbox_setup (vo_instance_t * instance, unsigned int width, | ||
260 | unsigned int height, unsigned int chroma_width, | ||
261 | unsigned int chroma_height, | ||
262 | vo_setup_result_t * result) | ||
263 | { | 229 | { |
264 | (void)instance; | ||
265 | |||
266 | result->convert = NULL; | ||
267 | |||
268 | image_width=width; | 230 | image_width=width; |
269 | image_height=height; | 231 | image_height=height; |
270 | image_chroma_x=image_width/chroma_width; | 232 | image_chroma_x=image_width/chroma_width; |
@@ -285,11 +247,4 @@ static int rockbox_setup (vo_instance_t * instance, unsigned int width, | |||
285 | output_height = image_height; | 247 | output_height = image_height; |
286 | output_y = (LCD_HEIGHT-image_height)/2; | 248 | output_y = (LCD_HEIGHT-image_height)/2; |
287 | } | 249 | } |
288 | |||
289 | return 0; | ||
290 | } | ||
291 | |||
292 | vo_instance_t * vo_rockbox_open (void) | ||
293 | { | ||
294 | return internal_open (rockbox_setup, rockbox_draw_frame); | ||
295 | } | 250 | } |