From 1670e33e21546546774e6430da8d8ea4b3e675d2 Mon Sep 17 00:00:00 2001 From: eugeni Date: Thu, 7 Aug 2008 22:20:50 +0000 Subject: [PATCH 01/22] Calculate subtitle position in floating point. Improves subtitle position precision from a unit of script coordinates to a screen pixel. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@27437 b3059339-0415-0410-9bf9-f77b7e298cf2 --- libass/ass_render.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/libass/ass_render.c b/libass/ass_render.c index d6e94a7544..b4c9ae090f 100644 --- a/libass/ass_render.c +++ b/libass/ass_render.c @@ -149,7 +149,7 @@ typedef struct render_context_s { EVENT_HSCROLL, // "Banner" transition effect, text_width is unlimited EVENT_VSCROLL // "Scroll up", "Scroll down" transition effects } evt_type; - int pos_x, pos_y; // position + double pos_x, pos_y; // position int org_x, org_y; // origin char have_origin; // origin is explicitly defined; if 0, get_base_point() is used double scale_x, scale_y; @@ -456,19 +456,19 @@ static ass_image_t* render_text(text_info_t* text_info, int dst_x, int dst_y) /** * \brief Mapping between script and screen coordinates */ -static int x2scr(int x) { +static int x2scr(double x) { return x*frame_context.orig_width_nocrop / frame_context.track->PlayResX + FFMAX(global_settings->left_margin, 0); } /** * \brief Mapping between script and screen coordinates */ -static int y2scr(int y) { +static int y2scr(double y) { return y * frame_context.orig_height_nocrop / frame_context.track->PlayResY + FFMAX(global_settings->top_margin, 0); } // the same for toptitles -static int y2scr_top(int y) { +static int y2scr_top(double y) { if (global_settings->use_margins) return y * frame_context.orig_height_nocrop / frame_context.track->PlayResY; else @@ -476,7 +476,7 @@ static int y2scr_top(int y) { FFMAX(global_settings->top_margin, 0); } // the same for subtitles -static int y2scr_sub(int y) { +static int y2scr_sub(double y) { if (global_settings->use_margins) return y * frame_context.orig_height_nocrop / frame_context.track->PlayResY + FFMAX(global_settings->top_margin, 0) + @@ -727,7 +727,7 @@ static char* parse_tag(char* p, double pwr) { } else if (mystrcmp(&p, "move")) { int x1, x2, y1, y2; long long t1, t2, delta_t, t; - int x, y; + double x, y; double k; skip('('); x1 = strtol(p, &p, 10); @@ -1935,7 +1935,7 @@ static int ass_render_event(ass_event_t* event, event_images_t* event_images) if (render_context.evt_type == EVENT_POSITIONED) { int base_x = 0; int base_y = 0; - mp_msg(MSGT_ASS, MSGL_DBG2, "positioned event at %d, %d\n", render_context.pos_x, render_context.pos_y); + mp_msg(MSGT_ASS, MSGL_DBG2, "positioned event at %f, %f\n", render_context.pos_x, render_context.pos_y); get_base_point(bbox, alignment, &base_x, &base_y); device_x = x2scr(render_context.pos_x) - base_x; device_y = y2scr(render_context.pos_y) - base_y; From 054f28e2d15a293bace0c41e40663a4d4c683606 Mon Sep 17 00:00:00 2001 From: eugeni Date: Thu, 7 Aug 2008 22:20:52 +0000 Subject: [PATCH 02/22] Calculate subtitle origin in floating point. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@27438 b3059339-0415-0410-9bf9-f77b7e298cf2 --- libass/ass_render.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libass/ass_render.c b/libass/ass_render.c index b4c9ae090f..bc746fd31d 100644 --- a/libass/ass_render.c +++ b/libass/ass_render.c @@ -150,7 +150,7 @@ typedef struct render_context_s { EVENT_VSCROLL // "Scroll up", "Scroll down" transition effects } evt_type; double pos_x, pos_y; // position - int org_x, org_y; // origin + double org_x, org_y; // origin char have_origin; // origin is explicitly defined; if 0, get_base_point() is used double scale_x, scale_y; double hspacing; // distance between letters, in pixels From 6c92d9358b3711eaa145b63467542e6b0f23321a Mon Sep 17 00:00:00 2001 From: eugeni Date: Thu, 7 Aug 2008 22:20:54 +0000 Subject: [PATCH 03/22] Treat \h as space character. Patch by Robert Rudd (robrudd at users sourceforge net). git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@27439 b3059339-0415-0410-9bf9-f77b7e298cf2 --- libass/ass_render.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libass/ass_render.c b/libass/ass_render.c index bc746fd31d..40f2aac6b1 100644 --- a/libass/ass_render.c +++ b/libass/ass_render.c @@ -1072,7 +1072,7 @@ static unsigned get_next_char(char** str) p += 2; *str = p; return '\n'; - } else if (*(p+1) == 'n') { + } else if ((*(p+1) == 'n') || (*(p+1) == 'h')) { p += 2; *str = p; return ' '; From a9259255439449505432709798347389d57956fd Mon Sep 17 00:00:00 2001 From: eugeni Date: Thu, 7 Aug 2008 22:20:56 +0000 Subject: [PATCH 04/22] \org turns off collision detection. Patch by Diogo Franco (diogomfranco gmail com). git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@27440 b3059339-0415-0410-9bf9-f77b7e298cf2 --- libass/ass_render.c | 1 + 1 file changed, 1 insertion(+) diff --git a/libass/ass_render.c b/libass/ass_render.c index 40f2aac6b1..0ed4054ffa 100644 --- a/libass/ass_render.c +++ b/libass/ass_render.c @@ -888,6 +888,7 @@ static char* parse_tag(char* p, double pwr) { render_context.org_x = v1; render_context.org_y = v2; render_context.have_origin = 1; + render_context.detect_collisions = 0; } else if (mystrcmp(&p, "t")) { double v[3]; int v1, v2; From 6c857af5c06f8b68e36a8a1606db8b996cb6419b Mon Sep 17 00:00:00 2001 From: eugeni Date: Thu, 7 Aug 2008 22:20:58 +0000 Subject: [PATCH 05/22] If (has outline) blur(outline) else blur(glyph). If there is an outline, the glyph itself should not be blurred. Keeps the border between glyph and outline clear (unblurred), which is probably how it should be. Patch by Diogo Franco (diogomfranco gmail com). git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@27441 b3059339-0415-0410-9bf9-f77b7e298cf2 --- libass/ass_bitmap.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/libass/ass_bitmap.c b/libass/ass_bitmap.c index 9fb77a6924..3d85300d11 100644 --- a/libass/ass_bitmap.c +++ b/libass/ass_bitmap.c @@ -274,9 +274,10 @@ int glyph_to_bitmap(ass_synth_priv_t* priv, FT_Glyph glyph, FT_Glyph outline_gly resize_tmp(priv, (*bm_g)->w, (*bm_g)->h); if (be) { - blur((*bm_g)->buffer, priv->tmp, (*bm_g)->w, (*bm_g)->h, (*bm_g)->w, (int*)priv->gt2, priv->g_r, priv->g_w); if (*bm_o) blur((*bm_o)->buffer, priv->tmp, (*bm_o)->w, (*bm_o)->h, (*bm_o)->w, (int*)priv->gt2, priv->g_r, priv->g_w); + else + blur((*bm_g)->buffer, priv->tmp, (*bm_g)->w, (*bm_g)->h, (*bm_g)->w, (int*)priv->gt2, priv->g_r, priv->g_w); } if (*bm_o) From e1ce107366596dbfbbe103fdce0cd93b90a08707 Mon Sep 17 00:00:00 2001 From: eugeni Date: Fri, 8 Aug 2008 20:08:02 +0000 Subject: [PATCH 06/22] Don't print drawing commands on screen. Drawing mode is not implemented in libass. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@27442 b3059339-0415-0410-9bf9-f77b7e298cf2 --- libass/ass_render.c | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/libass/ass_render.c b/libass/ass_render.c index 0ed4054ffa..3806907249 100644 --- a/libass/ass_render.c +++ b/libass/ass_render.c @@ -161,6 +161,7 @@ typedef struct render_context_s { uint32_t fade; // alpha from \fad char be; // blur edges int shadow; + int drawing_mode; // not implemented; when != 0 text is discarded, except for style override tags effect_t effect_type; int effect_timing; @@ -1028,6 +1029,13 @@ static char* parse_tag(char* p, double pwr) { render_context.shadow = val; else render_context.shadow = render_context.style->Shadow; + } else if (mystrcmp(&p, "pbo")) { + (void)strtol(p, &p, 10); // ignored + } else if (mystrcmp(&p, "p")) { + int val; + if (!mystrtoi(&p, 10, &val)) + val = 0; + render_context.drawing_mode = !!val; } return p; @@ -1203,6 +1211,7 @@ static void init_render_context(ass_event_t* event) render_context.clip_y1 = frame_context.track->PlayResY; render_context.detect_collisions = 1; render_context.fade = 0; + render_context.drawing_mode = 0; render_context.effect_type = EF_NONE; render_context.effect_timing = 0; render_context.effect_skip_timing = 0; @@ -1750,7 +1759,9 @@ static int ass_render_event(ass_event_t* event, event_images_t* event_images) while (1) { // get next char, executing style override // this affects render_context - code = get_next_char(&p); + do { + code = get_next_char(&p); + } while (code && render_context.drawing_mode); // skip everything in drawing mode // face could have been changed in get_next_char if (!render_context.font) { From 6d01235f44a7aa915965c2b2a2b1190397f06669 Mon Sep 17 00:00:00 2001 From: diego Date: Sat, 9 Aug 2008 13:53:19 +0000 Subject: [PATCH 07/22] Skip dependency generation if we just run distclean or if skipping is requested explicitly on the command line. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@27443 b3059339-0415-0410-9bf9-f77b7e298cf2 --- Makefile | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Makefile b/Makefile index 23dc7fcfe1..0eaa22098b 100644 --- a/Makefile +++ b/Makefile @@ -1055,7 +1055,13 @@ dhahelperwinclean: +# Do not include dependencies when they are about to be removed anyway +# or if SKIP_DEPS was set to "yes" on the command line. +ifneq ($(MAKECMDGOALS),distclean) +ifneq ($(SKIP_DEPS),yes) -include $(DEPS) +endif +endif .PHONY: all doxygen *install* *tools drivers dhahelper* .PHONY: checkheaders *clean dep depend tests From c3249660596f7ef8c7a194b1b2d2b18d2dde9914 Mon Sep 17 00:00:00 2001 From: diego Date: Sat, 9 Aug 2008 14:56:09 +0000 Subject: [PATCH 08/22] Remove duplicated prototype for XShmGetEventBase(), because - it is used in other places without checking, - it is a workaround for a bug elsewhere, - if the problem is real at all, there should be a proper configure check. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@27444 b3059339-0415-0410-9bf9-f77b7e298cf2 --- libvo/vo_x11.c | 3 --- libvo/vo_xvmc.c | 2 -- 2 files changed, 5 deletions(-) diff --git a/libvo/vo_x11.c b/libvo/vo_x11.c index 5f139287d2..2343a16f72 100644 --- a/libvo/vo_x11.c +++ b/libvo/vo_x11.c @@ -29,9 +29,6 @@ static int Shmem_Flag; static XShmSegmentInfo Shminfo[1]; static int gXErrorFlag; static int CompletionType = -1; - -/* since it doesn't seem to be defined on some platforms */ -int XShmGetEventBase(Display *); #endif #include "sub.h" diff --git a/libvo/vo_xvmc.c b/libvo/vo_xvmc.c index 3ad41b5ac9..8e0fbbb15d 100644 --- a/libvo/vo_xvmc.c +++ b/libvo/vo_xvmc.c @@ -131,8 +131,6 @@ const LIBVO_EXTERN(xvmc); //shm stuff from vo_xv #ifdef HAVE_SHM -/* since it doesn't seem to be defined on some platforms */ -int XShmGetEventBase(Display*); static XShmSegmentInfo Shminfo; static int Shmem_Flag; #endif From ff2a3dd06040c1182a3040125c0cd73fa915ef79 Mon Sep 17 00:00:00 2001 From: diego Date: Sat, 9 Aug 2008 15:45:00 +0000 Subject: [PATCH 09/22] Use translatable string instead of hardcoded message for process priority. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@27445 b3059339-0415-0410-9bf9-f77b7e298cf2 --- mplayer.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mplayer.c b/mplayer.c index 09bec5f97b..1d4845a102 100644 --- a/mplayer.c +++ b/mplayer.c @@ -2640,7 +2640,7 @@ int gui_no_filename=0; if(strcasecmp(priority_presets_defs[i].name, proc_priority) == 0) break; } - mp_msg(MSGT_CPLAYER,MSGL_STATUS,"Setting process priority: %s\n", + mp_msg(MSGT_CPLAYER,MSGL_STATUS,MSGTR_SettingProcessPriority, priority_presets_defs[i].name); SetPriorityClass(GetCurrentProcess(), priority_presets_defs[i].prio); } From 0bd41be67fc0f0a15ddd91410aa94a040c164021 Mon Sep 17 00:00:00 2001 From: gpoirier Date: Sat, 9 Aug 2008 18:40:51 +0000 Subject: [PATCH 10/22] sync w/27407 + fixes git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@27446 b3059339-0415-0410-9bf9-f77b7e298cf2 --- DOCS/man/fr/mplayer.1 | 20 ++++++-------------- 1 file changed, 6 insertions(+), 14 deletions(-) diff --git a/DOCS/man/fr/mplayer.1 b/DOCS/man/fr/mplayer.1 index 637bc4c82c..11b071d0fa 100644 --- a/DOCS/man/fr/mplayer.1 +++ b/DOCS/man/fr/mplayer.1 @@ -3229,7 +3229,7 @@ Corrige le basculement en mode plein- . .TP .B \-geometry x[%][:y[%]] ou [WxH][+x+y] -Ajuste la position d'origine sur l'cran de la sortie. +Ajuste la position d'origine sur l'cran de sortie. Les variables x et y sont en pixels mesurs partir du coin suprieur droit de l'cran jusqu'au coin suprieur droit de la vido affiche, cependant si un signe pourcentage est indiqu aprs la variable, cette valeur est alors @@ -3417,7 +3417,7 @@ Utile pour int par exemple). . .TP -.B \-xineramascreen <\-2\-...> (X11 uniquement) +.B \-xineramascreen <\-2\-...> Dans les configurations xinerama (c'est dire un bureau unique s'tendant sur plusieurs crans, cette option dit MPlayer sur quel cran afficher le film. La valeur \-2 signifie plein cran sur la totalit de l'cran virtuel, (dans ce @@ -3427,6 +3427,9 @@ La position initiale d dfini. Fontionnera gnralement uniquement avec "\-fstype \-fullscreen" ou "\-fstype none". +Cette option ne convient pour dfinir l'cran de dmarrage (de mme pour +l'cran en mode plein cran), \-geometry est plus appropri. +Gr par les pilotes de sortie vido gl, gl2, x11, et xv. . .TP .B \-zrbw (\-vo zr uniquement) @@ -8655,25 +8658,14 @@ plus les quantum seront semblables d'une trame .B vqcomp=<0.0\-1.0> Compression quantum, vrc_eq dpend de cette option (passe 1/2) (par dfaut\ : 0.5). -Par exemple, en prenant l'quation de contrle de flux (rate control) par -dfaut, si vqcomp=1.0, le contrle de flux alloue chaque trame le nombre -de bits ncessaire pour qu'elles soient toutes encodes avec le mme quantum -(que cela soit ncessaire ou non). -Si vqcomp=0.0, le contrle de flux alloue chaque trame le mme nombre de -bits, c--d un encodage dbit binaire strictement constant. .I NOTE\ : -Ceci sont des exemples extrmes et ne devraient jamais tre utilises. -La qualit subjective tant optimale pour des valeurs entre ces deux extrmes. +La qualit subjective sera optimale pour des valeurs entre ces deux extrmes. . .TP .B vrc_eq= quation principale de contrle de dbit (passe 1/2) .RE .RSs -.IPs "1\ \ \ \ " -constant bitrate -.IPs "tex\ \ " -qualit constante .IPs 1+(tex/\:avgTex-1)*qComp approximativement l'quation de l'ancien code de contrle de dbit .IPs tex^qComp From 880757477b98aa0dedd53ad8c2188131bdead371 Mon Sep 17 00:00:00 2001 From: compn Date: Sun, 10 Aug 2008 15:32:03 +0000 Subject: [PATCH 11/22] codecs.c note is very old and unneeded. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@27447 b3059339-0415-0410-9bf9-f77b7e298cf2 --- etc/codecs.conf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/etc/codecs.conf b/etc/codecs.conf index cd00c4d210..14b0f42d68 100644 --- a/etc/codecs.conf +++ b/etc/codecs.conf @@ -1,5 +1,5 @@ ;============================================================================= -; Default codecs config file. It replaces the old codecs.c file! +; Default codecs config file. ; Before editing this file, please read DOCS/tech/codecs.conf.txt ! ;============================================================================= From f2b329942c5b58c57450ed4b931cbe2d1c3d45f0 Mon Sep 17 00:00:00 2001 From: diego Date: Sun, 10 Aug 2008 18:38:13 +0000 Subject: [PATCH 12/22] The PNG encoder in libavcodec needs to be enabled for vf_screenshot even if MEncoder is disabled. patch by Adrian Stutz, adrian sttz ch git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@27448 b3059339-0415-0410-9bf9-f77b7e298cf2 --- configure | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/configure b/configure index 147115878b..0a9a0373df 100755 --- a/configure +++ b/configure @@ -6873,8 +6873,8 @@ echocheck "mencoder" if test "$_mencoder" = yes ; then _def_muxers='#define CONFIG_MUXERS 1' else - # mpeg1video for vf_lavc, snow for vf_uspp and vf_mcdeint - _libavencoders="MPEG1VIDEO_ENCODER SNOW_ENCODER" + # mpeg1video for vf_lavc, snow for vf_uspp and vf_mcdeint, png for vf_screenshot + _libavencoders="MPEG1VIDEO_ENCODER SNOW_ENCODER PNG_ENCODER" _libavmuxers="" fi echores "$_mencoder" From d4bf4c946c31c5cc91c9b932cb297cdb0a70da5c Mon Sep 17 00:00:00 2001 From: compn Date: Mon, 11 Aug 2008 17:32:31 +0000 Subject: [PATCH 13/22] fix audio in some rtsp streams, ok'd by lu_zero patch by Changjin Liu - !lcj.liu!at!gmail!com! http://thread.gmane.org/gmane.comp.video.mplayer.user/56893/focus=56894 git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@27449 b3059339-0415-0410-9bf9-f77b7e298cf2 --- libmpdemux/demux_rtp_codec.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/libmpdemux/demux_rtp_codec.cpp b/libmpdemux/demux_rtp_codec.cpp index 4dd2a1908f..15d9fd0be4 100644 --- a/libmpdemux/demux_rtp_codec.cpp +++ b/libmpdemux/demux_rtp_codec.cpp @@ -198,6 +198,7 @@ void rtpCodecInitialize_audio(demuxer_t* demuxer, sh_audio->wf = wf; demux_stream_t* d_audio = demuxer->audio; d_audio->sh = sh_audio; sh_audio->ds = d_audio; + d_audio->id = sh_audio->aid; wf->nChannels = subsession->numChannels(); From f14367fac94c32c6baab25ab34af96c93e183d0c Mon Sep 17 00:00:00 2001 From: gpoirier Date: Mon, 11 Aug 2008 21:10:04 +0000 Subject: [PATCH 14/22] sync w/r27348, patch by JRaSH git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@27450 b3059339-0415-0410-9bf9-f77b7e298cf2 --- DOCS/man/zh/mplayer.1 | 40 +++++++++++++++++++++++----------------- 1 file changed, 23 insertions(+), 17 deletions(-) diff --git a/DOCS/man/zh/mplayer.1 b/DOCS/man/zh/mplayer.1 index 9bd347d59e..8c91fcace0 100644 --- a/DOCS/man/zh/mplayer.1 +++ b/DOCS/man/zh/mplayer.1 @@ -1,4 +1,4 @@ -.\" sync with en/mplayer.1 r27132 +.\" sync with en/mplayer.1 r27348 .\" Encoding: UTF-8 .\" Reminder of hard terms which need better/final solution later: .\" /capture; playtree in parent list; colorkey; retrace; desync; downmix; @@ -73,7 +73,7 @@ mencoder \- 影视编解码器 . .br .B mplayer -[dvd|dvdnav]://[标题|[开始标题]\-结束标题] +[dvd|dvdnav]://[标题|[开始标题]\-结束标题][/设备] [选项] . .br @@ -835,7 +835,7 @@ MOUSE_BTN0\-MOUSE_BTN0_DBL。 xv, xvidix 和 dfbmga。 . .TP -.B \-framedrop(也请参见 \-hardframedrop,未指定 -no-correct-pts 时只可用于实验) +.B \-framedrop(也请参见 \-hardframedrop,未使用 \-nocorrect\-pts 时只可用于实验) 跳过显示一些帧从而在慢的机器上保持 A/V 同步。 视频滤镜不会应用到这些帧上。对于 B-帧 甚至解码也完全跳过。 . @@ -849,7 +849,7 @@ xv, xvidix 和 dfbmga。 显示简短的选项概要。 . .TP -.B \-hardframedrop(未指定 -no-correct-pts 时只可用于实验) +.B \-hardframedrop(未使用 \-nocorrect\-pts 时只可用于实验) 更加密集的丢帧(中断解码过程)。将导致图像失真! 注意,libmpeg2 解码器尤其可能在使用该选项后崩溃,所以请考虑使用 “\-vc ffmpeg12,”。 @@ -986,6 +986,10 @@ n 大小的 FIFO 能容纳 (n\-1) 缓冲事件。 必须选择 DVD 菜单中的按钮。 . .TP +.B \-noar +关闭对于 AppleIR 的支持。 +. +.TP .B \-noconsolecontrols 阻止 MPlayer 读取标准输入的键盘事件。 读取标准输入的数据时有用。命令行中发现 \- 会自动启用。 @@ -1002,10 +1006,6 @@ n 大小的 FIFO 能容纳 (n\-1) 缓冲事件。 关闭支持 LIRC。 . .TP -.B \-noar -关闭对于苹果 IR 遥控器的支持。 -. -.TP .B \-nomouseinput 停用鼠标键 按/\:放 输入 (mozplayerxp 的上下文菜单依赖此选项)。 . @@ -2701,7 +2701,6 @@ If not specified mplayer will search the first usable card. .B \-border 使用窗口边框和装饰来播放电影。 既然默认是启用, 使用 \-noborder 停用标准的窗口装饰。 -被 directx 视频输出驱动支持。 . .TP .B \-brightness <\-100\-100> @@ -3035,13 +3034,19 @@ ggi 和 gl2 的都支持此功能。 把 MPlayer 嵌入浏览器(比如 plugger 扩展)时有用。 . .TP -.B \-xineramascreen <\-2\-...> (仅用于 X11) +.B \-xineramascreen <\-2\-...> 在 Xinerama 配置中(就是一个单一桌面展开在多个显示器上), 此选项告诉 MPlayer 把电影显示在哪个屏幕上。 值 \-2 表示全屏幕展开到整个虚拟的显示屏幕上(在这种情况下将完全忽略Xinerama的信 息),\-1 表示在目前窗口所在的显示屏上全屏幕。 通过 \-geometry 选项设置的初始位置是相对于指定屏幕的。 通常只能与 "\-fstype \-fullscreen" 或 "\-fstype none" 一起工作。 +该选项不适用于仅仅设置启动屏幕(也不适用于设置全屏屏幕),\-geometry 是目前可用 +于此目前的最好选项。 +This option is not suitable to only set the startup screen (and not also the +fullscreen screen), \-geometry is the best that is available for that purpose +currently. +Supported by the gl, gl2, x11, and xv video output drivers. . .TP .B \-zrbw (仅用于 \-vo zr) @@ -4983,7 +4988,7 @@ unsigned long long counter /*用于保持同步, 更新每次 .br 该过滤器的工作方式是以正常速度播放 \'stride\' ms 的音频,而消耗的是 \'stride*scale\' ms 的输入音频。 -通过把一个跨度域内的 'overlap'% 的内容,与紧接着前一个跨度域的音频混合在一起,把各个 +通过把一个跨度域内的 \'overlap\'% 的内容,与紧接着前一个跨度域的音频混合在一起,把各个 跨度域拼接在一起。 也可以让该选项对后 \'search\' ms 的音频作一个短小的统计性分析,以判定最佳的重叠位置。 .PD 0 @@ -5011,7 +5016,7 @@ unsigned long long counter /*用于保持同步, 更新每次 设置播放速度改变时的反应。 .RSss .IPs tempo -改变音频节奏以使其与播放速度同步(默认值) +改变音频节奏以使其与播放速度同步(默认值)。 .IPs pitch 抵消过滤器产生的效果。 改变声音间隔而不改变音频节奏。 @@ -5020,9 +5025,9 @@ unsigned long long counter /*用于保持同步, 更新每次 .I 警告: 与视频的同步变差。 .IPs both -同时改变节奏和间隔 +同时改变节奏和间隔。 .IPs none -忽略速度的改变 +忽略速度的改变。 .RE .RE .sp 1 @@ -9829,6 +9834,10 @@ Sony 数字视频容器格式 有时需要提高这个值以防止“缓冲下溢”。 . .TP +.B "o\ \ \ \ \ \ " +FIXME:无说明文档 +. +.TP .B packetsize= 所选格式单个数据包的大小,以字节为单位表示。 当将流合并至MPEG[12]的实现格式时,默认值为: @@ -9839,9 +9848,6 @@ Sony 数字视频容器格式 当前只对MPEG[12]有意义:单位为秒,对于任意出现的流,输出流参照计时器(SCR)和解 码时间戳(DTS)间的初始差距(流分离至解码间的延迟)。 . -.TP -.B "o\ \ \ \ \ \ " -FIXME:没有说明文档 . . . From f2918b92400c460aafad3b98fecd03fde0fd0d0d Mon Sep 17 00:00:00 2001 From: ben Date: Mon, 11 Aug 2008 23:04:03 +0000 Subject: [PATCH 15/22] Add proper VIDIX support for SuperH architecture. Patch by Magnus Damm . git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@27451 b3059339-0415-0410-9bf9-f77b7e298cf2 --- vidix/AsmMacros.h | 2 ++ vidix/dha.c | 2 +- vidix/pci.c | 6 +++--- vidix/sysdep/pci_linux.c | 6 +++++- 4 files changed, 11 insertions(+), 5 deletions(-) diff --git a/vidix/AsmMacros.h b/vidix/AsmMacros.h index 228e4b6dd6..f40929ade5 100644 --- a/vidix/AsmMacros.h +++ b/vidix/AsmMacros.h @@ -77,6 +77,8 @@ #include "sysdep/AsmMacros_arm32.h" #elif defined(__powerpc__) #include "sysdep/AsmMacros_powerpc.h" +#elif defined(__sh__) +#include #else #include "sysdep/AsmMacros_x86.h" #endif diff --git a/vidix/dha.c b/vidix/dha.c index 8e3d2ada5d..28dc8c8c09 100644 --- a/vidix/dha.c +++ b/vidix/dha.c @@ -185,7 +185,7 @@ void unmap_phys_mem(void *ptr, unsigned long size) #endif /* Generic mmap (not win32, nor os2) */ -#if !defined(__alpha__) && !defined(__powerpc__) +#if !defined(__alpha__) && !defined(__powerpc__) && !defined(__sh__) unsigned char INPORT8(unsigned idx) { return inb(idx); diff --git a/vidix/pci.c b/vidix/pci.c index ffa91224e1..1006b14a80 100644 --- a/vidix/pci.c +++ b/vidix/pci.c @@ -484,7 +484,7 @@ static int pcibus=-1, pcicard=-1, pcifunc=-1 ; #include "sysdep/pci_arm32.c" #elif defined(__powerpc__) #include "sysdep/pci_powerpc.c" -#elif defined(__x86_64__) +#elif defined(__x86_64__) || defined(__sh__) /* Nothing here right now */ #else #include "sysdep/pci_x86.c" @@ -628,7 +628,7 @@ int pci_scan(pciinfo_t *pci_list,unsigned *num_pci) } while (++pcr._pcibusidx < pcr._pcinumbus); } -#if !defined(__alpha__) && !defined(__powerpc__) +#if !defined(__alpha__) && !defined(__powerpc__) && !defined(__sh__) /* Now try pci config 2 probe (deprecated) */ if ((pcr._configtype == 2) || do_mode2_scan) { @@ -689,7 +689,7 @@ int pci_scan(pciinfo_t *pci_list,unsigned *num_pci) outb(PCI_MODE2_ENABLE_REG, 0x00); } -#endif /* !__alpha__ && !__powerpc__ */ +#endif /* !__alpha__ && !__powerpc__ && !__sh__ */ disable_os_io(); diff --git a/vidix/sysdep/pci_linux.c b/vidix/sysdep/pci_linux.c index aca99573db..12da9376b9 100644 --- a/vidix/sysdep/pci_linux.c +++ b/vidix/sysdep/pci_linux.c @@ -36,6 +36,10 @@ int iopl(); #endif #endif +#ifdef __sh__ +#define iopl(x) 1 +#endif + #include "config.h" #ifdef CONFIG_DHAHELPER @@ -141,7 +145,7 @@ static __inline__ int disable_os_io(void) } #if (defined(__powerpc__) || defined(__sparc__) || defined(__sparc64__) \ - || defined(__x86_64__)) && defined(__linux__) && !defined(CONFIG_SVGAHELPER) + || defined(__x86_64__) || defined(__sh__)) && defined(__linux__) && !defined(CONFIG_SVGAHELPER) #define CONFIG_PCI_LINUX_PROC #endif From 8903c510f8340f9862dc4631e7f62d10b73f7d8b Mon Sep 17 00:00:00 2001 From: ben Date: Mon, 11 Aug 2008 23:10:03 +0000 Subject: [PATCH 16/22] Add VIDIX driver for SuperH Mobile VEU hardware block. Patch by Magnus Damm . git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@27452 b3059339-0415-0410-9bf9-f77b7e298cf2 --- Makefile | 1 + configure | 9 +- vidix/drivers.c | 4 + vidix/sh_veu_vid.c | 594 +++++++++++++++++++++++++++++++++++++++++++++ 4 files changed, 606 insertions(+), 2 deletions(-) create mode 100644 vidix/sh_veu_vid.c diff --git a/Makefile b/Makefile index 0eaa22098b..b0e6a0e53d 100644 --- a/Makefile +++ b/Makefile @@ -595,6 +595,7 @@ SRCS_MPLAYER-$(VIDIX_PM3) += vidix/pm3_vid.c SRCS_MPLAYER-$(VIDIX_RADEON) += vidix/radeon_vid.c SRCS_MPLAYER-$(VIDIX_RAGE128) += vidix/rage128_vid.c SRCS_MPLAYER-$(VIDIX_S3) += vidix/s3_vid.c +SRCS_MPLAYER-$(VIDIX_SH_VEU) += vidix/sh_veu_vid.c SRCS_MPLAYER-$(VIDIX_SIS) += vidix/sis_vid.c vidix/sis_bridge.c SRCS_MPLAYER-$(VIDIX_UNICHROME) += vidix/unichrome_vid.c diff --git a/configure b/configure index 0a9a0373df..c905117915 100755 --- a/configure +++ b/configure @@ -4287,6 +4287,8 @@ _def_vidix_drv_rage128='#undef CONFIG_VIDIX_DRV_RAGE128' _vidix_drv_rage128=no _def_vidix_drv_s3='#undef CONFIG_VIDIX_DRV_S3' _vidix_drv_s3=no +_def_vidix_drv_sh_veu='#undef CONFIG_VIDIX_DRV_SH_VEU' +_vidix_drv_sh_veu=no _def_vidix_drv_sis='#undef CONFIG_VIDIX_DRV_SIS' _vidix_drv_sis=no _def_vidix_drv_unichrome='#undef CONFIG_VIDIX_DRV_UNICHROME' @@ -4303,11 +4305,12 @@ if test "$_vidix" = yes ; then _def_vidix='#define CONFIG_VIDIX 1' _vosrc="$_vosrc vo_cvidix.c" _vomodules="cvidix $_vomodules" - test "$_vidix_drivers" || _vidix_drivers="cyberblade ivtv mach64 mga mga_crtc2 nvidia pm2 pm3 radeon rage128 s3 sis unichrome" + test "$_vidix_drivers" || _vidix_drivers="cyberblade ivtv mach64 mga mga_crtc2 nvidia pm2 pm3 radeon rage128 s3 sh_veu sis unichrome" test $_ivtv = "yes" || _vidix_drivers=`echo $_vidix_drivers | sed s/ivtv//` - # some vidix drivers are meant to work on x86 only, discard them elsewhere + # some vidix drivers are architecture and os specific, discard them elsewhere x86 || _vidix_drivers=`echo $_vidix_drivers | sed -e s/cyberblade// -e s/sis// -e s/unichrome// -e s/s3//` + (test $host_arch = "sh" && linux) || _vidix_drivers=`echo $_vidix_drivers | sed s/sh_veu//` for driver in $_vidix_drivers ; do uc_driver=`echo $driver | tr '[a-z]' '[A-Z]'` @@ -7894,6 +7897,7 @@ VIDIX_PM3=$_vidix_drv_pm3 VIDIX_RADEON=$_vidix_drv_radeon VIDIX_RAGE128=$_vidix_drv_rage128 VIDIX_S3=$_vidix_drv_s3 +VIDIX_SH_VEU=$_vidix_drv_sh_veu VIDIX_SIS=$_vidix_drv_sis VIDIX_UNICHROME=$_vidix_drv_unichrome VSTREAM = $_vstream @@ -8621,6 +8625,7 @@ $_def_vidix_drv_pm3 $_def_vidix_drv_radeon $_def_vidix_drv_rage128 $_def_vidix_drv_s3 +$_def_vidix_drv_sh_veu $_def_vidix_drv_sis $_def_vidix_drv_unichrome $_def_vidix_pfx diff --git a/vidix/drivers.c b/vidix/drivers.c index 483428ff3b..2311d94800 100644 --- a/vidix/drivers.c +++ b/vidix/drivers.c @@ -43,6 +43,7 @@ extern VDXDriver pm3_drv; extern VDXDriver radeon_drv; extern VDXDriver rage128_drv; extern VDXDriver s3_drv; +extern VDXDriver sh_veu_drv; extern VDXDriver sis_drv; extern VDXDriver unichrome_drv; @@ -92,6 +93,9 @@ void vidix_register_all_drivers (void) #ifdef CONFIG_VIDIX_DRV_S3 vidix_register_driver (&s3_drv); #endif +#ifdef CONFIG_VIDIX_DRV_SH_VEU + vidix_register_driver (&sh_veu_drv); +#endif #ifdef CONFIG_VIDIX_DRV_SIS vidix_register_driver (&sis_drv); #endif diff --git a/vidix/sh_veu_vid.c b/vidix/sh_veu_vid.c new file mode 100644 index 0000000000..1d683e38c6 --- /dev/null +++ b/vidix/sh_veu_vid.c @@ -0,0 +1,594 @@ +/* + * VIDIX driver for SuperH Mobile VEU hardware block. + * Copyright (C) 2008 Magnus Damm + * + * Requires a kernel that exposes the VEU hardware block to user space + * using UIO. Available in upstream linux-2.6.27 or later. + * + * Tested using WVGA and QVGA panels with sh7722 VEU and sh7723 VEU2H. + * + * This file is part of MPlayer. + * + * MPlayer is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 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 General Public License for more details. + * + * You should have received a copy of the GNU 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 + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "config.h" +#include "vidix.h" +#include "fourcc.h" + +#include "dha.h" + +static int fgets_with_openclose(char *fname, char *buf, size_t maxlen) +{ + FILE *fp; + + fp = fopen(fname, "r"); + if (!fp) + return -1; + + fgets(buf, maxlen, fp); + fclose(fp); + return strlen(buf); +} + +struct uio_device { + char *name; + char *path; + int fd; +}; + +#define MAXNAMELEN 256 + +static int locate_uio_device(char *name, struct uio_device *udp) +{ + char fname[MAXNAMELEN], buf[MAXNAMELEN]; + char *tmp; + int uio_id; + + uio_id = -1; + do { + uio_id++; + snprintf(fname, MAXNAMELEN, "/sys/class/uio/uio%d/name", uio_id); + if (fgets_with_openclose(fname, buf, MAXNAMELEN) < 0) + return -1; + + } while (strncmp(name, buf, strlen(name))); + + tmp = strchr(buf, '\n'); + if (tmp) + *tmp = '\0'; + + udp->name = strdup(buf); + udp->path = strdup(fname); + udp->path[strlen(udp->path) - 5] = '\0'; + + snprintf(buf, MAXNAMELEN, "/dev/uio%d", uio_id); + udp->fd = open(buf, O_RDWR | O_SYNC); + + if (udp->fd < 0) + return -1; + + return 0; +} + +struct uio_map { + unsigned long address; + unsigned long size; + void *iomem; +}; + +static int setup_uio_map(struct uio_device *udp, int nr, struct uio_map *ump) +{ + char fname[MAXNAMELEN], buf[MAXNAMELEN]; + + snprintf(fname, MAXNAMELEN, "%s/maps/map%d/addr", udp->path, nr); + if (fgets_with_openclose(fname, buf, MAXNAMELEN) <= 0) + return -1; + + ump->address = strtoul(buf, NULL, 0); + + snprintf(fname, MAXNAMELEN, "%s/maps/map%d/size", udp->path, nr); + if (fgets_with_openclose(fname, buf, MAXNAMELEN) <= 0) + return -1; + + ump->size = strtoul(buf, NULL, 0); + ump->iomem = mmap(0, ump->size, + PROT_READ|PROT_WRITE, MAP_SHARED, + udp->fd, nr * getpagesize()); + + if (ump->iomem == MAP_FAILED) + return -1; + + return 0; +} + +struct fb_info { + unsigned long width; + unsigned long height; + unsigned long bpp; + unsigned long line_length; + + unsigned long address; + unsigned long size; +}; + +static int get_fb_info(char *device, struct fb_info *fip) +{ + struct fb_var_screeninfo vinfo; + struct fb_fix_screeninfo finfo; + void *iomem; + int fd; + + fd = open(device, O_RDWR); + if (fd < 0) { + perror("open"); + return -1; + } + + if (ioctl(fd, FBIOGET_VSCREENINFO, &vinfo) == -1) { + perror("ioctl(FBIOGET_VSCREENINFO)"); + return -1; + } + + fip->width = vinfo.xres; + fip->height = vinfo.yres; + fip->bpp = vinfo.bits_per_pixel; + + if (ioctl(fd, FBIOGET_FSCREENINFO, &finfo) == -1) { + perror("ioctl(FBIOGET_FSCREENINFO)"); + return -1; + } + + fip->address = finfo.smem_start; + fip->size = finfo.smem_len; + fip->line_length = finfo.line_length; + + iomem = mmap(0, fip->size, PROT_READ|PROT_WRITE, MAP_SHARED, fd, 0); + + if (iomem == MAP_FAILED) { + perror("mmap"); + return -1; + } + + /* clear framebuffer */ + memset(iomem, 0, fip->line_length * fip->height); + munmap(iomem, fip->size); + + close(fd); + return 0; +} + +#define VESTR 0x00 /* start register */ +#define VESWR 0x10 /* src: line length */ +#define VESSR 0x14 /* src: image size */ +#define VSAYR 0x18 /* src: y/rgb plane address */ +#define VSACR 0x1c /* src: c plane address */ +#define VBSSR 0x20 /* bundle mode register */ +#define VEDWR 0x30 /* dst: line length */ +#define VDAYR 0x34 /* dst: y/rgb plane address */ +#define VDACR 0x38 /* dst: c plane address */ +#define VTRCR 0x50 /* transform control */ +#define VRFCR 0x54 /* resize scale */ +#define VRFSR 0x58 /* resize clip */ +#define VENHR 0x5c /* enhance */ +#define VFMCR 0x70 /* filter mode */ +#define VVTCR 0x74 /* lowpass vertical */ +#define VHTCR 0x78 /* lowpass horizontal */ +#define VAPCR 0x80 /* color match */ +#define VECCR 0x84 /* color replace */ +#define VAFXR 0x90 /* fixed mode */ +#define VSWPR 0x94 /* swap */ +#define VEIER 0xa0 /* interrupt mask */ +#define VEVTR 0xa4 /* interrupt event */ +#define VSTAR 0xb0 /* status */ +#define VBSRR 0xb4 /* reset */ + +#define VMCR00 0x200 /* color conversion matrix coefficient 00 */ +#define VMCR01 0x204 /* color conversion matrix coefficient 01 */ +#define VMCR02 0x208 /* color conversion matrix coefficient 02 */ +#define VMCR10 0x20c /* color conversion matrix coefficient 10 */ +#define VMCR11 0x210 /* color conversion matrix coefficient 11 */ +#define VMCR12 0x214 /* color conversion matrix coefficient 12 */ +#define VMCR20 0x218 /* color conversion matrix coefficient 20 */ +#define VMCR21 0x21c /* color conversion matrix coefficient 21 */ +#define VMCR22 0x220 /* color conversion matrix coefficient 22 */ +#define VCOFFR 0x224 /* color conversion offset */ +#define VCBR 0x228 /* color conversion clip */ + +/* Helper functions for reading registers. */ + +static unsigned long read_reg(struct uio_map *ump, int reg_offs) +{ + volatile unsigned long *reg = ump->iomem; + + return reg[reg_offs / 4]; +} + +static void write_reg(struct uio_map *ump, unsigned long value, int reg_offs) +{ + volatile unsigned long *reg = ump->iomem; + + reg[reg_offs / 4] = value; +} + +static vidix_capability_t sh_veu_cap = { + "SuperH VEU driver", + "Magnus Damm", + TYPE_OUTPUT, + { 0, 0, 0, 0 }, + 2560, + 1920, + 16, + 16, + -1, + FLAG_UPSCALER|FLAG_DOWNSCALER, + -1, + -1, + { 0, 0, 0, 0 } +}; + +/* global variables yuck */ + +static struct fb_info fbi; +static struct uio_device uio_dev; +static struct uio_map uio_mmio, uio_mem; + +struct sh_veu_plane { + unsigned long width; + unsigned long height; + unsigned long stride; + unsigned long pos_x; + unsigned long pos_y; +}; + +static struct sh_veu_plane _src, _dst; +static vidix_playback_t my_info; + +static int sh_veu_probe(int verbose, int force) +{ + int ret; + + ret = get_fb_info("/dev/fb0", &fbi); + if (ret < 0) + return ret; + + if (fbi.bpp != 16) { + printf("sh_veu: only 16bpp supported\n"); + return -1; + } + + ret = locate_uio_device("VEU", &uio_dev); + if (ret < 0) { + printf("sh_veu: unable to locate matching UIO device\n"); + return ret; + } + + ret = setup_uio_map(&uio_dev, 0, &uio_mmio); + if (ret < 0) { + printf("sh_veu: cannot setup MMIO\n"); + return ret; + } + + ret = setup_uio_map(&uio_dev, 1, &uio_mem); + if (ret < 0) { + printf("sh_veu: cannot setup contiguous memory\n"); + return ret; + } + + printf("sh_veu: Using %s at %s on %lux%lu %ldbpp /dev/fb0\n", + uio_dev.name, uio_dev.path, + fbi.width, fbi.height, fbi.bpp); + + return ret; +} + +static void sh_veu_wait_irq(vidix_playback_t *info) +{ + unsigned long n_pending; + + /* Wait for an interrupt */ + read(uio_dev.fd, &n_pending, sizeof(u_long)); + + write_reg(&uio_mmio, 0x100, VEVTR); /* ack int, write 0 to bit 0 */ +} + +static int sh_veu_is_veu2h(void) +{ + return uio_mmio.size > 0xb8; +} + +static unsigned long sh_veu_do_scale(struct uio_map *ump, + int vertical, int size_in, + int size_out, int crop_out) +{ + unsigned long fixpoint, mant, frac, value, rep; + + /* calculate FRAC and MANT */ + do { + rep = mant = frac = 0; + + if (size_in == size_out) { + if (crop_out != size_out) + mant = 1; /* needed for cropping */ + break; + } + + /* VEU2H special upscale */ + if (sh_veu_is_veu2h() && size_out > size_in) { + fixpoint = (4096 * size_in) / size_out; + + mant = fixpoint / 4096; + frac = fixpoint - (mant * 4096); + frac &= ~0x07; + + switch (frac) { + case 0x800: + rep = 1; + break; + case 0x400: + rep = 3; + break; + case 0x200: + rep = 7; + break; + } + + if (rep) + break; + } + + fixpoint = (4096 * (size_in - 1)) / (size_out + 1); + mant = fixpoint / 4096; + frac = fixpoint - (mant * 4096); + + if (frac & 0x07) { + frac &= ~0x07; + if (size_out > size_in) + frac -= 8; /* round down if scaling up */ + else + frac += 8; /* round up if scaling down */ + } + + } while (0); + + /* set scale */ + value = read_reg(ump, VRFCR); + if (vertical) { + value &= ~0xffff0000; + value |= ((mant << 12) | frac) << 16; + } else { + value &= ~0xffff; + value |= (mant << 12) | frac; + } + write_reg(ump, value, VRFCR); + + /* set clip */ + value = read_reg(ump, VRFSR); + if (vertical) { + value &= ~0xffff0000; + value |= ((rep << 12) | crop_out) << 16; + } else { + value &= ~0xffff; + value |= (rep << 12) | crop_out; + } + write_reg(ump, value, VRFSR); + + return (((size_in * crop_out) / size_out) + 0x03) & ~0x03; +} + +static void sh_veu_setup_planes(vidix_playback_t *info, + struct sh_veu_plane *src, + struct sh_veu_plane *dst) +{ + unsigned long addr, real_w, real_h; + + src->width = info->src.w; + src->height = info->src.h; + src->stride = (info->src.w+15) & ~15; + + dst->width = real_w = info->dest.w; + dst->height = real_h = info->dest.h; + dst->stride = fbi.line_length; + dst->pos_x = info->dest.x & ~0x03; + dst->pos_y = info->dest.y; + + if ((dst->width + dst->pos_x) > fbi.width) + dst->width = fbi.width - dst->pos_x; + + if ((dst->height + dst->pos_y) > fbi.height) + dst->height = fbi.height - dst->pos_y; + + addr = fbi.address; + addr += dst->pos_x * (fbi.bpp / 8); + addr += dst->pos_y * dst->stride; + + src->width = sh_veu_do_scale(&uio_mmio, 0, src->width, + real_w, dst->width); + src->height = sh_veu_do_scale(&uio_mmio, 1, src->height, + real_h, dst->height); + + write_reg(&uio_mmio, src->stride, VESWR); + write_reg(&uio_mmio, src->width | (src->height << 16), VESSR); + write_reg(&uio_mmio, 0, VBSSR); /* not using bundle mode */ + + write_reg(&uio_mmio, dst->stride, VEDWR); + write_reg(&uio_mmio, addr, VDAYR); + write_reg(&uio_mmio, 0, VDACR); /* unused for RGB */ + + write_reg(&uio_mmio, 0x67, VSWPR); + write_reg(&uio_mmio, (6 << 16) | (0 << 14) | 2 | 4, VTRCR); + + if (sh_veu_is_veu2h()) { + write_reg(&uio_mmio, 0x0cc5, VMCR00); + write_reg(&uio_mmio, 0x0950, VMCR01); + write_reg(&uio_mmio, 0x0000, VMCR02); + + write_reg(&uio_mmio, 0x397f, VMCR10); + write_reg(&uio_mmio, 0x0950, VMCR11); + write_reg(&uio_mmio, 0x3ccd, VMCR12); + + write_reg(&uio_mmio, 0x0000, VMCR20); + write_reg(&uio_mmio, 0x0950, VMCR21); + write_reg(&uio_mmio, 0x1023, VMCR22); + + write_reg(&uio_mmio, 0x00800010, VCOFFR); + } + + write_reg(&uio_mmio, 1, VEIER); /* enable interrupt in VEU */ +} + +static void sh_veu_blit(vidix_playback_t *info, int frame) +{ + unsigned long enable = 1; + unsigned long addr; + + addr = uio_mem.address + info->offsets[frame]; + + write_reg(&uio_mmio, addr + info->offset.y, VSAYR); + write_reg(&uio_mmio, addr + info->offset.u, VSACR); + + /* Enable interrupt in UIO driver */ + write(uio_dev.fd, &enable, sizeof(u_long)); + + write_reg(&uio_mmio, 1, VESTR); /* start operation */ +} + +static int sh_veu_init(void) +{ + write_reg(&uio_mmio, 0x100, VBSRR); /* reset VEU */ + return 0; +} + +static void sh_veu_destroy(void) +{ +} + +static int sh_veu_get_caps(vidix_capability_t *to) +{ + memcpy(to, &sh_veu_cap, sizeof(vidix_capability_t)); + return 0; +} + +static int sh_veu_query_fourcc(vidix_fourcc_t *to) +{ + if (to->fourcc == IMGFMT_NV12) { + to->depth = VID_DEPTH_ALL; + to->flags = VID_CAP_EXPAND | VID_CAP_SHRINK; + return 0; + } + to->depth = to->flags = 0; + return ENOSYS; +} + + +static int sh_veu_config_playback(vidix_playback_t *info) +{ + unsigned int i, y_pitch; + + switch (info->fourcc) { + case IMGFMT_NV12: + y_pitch = (info->src.w + 15) & ~15; + + info->offset.y = 0; + info->offset.u = y_pitch * info->src.h; + info->frame_size = info->offset.u + info->offset.u / 2; + break; + default: + return ENOTSUP; + } + + info->num_frames = uio_mem.size / info->frame_size; + if (info->num_frames > VID_PLAY_MAXFRAMES) + info->num_frames = VID_PLAY_MAXFRAMES; + + if (!info->num_frames) { + printf("sh_veu: %d is not enough memory for %d bytes frame\n", + (int)uio_mem.size, (int)info->frame_size); + return ENOMEM; + } + + info->dga_addr = uio_mem.iomem; + info->dest.pitch.y = info->dest.pitch.u = info->dest.pitch.v = 16; + + for (i = 0; i < info->num_frames; i++) + info->offsets[i] = info->frame_size * i; + + my_info = *info; + + printf("sh_veu: %d frames * %d bytes, total size = %d\n", + (int)info->num_frames, (int)info->frame_size, + (int)uio_mem.size); + + sh_veu_setup_planes(info, &_src, &_dst); + + printf("sh_veu: %dx%d->%dx%d@%dx%d -> %dx%d->%dx%d@%dx%d \n", + (int)info->src.w, (int)info->src.h, + (int)info->dest.w, (int)info->dest.h, + (int)info->dest.x, (int)info->dest.y, + (int)_src.width, (int)_src.height, + (int)_dst.width, (int)_dst.height, + (int)_dst.pos_x, (int)_dst.pos_y); + return 0; +} + + +static int sh_veu_playback_on(void) +{ + return 0; +} + +static int sh_veu_playback_off(void) +{ + return 0; +} + +static int sh_veu_first_frame = 1; + +static int sh_veu_frame_sel(unsigned int frame) +{ + if (!sh_veu_first_frame) + sh_veu_wait_irq(&my_info); + + sh_veu_blit(&my_info, frame); + sh_veu_first_frame = 0; + return 0; +} + +VDXDriver sh_veu_drv = { + "sh_veu", + NULL, + .probe = sh_veu_probe, + .get_caps = sh_veu_get_caps, + .query_fourcc = sh_veu_query_fourcc, + .init = sh_veu_init, + .destroy = sh_veu_destroy, + .config_playback = sh_veu_config_playback, + .playback_on = sh_veu_playback_on, + .playback_off = sh_veu_playback_off, + .frame_sel = sh_veu_frame_sel, +}; From 85d48b9bb01fa28f889291f0648b612c2b9e5a54 Mon Sep 17 00:00:00 2001 From: ben Date: Mon, 11 Aug 2008 23:11:38 +0000 Subject: [PATCH 17/22] Update ChangeLog with latest VIDIX related changes regarding SuperH. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@27453 b3059339-0415-0410-9bf9-f77b7e298cf2 --- Changelog | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Changelog b/Changelog index e049cc30f3..7168e8ecef 100644 --- a/Changelog +++ b/Changelog @@ -55,6 +55,7 @@ MPlayer (1.0) * replace PolypAudio by PulseAudio (-ao pulse) * add force-pbo suboption for faster output in vo_gl * add Nintendo Wii/GameCube video driver (-vo wii) + * VIDIX driver for SuperH Mobile VEU hardware block. MEncoder: * Ogg muxing using -of lavf -o done.ogg @@ -79,6 +80,7 @@ MPlayer (1.0) * AC3/DTS passthrough for ao_macosx * fix frozen OSD on Mac OS X * vo_gl now works with -wid and nVidia drivers on Windows (this is a hack) + * VIDIX on SuperH. rc2try2: From e73396900cef724364d8988d3fef730a9a072cd5 Mon Sep 17 00:00:00 2001 From: ben Date: Mon, 11 Aug 2008 23:15:24 +0000 Subject: [PATCH 18/22] Mention IVTV, S3 and SH_VEU drivers within VIDIX section of manpage. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@27454 b3059339-0415-0410-9bf9-f77b7e298cf2 --- DOCS/man/en/mplayer.1 | 5 +++-- DOCS/man/fr/mplayer.1 | 5 +++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/DOCS/man/en/mplayer.1 b/DOCS/man/en/mplayer.1 index 33301f5fc3..7e06545b80 100644 --- a/DOCS/man/en/mplayer.1 +++ b/DOCS/man/en/mplayer.1 @@ -3459,8 +3459,9 @@ Very fast video output driver on cards that support it. .RSs .IPs Explicitly choose the VIDIX subdevice driver to use. -Available subdevice drivers are cyberblade, mach64, -mga_crtc2, mga, nvidia, pm2, pm3, radeon, rage128, sis_vid and unichrome. +Available subdevice drivers are cyberblade, ivtv, mach64, +mga_crtc2, mga, nvidia, pm2, pm3, radeon, rage128, s3, sh_veu, +sis_vid and unichrome. .RE .PD 1 . diff --git a/DOCS/man/fr/mplayer.1 b/DOCS/man/fr/mplayer.1 index 11b071d0fa..9fd199e428 100644 --- a/DOCS/man/fr/mplayer.1 +++ b/DOCS/man/fr/mplayer.1 @@ -3650,8 +3650,9 @@ Pilote de sortie vid .RSs .IPs Choisi explicitement le sous-priphrique utiliser. -Les pilotes de sous-priphrique existant sont cyberblade, -mach64, mga_crtc2, mga, nvidia, pm2, pm3, radeon, rage128, sis et unichrome. +Les pilotes de sous-priphrique existant sont cyberblade, ivtv, +mach64, mga_crtc2, mga, nvidia, pm2, pm3, radeon, rage128, s3, sh_veu, +sis et unichrome. .RE .PD 1 . From 1dccc1979c882b834ee34289f6020f41a896e53d Mon Sep 17 00:00:00 2001 From: compn Date: Tue, 12 Aug 2008 01:58:36 +0000 Subject: [PATCH 19/22] updates git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@27455 b3059339-0415-0410-9bf9-f77b7e298cf2 --- Changelog | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/Changelog b/Changelog index 7168e8ecef..92e6c122d5 100644 --- a/Changelog +++ b/Changelog @@ -11,6 +11,8 @@ MPlayer (1.0) EA Maxis XA ADPCM audio, RL2 video, Beam Software SIFF video, V.Flash PTX video * AVOption support for libavcodec-based decoders * image decoders: Sun rasterfile, PCX image + * MLP decoder via lavc + * use lavc ADPCM codecs by default Demuxers: * -lavfdopts cryptokey allows decrypting MXF and ASF files @@ -26,6 +28,7 @@ MPlayer (1.0) * support MOV subtitle format * support for attachments in lavf demuxer * support for chapters in lavf demuxer + * Flac speedup in lavf demuxer Filters: * vf_ow new overcomplete wavelet denoiser @@ -43,22 +46,26 @@ MPlayer (1.0) FFmpeg/libavcodec: * DNxHD (SMPTE VC-3) encoder * H.264 speedup and PAFF decoding + * correctly decode more of the H.264 conformance testsuite * Nellymoser audio codec * VC-1/WMV3 MMX optimizations * VP3 decoder speedup + * Split-Radix FFT (speedup multiple audio codecs) + * MMX/SSE/ARM and other misc speedups libmpeg2: * enable Alpha/ARM optimizations in libmpeg2 * SSE2-optimized IDCT routines from upstream libmpeg2 + * synced with upstream Drivers: * replace PolypAudio by PulseAudio (-ao pulse) * add force-pbo suboption for faster output in vo_gl * add Nintendo Wii/GameCube video driver (-vo wii) * VIDIX driver for SuperH Mobile VEU hardware block. + * support -border on vo_gl/gl2 in x11 MEncoder: - * Ogg muxing using -of lavf -o done.ogg * check for system-wide configuration file in MEncoder * AVOption support for lavc encoders * AVOption support for lavf muxers @@ -74,6 +81,7 @@ MPlayer (1.0) * add options to disable some or all configuration files * support for DOS-style file:///x:/path paths * some new slave commands (check DOCS/tech/slave.txt) + * misc fixes to libass Ports: * small crash with vo_macosx fixed @@ -81,6 +89,7 @@ MPlayer (1.0) * fix frozen OSD on Mac OS X * vo_gl now works with -wid and nVidia drivers on Windows (this is a hack) * VIDIX on SuperH. + * intentionally break gcc 3.3 on mac os x, please use 4.x rc2try2: From ef97d3827aee450a35e53e4395044f64e1b65b8b Mon Sep 17 00:00:00 2001 From: diego Date: Tue, 12 Aug 2008 07:16:18 +0000 Subject: [PATCH 20/22] Enable PNG encoder in libavcodec for vf_screenshot only if zlib is enabled. based on a patch by Magnus Damm, magnus.damm gmail com git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@27456 b3059339-0415-0410-9bf9-f77b7e298cf2 --- configure | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/configure b/configure index c905117915..f7acba82d8 100755 --- a/configure +++ b/configure @@ -6877,7 +6877,8 @@ if test "$_mencoder" = yes ; then _def_muxers='#define CONFIG_MUXERS 1' else # mpeg1video for vf_lavc, snow for vf_uspp and vf_mcdeint, png for vf_screenshot - _libavencoders="MPEG1VIDEO_ENCODER SNOW_ENCODER PNG_ENCODER" + _libavencoders="MPEG1VIDEO_ENCODER SNOW_ENCODER" + test "$_zlib" = yes && _libavencoders="$_libavencoders PNG_ENCODER" _libavmuxers="" fi echores "$_mencoder" From 51700fd1f5ed67fcabfce0d3c1c662500d8c7a14 Mon Sep 17 00:00:00 2001 From: diego Date: Tue, 12 Aug 2008 07:33:15 +0000 Subject: [PATCH 21/22] Remove useless DVB-related #include. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@27457 b3059339-0415-0410-9bf9-f77b7e298cf2 --- cfg-common.h | 1 - 1 file changed, 1 deletion(-) diff --git a/cfg-common.h b/cfg-common.h index 812fba24a4..1737ecb169 100644 --- a/cfg-common.h +++ b/cfg-common.h @@ -171,7 +171,6 @@ const m_option_t pvropts_conf[]={ #endif /* CONFIG_PVR */ #ifdef CONFIG_DVBIN -#include "stream/dvbin.h" extern const m_config_t dvbin_opts_conf[]; #endif From f88bf0c7b7faf4b6f58c8b4c9c0f3892e07dc5ba Mon Sep 17 00:00:00 2001 From: diego Date: Tue, 12 Aug 2008 07:38:30 +0000 Subject: [PATCH 22/22] Remove pointless #ifdefs around extern declarations. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@27458 b3059339-0415-0410-9bf9-f77b7e298cf2 --- cfg-common.h | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/cfg-common.h b/cfg-common.h index 1737ecb169..bed59136e4 100644 --- a/cfg-common.h +++ b/cfg-common.h @@ -145,7 +145,6 @@ const m_option_t tvopts_conf[]={ }; #endif /* CONFIG_TV */ -#ifdef CONFIG_PVR extern int pvr_param_aspect_ratio; extern int pvr_param_sample_rate; extern int pvr_param_audio_layer; @@ -156,6 +155,7 @@ extern char *pvr_param_bitrate_mode; extern int pvr_param_bitrate_peak; extern char *pvr_param_stream_type; +#ifdef CONFIG_PVR const m_option_t pvropts_conf[]={ {"aspect", &pvr_param_aspect_ratio, CONF_TYPE_INT, 0, 1, 4, NULL}, {"arate", &pvr_param_sample_rate, CONF_TYPE_INT, 0, 32000, 48000, NULL}, @@ -170,10 +170,7 @@ const m_option_t pvropts_conf[]={ }; #endif /* CONFIG_PVR */ -#ifdef CONFIG_DVBIN extern const m_config_t dvbin_opts_conf[]; -#endif - extern const m_option_t lavfdopts_conf[]; extern int rtspStreamOverTCP; @@ -352,10 +349,9 @@ const m_option_t msgl_config[]={ }; -#ifdef WIN32 - extern char * proc_priority; +#ifdef WIN32 struct { char* name; int prio;