Switch indentation over to K&R style, replace all tabs by spaces.

patch by Christoph Egger <Christoph_Egger -- at -- gmx -- dot -- de>


git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@16410 b3059339-0415-0410-9bf9-f77b7e298cf2
This commit is contained in:
diego 2005-09-06 18:44:04 +00:00
parent f80470335c
commit 7e13572ce9
1 changed files with 271 additions and 292 deletions

View File

@ -52,6 +52,7 @@ static vo_info_t info =
LIBVO_EXTERN(ggi)
static struct ggi_conf_s {
char *driver;
@ -93,8 +94,7 @@ static void window_ontop(void)
static void set_graphtype(uint32_t format, ggi_mode *mode)
{
switch(format)
{
switch (format) {
case IMGFMT_RGB4:
mode->graphtype = GT_4BIT;
break;
@ -128,7 +128,8 @@ static void set_graphtype(uint32_t format, ggi_mode *mode)
}
static int config(uint32_t width, uint32_t height, uint32_t d_width,
uint32_t d_height, uint32_t flags, char *title, uint32_t format)
uint32_t d_height, uint32_t flags, char *title,
uint32_t format)
{
ggi_mode mode = {
1, /* frames */
@ -138,8 +139,7 @@ static int config(uint32_t width, uint32_t height, uint32_t d_width,
GT_AUTO, /* graphtype */
{GGI_AUTO, GGI_AUTO} /* dots per pixel */
};
ggi_mode parentmode =
{
ggi_mode parentmode = {
1, /* frames */
{width, height}, /* visible */
{GGI_AUTO, GGI_AUTO}, /* virt */
@ -148,6 +148,7 @@ static int config(uint32_t width, uint32_t height, uint32_t d_width,
{GGI_AUTO, GGI_AUTO} /* dots per pixel */
};
set_graphtype(format, &parentmode);
#if 0
@ -162,19 +163,16 @@ static int config(uint32_t width, uint32_t height, uint32_t d_width,
ggiCheckMode(ggi_conf.parentvis, &parentmode);
if (ggiSetMode(ggi_conf.parentvis, &parentmode) < 0)
{
if (ggiSetMode(ggi_conf.parentvis, &parentmode) < 0) {
mp_msg(MSGT_VO, MSGL_ERR, "[ggi] unable to set display mode\n");
return (-1);
}
if (ggiGetMode(ggi_conf.parentvis, &parentmode) < 0)
{
if (ggiGetMode(ggi_conf.parentvis, &parentmode) < 0) {
mp_msg(MSGT_VO, MSGL_ERR, "[ggi] unable to get display mode\n");
return (-1);
}
if ((parentmode.graphtype == GT_INVALID) || (parentmode.graphtype == GT_AUTO))
if ((parentmode.graphtype == GT_INVALID)
|| (parentmode.graphtype == GT_AUTO))
{
mp_msg(MSGT_VO, MSGL_ERR, "[ggi] not supported depth/bpp\n");
return (-1);
@ -196,14 +194,11 @@ static int config(uint32_t width, uint32_t height, uint32_t d_width,
ggiCheckMode(ggi_conf.vis, &mode);
if (ggiSetMode(ggi_conf.vis, &mode) < 0)
{
if (ggiSetMode(ggi_conf.vis, &mode) < 0) {
mp_msg(MSGT_VO, MSGL_ERR, "[ggi] unable to set video mode\n");
return (-1);
}
if (ggiGetMode(ggi_conf.vis, &mode) < 0)
{
if (ggiGetMode(ggi_conf.vis, &mode) < 0) {
mp_msg(MSGT_VO, MSGL_ERR, "[ggi] unable to get video mode\n");
return (-1);
}
@ -237,17 +232,11 @@ static int config(uint32_t width, uint32_t height, uint32_t d_width,
ggi_conf.voflags = flags;
if (IMGFMT_IS_RGB(ggi_conf.srcformat))
{
if (IMGFMT_IS_RGB(ggi_conf.srcformat)) {
ggi_conf.srcdepth = IMGFMT_RGB_DEPTH(ggi_conf.srcformat);
}
else
if (IMGFMT_IS_BGR(ggi_conf.srcformat))
{
} else if (IMGFMT_IS_BGR(ggi_conf.srcformat)) {
ggi_conf.srcdepth = IMGFMT_BGR_DEPTH(ggi_conf.srcformat);
}
else
{
} else {
mp_msg(MSGT_VO, MSGL_FATAL, "[ggi] Unknown image format: %s\n",
vo_format_name(ggi_conf.srcformat));
return (-1);
@ -292,8 +281,7 @@ static uint32_t get_image(mp_image_t *mpi)
(mpi->flags & MP_IMGFLAG_PLANAR) ||
(mpi->flags & MP_IMGFLAG_YUV) ||
(mpi->width != ggi_conf.srcwidth) ||
(mpi->height != ggi_conf.srcheight)
)
(mpi->height != ggi_conf.srcheight))
{
return (VO_FALSE);
}
@ -306,8 +294,7 @@ static uint32_t get_image(mp_image_t *mpi)
mpi->flags |= MP_IMGFLAG_DIRECT;
#ifdef GGI_FLIP
if (ggi_conf.voflags & VOFLAG_FLIPPING)
{
if (ggi_conf.voflags & VOFLAG_FLIPPING) {
mpi->stride[0] = -mpi->stride[0];
}
#endif
@ -318,7 +305,9 @@ static uint32_t get_image(mp_image_t *mpi)
static int draw_frame(uint8_t *src[])
{
ggiPutBox(ggi_conf.vis, 0, 0, ggi_conf.dstwidth, ggi_conf.dstheight, src[0]);
ggiPutBox(ggi_conf.vis, 0, 0,
ggi_conf.dstwidth, ggi_conf.dstheight,
src[0]);
ggi_conf.flushregion.x1 = ggi_conf.flushregion.y1 = 0;
ggi_conf.flushregion.x2 = ggi_conf.dstwidth;
@ -334,7 +323,8 @@ static void draw_osd(void)
static void flip_page(void)
{
ggiFlushRegion(ggi_conf.vis, ggi_conf.flushregion.x1, ggi_conf.flushregion.y1,
ggiFlushRegion(ggi_conf.vis,
ggi_conf.flushregion.x1, ggi_conf.flushregion.y1,
ggi_conf.flushregion.x2 - ggi_conf.flushregion.x1,
ggi_conf.flushregion.y2 - ggi_conf.flushregion.y1);
@ -342,8 +332,8 @@ static void flip_page(void)
ggi_conf.flushregion.y1 = ggi_conf.flushregion.y2 = -1;
}
static int draw_slice(uint8_t *src[], int stride[], int w, int h,
int x, int y)
static int draw_slice(uint8_t *src[], int stride[],
int w, int h, int x, int y)
{
ggiPutBox(ggi_conf.vis, x, y, w, h, src[0]);
@ -364,25 +354,22 @@ static int query_format(uint32_t format)
ggi_mode mode;
uint32_t vfcap;
vfcap = VFCAP_CSP_SUPPORTED | VFCAP_CSP_SUPPORTED_BY_HW | VFCAP_ACCEPT_STRIDE;
vfcap = VFCAP_CSP_SUPPORTED
| VFCAP_CSP_SUPPORTED_BY_HW
| VFCAP_ACCEPT_STRIDE;
if ((!vo_depthonscreen || !vo_dbpp) && ggi_conf.parentvis)
{
if (ggiGetMode(ggi_conf.parentvis, &mode) == 0)
{
if ((!vo_depthonscreen || !vo_dbpp) && ggi_conf.parentvis) {
if (ggiGetMode(ggi_conf.parentvis, &mode) == 0) {
vo_depthonscreen = GT_DEPTH(mode.graphtype);
vo_dbpp = GT_SIZE(mode.graphtype);
}
}
if ((IMGFMT_IS_BGR(format) && (IMGFMT_BGR_DEPTH(format) == vo_dbpp)) ||
(IMGFMT_IS_RGB(format) && (IMGFMT_RGB_DEPTH(format) == vo_dbpp)))
{
return vfcap;
}
if (IMGFMT_IS_BGR(format) || IMGFMT_IS_RGB(format))
{
if (IMGFMT_IS_BGR(format) || IMGFMT_IS_RGB(format)) {
set_graphtype(format, &mode);
if (ggiCheckMode(ggi_conf.parentvis, &mode) < 0) {
@ -391,28 +378,23 @@ static int query_format(uint32_t format)
return vfcap;
}
}
return (0);
}
static int preinit(const char *arg)
{
if (ggiInit() != 0)
{
if (ggiInit() != 0) {
mp_msg(MSGT_VO, MSGL_FATAL, "[ggi] unable to initialize GGI\n");
return (-1);
}
#ifdef HAVE_GGIWMH
if (ggiWmhInit() < 0)
{
if (ggiWmhInit() < 0) {
mp_msg(MSGT_VO, MSGL_FATAL, "[ggi] unable to initialize libggiwmh\n");
return (-1);
}
#endif
if ((char *)arg)
{
if ((char *) arg) {
int i = 0;
ggi_conf.driver = strdup(arg);
while (ggi_conf.driver[i]) {
@ -420,27 +402,23 @@ static int preinit(const char *arg)
ggi_conf.driver[i] = ',';
i++;
}
}
else
} else {
ggi_conf.driver = NULL;
}
ggi_conf.parentvis = ggiOpen(ggi_conf.driver);
if (ggi_conf.parentvis == NULL)
{
if (ggi_conf.parentvis == NULL) {
mp_msg(MSGT_VO, MSGL_FATAL, "[ggi] unable to open '%s' output\n",
(ggi_conf.driver == NULL) ? "default" : ggi_conf.driver);
ggiExit();
return (-1);
}
ggi_conf.vis = ggiOpen("display-sub", ggi_conf.parentvis);
if (ggi_conf.vis == NULL)
{
if (ggi_conf.vis == NULL) {
mp_msg(MSGT_VO, MSGL_FATAL, "[ggi] unable to open the video output\n");
ggiExit();
return (-1);
}
#ifdef HAVE_GGIWMH
ggiWmhAttach(ggi_conf.parentvis);
#endif
@ -469,8 +447,7 @@ static void uninit(void)
static int control(uint32_t request, void *data, ...)
{
switch(request)
{
switch (request) {
case VOCTRL_QUERY_FORMAT:
return query_format(*((uint32_t *) data));
case VOCTRL_GET_IMAGE:
@ -495,16 +472,17 @@ static void check_events(void)
ggi_event event;
ggi_event_mask mask;
if ((mask = ggiEventPoll(ggi_conf.parentvis, emAll, &tv)))
if (ggiEventRead(ggi_conf.parentvis, &event, emAll) != 0)
{
mp_dbg(MSGT_VO, MSGL_DBG3, "type: %4x, origin: %4x, sym: %4x, label: %4x, button=%4x\n",
event.any.origin, event.any.type, event.key.sym, event.key.label, event.key.button);
if ((mask = ggiEventPoll(ggi_conf.parentvis, emAll, &tv))) {
if (ggiEventRead(ggi_conf.parentvis, &event, emAll) != 0) {
mp_dbg(MSGT_VO, MSGL_DBG3,
"type: %4x, origin: %4x, "
"sym: %4x, label: %4x, button=%4x\n",
event.any.origin, event.any.type, event.key.sym,
event.key.label, event.key.button);
switch (event.any.type) {
case evKeyPress:
switch(event.key.sym)
{
switch (event.key.sym) {
case GIIK_PAsterisk: /* PStar */
case GIIUC_Asterisk:
mplayer_put_key('*');
@ -587,5 +565,6 @@ static void check_events(void)
break;
} /* switch */
} /* if */
} /* if */
return;
}