diff options
author | Robert Kukla <roolku@rockbox.org> | 2007-10-09 20:42:20 +0000 |
---|---|---|
committer | Robert Kukla <roolku@rockbox.org> | 2007-10-09 20:42:20 +0000 |
commit | fd3fe45bc14a0a540f2525102551c92a64a73b76 (patch) | |
tree | 1ef8103bbfa5b33f684a94bddc5ecb4685ec5e88 /apps/plugins/mpegplayer/video_out_rockbox.c | |
parent | ce135909b9393d9824b3f69a70659400480cc069 (diff) | |
download | rockbox-fd3fe45bc14a0a540f2525102551c92a64a73b76.tar.gz rockbox-fd3fe45bc14a0a540f2525102551c92a64a73b76.zip |
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
Diffstat (limited to 'apps/plugins/mpegplayer/video_out_rockbox.c')
-rw-r--r-- | apps/plugins/mpegplayer/video_out_rockbox.c | 108 |
1 files changed, 106 insertions, 2 deletions
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; | |||
43 | void vo_draw_frame (uint8_t * const * buf) | 43 | void vo_draw_frame (uint8_t * const * buf) |
44 | { | 44 | { |
45 | #ifdef HAVE_LCD_COLOR | 45 | #ifdef HAVE_LCD_COLOR |
46 | rb->lcd_yuv_blit(buf, | 46 | rb->lcd_yuv_blit(buf, 0,0,image_width, |
47 | 0,0,image_width, | ||
48 | output_x,output_y,output_width,output_height); | 47 | output_x,output_y,output_width,output_height); |
49 | #else | 48 | #else |
50 | gray_ub_gray_bitmap_part(buf[0],0,0,image_width, | 49 | gray_ub_gray_bitmap_part(buf[0],0,0,image_width, |
@@ -60,10 +59,105 @@ void vo_draw_frame (uint8_t * const * buf) | |||
60 | #define SCREEN_HEIGHT LCD_WIDTH | 59 | #define SCREEN_HEIGHT LCD_WIDTH |
61 | #endif | 60 | #endif |
62 | 61 | ||
62 | uint8_t* tmpbufa = 0; | ||
63 | uint8_t* tmpbufb = 0; | ||
64 | uint8_t* tmpbufc = 0; | ||
65 | uint8_t* tmpbuf[3]; | ||
66 | |||
67 | void vo_draw_frame_thumb (uint8_t * const * buf) | ||
68 | { | ||
69 | int r,c; | ||
70 | |||
71 | #if LCD_WIDTH >= LCD_HEIGHT | ||
72 | for (r=0;r<image_width/2;r++) | ||
73 | for (c=0;c<image_height/2;c++) | ||
74 | *(tmpbuf[0]+c*image_width/2+r) = | ||
75 | *(buf[0]+2*c*image_width+2*r); | ||
76 | |||
77 | for (r=0;r<image_width/4;r++) | ||
78 | for (c=0;c<image_height/4;c++) | ||
79 | { | ||
80 | *(tmpbuf[1]+c*image_width/4+r) = | ||
81 | *(buf[1]+2*c*image_width/2+2*r); | ||
82 | *(tmpbuf[2]+c*image_width/4+r) = | ||
83 | *(buf[2]+2*c*image_width/2+2*r); | ||
84 | } | ||
85 | #else | ||
86 | for (r=0;r<image_width/2;r++) | ||
87 | for (c=0;c<image_height/2;c++) | ||
88 | *(tmpbuf[0]+(image_width/2-1-r)*image_height/2+c) = | ||
89 | *(buf[0]+2*c*image_width+2*r); | ||
90 | |||
91 | for (r=0;r<image_width/4;r++) | ||
92 | for (c=0;c<image_height/4;c++) | ||
93 | { | ||
94 | *(tmpbuf[1]+(image_width/4-1-r)*image_height/4+c) = | ||
95 | *(buf[1]+2*c*image_width/2+2*r); | ||
96 | *(tmpbuf[2]+(image_width/4-1-r)*image_height/4+c) = | ||
97 | *(buf[2]+2*c*image_width/2+2*r); | ||
98 | } | ||
99 | #endif | ||
100 | |||
101 | rb->lcd_clear_display(); | ||
102 | rb->lcd_update(); | ||
103 | |||
104 | #ifdef HAVE_LCD_COLOR | ||
105 | #ifdef SIMULATOR | ||
106 | #if LCD_WIDTH >= LCD_HEIGHT | ||
107 | rb->lcd_yuv_blit(tmpbuf,0,0,image_width/2, | ||
108 | (LCD_WIDTH-1-image_width/2)/2, | ||
109 | LCD_HEIGHT-50-(image_height/2), | ||
110 | output_width/2,output_height/2); | ||
111 | |||
112 | #else | ||
113 | rb->lcd_yuv_blit(tmpbuf,0,0,image_height/2, | ||
114 | LCD_HEIGHT-50-(image_height/2), | ||
115 | (LCD_WIDTH-1-image_width/2)/2, | ||
116 | output_height/2,output_width/2); | ||
117 | #endif | ||
118 | #else | ||
119 | #if LCD_WIDTH >= LCD_HEIGHT | ||
120 | rb->lcd_yuv_blit(tmpbuf,0,0,image_width/2, | ||
121 | (LCD_WIDTH-1-image_width/2)/2, | ||
122 | LCD_HEIGHT-50-(image_height/2), | ||
123 | output_width/2,output_height/2); | ||
124 | #else | ||
125 | rb->lcd_yuv_blit(tmpbuf,0,0,image_height/2, | ||
126 | LCD_HEIGHT-50-(image_height/2), | ||
127 | (LCD_WIDTH-1-image_width/2)/2, | ||
128 | output_height/2,output_width/2); | ||
129 | #endif | ||
130 | #endif | ||
131 | #else | ||
132 | #if LCD_WIDTH >= LCD_HEIGHT | ||
133 | gray_ub_gray_bitmap_part(tmpbuf[0],0,0,image_width/2, | ||
134 | (LCD_WIDTH-1-image_width/2)/2, | ||
135 | LCD_HEIGHT-50-(image_height/2), | ||
136 | output_width/2,output_height/2); | ||
137 | #else | ||
138 | gray_ub_gray_bitmap_part(tmpbuf[0],0,0,image_height/2, | ||
139 | LCD_HEIGHT-50-(image_height/2), | ||
140 | (LCD_WIDTH-1-image_width/2)/2, | ||
141 | output_height/2,output_width/2); | ||
142 | #endif | ||
143 | #endif | ||
144 | } | ||
145 | |||
63 | void vo_setup(const mpeg2_sequence_t * sequence) | 146 | void vo_setup(const mpeg2_sequence_t * sequence) |
64 | { | 147 | { |
65 | image_width=sequence->width; | 148 | image_width=sequence->width; |
66 | image_height=sequence->height; | 149 | image_height=sequence->height; |
150 | |||
151 | tmpbufa = (uint8_t*)mpeg2_malloc(sizeof(uint8_t)*image_width/2* | ||
152 | image_height/2, -2); | ||
153 | tmpbufb = (uint8_t*)mpeg2_malloc(sizeof(uint8_t)*image_width/4* | ||
154 | image_height/4, -2); | ||
155 | tmpbufc = (uint8_t*)mpeg2_malloc(sizeof(uint8_t)*image_width/4* | ||
156 | image_height/4, -2); | ||
157 | tmpbuf[0] = tmpbufa; | ||
158 | tmpbuf[1] = tmpbufb; | ||
159 | tmpbuf[2] = tmpbufc; | ||
160 | |||
67 | image_chroma_x=image_width/sequence->chroma_width; | 161 | image_chroma_x=image_width/sequence->chroma_width; |
68 | image_chroma_y=image_height/sequence->chroma_height; | 162 | image_chroma_y=image_height/sequence->chroma_height; |
69 | 163 | ||
@@ -83,3 +177,13 @@ void vo_setup(const mpeg2_sequence_t * sequence) | |||
83 | output_y = (SCREEN_HEIGHT-sequence->display_height)/2; | 177 | output_y = (SCREEN_HEIGHT-sequence->display_height)/2; |
84 | } | 178 | } |
85 | } | 179 | } |
180 | |||
181 | void vo_cleanup(void) | ||
182 | { | ||
183 | if (tmpbufc) | ||
184 | mpeg2_free(tmpbufc); | ||
185 | if (tmpbufb) | ||
186 | mpeg2_free(tmpbufb); | ||
187 | if (tmpbufa) | ||
188 | mpeg2_free(tmpbufa); | ||
189 | } | ||