diff options
author | Uoti Urpala <uau@glyph.nonexistent.invalid> | 2009-11-16 06:54:22 +0200 |
---|---|---|
committer | Uoti Urpala <uau@glyph.nonexistent.invalid> | 2009-11-16 07:01:46 +0200 |
commit | 287b62163eed8811b6cd33716c0691d328947d48 (patch) | |
tree | 3143d2cb17b32a19e3e7e0aa428210d1bba3eb0b /libvo | |
parent | 507f4fe6c7811558b1367e4b64855ae7f9bc8da8 (diff) | |
parent | b411278fbb00767b8013604157a43e0203f66f4c (diff) | |
download | mpv-287b62163eed8811b6cd33716c0691d328947d48.tar.bz2 mpv-287b62163eed8811b6cd33716c0691d328947d48.tar.xz |
Merge svn changes up to r29912
Diffstat (limited to 'libvo')
-rw-r--r-- | libvo/aspecttest.c | 4 | ||||
-rw-r--r-- | libvo/osx_common.c | 51 | ||||
-rw-r--r-- | libvo/sub.c | 16 | ||||
-rw-r--r-- | libvo/video_out.c | 5 | ||||
-rw-r--r-- | libvo/video_out.h | 3 | ||||
-rw-r--r-- | libvo/x11_common.c | 21 |
6 files changed, 76 insertions, 24 deletions
diff --git a/libvo/aspecttest.c b/libvo/aspecttest.c index 3d6064c577..b73e8c589c 100644 --- a/libvo/aspecttest.c +++ b/libvo/aspecttest.c @@ -18,6 +18,7 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ +#include <stdint.h> #include <stdio.h> #include <stdlib.h> @@ -27,8 +28,11 @@ #define DEF_ZOOM 1 extern float monitor_aspect; +int vo_dheight; +int vo_dwidth; int vo_fs; float vo_panscan; +int64_t WinID = -1; int main(int argc, char *argv[]) { int w,h,z=DEF_ZOOM; diff --git a/libvo/osx_common.c b/libvo/osx_common.c index 359e6a78f7..e82bc7aa6e 100644 --- a/libvo/osx_common.c +++ b/libvo/osx_common.c @@ -25,6 +25,57 @@ #include "osdep/keycodes.h" #include "input/input.h" +/* + * Define keycodes only found in OSX >= 10.5 for older versions + */ +#if MAC_OS_X_VERSION_MAX_ALLOWED <= 1040 +#define kVK_ANSI_Keypad0 0x52 +#define kVK_ANSI_Keypad1 0x53 +#define kVK_ANSI_Keypad2 0x54 +#define kVK_ANSI_Keypad3 0x55 +#define kVK_ANSI_Keypad4 0x56 +#define kVK_ANSI_Keypad5 0x57 +#define kVK_ANSI_Keypad6 0x58 +#define kVK_ANSI_Keypad7 0x59 +#define kVK_ANSI_Keypad8 0x5b +#define kVK_ANSI_Keypad9 0x5c +#define kVK_ANSI_KeypadDecimal 0x41 +#define kVK_ANSI_KeypadDivide 0x4b +#define kVK_ANSI_KeypadEnter 0x4c +#define kVK_ANSI_KeypadMinus 0x4e +#define kVK_ANSI_KeypadMultiply 0x43 +#define kVK_ANSI_KeypadPlus 0x45 +#define kVK_Control 0x3b +#define kVK_Delete 0x33 +#define kVK_DownArrow 0x7d +#define kVK_End 0x77 +#define kVK_Escape 0x35 +#define kVK_F1 0x7a +#define kVK_F10 0x6d +#define kVK_F11 0x67 +#define kVK_F12 0x6f +#define kVK_F2 0x78 +#define kVK_F3 0x63 +#define kVK_F4 0x76 +#define kVK_F5 0x60 +#define kVK_F6 0x61 +#define kVK_F7 0x62 +#define kVK_F8 0x64 +#define kVK_F9 0x65 +#define kVK_ForwardDelete 0x75 +#define kVK_Help 0x72 +#define kVK_Home 0x73 +#define kVK_LeftArrow 0x7b +#define kVK_Option 0x3a +#define kVK_PageDown 0x79 +#define kVK_PageUp 0x74 +#define kVK_Return 0x24 +#define kVK_RightArrow 0x7c +#define kVK_Shift 0x38 +#define kVK_Tab 0x30 +#define kVK_UpArrow 0x7e +#endif /* MAC_OS_X_VERSION_MAX_ALLOWED <= 1040 */ + static const struct keymap keymap[] = { // special keys {0x34, KEY_ENTER}, // Enter key on some iBooks? diff --git a/libvo/sub.c b/libvo/sub.c index 744652086d..3187f935ea 100644 --- a/libvo/sub.c +++ b/libvo/sub.c @@ -29,7 +29,7 @@ #include "stream/stream_dvdnav.h" #define OSD_NAV_BOX_ALPHA 0x7f -#include "stream/tv.h" +#include "libmpcodecs/dec_teletext.h" #include "osdep/timer.h" #include "talloc.h" @@ -85,13 +85,11 @@ char * const sub_osd_names_short[] ={ "", "|>", "||", "[]", "<<" , ">>", "", "", //static int vo_font_loaded=-1; font_desc_t* vo_font=NULL; -#ifdef CONFIG_TV_TELETEXT void* vo_osd_teletext_page=NULL; int vo_osd_teletext_half = 0; int vo_osd_teletext_mode=0; int vo_osd_teletext_format=0; int vo_osd_teletext_scale=0; -#endif int sub_unicode=0; int sub_utf8=0; int sub_pos=100; @@ -277,7 +275,6 @@ inline static void vo_update_nav (mp_osd_obj_t *obj, int dxs, int dys, int left_ } #endif -#ifdef CONFIG_TV_TELETEXT // renders char to a big per-object buffer where alpha and bitmap are separated static void tt_draw_alpha_buf(mp_osd_obj_t* obj, int x0,int y0, int w,int h, unsigned char* src, int stride,int fg,int bg,int alpha) { @@ -318,7 +315,7 @@ inline static void vo_update_text_teletext(mp_osd_obj_t *obj, int dxs, int dys) int b,ax[6],ay[6],aw[6],ah[6]; tt_char tc; tt_char* tdp=vo_osd_teletext_page; - unsigned char colors[8]={1,85,150,226,70,105,179,254}; + static const uint8_t colors[8]={1,85,150,226,70,105,179,254}; unsigned char* buf[9]; obj->flags|=OSDFLAG_CHANGED|OSDFLAG_VISIBLE; @@ -357,6 +354,7 @@ inline static void vo_update_text_teletext(mp_osd_obj_t *obj, int dxs, int dys) hm=vo_font->height+1; wm=dxs*hm*max_rows/(dys*VBI_COLUMNS); +#ifdef CONFIG_FREETYPE //very simple teletext font auto scaling if(!vo_osd_teletext_scale && hm*(max_rows+1)>dys){ osd_font_scale_factor*=1.0*(dys)/((max_rows+1)*hm); @@ -365,6 +363,7 @@ inline static void vo_update_text_teletext(mp_osd_obj_t *obj, int dxs, int dys) obj->flags&=~OSDFLAG_VISIBLE; return; } +#endif cols=dxs/wm; rows=dys/hm; @@ -519,7 +518,6 @@ TODO: support for separated graphics symbols (where six rectangles does not touc for(i=0;i<9;i++) free(buf[i]); } -#endif int vo_osd_progbar_type=-1; int vo_osd_progbar_value=100; // 0..256 @@ -1162,11 +1160,9 @@ int osd_update_ext(struct osd_state *osd, int dxs, int dys, int left_border, case OSDTYPE_SUBTITLE: vo_update_text_sub(osd, obj,dxs,dys); break; -#ifdef CONFIG_TV_TELETEXT case OSDTYPE_TELETEXT: vo_update_text_teletext(obj,dxs,dys); break; -#endif case OSDTYPE_PROGBAR: vo_update_text_progbar(obj,dxs,dys); break; @@ -1242,9 +1238,7 @@ struct osd_state *osd_create(void) #ifdef CONFIG_DVDNAV new_osd_obj(OSDTYPE_DVDNAV); #endif -#ifdef CONFIG_TV_TELETEXT new_osd_obj(OSDTYPE_TELETEXT); -#endif #ifdef CONFIG_FREETYPE force_load_font = 1; #endif @@ -1295,9 +1289,7 @@ void osd_draw_text_ext(struct osd_state *osd, int dxs, int dys, #ifdef CONFIG_DVDNAV case OSDTYPE_DVDNAV: #endif -#ifdef CONFIG_TV_TELETEXT case OSDTYPE_TELETEXT: -#endif case OSDTYPE_OSD: case OSDTYPE_SUBTITLE: case OSDTYPE_PROGBAR: diff --git a/libvo/video_out.c b/libvo/video_out.c index eb3d0183d6..e2d42f4900 100644 --- a/libvo/video_out.c +++ b/libvo/video_out.c @@ -70,6 +70,11 @@ int vo_directrendering=0; int vo_colorkey = 0x0000ff00; // default colorkey is green // (0xff000000 means that colorkey has been disabled) +// name to be used instead of the vo's default +char *vo_winname; +// title to be applied to movie window +char *vo_wintitle; + // // Externally visible list of all vo drivers // diff --git a/libvo/video_out.h b/libvo/video_out.h index 17c387a320..7211d69e65 100644 --- a/libvo/video_out.h +++ b/libvo/video_out.h @@ -316,6 +316,9 @@ extern char *vo_subdevice; extern int vo_colorkey; +extern char *vo_winname; +extern char *vo_wintitle; + extern int64_t WinID; typedef struct { diff --git a/libvo/x11_common.c b/libvo/x11_common.c index e617aad082..66af7feabd 100644 --- a/libvo/x11_common.c +++ b/libvo/x11_common.c @@ -713,7 +713,7 @@ void vo_x11_classhint(struct vo *vo, Window window, char *name) XClassHint wmClass; pid_t pid = getpid(); - wmClass.res_name = name; + wmClass.res_name = vo_winname ? vo_winname : name; wmClass.res_class = "MPlayer"; XSetClassHint(x11->display, window, &wmClass); XChangeProperty(x11->display, window, x11->XA_NET_WM_PID, XA_CARDINAL, @@ -1210,7 +1210,6 @@ static int vo_x11_get_fs_type(int supported) if (vo_fstype_list) { - i = 0; for (i = 0; vo_fstype_list[i]; i++) { int neg = 0; @@ -1268,7 +1267,7 @@ static int vo_x11_get_fs_type(int supported) else type |= vo_wm_NETWM; } else if (!strcmp(arg, "none")) - return 0; + type = 0; // clear; keep parsing } } @@ -1293,6 +1292,9 @@ int vo_x11_update_geometry(struct vo *vo) } XTranslateCoordinates(x11->display, x11->window, x11->rootwin, 0, 0, &vo->dx, &vo->dy, &dummy_win); + if (vo_wintitle) + XStoreName(x11->display, x11->window, vo_wintitle); + return depth <= INT_MAX ? depth : 0; } @@ -1301,6 +1303,10 @@ void vo_x11_fullscreen(struct vo *vo) struct MPOpts *opts = vo->opts; struct vo_x11_state *x11 = vo->x11; int x, y, w, h; + x = x11->vo_old_x; + y = x11->vo_old_y; + w = x11->vo_old_width; + h = x11->vo_old_height; if (WinID >= 0) { vo_fs = !vo_fs; @@ -1311,15 +1317,6 @@ void vo_x11_fullscreen(struct vo *vo) if (vo_fs) { - // fs->win - if ( ! (x11->fs_type & vo_wm_FULLSCREEN) ) // not needed with EWMH fs - { - x = x11->vo_old_x; - y = x11->vo_old_y; - w = x11->vo_old_width; - h = x11->vo_old_height; - } - vo_x11_ewmh_fullscreen(x11, _NET_WM_STATE_REMOVE); // removes fullscreen state if wm supports EWMH vo_fs = VO_FALSE; } else |