forked from len0rd/rockbox
add support for non 16x16 frame sizes
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@13016 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
parent
abd103c315
commit
ab9d654c86
3 changed files with 12 additions and 9 deletions
|
@ -879,7 +879,9 @@ static void video_thread(void)
|
|||
continue;
|
||||
|
||||
case STATE_SEQUENCE:
|
||||
vo_setup(info->sequence->width,
|
||||
vo_setup(info->sequence->display_width,
|
||||
info->sequence->display_height,
|
||||
info->sequence->width,
|
||||
info->sequence->height,
|
||||
info->sequence->chroma_width,
|
||||
info->sequence->chroma_height);
|
||||
|
|
|
@ -22,5 +22,6 @@
|
|||
*/
|
||||
|
||||
void vo_draw_frame (uint8_t * const * buf);
|
||||
void vo_setup (unsigned int width, unsigned int height,
|
||||
void vo_setup (unsigned int display_width, unsigned int display_height,
|
||||
unsigned int width, unsigned int height,
|
||||
unsigned int chroma_width, unsigned int chroma_height);
|
||||
|
|
|
@ -213,7 +213,7 @@ void vo_draw_frame (uint8_t * const * buf)
|
|||
#define SCREEN_HEIGHT LCD_WIDTH
|
||||
#endif
|
||||
|
||||
void vo_setup(unsigned int width, unsigned int height,
|
||||
void vo_setup(unsigned int display_width, unsigned int display_height, unsigned int width, unsigned int height,
|
||||
unsigned int chroma_width, unsigned int chroma_height)
|
||||
{
|
||||
image_width=width;
|
||||
|
@ -221,19 +221,19 @@ void vo_setup(unsigned int width, unsigned int height,
|
|||
image_chroma_x=image_width/chroma_width;
|
||||
image_chroma_y=image_height/chroma_height;
|
||||
|
||||
if (image_width >= SCREEN_WIDTH) {
|
||||
if (display_width >= SCREEN_WIDTH) {
|
||||
output_width = SCREEN_WIDTH;
|
||||
output_x = 0;
|
||||
} else {
|
||||
output_width = image_width;
|
||||
output_x = (SCREEN_WIDTH-image_width)/2;
|
||||
output_width = display_width;
|
||||
output_x = (SCREEN_WIDTH-display_width)/2;
|
||||
}
|
||||
|
||||
if (image_height >= SCREEN_HEIGHT) {
|
||||
if (display_height >= SCREEN_HEIGHT) {
|
||||
output_height = SCREEN_HEIGHT;
|
||||
output_y = 0;
|
||||
} else {
|
||||
output_height = image_height;
|
||||
output_y = (SCREEN_HEIGHT-image_height)/2;
|
||||
output_height = display_height;
|
||||
output_y = (SCREEN_HEIGHT-display_height)/2;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue