From 4ca1fa0a0835d511167017a2621a085076d9fdfa Mon Sep 17 00:00:00 2001 From: diego Date: Mon, 15 Sep 2008 05:40:29 +0000 Subject: Upgrade license of LGPL 2 or later files to LGPL 2.1 or later. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@27614 b3059339-0415-0410-9bf9-f77b7e298cf2 --- libvo/vo_dfbmga.c | 43 +++++++++++++++++++++---------------------- libvo/vo_directfb2.c | 43 ++++++++++++++++++++++--------------------- libvo/vo_gif89a.c | 43 +++++++++++++++++++++---------------------- libvo/vo_quartz.h | 8 ++++---- 4 files changed, 68 insertions(+), 69 deletions(-) (limited to 'libvo') diff --git a/libvo/vo_dfbmga.c b/libvo/vo_dfbmga.c index af1e89105e..3c22145517 100644 --- a/libvo/vo_dfbmga.c +++ b/libvo/vo_dfbmga.c @@ -1,26 +1,25 @@ /* - MPlayer video driver for DirectFB / Matrox G200/G400/G450/G550 - - Copyright (C) 2002-2005 Ville Syrjala - - Originally based on vo_directfb.c by - Jiri Svoboda - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the - Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - Boston, MA 02110-1301 USA. -*/ + * MPlayer video driver for DirectFB / Matrox G200/G400/G450/G550 + * + * copyright (C) 2002-2005 Ville Syrjala + * Originally based on vo_directfb.c by Jiri Svoboda . + * + * This file is part of MPlayer. + * + * MPlayer is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * MPlayer is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with MPlayer; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + */ /* directfb includes */ #include diff --git a/libvo/vo_directfb2.c b/libvo/vo_directfb2.c index 86dbc9b0d2..133f46a07e 100644 --- a/libvo/vo_directfb2.c +++ b/libvo/vo_directfb2.c @@ -1,25 +1,26 @@ /* - MPlayer video driver for DirectFramebuffer device - - (C) 2002 - - Written by Jiri Svoboda - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the - Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - Boston, MA 02110-1301 USA. -*/ + * MPlayer video driver for DirectFramebuffer device + * + * copyright (C) 2002 Jiri Svoboda + * + * based on vo_directfb2.c + * + * This file is part of MPlayer. + * + * MPlayer is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * MPlayer is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with MPlayer; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + */ // directfb includes diff --git a/libvo/vo_gif89a.c b/libvo/vo_gif89a.c index e3e1d6ac95..5e59a3dcef 100644 --- a/libvo/vo_gif89a.c +++ b/libvo/vo_gif89a.c @@ -1,26 +1,25 @@ /* - MPlayer video driver for animated gif output - - (C) 2002 - - Written by Joey Parrish - Based on vo_directfb2.c - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the - Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - Boston, MA 02110-1301 USA. -*/ + * MPlayer video driver for animated GIF output + * + * copyright (C) 2002 Joey Parrish + * based on vo_directfb2.c + * + * This file is part of MPlayer. + * + * MPlayer is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * MPlayer is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with MPlayer; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + */ /* Notes: * when setting output framerate, frames will be ignored as needed diff --git a/libvo/vo_quartz.h b/libvo/vo_quartz.h index b0e8fece46..82eb096ba0 100644 --- a/libvo/vo_quartz.h +++ b/libvo/vo_quartz.h @@ -9,16 +9,16 @@ Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002 Sam Lantinga This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public + modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either - version 2 of the License, or (at your option) any later version. + version 2.1 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. + Lesser General Public License for more details. - You should have received a copy of the GNU Library General Public + You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -- cgit v1.2.3 From d45397dbdd99cbe83f4e297c608aecbbd77c64c2 Mon Sep 17 00:00:00 2001 From: syrjala Date: Mon, 15 Sep 2008 11:47:02 +0000 Subject: Eliminate void * arithmetic. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@27615 b3059339-0415-0410-9bf9-f77b7e298cf2 --- libvo/vo_dfbmga.c | 34 ++++++++++++++++++++-------------- 1 file changed, 20 insertions(+), 14 deletions(-) (limited to 'libvo') diff --git a/libvo/vo_dfbmga.c b/libvo/vo_dfbmga.c index 3c22145517..ac968bb442 100644 --- a/libvo/vo_dfbmga.c +++ b/libvo/vo_dfbmga.c @@ -959,7 +959,8 @@ draw_alpha( int x0, int y0, unsigned char *srca, int stride ) { - void *dst; + uint8_t *dst; + void *ptr; int pitch; if (use_spic) { @@ -974,44 +975,45 @@ draw_alpha( int x0, int y0, osd_dirty |= osd_current; } - if (subframe->Lock( subframe, DSLF_READ | DSLF_WRITE, &dst, &pitch ) != DFB_OK) + if (subframe->Lock( subframe, DSLF_READ | DSLF_WRITE, &ptr, &pitch ) != DFB_OK) return; + dst = ptr; switch (subframe_format) { case DSPF_ALUT44: vo_draw_alpha_alut44( w, h, src, srca, stride, - ((uint8_t *) dst) + pitch * y0 + x0, + dst + pitch * y0 + x0, pitch ); break; case DSPF_RGB32: case DSPF_ARGB: vo_draw_alpha_rgb32( w, h, src, srca, stride, - (( uint8_t *) dst) + pitch * y0 + 4 * x0, + dst + pitch * y0 + 4 * x0, pitch ); break; case DSPF_RGB24: vo_draw_alpha_rgb24( w, h, src, srca, stride, - ((uint8_t *) dst) + pitch * y0 + 3 * x0, + dst + pitch * y0 + 3 * x0, pitch ); break; case DSPF_RGB16: vo_draw_alpha_rgb16( w, h, src, srca, stride, - ((uint8_t *) dst) + pitch * y0 + 2 * x0, + dst + pitch * y0 + 2 * x0, pitch ); break; case DSPF_ARGB1555: vo_draw_alpha_rgb15( w, h, src, srca, stride, - ((uint8_t *) dst) + pitch * y0 + 2 * x0, + dst + pitch * y0 + 2 * x0, pitch ); break; case DSPF_YUY2: vo_draw_alpha_yuy2( w, h, src, srca, stride, - ((uint8_t *) dst) + pitch * y0 + 2 * x0, + dst + pitch * y0 + 2 * x0, pitch ); break; case DSPF_UYVY: vo_draw_alpha_yuy2( w, h, src, srca, stride, - ((uint8_t *) dst) + pitch * y0 + 2 * x0 + 1, + dst + pitch * y0 + 2 * x0 + 1, pitch ); break; #if DIRECTFBVERSION > DFB_VERSION(0,9,21) @@ -1021,7 +1023,7 @@ draw_alpha( int x0, int y0, case DSPF_I420: case DSPF_YV12: vo_draw_alpha_yv12( w, h, src, srca, stride, - ((uint8_t *) dst) + pitch * y0 + x0, + dst + pitch * y0 + x0, pitch ); break; } @@ -1038,11 +1040,13 @@ draw_frame( uint8_t * src[] ) static int draw_slice( uint8_t * src[], int stride[], int w, int h, int x, int y ) { - void *dst; + uint8_t *dst; + void *ptr; int pitch; - if (frame->Lock( frame, DSLF_WRITE, &dst, &pitch ) != DFB_OK) + if (frame->Lock( frame, DSLF_WRITE, &ptr, &pitch ) != DFB_OK) return VO_FALSE; + dst = ptr; memcpy_pic( dst + pitch * y + x, src[0], w, h, pitch, stride[0] ); @@ -1214,7 +1218,8 @@ static uint32_t get_image( mp_image_t *mpi ) { int buf = current_buf; - void *dst; + uint8_t *dst; + void *ptr; int pitch; if (mpi->flags & MP_IMGFLAG_READABLE && @@ -1237,8 +1242,9 @@ get_image( mp_image_t *mpi ) /* Always use DSLF_READ to preserve system memory copy */ if (frame->Lock( frame, DSLF_WRITE | DSLF_READ, - &dst, &pitch ) != DFB_OK) + &ptr, &pitch ) != DFB_OK) return VO_FALSE; + dst = ptr; if ((mpi->width == pitch) || (mpi->flags & (MP_IMGFLAG_ACCEPT_STRIDE | MP_IMGFLAG_ACCEPT_WIDTH))) { -- cgit v1.2.3 From 9a00106a58028aa964cdc8343793be9a394cc6bf Mon Sep 17 00:00:00 2001 From: syrjala Date: Mon, 15 Sep 2008 20:35:05 +0000 Subject: Remove BGR24 support since it has never worked anyway. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@27621 b3059339-0415-0410-9bf9-f77b7e298cf2 --- libvo/vo_dfbmga.c | 10 ---------- 1 file changed, 10 deletions(-) (limited to 'libvo') diff --git a/libvo/vo_dfbmga.c b/libvo/vo_dfbmga.c index ac968bb442..8192a8d0fd 100644 --- a/libvo/vo_dfbmga.c +++ b/libvo/vo_dfbmga.c @@ -136,8 +136,6 @@ pixelformat_name( DFBSurfacePixelFormat format ) return "ARGB"; case DSPF_RGB32: return "RGB32"; - case DSPF_RGB24: - return "RGB24"; case DSPF_RGB16: return "RGB16"; case DSPF_ARGB1555: @@ -169,8 +167,6 @@ imgfmt_to_pixelformat( uint32_t format ) switch (format) { case IMGFMT_BGR32: return DSPF_RGB32; - case IMGFMT_BGR24: - return DSPF_RGB24; case IMGFMT_BGR16: return DSPF_RGB16; case IMGFMT_BGR15: @@ -894,7 +890,6 @@ query_format( uint32_t format ) { switch (format) { case IMGFMT_BGR32: - case IMGFMT_BGR24: case IMGFMT_BGR16: case IMGFMT_BGR15: case IMGFMT_UYVY: @@ -991,11 +986,6 @@ draw_alpha( int x0, int y0, dst + pitch * y0 + 4 * x0, pitch ); break; - case DSPF_RGB24: - vo_draw_alpha_rgb24( w, h, src, srca, stride, - dst + pitch * y0 + 3 * x0, - pitch ); - break; case DSPF_RGB16: vo_draw_alpha_rgb16( w, h, src, srca, stride, dst + pitch * y0 + 2 * x0, -- cgit v1.2.3 From 654db6243721da17c20204ddcdae72efba62212f Mon Sep 17 00:00:00 2001 From: syrjala Date: Mon, 15 Sep 2008 20:39:03 +0000 Subject: Add CRTC1 support. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@27622 b3059339-0415-0410-9bf9-f77b7e298cf2 --- libvo/vo_dfbmga.c | 120 ++++++++++++++++++++++++++++++++++++++++++++++++++---- 1 file changed, 112 insertions(+), 8 deletions(-) (limited to 'libvo') diff --git a/libvo/vo_dfbmga.c b/libvo/vo_dfbmga.c index 8192a8d0fd..898593b00d 100644 --- a/libvo/vo_dfbmga.c +++ b/libvo/vo_dfbmga.c @@ -72,6 +72,7 @@ static IDirectFBSurface *frame; static IDirectFBSurface *subframe; static IDirectFBSurface *besframe; +static IDirectFBSurface *c1frame; static IDirectFBSurface *c2frame; static IDirectFBSurface *spicframe; @@ -79,6 +80,7 @@ static DFBSurfacePixelFormat frame_format; static DFBSurfacePixelFormat subframe_format; static DFBRectangle besrect; +static DFBRectangle c1rect; static DFBRectangle c2rect; static DFBRectangle *subrect; @@ -87,9 +89,11 @@ static IDirectFBInputDevice *remote; static IDirectFBEventBuffer *buffer; static int blit_done; +static int c1stretch; static int stretch; static int use_bes; +static int use_crtc1; static int use_crtc2; static int use_spic; static int use_input; @@ -231,6 +235,7 @@ preinit( const char *arg ) /* Some defaults */ use_bes = 0; + use_crtc1 = 0; use_crtc2 = 1; use_spic = 1; field_parity = -1; @@ -254,6 +259,10 @@ preinit( const char *arg ) use_bes = !opt_no; vo_subdevice += 3; opt_no = 0; + } else if (!strncmp(vo_subdevice, "crtc1", 5)) { + use_crtc1 = !opt_no; + vo_subdevice += 5; + opt_no = 0; } else if (!strncmp(vo_subdevice, "crtc2", 5)) { use_crtc2 = !opt_no; vo_subdevice += 5; @@ -358,6 +367,7 @@ preinit( const char *arg ) "Example: mplayer -vo dfbmga:nocrtc2:bes:buffermode=single\n" "\nOptions (use 'no' prefix to disable):\n" " bes Use Backend Scaler\n" + " crtc1 Use CRTC1\n" " crtc2 Use CRTC2\n" " spic Use hardware sub-picture for OSD\n" " input Use DirectFB for keyboard input\n" @@ -378,10 +388,14 @@ preinit( const char *arg ) return -1; } } - if (!use_bes && !use_crtc2) { + if (!use_bes && !use_crtc1 && !use_crtc2) { mp_msg( MSGT_VO, MSGL_ERR, "vo_dfbmga: No output selected\n" ); return -1; } + if (use_bes && use_crtc1) { + mp_msg( MSGT_VO, MSGL_ERR, "vo_dfbmga: Both BES and CRTC1 outputs selected\n" ); + return -1; + } if ((res = DirectFBInit( NULL, NULL )) != DFB_OK) { mp_msg( MSGT_VO, MSGL_ERR, @@ -419,7 +433,7 @@ preinit( const char *arg ) return -1; } - if (use_bes) { + if (use_crtc1 || use_bes) { struct layer_enum l = { "FBDev Primary Layer", &primary, @@ -554,6 +568,8 @@ static void release_config( void ) spic->Release( spic ); if (c2frame) c2frame->Release( c2frame ); + if (c1frame) + c1frame->Release( c1frame ); if (besframe) besframe->Release( besframe ); if (bufs[0]) @@ -566,6 +582,7 @@ static void release_config( void ) spicframe = NULL; spic = NULL; c2frame = NULL; + c1frame = NULL; besframe = NULL; bufs[0] = NULL; bufs[1] = NULL; @@ -684,6 +701,63 @@ config( uint32_t width, uint32_t height, mp_msg( MSGT_VO, MSGL_INFO, "vo_dfbmga: BES surface %dx%d %s\n", dlc.width, dlc.height, pixelformat_name( dlc.pixelformat ) ); } + /* + * CRTC1 + */ + if (use_crtc1) { + dlc.flags = DLCONF_BUFFERMODE; + dlc.buffermode = buffermode; + + if ((res = primary->TestConfiguration( primary, &dlc, &failed )) != DFB_OK) { + mp_msg( MSGT_VO, MSGL_ERR, + "vo_dfbmga: Invalid CRTC1 configuration - %s!\n", + DirectFBErrorString( res ) ); + return -1; + } + if ((res = primary->SetConfiguration( primary, &dlc )) != DFB_OK) { + mp_msg( MSGT_VO, MSGL_ERR, + "vo_dfbmga: CRTC1 configuration failed - %s!\n", + DirectFBErrorString( res ) ); + return -1; + } + if ((res = primary->GetConfiguration( primary, &dlc )) != DFB_OK) { + mp_msg( MSGT_VO, MSGL_ERR, + "vo_dfbmga: Getting CRTC1 configuration failed - %s!\n", + DirectFBErrorString( res ) ); + return -1; + } + + primary->GetSurface( primary, &c1frame ); + c1frame->SetBlittingFlags( c1frame, DSBLIT_NOFX ); + c1frame->SetColor( c1frame, 0, 0, 0, 0xff ); + + c1frame->GetSize( c1frame, &screen_width, &screen_height ); + + aspect_save_screenres( screen_width, screen_height ); + aspect( &out_width, &out_height, (flags & VOFLAG_FULLSCREEN) ? A_ZOOM : A_NOZOOM ); + + if (in_width != out_width || in_height != out_height) + c1stretch = 1; + else + c1stretch = 0; + + c1rect.x = (screen_width - out_width) / 2; + c1rect.y = (screen_height - out_height) / 2; + c1rect.w = out_width; + c1rect.h = out_height; + + c1frame->Clear( c1frame, 0, 0, 0, 0xff ); + c1frame->Flip( c1frame, NULL, 0 ); + c1frame->Clear( c1frame, 0, 0, 0, 0xff ); + c1frame->Flip( c1frame, NULL, 0 ); + c1frame->Clear( c1frame, 0, 0, 0, 0xff ); + + mp_msg( MSGT_VO, MSGL_INFO, "vo_dfbmga: CRTC1 using %s buffering\n", + dlc.buffermode == DLBM_TRIPLE ? "triple" : + dlc.buffermode == DLBM_BACKVIDEO ? "double" : "single" ); + mp_msg( MSGT_VO, MSGL_INFO, "vo_dfbmga: CRTC1 surface %dx%d %s\n", screen_width, screen_height, pixelformat_name( dlc.pixelformat ) ); + } + /* * CRTC2 */ @@ -865,6 +939,10 @@ config( uint32_t width, uint32_t height, /* Draw OSD to CRTC2 surface */ subframe = c2frame; subrect = &c2rect; + } else if (use_crtc1) { + /* Draw OSD to CRTC1 surface */ + subframe = c1frame; + subrect = &c1rect; } else { /* Draw OSD to BES surface */ subframe = besframe; @@ -876,7 +954,8 @@ config( uint32_t width, uint32_t height, mp_msg( MSGT_VO, MSGL_INFO, "vo_dfbmga: Sub-picture surface %dx%d %s (%s)\n", sub_width, sub_height, pixelformat_name( subframe_format ), - use_crtc2 ? (use_spic ? "Sub-picture layer" : "CRTC2") : "BES" ); + use_crtc2 ? (use_spic ? "Sub-picture layer" : "CRTC2") : + use_crtc1 ? "CRTC1" : "BES" ); osd_dirty = 0; osd_current = 1; @@ -889,21 +968,28 @@ static int query_format( uint32_t format ) { switch (format) { + case IMGFMT_YV12: + case IMGFMT_I420: + case IMGFMT_IYUV: + if (is_g200 || use_crtc1) + return 0; + break; case IMGFMT_BGR32: case IMGFMT_BGR16: case IMGFMT_BGR15: + if (is_g200 && use_bes) + return 0; + break; case IMGFMT_UYVY: - case IMGFMT_YV12: - case IMGFMT_I420: - case IMGFMT_IYUV: if (is_g200) return 0; + break; case IMGFMT_YUY2: break; #if DIRECTFBVERSION > DFB_VERSION(0,9,21) case IMGFMT_NV12: case IMGFMT_NV21: - if (!use_bes || use_crtc2) + if (use_crtc1 || use_crtc2) return 0; break; #endif @@ -1096,6 +1182,18 @@ blit_to_screen( void ) srect = &besrect; } + if (use_crtc1) { +#if DIRECTFBVERSION > DFB_VERSION(0,9,15) + if (vo_vsync && !flipping) + primary->WaitForSync( primary ); +#endif + + if (c1stretch) + c1frame->StretchBlit( c1frame, blitsrc, srect, &c1rect ); + else + c1frame->Blit( c1frame, blitsrc, srect, c1rect.x, c1rect.y ); + } + if (use_crtc2) { #if DIRECTFBVERSION > DFB_VERSION(0,9,15) if (vo_vsync && !flipping) @@ -1161,7 +1259,9 @@ flip_page( void ) if (flipping) { if (use_crtc2) c2frame->Flip( c2frame, NULL, vo_vsync ? DSFLIP_WAITFORSYNC : DSFLIP_ONSYNC ); - else + if (use_crtc1) + c1frame->Flip( c1frame, NULL, vo_vsync ? DSFLIP_WAITFORSYNC : DSFLIP_ONSYNC ); + if (use_bes) besframe->Flip( besframe, NULL, vo_vsync ? DSFLIP_WAITFORSYNC : DSFLIP_ONSYNC ); if (!use_spic) { @@ -1334,6 +1434,8 @@ set_equalizer( char *data, int value ) /* Prefer CRTC2 over BES */ if (use_crtc2) res = crtc2->SetColorAdjustment( crtc2, &ca ); + else if (use_crtc1) + res = primary->SetColorAdjustment( primary, &ca ); else res = bes->SetColorAdjustment( bes, &ca ); @@ -1353,6 +1455,8 @@ get_equalizer( char *data, int *value ) /* Prefer CRTC2 over BES */ if (use_crtc2) res = crtc2->GetColorAdjustment( crtc2, &ca ); + else if (use_crtc1) + res = primary->GetColorAdjustment( primary, &ca ); else res = bes->GetColorAdjustment( bes, &ca ); -- cgit v1.2.3 From af709594ea4f34f1788ffc566127e54b790f2dc9 Mon Sep 17 00:00:00 2001 From: syrjala Date: Mon, 15 Sep 2008 20:41:08 +0000 Subject: Rename some variables and change some strings to make the CRTC1 code clearer. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@27623 b3059339-0415-0410-9bf9-f77b7e298cf2 --- libvo/vo_dfbmga.c | 38 +++++++++++++++++++------------------- 1 file changed, 19 insertions(+), 19 deletions(-) (limited to 'libvo') diff --git a/libvo/vo_dfbmga.c b/libvo/vo_dfbmga.c index 898593b00d..8d22123826 100644 --- a/libvo/vo_dfbmga.c +++ b/libvo/vo_dfbmga.c @@ -58,7 +58,7 @@ const LIBVO_EXTERN(dfbmga) */ static IDirectFB *dfb; -static IDirectFBDisplayLayer *primary; +static IDirectFBDisplayLayer *crtc1; static IDirectFBDisplayLayer *bes; static IDirectFBDisplayLayer *crtc2; static IDirectFBDisplayLayer *spic; @@ -90,7 +90,7 @@ static IDirectFBEventBuffer *buffer; static int blit_done; static int c1stretch; -static int stretch; +static int c2stretch; static int use_bes; static int use_crtc1; @@ -436,18 +436,18 @@ preinit( const char *arg ) if (use_crtc1 || use_bes) { struct layer_enum l = { "FBDev Primary Layer", - &primary, + &crtc1, DFB_UNSUPPORTED }; dfb->EnumDisplayLayers( dfb, get_layer_by_name, &l ); if (l.res != DFB_OK) { - mp_msg( MSGT_VO, MSGL_ERR, "vo_dfbmga: Can't get primary layer - %s\n", + mp_msg( MSGT_VO, MSGL_ERR, "vo_dfbmga: Can't get CRTC1 layer - %s\n", DirectFBErrorString( l.res ) ); uninit(); return -1; } - if ((res = primary->SetCooperativeLevel( primary, DLSCL_EXCLUSIVE )) != DFB_OK) { - mp_msg( MSGT_VO, MSGL_ERR, "Can't get exclusive access to primary layer - %s\n", + if ((res = crtc1->SetCooperativeLevel( crtc1, DLSCL_EXCLUSIVE )) != DFB_OK) { + mp_msg( MSGT_VO, MSGL_ERR, "Can't get exclusive access to CRTC1 layer - %s\n", DirectFBErrorString( res ) ); uninit(); return -1; @@ -708,26 +708,26 @@ config( uint32_t width, uint32_t height, dlc.flags = DLCONF_BUFFERMODE; dlc.buffermode = buffermode; - if ((res = primary->TestConfiguration( primary, &dlc, &failed )) != DFB_OK) { + if ((res = crtc1->TestConfiguration( crtc1, &dlc, &failed )) != DFB_OK) { mp_msg( MSGT_VO, MSGL_ERR, "vo_dfbmga: Invalid CRTC1 configuration - %s!\n", DirectFBErrorString( res ) ); return -1; } - if ((res = primary->SetConfiguration( primary, &dlc )) != DFB_OK) { + if ((res = crtc1->SetConfiguration( crtc1, &dlc )) != DFB_OK) { mp_msg( MSGT_VO, MSGL_ERR, "vo_dfbmga: CRTC1 configuration failed - %s!\n", DirectFBErrorString( res ) ); return -1; } - if ((res = primary->GetConfiguration( primary, &dlc )) != DFB_OK) { + if ((res = crtc1->GetConfiguration( crtc1, &dlc )) != DFB_OK) { mp_msg( MSGT_VO, MSGL_ERR, "vo_dfbmga: Getting CRTC1 configuration failed - %s!\n", DirectFBErrorString( res ) ); return -1; } - primary->GetSurface( primary, &c1frame ); + crtc1->GetSurface( crtc1, &c1frame ); c1frame->SetBlittingFlags( c1frame, DSBLIT_NOFX ); c1frame->SetColor( c1frame, 0, 0, 0, 0xff ); @@ -842,9 +842,9 @@ config( uint32_t width, uint32_t height, if (in_width != out_width || in_height != out_height) - stretch = 1; + c2stretch = 1; else - stretch = 0; + c2stretch = 0; c2rect.x = (screen_width - out_width) / 2; c2rect.y = (screen_height - out_height) / 2; @@ -1185,7 +1185,7 @@ blit_to_screen( void ) if (use_crtc1) { #if DIRECTFBVERSION > DFB_VERSION(0,9,15) if (vo_vsync && !flipping) - primary->WaitForSync( primary ); + crtc1->WaitForSync( crtc1 ); #endif if (c1stretch) @@ -1200,7 +1200,7 @@ blit_to_screen( void ) crtc2->WaitForSync( crtc2 ); #endif - if (stretch) + if (c2stretch) c2frame->StretchBlit( c2frame, blitsrc, srect, &c2rect ); else c2frame->Blit( c2frame, blitsrc, srect, c2rect.x, c2rect.y ); @@ -1290,8 +1290,8 @@ uninit( void ) crtc2->Release( crtc2 ); if (bes) bes->Release( bes ); - if (primary) - primary->Release( primary ); + if (crtc1) + crtc1->Release( crtc1 ); if (dfb) dfb->Release( dfb ); @@ -1300,7 +1300,7 @@ uninit( void ) keyboard = NULL; crtc2 = NULL; bes = NULL; - primary = NULL; + crtc1 = NULL; dfb = NULL; } @@ -1435,7 +1435,7 @@ set_equalizer( char *data, int value ) if (use_crtc2) res = crtc2->SetColorAdjustment( crtc2, &ca ); else if (use_crtc1) - res = primary->SetColorAdjustment( primary, &ca ); + res = crtc1->SetColorAdjustment( crtc1, &ca ); else res = bes->SetColorAdjustment( bes, &ca ); @@ -1456,7 +1456,7 @@ get_equalizer( char *data, int *value ) if (use_crtc2) res = crtc2->GetColorAdjustment( crtc2, &ca ); else if (use_crtc1) - res = primary->GetColorAdjustment( primary, &ca ); + res = crtc1->GetColorAdjustment( crtc1, &ca ); else res = bes->GetColorAdjustment( bes, &ca ); -- cgit v1.2.3 From 7c94b443089d174e37085df4f5995031faf1fd35 Mon Sep 17 00:00:00 2001 From: syrjala Date: Mon, 15 Sep 2008 20:43:24 +0000 Subject: Don't limit BES to non-synced single buffering when CRTC2 is used. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@27624 b3059339-0415-0410-9bf9-f77b7e298cf2 --- libvo/vo_dfbmga.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) (limited to 'libvo') diff --git a/libvo/vo_dfbmga.c b/libvo/vo_dfbmga.c index 8d22123826..1b2e477fe9 100644 --- a/libvo/vo_dfbmga.c +++ b/libvo/vo_dfbmga.c @@ -666,10 +666,6 @@ config( uint32_t width, uint32_t height, dlc.flags = DLCONF_WIDTH | DLCONF_HEIGHT | DLCONF_PIXELFORMAT | DLCONF_BUFFERMODE; dlc.width = besrect.w + besrect.x * 2; dlc.height = besrect.h + besrect.y * 2; - - if (use_crtc2) - dlc.buffermode = DLBM_FRONTONLY; - else dlc.buffermode = buffermode; if ((res = bes->TestConfiguration( bes, &dlc, &failed )) != DFB_OK) { @@ -1173,7 +1169,7 @@ blit_to_screen( void ) if (use_bes) { #if DIRECTFBVERSION > DFB_VERSION(0,9,15) - if (vo_vsync && !flipping && !use_crtc2) + if (vo_vsync && !flipping) bes->WaitForSync( bes ); #endif -- cgit v1.2.3 From b129179e5d68a6980316fc726de3d88c08560532 Mon Sep 17 00:00:00 2001 From: syrjala Date: Mon, 15 Sep 2008 20:45:17 +0000 Subject: Cosmetics: - Convert tabs to spaces - Remove trailing whitespace - Remove useless comments git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@27625 b3059339-0415-0410-9bf9-f77b7e298cf2 --- libvo/vo_dfbmga.c | 275 ++++++++++++++++++++++++++---------------------------- 1 file changed, 132 insertions(+), 143 deletions(-) (limited to 'libvo') diff --git a/libvo/vo_dfbmga.c b/libvo/vo_dfbmga.c index 1b2e477fe9..cf4528b630 100644 --- a/libvo/vo_dfbmga.c +++ b/libvo/vo_dfbmga.c @@ -49,13 +49,6 @@ static const vo_info_t info = { const LIBVO_EXTERN(dfbmga) -/****************************** -* directfb * -******************************/ - -/* - * (Globals) - */ static IDirectFB *dfb; static IDirectFBDisplayLayer *crtc1; @@ -110,10 +103,6 @@ static int osd_max; static int is_g200; -/****************************** -* vo_dfbmga * -******************************/ - #if DIRECTFBVERSION < DFB_VERSION(0,9,18) #define DSPF_ALUT44 DSPF_LUT8 #define DLBM_TRIPLE ~0 @@ -141,19 +130,19 @@ pixelformat_name( DFBSurfacePixelFormat format ) case DSPF_RGB32: return "RGB32"; case DSPF_RGB16: - return "RGB16"; + return "RGB16"; case DSPF_ARGB1555: - return "ARGB1555"; + return "ARGB1555"; case DSPF_YUY2: - return "YUY2"; + return "YUY2"; case DSPF_UYVY: - return "UYVY"; + return "UYVY"; case DSPF_YV12: - return "YV12"; + return "YV12"; case DSPF_I420: - return "I420"; + return "I420"; case DSPF_ALUT44: - return "ALUT44"; + return "ALUT44"; #if DIRECTFBVERSION > DFB_VERSION(0,9,21) case DSPF_NV12: return "NV12"; @@ -161,7 +150,7 @@ pixelformat_name( DFBSurfacePixelFormat format ) return "NV21"; #endif default: - return "Unknown pixel format"; + return "Unknown pixel format"; } } @@ -170,17 +159,17 @@ imgfmt_to_pixelformat( uint32_t format ) { switch (format) { case IMGFMT_BGR32: - return DSPF_RGB32; + return DSPF_RGB32; case IMGFMT_BGR16: - return DSPF_RGB16; + return DSPF_RGB16; case IMGFMT_BGR15: - return DSPF_ARGB1555; + return DSPF_ARGB1555; case IMGFMT_YUY2: - return DSPF_YUY2; + return DSPF_YUY2; case IMGFMT_UYVY: - return DSPF_UYVY; + return DSPF_UYVY; case IMGFMT_YV12: - return DSPF_YV12; + return DSPF_YV12; case IMGFMT_I420: case IMGFMT_IYUV: return DSPF_I420; @@ -191,7 +180,7 @@ imgfmt_to_pixelformat( uint32_t format ) return DSPF_NV21; #endif default: - return DSPF_UNKNOWN; + return DSPF_UNKNOWN; } } @@ -360,7 +349,7 @@ preinit( const char *arg ) show_help = 1; break; } - } + } if (show_help) { mp_msg( MSGT_VO, MSGL_ERR, "\nvo_dfbmga command line help:\n" @@ -389,49 +378,49 @@ preinit( const char *arg ) } } if (!use_bes && !use_crtc1 && !use_crtc2) { - mp_msg( MSGT_VO, MSGL_ERR, "vo_dfbmga: No output selected\n" ); + mp_msg( MSGT_VO, MSGL_ERR, "vo_dfbmga: No output selected\n" ); return -1; } if (use_bes && use_crtc1) { - mp_msg( MSGT_VO, MSGL_ERR, "vo_dfbmga: Both BES and CRTC1 outputs selected\n" ); + mp_msg( MSGT_VO, MSGL_ERR, "vo_dfbmga: Both BES and CRTC1 outputs selected\n" ); return -1; } - if ((res = DirectFBInit( NULL, NULL )) != DFB_OK) { - mp_msg( MSGT_VO, MSGL_ERR, - "vo_dfbmga: DirectFBInit() failed - %s\n", - DirectFBErrorString( res ) ); - return -1; - } + if ((res = DirectFBInit( NULL, NULL )) != DFB_OK) { + mp_msg( MSGT_VO, MSGL_ERR, + "vo_dfbmga: DirectFBInit() failed - %s\n", + DirectFBErrorString( res ) ); + return -1; + } - switch (tvnorm) { - case 0: - DirectFBSetOption( "matrox-tv-standard", "pal" ); - mp_msg( MSGT_VO, MSGL_INFO, "vo_dfbmga: Forced TV standard to PAL\n" ); - break; - case 1: + switch (tvnorm) { + case 0: + DirectFBSetOption( "matrox-tv-standard", "pal" ); + mp_msg( MSGT_VO, MSGL_INFO, "vo_dfbmga: Forced TV standard to PAL\n" ); + break; + case 1: + DirectFBSetOption( "matrox-tv-standard", "ntsc" ); + mp_msg( MSGT_VO, MSGL_INFO, "vo_dfbmga: Forced TV standard to NTSC\n" ); + break; + case 2: + if (vo_fps > 27) { DirectFBSetOption( "matrox-tv-standard", "ntsc" ); - mp_msg( MSGT_VO, MSGL_INFO, "vo_dfbmga: Forced TV standard to NTSC\n" ); - break; - case 2: - if (vo_fps > 27) { - DirectFBSetOption( "matrox-tv-standard", "ntsc" ); - mp_msg( MSGT_VO, MSGL_INFO, - "vo_dfbmga: Selected TV standard based upon FPS: NTSC\n" ); - } else { - DirectFBSetOption( "matrox-tv-standard", "pal" ); - mp_msg( MSGT_VO, MSGL_INFO, - "vo_dfbmga: Selected TV standard based upon FPS: PAL\n" ); - } - break; + mp_msg( MSGT_VO, MSGL_INFO, + "vo_dfbmga: Selected TV standard based upon FPS: NTSC\n" ); + } else { + DirectFBSetOption( "matrox-tv-standard", "pal" ); + mp_msg( MSGT_VO, MSGL_INFO, + "vo_dfbmga: Selected TV standard based upon FPS: PAL\n" ); } + break; + } - if ((res = DirectFBCreate( &dfb )) != DFB_OK) { - mp_msg( MSGT_VO, MSGL_ERR, - "vo_dfbmga: DirectFBCreate() failed - %s\n", - DirectFBErrorString( res ) ); - return -1; - } + if ((res = DirectFBCreate( &dfb )) != DFB_OK) { + mp_msg( MSGT_VO, MSGL_ERR, + "vo_dfbmga: DirectFBCreate() failed - %s\n", + DirectFBErrorString( res ) ); + return -1; + } if (use_crtc1 || use_bes) { struct layer_enum l = { @@ -556,7 +545,7 @@ preinit( const char *arg ) return -1; } } - + return 0; } @@ -578,7 +567,7 @@ static void release_config( void ) bufs[1]->Release( bufs[1] ); if (bufs[2]) bufs[2]->Release( bufs[2] ); - + spicframe = NULL; spic = NULL; c2frame = NULL; @@ -594,7 +583,7 @@ 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 format ) { DFBResult res; @@ -666,7 +655,7 @@ config( uint32_t width, uint32_t height, dlc.flags = DLCONF_WIDTH | DLCONF_HEIGHT | DLCONF_PIXELFORMAT | DLCONF_BUFFERMODE; dlc.width = besrect.w + besrect.x * 2; dlc.height = besrect.h + besrect.y * 2; - dlc.buffermode = buffermode; + dlc.buffermode = buffermode; if ((res = bes->TestConfiguration( bes, &dlc, &failed )) != DFB_OK) { mp_msg( MSGT_VO, MSGL_ERR, @@ -964,33 +953,33 @@ static int query_format( uint32_t format ) { switch (format) { - case IMGFMT_YV12: - case IMGFMT_I420: - case IMGFMT_IYUV: - if (is_g200 || use_crtc1) - return 0; - break; - case IMGFMT_BGR32: - case IMGFMT_BGR16: - case IMGFMT_BGR15: - if (is_g200 && use_bes) - return 0; - break; - case IMGFMT_UYVY: - if (is_g200) - return 0; - break; - case IMGFMT_YUY2: - break; + case IMGFMT_YV12: + case IMGFMT_I420: + case IMGFMT_IYUV: + if (is_g200 || use_crtc1) + return 0; + break; + case IMGFMT_BGR32: + case IMGFMT_BGR16: + case IMGFMT_BGR15: + if (is_g200 && use_bes) + return 0; + break; + case IMGFMT_UYVY: + if (is_g200) + return 0; + break; + case IMGFMT_YUY2: + break; #if DIRECTFBVERSION > DFB_VERSION(0,9,21) - case IMGFMT_NV12: - case IMGFMT_NV21: - if (use_crtc1 || use_crtc2) - return 0; - break; -#endif - default: + case IMGFMT_NV12: + case IMGFMT_NV21: + if (use_crtc1 || use_crtc2) return 0; + break; +#endif + default: + return 0; } return VFCAP_HWSCALE_UP | @@ -1002,11 +991,11 @@ query_format( uint32_t format ) static void vo_draw_alpha_alut44( int w, int h, - unsigned char* src, - unsigned char *srca, - int srcstride, - unsigned char* dst, - int dststride ) + unsigned char* src, + unsigned char *srca, + int srcstride, + unsigned char* dst, + int dststride ) { int x; @@ -1033,7 +1022,7 @@ static void draw_alpha( int x0, int y0, int w, int h, unsigned char *src, - unsigned char *srca, + unsigned char *srca, int stride ) { uint8_t *dst; @@ -1060,44 +1049,44 @@ draw_alpha( int x0, int y0, case DSPF_ALUT44: vo_draw_alpha_alut44( w, h, src, srca, stride, dst + pitch * y0 + x0, - pitch ); + pitch ); break; case DSPF_RGB32: case DSPF_ARGB: - vo_draw_alpha_rgb32( w, h, src, srca, stride, + vo_draw_alpha_rgb32( w, h, src, srca, stride, dst + pitch * y0 + 4 * x0, pitch ); - break; + break; case DSPF_RGB16: - vo_draw_alpha_rgb16( w, h, src, srca, stride, + vo_draw_alpha_rgb16( w, h, src, srca, stride, dst + pitch * y0 + 2 * x0, pitch ); - break; + break; case DSPF_ARGB1555: - vo_draw_alpha_rgb15( w, h, src, srca, stride, + vo_draw_alpha_rgb15( w, h, src, srca, stride, dst + pitch * y0 + 2 * x0, pitch ); - break; + break; case DSPF_YUY2: - vo_draw_alpha_yuy2( w, h, src, srca, stride, + vo_draw_alpha_yuy2( w, h, src, srca, stride, dst + pitch * y0 + 2 * x0, pitch ); - break; + break; case DSPF_UYVY: - vo_draw_alpha_yuy2( w, h, src, srca, stride, + vo_draw_alpha_yuy2( w, h, src, srca, stride, dst + pitch * y0 + 2 * x0 + 1, pitch ); - break; + break; #if DIRECTFBVERSION > DFB_VERSION(0,9,21) case DSPF_NV12: case DSPF_NV21: #endif case DSPF_I420: case DSPF_YV12: - vo_draw_alpha_yv12( w, h, src, srca, stride, + vo_draw_alpha_yv12( w, h, src, srca, stride, dst + pitch * y0 + x0, pitch ); - break; + break; } subframe->Unlock( subframe ); @@ -1135,25 +1124,25 @@ draw_slice( uint8_t * src[], int stride[], int w, int h, int x, int y ) } else #endif { - x /= 2; - w /= 2; - pitch /= 2; + x /= 2; + w /= 2; + pitch /= 2; - if (frame_format == DSPF_I420 ) - memcpy_pic( dst + pitch * y + x, src[1], - w, h, pitch, stride[1] ); - else - memcpy_pic( dst + pitch * y + x, src[2], - w, h, pitch, stride[2] ); + if (frame_format == DSPF_I420 ) + memcpy_pic( dst + pitch * y + x, src[1], + w, h, pitch, stride[1] ); + else + memcpy_pic( dst + pitch * y + x, src[2], + w, h, pitch, stride[2] ); - dst += pitch * buf_height / 2; + dst += pitch * buf_height / 2; - if (frame_format == DSPF_I420 ) - memcpy_pic( dst + pitch * y + x, src[2], - w, h, pitch, stride[2] ); - else - memcpy_pic( dst + pitch * y + x, src[1], - w, h, pitch, stride[1] ); + if (frame_format == DSPF_I420 ) + memcpy_pic( dst + pitch * y + x, src[2], + w, h, pitch, stride[2] ); + else + memcpy_pic( dst + pitch * y + x, src[1], + w, h, pitch, stride[1] ); } frame->Unlock( frame ); @@ -1196,9 +1185,9 @@ blit_to_screen( void ) crtc2->WaitForSync( crtc2 ); #endif - if (c2stretch) + if (c2stretch) c2frame->StretchBlit( c2frame, blitsrc, srect, &c2rect ); - else + else c2frame->Blit( c2frame, blitsrc, srect, c2rect.x, c2rect.y ); } } @@ -1232,8 +1221,8 @@ draw_osd( void ) osd_dirty &= ~osd_current; } - blit_to_screen(); - blit_done = 1; + blit_to_screen(); + blit_done = 1; vo_remove_text( sub_width, sub_height, clear_alpha ); vo_draw_text( sub_width, sub_height, draw_alpha ); @@ -1249,8 +1238,8 @@ draw_osd( void ) static void flip_page( void ) { - if (!blit_done) - blit_to_screen(); + if (!blit_done) + blit_to_screen(); if (flipping) { if (use_crtc2) @@ -1341,17 +1330,17 @@ get_image( mp_image_t *mpi ) if (mpi->flags & MP_IMGFLAG_PLANAR) { if (mpi->num_planes > 2) { - mpi->stride[1] = mpi->stride[2] = pitch / 2; + mpi->stride[1] = mpi->stride[2] = pitch / 2; - if (mpi->flags & MP_IMGFLAG_SWAPPED) { - /* I420 */ - mpi->planes[1] = dst + buf_height * pitch; - mpi->planes[2] = mpi->planes[1] + buf_height * pitch / 4; - } else { - /* YV12 */ - mpi->planes[2] = dst + buf_height * pitch; - mpi->planes[1] = mpi->planes[2] + buf_height * pitch / 4; - } + if (mpi->flags & MP_IMGFLAG_SWAPPED) { + /* I420 */ + mpi->planes[1] = dst + buf_height * pitch; + mpi->planes[2] = mpi->planes[1] + buf_height * pitch / 4; + } else { + /* YV12 */ + mpi->planes[2] = dst + buf_height * pitch; + mpi->planes[1] = mpi->planes[2] + buf_height * pitch / 4; + } } else { /* NV12/NV21 */ mpi->stride[1] = pitch; @@ -1458,7 +1447,7 @@ get_equalizer( char *data, int *value ) if (res != DFB_OK) return VO_FALSE; - + if (!strcasecmp( data, "brightness" ) && (ca.flags & DCAF_BRIGHTNESS)) *value = (ca.brightness - 0x8000) * factor; @@ -1484,7 +1473,7 @@ control( uint32_t request, void *data, ... ) return VO_TRUE; case VOCTRL_QUERY_FORMAT: - return query_format( *((uint32_t *) data) ); + return query_format( *((uint32_t *) data) ); case VOCTRL_GET_IMAGE: return get_image( data ); @@ -1597,7 +1586,7 @@ check_events( void ) mplayer_put_key( KEY_PREV ); break; case DIKS_VOLUME_UP: - mplayer_put_key( KEY_VOLUME_UP ); + mplayer_put_key( KEY_VOLUME_UP ); break; case DIKS_VOLUME_DOWN: mplayer_put_key( KEY_VOLUME_DOWN ); -- cgit v1.2.3 From d4471e0a095e25e2e8932cf41f8eee4a62edd14c Mon Sep 17 00:00:00 2001 From: syrjala Date: Mon, 15 Sep 2008 20:46:43 +0000 Subject: Update the copyright statement. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@27626 b3059339-0415-0410-9bf9-f77b7e298cf2 --- libvo/vo_dfbmga.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'libvo') diff --git a/libvo/vo_dfbmga.c b/libvo/vo_dfbmga.c index cf4528b630..fd1a3638db 100644 --- a/libvo/vo_dfbmga.c +++ b/libvo/vo_dfbmga.c @@ -1,7 +1,7 @@ /* * MPlayer video driver for DirectFB / Matrox G200/G400/G450/G550 * - * copyright (C) 2002-2005 Ville Syrjala + * copyright (C) 2002-2008 Ville Syrjala * Originally based on vo_directfb.c by Jiri Svoboda . * * This file is part of MPlayer. -- cgit v1.2.3 From 0643fde0c3e40d8be813c890d5009c9d878ea83e Mon Sep 17 00:00:00 2001 From: reimar Date: Sat, 20 Sep 2008 08:14:28 +0000 Subject: Use already "prefetched" atoms instead of calling XInternAtom each time. Patch by Julien Danjou [ julien danjou info ] git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@27648 b3059339-0415-0410-9bf9-f77b7e298cf2 --- libvo/x11_common.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) (limited to 'libvo') diff --git a/libvo/x11_common.c b/libvo/x11_common.c index 65b88cb307..4dac528361 100644 --- a/libvo/x11_common.c +++ b/libvo/x11_common.c @@ -140,14 +140,11 @@ void vo_x11_ewmh_fullscreen(int action) xev.xclient.type = ClientMessage; xev.xclient.serial = 0; xev.xclient.send_event = True; - xev.xclient.message_type = XInternAtom(mDisplay, - "_NET_WM_STATE", False); + xev.xclient.message_type = XA_NET_WM_STATE; xev.xclient.window = vo_window; xev.xclient.format = 32; xev.xclient.data.l[0] = action; - xev.xclient.data.l[1] = XInternAtom(mDisplay, - "_NET_WM_STATE_FULLSCREEN", - False); + xev.xclient.data.l[1] = XA_NET_WM_STATE_FULLSCREEN; xev.xclient.data.l[2] = 0; xev.xclient.data.l[3] = 0; xev.xclient.data.l[4] = 0; -- cgit v1.2.3 From 7756839a147ce2421cfb4e3de046364962094b60 Mon Sep 17 00:00:00 2001 From: reimar Date: Sat, 20 Sep 2008 08:16:05 +0000 Subject: Remove already disabled and probably long obsolete code that worked around an OpenBox bug. Patch by Julien Danjou [ julien danjou info ] git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@27649 b3059339-0415-0410-9bf9-f77b7e298cf2 --- libvo/x11_common.c | 16 ---------------- 1 file changed, 16 deletions(-) (limited to 'libvo') diff --git a/libvo/x11_common.c b/libvo/x11_common.c index 4dac528361..287e0b3a0a 100644 --- a/libvo/x11_common.c +++ b/libvo/x11_common.c @@ -101,7 +101,6 @@ static Atom XA_NET_WM_PID; static Atom XA_WIN_PROTOCOLS; static Atom XA_WIN_LAYER; static Atom XA_WIN_HINTS; -static Atom XA_BLACKBOX_PID; static Atom XAWM_PROTOCOLS; static Atom XAWM_DELETE_WINDOW; @@ -325,20 +324,6 @@ static int vo_wm_detect(void) for (i = 0; i < nitems; i++) wm |= net_wm_support_state_test(args[i]); XFree(args); -#if 0 - // ugly hack for broken OpenBox _NET_WM_STATE_FULLSCREEN support - // (in their implementation it only changes internal window state, nothing more!!!) - if (wm & vo_wm_FULLSCREEN) - { - if (x11_get_property(XA_BLACKBOX_PID, &args, &nitems)) - { - mp_msg(MSGT_VO, MSGL_V, - "[x11] Detected wm is a broken OpenBox.\n"); - wm ^= vo_wm_FULLSCREEN; - } - XFree(args); - } -#endif } if (wm == 0) @@ -358,7 +343,6 @@ static void init_atoms(void) XA_INIT(_WIN_PROTOCOLS); XA_INIT(_WIN_LAYER); XA_INIT(_WIN_HINTS); - XA_INIT(_BLACKBOX_PID); XA_INIT(WM_PROTOCOLS); XA_INIT(WM_DELETE_WINDOW); } -- cgit v1.2.3