X-Git-Url: https://notaz.gp2x.de/cgi-bin/gitweb.cgi?p=sdl_omap.git;a=blobdiff_plain;f=src%2Fvideo%2Fomapdss%2Fosdl_video.c;h=2c2226455c3005a144dd5dd86f04ddc409c768a4;hp=fce7eeacc8e03945637b0d66fc167ac19f631bc6;hb=455c8c43b353b60ebbb70caa09ae87be49520838;hpb=5f4b1fd346a57d90ffda9eaba68c7b0b0aa8acab diff --git a/src/video/omapdss/osdl_video.c b/src/video/omapdss/osdl_video.c index fce7eea..2c22264 100644 --- a/src/video/omapdss/osdl_video.c +++ b/src/video/omapdss/osdl_video.c @@ -303,10 +303,12 @@ static int osdl_setup_omap_layer(struct SDL_PrivateVideoData *pdata, return ret; } -int osdl_video_set_mode(struct SDL_PrivateVideoData *pdata, - int width, int height, int bpp, int doublebuf) +void *osdl_video_set_mode(struct SDL_PrivateVideoData *pdata, + int border_l, int border_r, int border_t, int border_b, + int width, int height, int bpp, int doublebuf) { const char *fbname; + void *result; int ret; fbname = get_fb_device(); @@ -318,11 +320,25 @@ int osdl_video_set_mode(struct SDL_PrivateVideoData *pdata, ret = osdl_setup_omap_layer(pdata, fbname, width, height, bpp); if (ret < 0) - return -1; + return NULL; pdata->fbdev = vout_fbdev_init(fbname, &width, &height, bpp, doublebuf ? 2 : 1); if (pdata->fbdev == NULL) - return -1; + return NULL; + + if (border_l | border_r | border_t | border_b) { + width -= border_l + border_r; + height -= border_t + border_b; + result = vout_fbdev_resize(pdata->fbdev, width, height, bpp, + border_l, border_r, border_t, border_b, doublebuf ? 2 : 1); + } + else { + result = osdl_video_flip(pdata); + } + if (result == NULL) { + osdl_video_finish(pdata); + return NULL; + } if (!pdata->xenv_up) { ret = xenv_init(); @@ -330,7 +346,7 @@ int osdl_video_set_mode(struct SDL_PrivateVideoData *pdata, pdata->xenv_up = 1; } - return 0; + return result; } void *osdl_video_flip(struct SDL_PrivateVideoData *pdata)