From fd3fe45bc14a0a540f2525102551c92a64a73b76 Mon Sep 17 00:00:00 2001 From: Robert Kukla Date: Tue, 9 Oct 2007 20:42:20 +0000 Subject: FS#7487 - mpegplayer - video start time seek with resume by John S. Gwynne & Brian J. Morey This should stop the patch from breaking again and give them opportunity to improve it further. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@15052 a1c6a512-1295-4272-9138-f99709370657 --- apps/plugins/mpegplayer/video_out_rockbox.c | 108 +++++++++++++++++++++++++++- 1 file changed, 106 insertions(+), 2 deletions(-) (limited to 'apps/plugins/mpegplayer/video_out_rockbox.c') diff --git a/apps/plugins/mpegplayer/video_out_rockbox.c b/apps/plugins/mpegplayer/video_out_rockbox.c index 2aac0b8039..490f04411f 100644 --- a/apps/plugins/mpegplayer/video_out_rockbox.c +++ b/apps/plugins/mpegplayer/video_out_rockbox.c @@ -43,8 +43,7 @@ static int output_height; void vo_draw_frame (uint8_t * const * buf) { #ifdef HAVE_LCD_COLOR - rb->lcd_yuv_blit(buf, - 0,0,image_width, + rb->lcd_yuv_blit(buf, 0,0,image_width, output_x,output_y,output_width,output_height); #else gray_ub_gray_bitmap_part(buf[0],0,0,image_width, @@ -60,10 +59,105 @@ void vo_draw_frame (uint8_t * const * buf) #define SCREEN_HEIGHT LCD_WIDTH #endif +uint8_t* tmpbufa = 0; +uint8_t* tmpbufb = 0; +uint8_t* tmpbufc = 0; +uint8_t* tmpbuf[3]; + +void vo_draw_frame_thumb (uint8_t * const * buf) +{ + int r,c; + +#if LCD_WIDTH >= LCD_HEIGHT + for (r=0;rlcd_clear_display(); +rb->lcd_update(); + +#ifdef HAVE_LCD_COLOR +#ifdef SIMULATOR +#if LCD_WIDTH >= LCD_HEIGHT + rb->lcd_yuv_blit(tmpbuf,0,0,image_width/2, + (LCD_WIDTH-1-image_width/2)/2, + LCD_HEIGHT-50-(image_height/2), + output_width/2,output_height/2); + +#else + rb->lcd_yuv_blit(tmpbuf,0,0,image_height/2, + LCD_HEIGHT-50-(image_height/2), + (LCD_WIDTH-1-image_width/2)/2, + output_height/2,output_width/2); +#endif +#else +#if LCD_WIDTH >= LCD_HEIGHT + rb->lcd_yuv_blit(tmpbuf,0,0,image_width/2, + (LCD_WIDTH-1-image_width/2)/2, + LCD_HEIGHT-50-(image_height/2), + output_width/2,output_height/2); +#else + rb->lcd_yuv_blit(tmpbuf,0,0,image_height/2, + LCD_HEIGHT-50-(image_height/2), + (LCD_WIDTH-1-image_width/2)/2, + output_height/2,output_width/2); +#endif +#endif +#else +#if LCD_WIDTH >= LCD_HEIGHT + gray_ub_gray_bitmap_part(tmpbuf[0],0,0,image_width/2, + (LCD_WIDTH-1-image_width/2)/2, + LCD_HEIGHT-50-(image_height/2), + output_width/2,output_height/2); +#else + gray_ub_gray_bitmap_part(tmpbuf[0],0,0,image_height/2, + LCD_HEIGHT-50-(image_height/2), + (LCD_WIDTH-1-image_width/2)/2, + output_height/2,output_width/2); +#endif +#endif +} + void vo_setup(const mpeg2_sequence_t * sequence) { image_width=sequence->width; image_height=sequence->height; + + tmpbufa = (uint8_t*)mpeg2_malloc(sizeof(uint8_t)*image_width/2* + image_height/2, -2); + tmpbufb = (uint8_t*)mpeg2_malloc(sizeof(uint8_t)*image_width/4* + image_height/4, -2); + tmpbufc = (uint8_t*)mpeg2_malloc(sizeof(uint8_t)*image_width/4* + image_height/4, -2); + tmpbuf[0] = tmpbufa; + tmpbuf[1] = tmpbufb; + tmpbuf[2] = tmpbufc; + image_chroma_x=image_width/sequence->chroma_width; image_chroma_y=image_height/sequence->chroma_height; @@ -83,3 +177,13 @@ void vo_setup(const mpeg2_sequence_t * sequence) output_y = (SCREEN_HEIGHT-sequence->display_height)/2; } } + +void vo_cleanup(void) +{ + if (tmpbufc) + mpeg2_free(tmpbufc); + if (tmpbufb) + mpeg2_free(tmpbufb); + if (tmpbufa) + mpeg2_free(tmpbufa); +} -- cgit v1.2.3