summaryrefslogtreecommitdiff
path: root/apps/plugins/mpegplayer/video_out_rockbox.c
diff options
context:
space:
mode:
authorDave Chapman <dave@dchapman.com>2006-08-20 23:12:56 +0000
committerDave Chapman <dave@dchapman.com>2006-08-20 23:12:56 +0000
commitc8e69dfb71d936b4bc5e18f6246ac126c629f772 (patch)
treed43563a0c30011d3ec7af1e13e1892bdfff60a46 /apps/plugins/mpegplayer/video_out_rockbox.c
parent18cfe431d7556f8cd7047018febe191073c26a1f (diff)
downloadrockbox-c8e69dfb71d936b4bc5e18f6246ac126c629f772.tar.gz
rockbox-c8e69dfb71d936b4bc5e18f6246ac126c629f772.zip
Move FPS display out of video_out_rockbox.c and into mpegplayer.c. Also add frame-rate limiting and frame-skipping (skipping display only, not decoding) to try and achieve real-time playback. Frame-rate limiting and frame skipping (and FPS display) are enabled via options in a new menu and are currently all off by default.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@10669 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/plugins/mpegplayer/video_out_rockbox.c')
-rw-r--r--apps/plugins/mpegplayer/video_out_rockbox.c25
1 files changed, 0 insertions, 25 deletions
diff --git a/apps/plugins/mpegplayer/video_out_rockbox.c b/apps/plugins/mpegplayer/video_out_rockbox.c
index 258416fcdd..38a76a7747 100644
--- a/apps/plugins/mpegplayer/video_out_rockbox.c
+++ b/apps/plugins/mpegplayer/video_out_rockbox.c
@@ -30,9 +30,6 @@ extern struct plugin_api* rb;
30#include "mpeg2.h" 30#include "mpeg2.h"
31#include "video_out.h" 31#include "video_out.h"
32 32
33static int starttick = 0;
34static int lasttick = 0;
35
36#define CSUB_X 2 33#define CSUB_X 2
37#define CSUB_Y 2 34#define CSUB_Y 2
38 35
@@ -191,10 +188,6 @@ static void yuv_bitmap_part(unsigned char * const src[3],
191 188
192void vo_draw_frame (uint8_t * const * buf) 189void vo_draw_frame (uint8_t * const * buf)
193{ 190{
194 char str[80];
195 static int frame=0;
196 int ticks,fps;
197
198#ifdef SIMULATOR 191#ifdef SIMULATOR
199 yuv_bitmap_part(buf,0,0,image_width, 192 yuv_bitmap_part(buf,0,0,image_width,
200 output_x,output_y,output_width,output_height); 193 output_x,output_y,output_width,output_height);
@@ -204,24 +197,6 @@ void vo_draw_frame (uint8_t * const * buf)
204 0,0,image_width, 197 0,0,image_width,
205 output_x,output_y,output_width,output_height); 198 output_x,output_y,output_width,output_height);
206#endif 199#endif
207
208 if (starttick==0) {
209 starttick=*rb->current_tick-1; /* Avoid divby0 */
210 lasttick=starttick;
211 }
212
213 /* Calculate fps */
214 if (*rb->current_tick-lasttick>=2*HZ) {
215 ticks=(*rb->current_tick)-starttick;
216
217 fps=(frame*1000)/ticks;
218 rb->snprintf(str,sizeof(str),"%d.%d",(fps/10),fps%10);
219 rb->lcd_putsxy(0,0,str);
220 rb->lcd_update_rect(0,0,80,8);
221
222 lasttick+=2*HZ;
223 }
224 frame++;
225} 200}
226 201
227void vo_setup(unsigned int width, unsigned int height, 202void vo_setup(unsigned int width, unsigned int height,