Ticket #251: mplayer-20050304-noidle.diff

File mplayer-20050304-noidle.diff, 3.8 KB (added by nicolas.george@…, 22 years ago)

-xtest-noidle option

  • MPlayer-20050304

    diff -ru MPlayer-20050304/cfg-mplayer.h MPlayer-20050304.noidle/cfg-mplayer.h
    old new  
    6969#endif
    7070extern int WinID;
    7171
     72#ifdef HAVE_XTEST
     73extern int xtest_noidle;
     74#endif
     75
    7276#ifdef HAVE_MENU
    7377extern int menu_startup;
    7478#endif
    … …  
    183187        {"display", &mDisplayName, CONF_TYPE_STRING, 0, 0, 0, NULL},
    184188#endif
    185189
     190#ifdef HAVE_XTEST
     191        {"xtest-noidle", &xtest_noidle, CONF_TYPE_INT, 0, 0, 0, NULL},
     192#endif
     193
    186194        // -vo png only:
    187195#ifdef HAVE_PNG
    188196        {"z", "-z is replaced by -vo png:z=<0-9>\n", CONF_TYPE_PRINT, 0, 0, 0, NULL},
  • MPlayer-20050304

    diff -ru MPlayer-20050304/libvo/vo_gl.c MPlayer-20050304.noidle/libvo/vo_gl.c
    old new  
    371371static void
    372372flip_page(void)
    373373{
     374#ifdef HAVE_XTEST
     375  vo_x11_noidle();
     376#endif
    374377
    375378//  glEnable(GL_TEXTURE_2D);
    376379//  glBindTexture(GL_TEXTURE_2D, texture_id);
  • MPlayer-20050304

    diff -ru MPlayer-20050304/libvo/vo_x11.c MPlayer-20050304.noidle/libvo/vo_x11.c
    old new  
    568568
    569569static void flip_page(void)
    570570{
     571#ifdef HAVE_XTEST
     572    vo_x11_noidle();
     573#endif
    571574    Display_Image(myximage, ImageData);
    572575    XSync(mDisplay, False);
    573576}
  • MPlayer-20050304

    diff -ru MPlayer-20050304/libvo/vo_xv.c MPlayer-20050304.noidle/libvo/vo_xv.c
    old new  
    602602
    603603static void flip_page(void)
    604604{
     605#ifdef HAVE_XTEST
     606    vo_x11_noidle();
     607#endif
     608
    605609    put_xvimage( xvimage[current_buf] );
    606610
    607611    /* remember the currently visible buffer */
  • libvo/x11_common.c

    diff -ru MPlayer-20050304/libvo/x11_common.c MPlayer-20050304.noidle/libvo/x11_common.c
    old new  
    536536    mDisplay = NULL;
    537537}
    538538
     539#ifdef HAVE_XTEST
     540#include <X11/extensions/XTest.h>
     541
     542int xtest_noidle = -1;
     543static int xtest_noidle_step = 30, xtest_noidle_cpt;
     544
     545void vo_x11_noidle(void)
     546{
     547    if(--xtest_noidle_cpt > 0)
     548        return;
     549    xtest_noidle_cpt = xtest_noidle_step;
     550    if(!XTestFakeKeyEvent(mDisplay, xtest_noidle, True, 0L) ||
     551        !XTestFakeKeyEvent(mDisplay, xtest_noidle, False, 0L)) {
     552        mp_msg(MSGT_VO, MSGL_WARN, "Fake key press failed.\n");
     553    }
     554}
     555#endif
     556
    539557#include "osdep/keycodes.h"
    540558#include "wskeys.h"
    541559
    … …  
    17001718
    17011719    int interval, prefer_blank, allow_exp;
    17021720
     1721#ifdef HAVE_XTEST
     1722    if(xtest_noidle > 0) {
     1723        int nothing;
     1724
     1725        if(XTestQueryExtension(mDisplay, &nothing, &nothing,
     1726            &nothing, &nothing)) {
     1727            mp_msg(MSGT_VO, MSGL_V, "Using XTest noidle.\n");
     1728            xtest_noidle_cpt = xtest_noidle_step;
     1729            return;
     1730        } else {
     1731            mp_msg(MSGT_VO, MSGL_WARN, "XTest not available.\n");
     1732            xtest_noidle = -1;
     1733        }
     1734    }
     1735#endif
     1736
    17031737#ifdef HAVE_XDPMS
    17041738    int nothing;
    17051739
  • libvo/x11_common.h

    diff -ru MPlayer-20050304/libvo/x11_common.h MPlayer-20050304.noidle/libvo/x11_common.h
    old new  
    5959extern void vo_x11_fullscreen( void );
    6060extern void vo_x11_setlayer( Display * mDisplay,Window vo_window,int layer );
    6161extern void vo_x11_uninit();
     62extern void vo_x11_noidle( void );
    6263extern Colormap vo_x11_create_colormap(XVisualInfo *vinfo);
    6364extern uint32_t vo_x11_set_equalizer(char *name, int value);
    6465extern uint32_t vo_x11_get_equalizer(char *name, int *value);