aboutsummaryrefslogtreecommitdiffstats
path: root/channels/console_video.c
diff options
context:
space:
mode:
authorrizzo <rizzo@f38db490-d61c-443f-a65b-d21fe96a405b>2007-12-23 12:36:32 +0000
committerrizzo <rizzo@f38db490-d61c-443f-a65b-d21fe96a405b>2007-12-23 12:36:32 +0000
commite2d7f8d7935b157aaa14de77e2b5602218702795 (patch)
treef8e60da532c7bde9d8ce0c811e6eb19fce6b7265 /channels/console_video.c
parentb7e2b87525ec3798593f3c0e0364f9d3acb9c166 (diff)
make sure the minimum surface depth is 16bpp so we can create YUVoverlays.
With this change we can do setenv SDL_VIDEODRIVER aalib and output to an ascii window (which is still in an X11 window). If you also do unsetenv DISPLAY then the output goes into the main asterisk window, unfortunately it interferes with the normal output so you don't see much. In any case, i don't think we are very far away from having a working xterm videophone! git-svn-id: http://svn.digium.com/svn/asterisk/trunk@94714 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'channels/console_video.c')
-rw-r--r--channels/console_video.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/channels/console_video.c b/channels/console_video.c
index 87148d3b0..867eb0710 100644
--- a/channels/console_video.c
+++ b/channels/console_video.c
@@ -2895,8 +2895,15 @@ static int keypad_cfg_read(struct gui_info *gui, const char *val);
static void sdl_setup(struct video_desc *env)
{
int dpy_fmt = SDL_IYUV_OVERLAY; /* YV12 causes flicker in SDL */
- int maxw, maxh;
+ int depth, maxw, maxh;
+ const SDL_VideoInfo *info = SDL_GetVideoInfo();
+ /* We want at least 16bpp to support YUV overlays.
+ * E.g with SDL_VIDEODRIVER = aalib the default is 8
+ */
+ depth = info->vfmt->BitsPerPixel;
+ if (depth < 16)
+ depth = 16;
/*
* initialize the SDL environment. We have one large window
* with local and remote video, and a keypad.
@@ -2989,7 +2996,7 @@ static void sdl_setup(struct video_desc *env)
maxh = MAX( MAX(env->in.rem_dpy.h, env->out.loc_dpy.h), env->out.keypad_dpy.h);
maxw += 4 * BORDER;
maxh += 2 * BORDER;
- env->screen = SDL_SetVideoMode(maxw, maxh, 0, 0);
+ env->screen = SDL_SetVideoMode(maxw, maxh, depth, 0);
if (!env->screen) {
ast_log(LOG_ERROR, "SDL: could not set video mode - exiting\n");
goto no_sdl;