aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--DOCS/README6
-rw-r--r--DOCS/man/en/mplayer.16
-rw-r--r--DOCS/man/zh_CN/mplayer.110
-rw-r--r--DOCS/xml/Makefile56
-rw-r--r--DOCS/xml/Makefile.inc62
-rw-r--r--DOCS/xml/README.maintainers60
-rwxr-xr-xDOCS/xml/configure2
-rw-r--r--DOCS/xml/cs/Makefile9
-rw-r--r--DOCS/xml/de/Makefile9
-rw-r--r--DOCS/xml/en/Makefile9
-rw-r--r--DOCS/xml/es/Makefile9
-rw-r--r--DOCS/xml/fr/Makefile9
-rw-r--r--DOCS/xml/hu/Makefile9
-rw-r--r--DOCS/xml/it/Makefile9
-rw-r--r--DOCS/xml/pl/Makefile9
-rw-r--r--DOCS/xml/pl/html-chunk.xsl8
-rw-r--r--DOCS/xml/pl/html-common.xsl15
-rw-r--r--DOCS/xml/pl/html-single.xsl8
-rw-r--r--DOCS/xml/ru/Makefile9
-rw-r--r--DOCS/xml/zh_CN/Makefile9
-rw-r--r--Makefile5
-rwxr-xr-xconfigure5
-rw-r--r--etc/codecs.conf13
-rw-r--r--etc/example.conf9
-rw-r--r--help/help_mp-en.h1
-rw-r--r--help/help_mp-zh_CN.h92
-rw-r--r--libmpdemux/aviheader.c10
-rw-r--r--libvo/font_load_ft.c41
-rw-r--r--libvo/gl_common.c375
-rw-r--r--libvo/gl_common.h161
-rw-r--r--libvo/vo_corevideo.m23
-rw-r--r--libvo/vo_gl.c171
-rw-r--r--libvo/vo_gl2.c55
-rw-r--r--stream/tvi_v4l2.c2
-rw-r--r--tremor/misc.h2
-rw-r--r--tremor/tremor.diff13
-rw-r--r--vidix/AsmMacros.h2
-rwxr-xr-x[-rw-r--r--]vidix/pci_db2c.awk5
-rw-r--r--vidix/sh_veu_vid.c50
-rw-r--r--vidix/sysdep/pci_linux.c2
40 files changed, 746 insertions, 614 deletions
diff --git a/DOCS/README b/DOCS/README
index 7caffa7300..04d7357854 100644
--- a/DOCS/README
+++ b/DOCS/README
@@ -12,10 +12,10 @@ Thanks for reading MPlayer documentation !!!
each language in its own subdirectory.
b, If you prefer reading the documentation as a single big file it
- can be found in the HTML-single/ directory, each language in its
+ can be found in the file MPlayer.html, each language in its
own subdirectory.
- c, If the HTML/ or HTML-single/ directories don't contain your language,
+ c, If the HTML/ directory does not contain your language,
try the subdirectories in this very same folder.
@@ -23,7 +23,7 @@ Thanks for reading MPlayer documentation !!!
a, Enter the xml/ directory, and read the README file there to find
out how to build a HTML version of the XML documentation. It will
- be created in the HTML/ and HTML-single/ directories.
+ be created in the HTML/ directory.
b, If the xml/ directory doesn't contain your language, try the
subdirectories in this very same folder.
diff --git a/DOCS/man/en/mplayer.1 b/DOCS/man/en/mplayer.1
index 0393c47dda..29efd7c437 100644
--- a/DOCS/man/en/mplayer.1
+++ b/DOCS/man/en/mplayer.1
@@ -3115,11 +3115,11 @@ y coordinates are relative to the top-left corner of the window rather
than the screen.
The coordinates are relative to the screen given with \-xineramascreen for
the video output drivers that fully support \-xineramascreen (direct3d, gl, gl2,
-vdpau, x11, xv, xvmc).
+vdpau, x11, xv, xvmc, corevideo).
.br
.I NOTE:
This option is only supported by the x11, xmga, xv, xvmc, xvidix,
-gl, gl2, directx, fbdev and tdfxfb video output drivers.
+gl, gl2, directx, fbdev, tdfxfb and corevideo video output drivers.
.sp 1
.I EXAMPLE:
.PD 0
@@ -3305,7 +3305,7 @@ This option is not suitable to only set the startup screen (because
it will always display on the given screen in fullscreen mode),
\-geometry is the best that is available for that purpose
currently.
-Supported by at least the direct3d, gl, gl2, x11 and xv video output drivers.
+Supported by at least the direct3d, gl, gl2, x11, xv and corevideo video output drivers.
.
.TP
.B \-zrbw (\-vo zr only)
diff --git a/DOCS/man/zh_CN/mplayer.1 b/DOCS/man/zh_CN/mplayer.1
index 699e982da7..e026e4a002 100644
--- a/DOCS/man/zh_CN/mplayer.1
+++ b/DOCS/man/zh_CN/mplayer.1
@@ -1,4 +1,4 @@
-.\" sync with en/mplayer.1 r29905
+.\" sync with en/mplayer.1 r30053
.\" Encoding: UTF-8
.\" Reminder of hard terms which need better/final solution later:
.\" /capture; playtree in parent list; colorkey; retrace; desync; downmix;
@@ -2935,14 +2935,14 @@ x 和 y 代表从屏幕左上角到显示图像左上角的距离(以像素为
如果使用 \-wid 选项指定了外部窗口,
那么 x 和 y 坐标是相对于窗口而不是屏幕的左上角。
坐标是相对于 \-xineramascreen 选项给出的屏幕,该屏幕用于完全支持 \-xineramascreen 的
-视频输出的驱动(direct3d、gl、gl2、vdpau、x11、xv、xvmc)。
+视频输出的驱动(direct3d、gl、gl2、vdpau、x11、xv、xvmc、corevideo)。
The coordinates are relative to the screen given with \-xineramascreen for
the video output drivers that fully support \-xineramascreen (direct3d, gl, gl2,
vdpau, x11, xv, xvmc).
.br
.I 注意:
-此选项仅被 x11、xmga、xv、xvmc、xvidix、
-gl、gl2、directx、fbdev 和 tdfxfb 视频输出驱动支持。
+此选项仅被 x11、xmga、xv、xvmc、xvidix、gl、gl2、directx、fbdev、tdfxfb 和
+corevideo 视频输出驱动支持。
.sp 1
.I 示例:
.PD 0
@@ -3116,7 +3116,7 @@ ggi 和 gl2 的都支持此功能。
通常只能与 "\-fstype \-fullscreen" 或 "\-fstype none" 一起工作。
该选项不适用于仅仅设置启动屏幕(并且也不适合设置全屏屏幕),\-geometry 是目前可用
于此目的的最好选项。
-至少 direct3d、gl、gl2、x11 和 xv 视频输出驱动支持该选项。
+至少 direct3d、gl、gl2、x11、xv 和 corevideo 视频输出驱动支持该选项。
.TP
.B \-zrbw (仅用于 \-vo zr)
黑白显示。
diff --git a/DOCS/xml/Makefile b/DOCS/xml/Makefile
index 7a90938aef..ed0ec64ed6 100644
--- a/DOCS/xml/Makefile
+++ b/DOCS/xml/Makefile
@@ -2,11 +2,11 @@
include ../../config.mak
-# Generated chunked HTML files go here.
-HTML_CHUNKED = ../HTML
+# Generated HTML files go here.
+HTML = ../HTML
-# Generated single HTML files go here.
-HTML_SINGLE = ../HTML-single
+MAIN_XML_ALL = $(foreach lang,$(DOC_LANG_ALL),$(lang)/main.xml)
+CONFIGURE_GENERATED = html-chunk.xsl html-single.xsl xsltproc.sh xmllint.sh
all: html-chunked html-single
@@ -18,48 +18,48 @@ help:
@echo "html-single-LANG : As above, but only one language."
@echo "html-chunked : HTML documentation for configured languages (multiple files)"
@echo "html-chunked-LANG : As above, but only one language."
- @echo "xmllint : Check syntax of all xml files."
- @echo "xmllint-LANG : Check syntax of LANG xml files."
- @echo "clean : Purge the 'HTML' and 'HTML-single' directories."
+ @echo "xmllint : Check syntax of XML files for configured languages."
+ @echo "xmllint-LANG : Check syntax of LANG XML files."
+ @echo "clean : Purge the 'HTML' directory."
@echo "releaseclean : Remove generated files but keep the HTML."
@echo "distclean : Remove ALL generated files."
@echo "Substitute LANG for one of $(DOC_LANG_ALL)"
-html-chunked: xsltproc.sh xmllint.sh $(HTML_CHUNKED) $(addprefix html-chunked-,$(DOC_LANGS))
+html-chunked: $(addprefix html-chunked-,$(DOC_LANGS))
+html-single: $(addprefix html-single-,$(DOC_LANGS))
-html-single: xsltproc.sh xmllint.sh $(HTML_SINGLE) $(addprefix html-single-,$(DOC_LANGS))
+xmllint: $(addprefix xmllint-,$(DOC_LANGS))
-xmllint: xmllint.sh $(addprefix xmllint-,$(DOC_LANG_ALL))
+$(foreach lang,$(DOC_LANG_ALL),$(HTML)/$(lang)):
+ mkdir -p $@
-$(HTML_CHUNKED) $(HTML_SINGLE):
- -mkdir -p $@
-
-xsltproc.sh xmllint.sh:
+$(CONFIGURE_GENERATED) $(MAIN_XML_ALL):
sh configure
define lang-def
-html-chunked-$(1): xsltproc.sh xmllint.sh $(HTML_CHUNKED)
- -mkdir -p $(HTML_CHUNKED)/$(1)
- $(MAKE) HTMLDIR=../$(HTML_CHUNKED)/$(1) -C $(1) html-chunked
+html-chunked-$(lang) html-single-$(lang): $(HTML)/$(lang) $(CONFIGURE_GENERATED)
+
+html-chunked-$(lang):
+ $(MAKE) HTMLDIR=../$$< -C $(lang) html-chunked
-html-single-$(1): xsltproc.sh xmllint.sh $(HTML_SINGLE)
- -mkdir -p $(HTML_SINGLE)/$(1)
- $(MAKE) HTMLFILE=../$(HTML_SINGLE)/$(1)/MPlayer.html -C $(1) html-single
+html-single-$(lang):
+ $(MAKE) HTMLDIR=../$$< -C $(lang) html-single
-xmllint-$(1): xmllint.sh
- $(MAKE) HTMLFILE=../$(HTML_SINGLE)/$(1)/MPlayer.html -C $(1) xmllint
+xmllint-$(lang): xmllint.sh
+ $(MAKE) -C $(lang) xmllint
endef
-$(foreach lang, $(DOC_LANG_ALL),$(eval $(call lang-def,$(lang))))
+$(foreach lang, $(DOC_LANG_ALL),$(eval $(lang-def)))
clean:
- rm -rf $(HTML_CHUNKED) $(HTML_SINGLE)
+ -rm -rf $(HTML)
releaseclean:
- rm -f $(foreach lang,$(DOC_LANG_ALL),$(lang)/main.xml)
- rm -f $$(find . -name *.xml -type l)
- rm -f html-chunk.xsl html-single.xsl xsltproc.sh xmllint.sh
+ -rm -f $(CONFIGURE_GENERATED)
+ -rm -f $(MAIN_XML_ALL)
+ -rm -f $$(find . -name *.xml -type l)
distclean: clean releaseclean
-.PHONY: all help html-chunked* html-single* xmllint* *clean*
+.PHONY: all help html-chunked html-single xmllint
+.PHONY: html-chunked-* html-single-* xmllint-* *clean*
diff --git a/DOCS/xml/Makefile.inc b/DOCS/xml/Makefile.inc
index c7c3252240..33639bed7e 100644
--- a/DOCS/xml/Makefile.inc
+++ b/DOCS/xml/Makefile.inc
@@ -2,75 +2,35 @@
# Makefile.inc for Makefiles in subdirectories.
#
-# Use customized html-chunk.xsl and/or html-single.xsl file if they exist...
-# Also add html-common.xsl to depends if it exists.
-ifeq (html-common.xsl,$(wildcard html-common.xsl))
-COMMON_XSL_DEPS := html-common.xsl ../html-common.xsl
-else
-COMMON_XSL_DEPS := ../html-common.xsl
-endif
-
-ifeq (html-chunk.xsl,$(wildcard html-chunk.xsl))
-HTML_CHUNK_XSL := html-chunk.xsl
-CHUNK_XSL_DEPS := $(HTML_CHUNK_XSL) ../html-chunk.xsl $(COMMON_XSL_DEPS)
-else
HTML_CHUNK_XSL := ../html-chunk.xsl
CHUNK_XSL_DEPS := $(HTML_CHUNK_XSL) ../html-common.xsl
-endif
-ifeq (html-single.xsl,$(wildcard html-single.xsl))
-HTML_SINGLE_XSL := html-single.xsl
-XSL_DEPS := $(HTML_SINGLE_XSL) ../html-single.xsl $(COMMON_XSL_DEPS)
-else
HTML_SINGLE_XSL := ../html-single.xsl
-XSL_DEPS := $(HTML_SINGLE_XSL) ../html-common.xsl
-endif
-
-# Fall back to the default HTML stylesheet if none is specified.
-HTML_STYLESHEET ?= ../default.css
+SINGLE_XSL_DEPS := $(HTML_SINGLE_XSL) ../html-common.xsl
# This is the main target...
all: html-chunked html-single
html-chunked: $(HTMLDIR)/index.html
-html-single: $(HTMLFILE)
+html-single: $(HTMLDIR)/MPlayer.html
-SYMLINKS_DEPS:=$(if $(findstring yes,$(USE_SYMLINKS)), $(patsubst ../en/%,%,$(wildcard ../en/*.xml)))
+SYMLINKS_DEPS := $(filter-out $(wildcard *.xml),$(notdir $(wildcard ../en/*.xml)))
xmllint: main.xml $(SYMLINKS_DEPS)
../xmllint.sh $<
-$(HTMLDIR)/index.html: main.xml $(CHUNK_XSL_DEPS) $(SYMLINKS_DEPS)
-ifndef HTMLDIR
- $(warning $(HTMLDIR))
- $(warning Error: HTMLDIR not set!!!)
- $(warning Typically this means, that you've run make from a subdir of DOCS/xml.)
- $(error Don't do this!)
-endif
- -rm -f $(HTMLDIR)/*
- ../xmllint.sh $<
- cp -f $(HTML_STYLESHEET) $(HTMLDIR)/
+$(HTMLDIR)/default.css:
+ cp -f ../default.css $(@D)
+
+$(HTMLDIR)/index.html: main.xml $(CHUNK_XSL_DEPS) $(SYMLINKS_DEPS) xmllint $(HTMLDIR)/default.css
../xsltproc.sh $(HTMLDIR)/ $(HTML_CHUNK_XSL) $<
-$(HTMLFILE): main.xml $(XSL_DEPS) $(SYMLINKS_DEPS)
-ifndef HTMLFILE
- $(warning Error: HTMLFILE not set!!!)
- $(warning Typically this means, that you've run make from a subdir of DOCS/xml.)
- $(error Don't do this!)
-endif
- -rm -f $(HTMLFILE)
- ../xmllint.sh $<
- cp -f $(HTML_STYLESHEET) `dirname $(HTMLFILE)`
- ../xsltproc.sh $(HTMLFILE) $(HTML_SINGLE_XSL) $<
+$(HTMLDIR)/MPlayer.html: main.xml $(SINGLE_XSL_DEPS) $(SYMLINKS_DEPS) xmllint $(HTMLDIR)/default.css
+ ../xsltproc.sh $@ $(HTML_SINGLE_XSL) $<
../html-chunk.xsl ../html-single.xsl main.xml:
cd .. && sh configure
-$(filter-out main.xml, $(patsubst ../en/%,%, $(wildcard ../en/*.xml))):
- $(if $(findstring yes,$(USE_SYMLINKS)), ,exit 0;)\
- for file in ../en/*.xml ; do \
- if ! test -r `basename $$file` ; then \
- ln -s $$file `basename $$file` ; \
- fi; \
- done
+$(SYMLINKS_DEPS):
+ ln -s ../en/$@ $@
.PHONY: all html-chunked html-single xmllint
diff --git a/DOCS/xml/README.maintainers b/DOCS/xml/README.maintainers
index a17617a555..73114f2359 100644
--- a/DOCS/xml/README.maintainers
+++ b/DOCS/xml/README.maintainers
@@ -2,21 +2,17 @@ The documentation and its translations reside in subdirectories.
When building the documentation, the toplevel Makefile goes into
the subdirectories listed in the SUBDIRS variable and executes make
in each of those directories to create the HTML documentation
-in subdirectories of the 'HTML' and 'HTML-single' directories.
+in subdirectories of the 'HTML' directory.
-IMPORTANT: Do NOT place sensitive files under 'HTML' or 'HTML-single'!
+IMPORTANT: Do NOT place sensitive files under 'HTML'!
It is for generated documentation only.
The whole directory tree is wiped out by the Makefile
when running 'make distclean' or 'make clean'.
- Also, subdirectories are wiped out one by one before
- creating the HTML files.
Each subdirectory must have a Makefile. Its purpose is to include
the toplevel Makefile.inc file (with the rules to build the docs)
and add dependency information to the main target, $(HTMLDIR)/index.html.
-The main target usually depends on all the XML and XSL files in the
-subdirectory. (Note that the toplevel *.xsl files are added automatically
-by Makefile.inc, so you do not have to list them.)
+The main target usually depends on all the XML files in the subdirectory.
Adding new translations
@@ -28,56 +24,8 @@ Adding new translations
2) Make sure to create a 'Makefile' for the translation -- you can
use 'en/Makefile' as an example.
-3) If you want to use a customized XSL stylesheet, create one and name it
- 'html-common.xsl'. Also create two additional XSL stylesheets
- ('html-single.xsl' and 'html-chunk.xsl'), with content such as this:
-
- html-single.xsl:
-
- <?xml version="1.0" encoding="ISO-8859-1"?>
- <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
- version="1.0">
-
- <xsl:import href="../html-single.xsl"/>
- <xsl:include href="html-common.xsl"/>
-
- </xsl:stylesheet>
-
- html-chunk.xsl:
-
- <?xml version="1.0" encoding="ISO-8859-1"?>
- <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
- version="1.0">
-
- <xsl:import href="../html-chunk.xsl"/>
- <xsl:include href="html-common.xsl"/>
-
- </xsl:stylesheet>
-
-
- Note: You mustn't xsl:include or xsl:import chunk.xsl directly!
- Including it can (and will) break building of documentation if chunk.xsl
- is installed at a nonstandard location.
-
-4) If you wish to change the output encoding of generated files, create
- html-common.xsl as suggested in step 4) and add strings such as these
- somewhere between the <xsl:stylesheet ...> and </xsl:stylesheet> tags
- (please, pay attention to quotes):
-
- <xsl:param name="chunker.output.encoding" select="'your_encoding'"/>
- <xsl:output encoding="your_encoding"/>
-
-5) If you are using your own HTML stylesheet, edit your Makefile and set
- the HTML_STYLESHEET variable to its name. Please, don't call your HTML
- stylesheet 'default.css'.
-
-6) In each translated file after the <?xml ... ?> tag you must put a note
+3) In each translated file after the <?xml ... ?> tag you must put a note
like <!-- synced with r2 -->, where 2 is the revision of corresponding
English file (see comment at the top of file).
-7) While your translation isn't finished, you can change USE_SYMLINKS
- to "yes" in your Makefile. This will help you testing your translation:
- English files will be used instead of untranslated ones, when generating
- HTML docs.
-
That's all, in theory.
diff --git a/DOCS/xml/configure b/DOCS/xml/configure
index d4145ddf4c..b94eebf7e5 100755
--- a/DOCS/xml/configure
+++ b/DOCS/xml/configure
@@ -181,7 +181,7 @@ echo "Looking for a valid XSLT processor..."
# Also checks for Jade/OpenJade.
#FIXME: Add support for the xalan/xalan2 XSLT processors.
-if xsltproc --version &> /dev/null
+if xsltproc --version > /dev/null 2>&1
then
if test -z "$_fake_chunk_xsl"
then
diff --git a/DOCS/xml/cs/Makefile b/DOCS/xml/cs/Makefile
index e36fbfffa5..db38611f41 100644
--- a/DOCS/xml/cs/Makefile
+++ b/DOCS/xml/cs/Makefile
@@ -1,11 +1,4 @@
-# Set if you are using your own HTML stylesheet...
-#HTML_STYLESHEET = mystyle.css
-
-# Change to yes to enable symlinking missing files to English master versions
-USE_SYMLINKS = no
-
# Dependency information.
-$(HTMLDIR)/index.html: $(wildcard *.xml)
-$(HTMLFILE): $(wildcard *.xml)
+$(HTMLDIR)/index.html $(HTMLDIR)/MPlayer.html: $(wildcard *.xml)
include ../Makefile.inc
diff --git a/DOCS/xml/de/Makefile b/DOCS/xml/de/Makefile
index e18885f6df..db38611f41 100644
--- a/DOCS/xml/de/Makefile
+++ b/DOCS/xml/de/Makefile
@@ -1,11 +1,4 @@
-# Set if you are using your own HTML stylesheet...
-#HTML_STYLESHEET = mystyle.css
-
-# Change to yes to enable symlinking missing files to English master versions
-USE_SYMLINKS = yes
-
# Dependency information.
-$(HTMLDIR)/index.html: $(wildcard *.xml)
-$(HTMLFILE): $(wildcard *.xml)
+$(HTMLDIR)/index.html $(HTMLDIR)/MPlayer.html: $(wildcard *.xml)
include ../Makefile.inc
diff --git a/DOCS/xml/en/Makefile b/DOCS/xml/en/Makefile
index e36fbfffa5..db38611f41 100644
--- a/DOCS/xml/en/Makefile
+++ b/DOCS/xml/en/Makefile
@@ -1,11 +1,4 @@
-# Set if you are using your own HTML stylesheet...
-#HTML_STYLESHEET = mystyle.css
-
-# Change to yes to enable symlinking missing files to English master versions
-USE_SYMLINKS = no
-
# Dependency information.
-$(HTMLDIR)/index.html: $(wildcard *.xml)
-$(HTMLFILE): $(wildcard *.xml)
+$(HTMLDIR)/index.html $(HTMLDIR)/MPlayer.html: $(wildcard *.xml)
include ../Makefile.inc
diff --git a/DOCS/xml/es/Makefile b/DOCS/xml/es/Makefile
index e18885f6df..db38611f41 100644
--- a/DOCS/xml/es/Makefile
+++ b/DOCS/xml/es/Makefile
@@ -1,11 +1,4 @@
-# Set if you are using your own HTML stylesheet...
-#HTML_STYLESHEET = mystyle.css
-
-# Change to yes to enable symlinking missing files to English master versions
-USE_SYMLINKS = yes
-
# Dependency information.
-$(HTMLDIR)/index.html: $(wildcard *.xml)
-$(HTMLFILE): $(wildcard *.xml)
+$(HTMLDIR)/index.html $(HTMLDIR)/MPlayer.html: $(wildcard *.xml)
include ../Makefile.inc
diff --git a/DOCS/xml/fr/Makefile b/DOCS/xml/fr/Makefile
index e36fbfffa5..db38611f41 100644
--- a/DOCS/xml/fr/Makefile
+++ b/DOCS/xml/fr/Makefile
@@ -1,11 +1,4 @@
-# Set if you are using your own HTML stylesheet...
-#HTML_STYLESHEET = mystyle.css
-
-# Change to yes to enable symlinking missing files to English master versions
-USE_SYMLINKS = no
-
# Dependency information.
-$(HTMLDIR)/index.html: $(wildcard *.xml)
-$(HTMLFILE): $(wildcard *.xml)
+$(HTMLDIR)/index.html $(HTMLDIR)/MPlayer.html: $(wildcard *.xml)
include ../Makefile.inc
diff --git a/DOCS/xml/hu/Makefile b/DOCS/xml/hu/Makefile
index e18885f6df..db38611f41 100644
--- a/DOCS/xml/hu/Makefile
+++ b/DOCS/xml/hu/Makefile
@@ -1,11 +1,4 @@
-# Set if you are using your own HTML stylesheet...
-#HTML_STYLESHEET = mystyle.css
-
-# Change to yes to enable symlinking missing files to English master versions
-USE_SYMLINKS = yes
-
# Dependency information.
-$(HTMLDIR)/index.html: $(wildcard *.xml)
-$(HTMLFILE): $(wildcard *.xml)
+$(HTMLDIR)/index.html $(HTMLDIR)/MPlayer.html: $(wildcard *.xml)
include ../Makefile.inc
diff --git a/DOCS/xml/it/Makefile b/DOCS/xml/it/Makefile
index e18885f6df..db38611f41 100644
--- a/DOCS/xml/it/Makefile
+++ b/DOCS/xml/it/Makefile
@@ -1,11 +1,4 @@
-# Set if you are using your own HTML stylesheet...
-#HTML_STYLESHEET = mystyle.css
-
-# Change to yes to enable symlinking missing files to English master versions
-USE_SYMLINKS = yes
-
# Dependency information.
-$(HTMLDIR)/index.html: $(wildcard *.xml)
-$(HTMLFILE): $(wildcard *.xml)
+$(HTMLDIR)/index.html $(HTMLDIR)/MPlayer.html: $(wildcard *.xml)
include ../Makefile.inc
diff --git a/DOCS/xml/pl/Makefile b/DOCS/xml/pl/Makefile
index e36fbfffa5..db38611f41 100644
--- a/DOCS/xml/pl/Makefile
+++ b/DOCS/xml/pl/Makefile
@@ -1,11 +1,4 @@
-# Set if you are using your own HTML stylesheet...
-#HTML_STYLESHEET = mystyle.css
-
-# Change to yes to enable symlinking missing files to English master versions
-USE_SYMLINKS = no
-
# Dependency information.
-$(HTMLDIR)/index.html: $(wildcard *.xml)
-$(HTMLFILE): $(wildcard *.xml)
+$(HTMLDIR)/index.html $(HTMLDIR)/MPlayer.html: $(wildcard *.xml)
include ../Makefile.inc
diff --git a/DOCS/xml/pl/html-chunk.xsl b/DOCS/xml/pl/html-chunk.xsl
deleted file mode 100644
index 26cfa2f125..0000000000
--- a/DOCS/xml/pl/html-chunk.xsl
+++ /dev/null
@@ -1,8 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
- version="1.0">
-
- <xsl:import href="../html-chunk.xsl"/>
- <xsl:include href="html-common.xsl"/>
-
-</xsl:stylesheet>
diff --git a/DOCS/xml/pl/html-common.xsl b/DOCS/xml/pl/html-common.xsl
deleted file mode 100644
index b3c85812ce..0000000000
--- a/DOCS/xml/pl/html-common.xsl
+++ /dev/null
@@ -1,15 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-
-<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
- version="1.0">
-
- <xsl:param name="local.l10n.xml" select="document('')"/>
- <l:i18n xmlns:l="http://docbook.sourceforge.net/xmlns/l10n/1.0">
- <l:l10n language="pl">
- <l:gentext key="NOTE" text="Informacja"/>
- <l:gentext key="Note" text="Informacja"/>
- <l:gentext key="note" text="Informacja"/>
- </l:l10n>
- </l:i18n>
-
-</xsl:stylesheet>
diff --git a/DOCS/xml/pl/html-single.xsl b/DOCS/xml/pl/html-single.xsl
deleted file mode 100644
index b263daf761..0000000000
--- a/DOCS/xml/pl/html-single.xsl
+++ /dev/null
@@ -1,8 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
- version="1.0">
-
- <xsl:import href="../html-single.xsl"/>
- <xsl:include href="html-common.xsl"/>
-
-</xsl:stylesheet>
diff --git a/DOCS/xml/ru/Makefile b/DOCS/xml/ru/Makefile
index e18885f6df..db38611f41 100644
--- a/DOCS/xml/ru/Makefile
+++ b/DOCS/xml/ru/Makefile
@@ -1,11 +1,4 @@
-# Set if you are using your own HTML stylesheet...
-#HTML_STYLESHEET = mystyle.css
-
-# Change to yes to enable symlinking missing files to English master versions
-USE_SYMLINKS = yes
-
# Dependency information.
-$(HTMLDIR)/index.html: $(wildcard *.xml)
-$(HTMLFILE): $(wildcard *.xml)
+$(HTMLDIR)/index.html $(HTMLDIR)/MPlayer.html: $(wildcard *.xml)
include ../Makefile.inc
diff --git a/DOCS/xml/zh_CN/Makefile b/DOCS/xml/zh_CN/Makefile
index e18885f6df..db38611f41 100644
--- a/DOCS/xml/zh_CN/Makefile
+++ b/DOCS/xml/zh_CN/Makefile
@@ -1,11 +1,4 @@
-# Set if you are using your own HTML stylesheet...
-#HTML_STYLESHEET = mystyle.css
-
-# Change to yes to enable symlinking missing files to English master versions
-USE_SYMLINKS = yes
-
# Dependency information.
-$(HTMLDIR)/index.html: $(wildcard *.xml)
-$(HTMLFILE): $(wildcard *.xml)
+$(HTMLDIR)/index.html $(HTMLDIR)/MPlayer.html: $(wildcard *.xml)
include ../Makefile.inc
diff --git a/Makefile b/Makefile
index b50448a1be..d2363bbb13 100644
--- a/Makefile
+++ b/Makefile
@@ -269,7 +269,10 @@ SRCS_COMMON-$(TREMOR_INTERNAL) += tremor/bitwise.c \
SRCS_COMMON-$(TV) += stream/stream_tv.c stream/tv.c \
stream/frequencies.c stream/tvi_dummy.c
SRCS_COMMON-$(TV_BSDBT848) += stream/tvi_bsdbt848.c
-SRCS_COMMON-$(TV_DSHOW) += stream/tvi_dshow.c
+SRCS_COMMON-$(TV_DSHOW) += stream/tvi_dshow.c \
+ loader/dshow/guids.c \
+ loader/dshow/mediatype.c \
+
SRCS_COMMON-$(TV_V4L1) += stream/tvi_v4l.c stream/audio_in.c
SRCS_COMMON-$(TV_V4L2) += stream/tvi_v4l2.c stream/audio_in.c
SRCS_COMMON-$(UNRAR_EXEC) += unrar_exec.c
diff --git a/configure b/configure
index 3bd8adcc11..78fcf6716f 100755
--- a/configure
+++ b/configure
@@ -2962,7 +2962,8 @@ _socklib=no
for _ld_tmp in "" "-lsocket -lbind" "-lsocket -ldnet" "-lsocket -lnsl" "-lnsl" "-lsocket" ; do
cc_check $_ld_tmp && _ld_sock="$_ld_tmp" && _socklib=yes && break
done
-if test $_winsock2_h = auto && ! cygwin ; then
+test $_socklib = yes && test $_winsock2_h = auto && _winsock2_h=no
+if test $_winsock2_h = auto ; then
_winsock2_h=no
cat > $TMPC << EOF
#include <winsock2.h>
@@ -6972,7 +6973,7 @@ if test "$_x264" = auto ; then
cat > $TMPC << EOF
#include <inttypes.h>
#include <x264.h>
-#if X264_BUILD < 78
+#if X264_BUILD < 79
#error We do not support old versions of x264. Get the latest from git.
#endif
int main(void) { x264_encoder_open((void*)0); return 0; }
diff --git a/etc/codecs.conf b/etc/codecs.conf
index 49faf25322..9c7751b909 100644
--- a/etc/codecs.conf
+++ b/etc/codecs.conf
@@ -76,6 +76,14 @@ videocodec yuv8
out YV12,I420,UYVY
out BGR24,BGR15,BGR32
+videocodec ffr210
+ info "FFmpeg R210 - 10-bit RGB"
+ status working
+ fourcc r210
+ driver ffmpeg
+ dll "r210"
+ out RGB48BE,RGB48LE
+
videocodec blackmagic
info "Blackmagic 10-bit"
status working
@@ -162,6 +170,7 @@ videocodec ffmpeg2
fourcc m2v1
fourcc PIM2
fourcc LMP2 ; Lead mpeg2 in avi
+ fourcc slif ; SoftLab MPEG-2 I-frames Codec
driver ffmpeg
dll "mpeg2video"
out YV12,I420,IYUV
@@ -200,6 +209,7 @@ videocodec ffmpeg12
fourcc mp2v,mpgv
fourcc m2v1,m1v1
fourcc LMP2 ; Lead mpeg2 in avi
+ fourcc slif ; SoftLab MPEG-2 I-frames Codec
driver ffmpeg
dll "mpegvideo"
out YV12,I420,IYUV
@@ -1265,6 +1275,8 @@ videocodec ffmjpeg
fourcc SLMJ ; SL M-JPEG
fourcc MVJP ; Midvid JPEG Video Codec
fourcc IJLV ; Intel JPEG Library Video Codec
+ fourcc avi1,avi2
+ fourcc MTSJ
driver ffmpeg
dll mjpeg
out 444P
@@ -1340,6 +1352,7 @@ videocodec LEAD
fourcc MJPG
fourcc jpeg MJPG ; MOV Photo-JPEG
fourcc LEAD
+ fourcc MTSJ MJPG
driver vfw
dll "LCodcCMP.dll"
out BGR24,BGR15
diff --git a/etc/example.conf b/etc/example.conf
index a0fec86eb0..bdd3cb56bf 100644
--- a/etc/example.conf
+++ b/etc/example.conf
@@ -16,6 +16,10 @@
# video settings #
##################
+# Specify vdpau codecs when using -vo vdpau.
+#[vo.vdpau]
+#vc=ffmpeg12vdpau,ffwmv3vdpau,ffvc1vdpau,ffh264vdpau,ffodivxvdpau,
+
# Specify default video driver (see -vo help for a list).
#vo=xv
@@ -82,6 +86,9 @@
# Resample the sound to 44100Hz with the lavcresample audio filter.
#af=lavcresample=44100
+# Output audio to S/PDIF
+#ao=alsa:device=spdif
+#ac=hwac3,hwdts,hwmpa,
##################
# other settings #
@@ -93,7 +100,7 @@
# Pretend to be Quicktime
# Fixes playback for apple.com/trailers redirects
-#user-agent="QuickTime/7.1.3 (qtver=7.1.3;cpu=PPC;os=Mac 10.4.8)"
+#user-agent="QuickTime"
# Drop frames to preserve audio/video sync.
#framedrop = yes
diff --git a/help/help_mp-en.h b/help/help_mp-en.h
index c401136a63..2376bdefa7 100644
--- a/help/help_mp-en.h
+++ b/help/help_mp-en.h
@@ -856,6 +856,7 @@ static const char help_text[]=
#define MSGTR_LIBVO_FONT_LOAD_FT_CannotPrepareOSDFont "Cannot prepare OSD font.\n"
#define MSGTR_LIBVO_FONT_LOAD_FT_CannotGenerateTables "Cannot generate tables.\n"
#define MSGTR_LIBVO_FONT_LOAD_FT_DoneFreeTypeFailed "FT_Done_FreeType failed.\n"
+#define MSGTR_LIBVO_FONT_LOAD_FT_FontconfigNoMatch "Fontconfig failed to select a font. Trying without fontconfig...\n"
// sub.c
#define MSGTR_VO_SUB_Seekbar "Seekbar"
diff --git a/help/help_mp-zh_CN.h b/help/help_mp-zh_CN.h
index 69e2bb7000..9e0f2809b7 100644
--- a/help/help_mp-zh_CN.h
+++ b/help/help_mp-zh_CN.h
@@ -1,4 +1,4 @@
-// Synced with help_mp-en.h r29912 (MSGTR_MPDEMUX_ASFHDR_HeaderSizeOver1MB)
+// Synced with help_mp-en.h r30044 (MSGTR_VO_YUV4MPEG_InterlacedHeightDivisibleBy4)
// Reminder of hard terms which need better/final solution later:
// (file links to be updated later if available!);
// NAV; section/subsection; XScreenSaver; keycolor;
@@ -842,7 +842,7 @@ static const char help_text[]=
#define MSGTR_LIBVO_FONT_LOAD_FT_DoneFreeTypeFailed "调用 FT_Done_FreeType 失败。\n"
// sub.c
-#define MSGTR_VO_SUB_Seekbar "搜索条"
+#define MSGTR_VO_SUB_Seekbar "定位条"
#define MSGTR_VO_SUB_Play "播放"
#define MSGTR_VO_SUB_Pause "暂停"
#define MSGTR_VO_SUB_Stop "停止"
@@ -989,14 +989,14 @@ static const char help_text[]=
// vo_tdfx_vid.c
#define MSGTR_LIBVO_TDFXVID_Move "[VO_TDXVID] 移动 %d(%d) x %d => %d。\n"
-#define MSGTR_LIBVO_TDFXVID_AGPMoveFailedToClearTheScreen "[VO_TDFXVID] AGP 移动操作清除屏幕失败。\n"
+#define MSGTR_LIBVO_TDFXVID_AGPMoveFailedToClearTheScreen "[VO_TDFXVID] AGP 移动操作未能清空屏幕。\n"
#define MSGTR_LIBVO_TDFXVID_BlitFailed "[VO_TDFXVID] 位块传输失败。\n"
#define MSGTR_LIBVO_TDFXVID_NonNativeOverlayFormatNeedConversion "[VO_TDFXVID] 非原生支持的覆盖格式需要转换。\n"
#define MSGTR_LIBVO_TDFXVID_UnsupportedInputFormat "[VO_TDFXVID] 不支持的输入格式 0x%x。\n"
#define MSGTR_LIBVO_TDFXVID_OverlaySetupFailed "[VO_TDFXVID] 覆盖模式设置失败。\n"
#define MSGTR_LIBVO_TDFXVID_OverlayOnFailed "[VO_TDFXVID] 覆盖模式打开失败。\n"
-#define MSGTR_LIBVO_TDFXVID_OverlayReady "[VO_TDFXVID] 覆盖模式准备完成:%d(%d) x %d @ %d => %d(%d) x %d @ %d。\n"
-#define MSGTR_LIBVO_TDFXVID_TextureBlitReady "[VO_TDFXVID] 纹理位块传输准备完毕:%d(%d) x %d @ %d => %d(%d) x %d @ %d。\n"
+#define MSGTR_LIBVO_TDFXVID_OverlayReady "[VO_TDFXVID] 覆盖模式就绪:%d(%d) x %d @ %d => %d(%d) x %d @ %d。\n"
+#define MSGTR_LIBVO_TDFXVID_TextureBlitReady "[VO_TDFXVID] 纹理位块传输就绪:%d(%d) x %d @ %d => %d(%d) x %d @ %d。\n"
#define MSGTR_LIBVO_TDFXVID_OverlayOffFailed "[VO_TDFXVID] 覆盖模式关闭失败\n"
#define MSGTR_LIBVO_TDFXVID_CantOpen "[VO_TDFXVID] 无法打开 %s:%s。\n"
#define MSGTR_LIBVO_TDFXVID_CantGetCurrentCfg "[VO_TDFXVID] 无法获得当前配置:%s。\n"
@@ -1004,9 +1004,9 @@ static const char help_text[]=
#define MSGTR_LIBVO_TDFXVID_GetImageTodo "获得图像 todo。\n"
#define MSGTR_LIBVO_TDFXVID_AgpMoveFailed "[VO_TDFXVID] AGP 移动操作失败。\n"
#define MSGTR_LIBVO_TDFXVID_SetYuvFailed "[VO_TDFXVID] 设置 YUV 失败。\n"
-#define MSGTR_LIBVO_TDFXVID_AgpMoveFailedOnYPlane "[VO_TDFXVID] Y 平面的 AGP 移动操作失败。\n"
-#define MSGTR_LIBVO_TDFXVID_AgpMoveFailedOnUPlane "[VO_TDFXVID] U 平面的 AGP 移动操作失败。\n"
-#define MSGTR_LIBVO_TDFXVID_AgpMoveFailedOnVPlane "[VO_TDFXVID] V 平面的 AGP 移动操作失败。\n"
+#define MSGTR_LIBVO_TDFXVID_AgpMoveFailedOnYPlane "[VO_TDFXVID] Y 平面 AGP 移动操作失败。\n"
+#define MSGTR_LIBVO_TDFXVID_AgpMoveFailedOnUPlane "[VO_TDFXVID] U 平面 AGP 移动操作失败。\n"
+#define MSGTR_LIBVO_TDFXVID_AgpMoveFailedOnVPlane "[VO_TDFXVID] V 平面 AGP 移动操作失败。\n"
#define MSGTR_LIBVO_TDFXVID_UnknownFormat "[VO_TDFXVID] 未知格式:0x%x。\n"
// vo_tdfxfb.c
@@ -1016,10 +1016,10 @@ static const char help_text[]=
#define MSGTR_LIBVO_TDFXFB_ThisDriverOnlySupports "[VO_TDFXFB] 该驱动仅支持 3Dfx Banshee、Voodoo3 和 Voodoo 5。\n"
#define MSGTR_LIBVO_TDFXFB_OutputIsNotSupported "[VO_TDFXFB] 不支持 %d bpp 输出。\n"
#define MSGTR_LIBVO_TDFXFB_CouldntMapMemoryAreas "[VO_TDFXFB] 无法映射内存区域:%s。\n"
-#define MSGTR_LIBVO_TDFXFB_BppOutputIsNotSupported "[VO_TDFXFB] 不支持 %d bpp 输出(这不应该出现)。\n"
+#define MSGTR_LIBVO_TDFXFB_BppOutputIsNotSupported "[VO_TDFXFB] 不支持 %d bpp 输出(这种情况不应出现)。\n"
#define MSGTR_LIBVO_TDFXFB_SomethingIsWrongWithControl "[VO_TDFXFB] 呃!control() 有点问题。\n"
-#define MSGTR_LIBVO_TDFXFB_NotEnoughVideoMemoryToPlay "[VO_TDFXFB] 没有足够的显存播放此片,尝试较低的分辨率。\n"
-#define MSGTR_LIBVO_TDFXFB_ScreenIs "[VO_TDFXFB] 屏幕 %dx%d 色深 %d bpp,输入 %dx%d 色深 %d bpp,输出 %dx%d。\n"
+#define MSGTR_LIBVO_TDFXFB_NotEnoughVideoMemoryToPlay "[VO_TDFXFB] 没有足够的显存播放此影片,请尝试使用较低的分辨率。\n"
+#define MSGTR_LIBVO_TDFXFB_ScreenIs "[VO_TDFXFB] 屏幕尺寸为 %dx%d 色深 %d bpp,输入尺寸 %dx%d 色深 %d bpp,标准化尺寸 %dx%d。\n"
// vo_tga.c
#define MSGTR_LIBVO_TGA_UnknownSubdevice "[VO_TGA] 未知子设备:%s。\n"
@@ -1027,11 +1027,11 @@ static const char help_text[]=
// vo_vesa.c
#define MSGTR_LIBVO_VESA_FatalErrorOccurred "[VO_VESA] 发生致命错误!无法继续。\n"
#define MSGTR_LIBVO_VESA_UnknownSubdevice "[VO_VESA] 未知子设备:‘%s’。\n"
-#define MSGTR_LIBVO_VESA_YouHaveTooLittleVideoMemory "[VO_VESA] 显存太小无法支持该模式:\n[VO_VESA] 需要:%08lX 可用:%08lX。\n"
-#define MSGTR_LIBVO_VESA_YouHaveToSpecifyTheCapabilitiesOfTheMonitor "[VO_VESA] 需要指定显示器的性能。未改变刷新率。\n"
-#define MSGTR_LIBVO_VESA_UnableToFitTheMode "[VO_VESA] 模式超出显示器的限制。未改变刷新率。\n"
+#define MSGTR_LIBVO_VESA_YouHaveTooLittleVideoMemory "[VO_VESA] 显存太小无法支持该模式:\n[VO_VESA] 需要:%08lX 现有:%08lX。\n"
+#define MSGTR_LIBVO_VESA_YouHaveToSpecifyTheCapabilitiesOfTheMonitor "[VO_VESA] 需要指定显示器的性能。未改变刷新频率。\n"
+#define MSGTR_LIBVO_VESA_UnableToFitTheMode "[VO_VESA] 模式超出显示器的限制。未改变刷新频率。\n"
#define MSGTR_LIBVO_VESA_DetectedInternalFatalError "[VO_VESA] 检测到内部致命错误:init 在 preinit 前被调用。\n"
-#define MSGTR_LIBVO_VESA_SwitchFlipIsNotSupported "[VO_VESA] -flip 命令不支持。\n"
+#define MSGTR_LIBVO_VESA_SwitchFlipIsNotSupported "[VO_VESA] 不支持 -flip 命令。\n"
#define MSGTR_LIBVO_VESA_PossibleReasonNoVbe2BiosFound "[VO_VESA] 可能的原因:未找到 VBE2 BIOS。\n"
#define MSGTR_LIBVO_VESA_FoundVesaVbeBiosVersion "[VO_VESA] 找到 VESA VBE BIOS 版本 %x.%x 修订版本:%x。\n"
#define MSGTR_LIBVO_VESA_VideoMemory "[VO_VESA] 显存:%u Kb。\n"
@@ -1043,7 +1043,7 @@ static const char help_text[]=
#define MSGTR_LIBVO_VESA_OemVendor "[VO_VESA] OEM 销售商:%s。\n"
#define MSGTR_LIBVO_VESA_OemProductName "[VO_VESA] OEM 产品名:%s。\n"
#define MSGTR_LIBVO_VESA_OemProductRev "[VO_VESA] OEM 产品版本:%s。\n"
-#define MSGTR_LIBVO_VESA_Hint "[VO_VESA] 提示:为使用电视输出你应当在启动前插入 TV 接口。\n"\
+#define MSGTR_LIBVO_VESA_Hint "[VO_VESA] 提示:为使用电视输出你应当在启动前插入电视接头。\n"\
"[VO_VESA] 因为 VESA BIOS 只在自检的时候执行初始化。\n"
#define MSGTR_LIBVO_VESA_UsingVesaMode "[VO_VESA] 使用 VESA 模式 (%u) = %x [%ux%u@%u]\n"
#define MSGTR_LIBVO_VESA_CantInitializeSwscaler "[VO_VESA] 无法初始化软件缩放功能。\n"
@@ -1055,7 +1055,7 @@ static const char help_text[]=
#define MSGTR_LIBVO_VESA_CantFindValidWindowAddress "[VO_VESA] 无法找到有效的视频窗口地址。\n"
#define MSGTR_LIBVO_VESA_UsingBankSwitchingMode "[VO_VESA] 使用组交换模式(物理资源:%08lXh, %08lXh)。\n"
#define MSGTR_LIBVO_VESA_CantAllocateTemporaryBuffer "[VO_VESA] 无法分配临时缓冲。\n"
-#define MSGTR_LIBVO_VESA_SorryUnsupportedMode "[VO_VESA] 抱歉,不支持该模式——试试 -x 640 -zoom。\n"
+#define MSGTR_LIBVO_VESA_SorryUnsupportedMode "[VO_VESA] 抱歉,不支持该模式——请尝试 -x 640 -zoom。\n"
#define MSGTR_LIBVO_VESA_OhYouReallyHavePictureOnTv "[VO_VESA] 噢,你的电视上有图像了!\n"
#define MSGTR_LIBVO_VESA_CantInitialozeLinuxVideoOverlay "[VO_VESA] 无法初始化 Linux 视频覆盖模式。\n"
#define MSGTR_LIBVO_VESA_UsingVideoOverlay "[VO_VESA] 使用视频覆盖模式:%s。\n"
@@ -1068,15 +1068,15 @@ static const char help_text[]=
#define MSGTR_LIBVO_VESA_ThisBranchIsNoLongerSupported "[VESA_LVO] 这个分支版本已经不再维护。\n[VESA_LVO] 请使用 -vo vesa:vidix。\n"
#define MSGTR_LIBVO_VESA_CouldntOpen "[VESA_LVO] 无法打开:‘%s’\n"
#define MSGTR_LIBVO_VESA_InvalidOutputFormat "[VESA_LVI] 无效的输出格式:%s(%0X)\n"
-#define MSGTR_LIBVO_VESA_IncompatibleDriverVersion "[VESA_LVO] 你的 fb_vid 驱动版本与该版本 MPlayer 不兼容!\n"
+#define MSGTR_LIBVO_VESA_IncompatibleDriverVersion "[VESA_LVO] fb_vid 驱动版本与该版本 MPlayer 不兼容!\n"
// vo_x11.c
#define MSGTR_LIBVO_X11_DrawFrameCalled "[VO_X11] 已调用 draw_frame()!!!\n"
// vo_xv.c
#define MSGTR_LIBVO_XV_DrawFrameCalled "[VO_XV] 已调用 draw_frame()!!!\n"
-#define MSGTR_LIBVO_XV_SharedMemoryNotSupported "[VO_XV] 共享内存模式不支持\n回复到正常 Xv 模式。\n"
-#define MSGTR_LIBVO_XV_XvNotSupportedByX11 "[VO_XV] 对不起,该 X11 版本/驱动不支持 Xv\n[VO_XV] ******** 试试使用 -vo x11 或 -vo sdl *********\n"
+#define MSGTR_LIBVO_XV_SharedMemoryNotSupported "[VO_XV] 不支持共享内存模式\n回复到正常 Xv 模式。\n"
+#define MSGTR_LIBVO_XV_XvNotSupportedByX11 "[VO_XV] 对不起,该 X11 版本/驱动不支持 Xv\n[VO_XV] ******** 请尝试使用 -vo x11 或 -vo sdl *********\n"
#define MSGTR_LIBVO_XV_XvQueryAdaptorsFailed "[VO_XV] XvQueryAdaptors 失败。\n"
#define MSGTR_LIBVO_XV_InvalidPortParameter "[VO_XV] 无效的端口参数,改用端口 0。\n"
#define MSGTR_LIBVO_XV_CouldNotGrabPort "[VO_XV] 无法绑定端口 %i。\n"
@@ -1440,40 +1440,40 @@ static const char help_text[]=
// asfheader.c
-#define MSGTR_MPDEMUX_ASFHDR_HeaderSizeOver1MB "致命: 头部的大小超过 1 MB (%d)!\n请联系 MPlayer 的作者, 并且发送或上传此文件。\n"
-#define MSGTR_MPDEMUX_ASFHDR_HeaderMallocFailed "不能为头部分配 %d 字节的空间。\n"
-#define MSGTR_MPDEMUX_ASFHDR_EOFWhileReadingHeader "读 ASF 头部时遇到 EOF, 文件损坏或不完整?\n"
-#define MSGTR_MPDEMUX_ASFHDR_DVRWantsLibavformat "DVR 可能只能和 libavformat 一起工作, 如果有问题请试试 -demuxer 35\n"
-#define MSGTR_MPDEMUX_ASFHDR_NoDataChunkAfterHeader "没有数据块紧随头部之后!\n"
-#define MSGTR_MPDEMUX_ASFHDR_AudioVideoHeaderNotFound "ASF: 找不到音频或视频头部 - 文件损坏?\n"
-#define MSGTR_MPDEMUX_ASFHDR_InvalidLengthInASFHeader "无效的 ASF 头部长度!\n"
-#define MSGTR_MPDEMUX_ASFHDR_DRMLicenseURL "DRM许可证URL地址:%s\n"
-#define MSGTR_MPDEMUX_ASFHDR_DRMProtected "该文件经过了DRM加密,不能在Mplayer中播放!\n"
+#define MSGTR_MPDEMUX_ASFHDR_HeaderSizeOver1MB "致命错误:文件头部大小超过 1 MB(%d)!\n请联系 MPlayer 的作者, 并且发送或上传此文件。\n"
+#define MSGTR_MPDEMUX_ASFHDR_HeaderMallocFailed "无法为文件头部分配 %d 字节的存放空间。\n"
+#define MSGTR_MPDEMUX_ASFHDR_EOFWhileReadingHeader "读 ASF 头部时遇到文件结尾,文件损坏或不完整?\n"
+#define MSGTR_MPDEMUX_ASFHDR_DVRWantsLibavformat "DVR 可能只能与 libavformat 一同使用,如果有问题请尝试 -demuxer 35。\n"
+#define MSGTR_MPDEMUX_ASFHDR_NoDataChunkAfterHeader "文件头部之后没有数据块!\n"
+#define MSGTR_MPDEMUX_ASFHDR_AudioVideoHeaderNotFound "ASF:未找到音频或视频头部 - 文件损坏?\n"
+#define MSGTR_MPDEMUX_ASFHDR_InvalidLengthInASFHeader "ASF 头部长度无效!\n"
+#define MSGTR_MPDEMUX_ASFHDR_DRMLicenseURL "DRM 许可证 URL 地址:%s\n"
+#define MSGTR_MPDEMUX_ASFHDR_DRMProtected "该文件经过了 DRM 加密保护,无法在 Mplayer 中播放!\n"
// aviheader.c
-#define MSGTR_MPDEMUX_AVIHDR_EmptyList "**空列表?!\n"
-#define MSGTR_MPDEMUX_AVIHDR_FoundMovieAt "在 0x%X - 0x%X 找到电影\n"
-#define MSGTR_MPDEMUX_AVIHDR_FoundBitmapInfoHeader "找到 'bih', %u 字节的 %d\n"
+#define MSGTR_MPDEMUX_AVIHDR_EmptyList "**空列表?!\n"
+#define MSGTR_MPDEMUX_AVIHDR_FoundMovieAt "于 0x%X - 0x%X 位置找到影片数据\n"
+#define MSGTR_MPDEMUX_AVIHDR_FoundBitmapInfoHeader "找到‘bih’,%u 字节,%d\n"
#define MSGTR_MPDEMUX_AVIHDR_RegeneratingKeyfTableForMPG4V1 "为 M$ mpg4v1 视频重新生成关键帧表。\n"
#define MSGTR_MPDEMUX_AVIHDR_RegeneratingKeyfTableForDIVX3 "为 DIVX3 视频重新生成关键帧表。\n"
#define MSGTR_MPDEMUX_AVIHDR_RegeneratingKeyfTableForMPEG4 "为 MPEG4 视频重新生成关键帧表。\n"
-#define MSGTR_MPDEMUX_AVIHDR_FoundWaveFmt "找到 'wf', %d 字节的 %d\n"
-#define MSGTR_MPDEMUX_AVIHDR_FoundAVIV2Header "AVI: 发现 dmlh (size=%d) (total_frames=%d)\n"
-#define MSGTR_MPDEMUX_AVIHDR_ReadingIndexBlockChunksForFrames "正在读 INDEX 块, %d 区块的 %d 帧 (fpos=%"PRId64")。\n"
-#define MSGTR_MPDEMUX_AVIHDR_AdditionalRIFFHdr "附加的 RIFF 头...\n"
-#define MSGTR_MPDEMUX_AVIHDR_WarnNotExtendedAVIHdr "** 警告: 这不是扩展的 AVI 头部..\n"
-#define MSGTR_MPDEMUX_AVIHDR_BrokenChunk "区块损坏? chunksize=%d (id=%.4s)\n"
-#define MSGTR_MPDEMUX_AVIHDR_BuildingODMLidx "AVI: ODML: 建造 ODML 索引 (%d superindexchunks)。\n"
-#define MSGTR_MPDEMUX_AVIHDR_BrokenODMLfile "AVI: ODML: 检测到损坏的(不完整的?)文件。将使用传统的索引。\n"
-#define MSGTR_MPDEMUX_AVIHDR_CantReadIdxFile "不能读索引文件 %s: %s\n"
+#define MSGTR_MPDEMUX_AVIHDR_FoundWaveFmt "找到‘wf’,%d 字节,%d\n"
+#define MSGTR_MPDEMUX_AVIHDR_FoundAVIV2Header "AVI:发现 dmlh (size=%d) (total_frames=%d)\n"
+#define MSGTR_MPDEMUX_AVIHDR_ReadingIndexBlockChunksForFrames "正在读取索引数据块,%d 块数据用于 %d 帧 (fpos=%"PRId64")。\n"
+#define MSGTR_MPDEMUX_AVIHDR_AdditionalRIFFHdr "额外的 RIFF 头部数据...\n"
+#define MSGTR_MPDEMUX_AVIHDR_WarnNotExtendedAVIHdr "** 警告:这不是扩展格式的 AVI 头部..\n"
+#define MSGTR_MPDEMUX_AVIHDR_BrokenChunk "数据块损坏? chunksize=%d (id=%.4s)\n"
+#define MSGTR_MPDEMUX_AVIHDR_BuildingODMLidx "AVI:ODML:构造 ODML 索引 (%d superindexchunks)。\n"
+#define MSGTR_MPDEMUX_AVIHDR_BrokenODMLfile "AVI:ODML:检测到损坏的(不完整的?)文件。将使用传统的索引模式。\n"
+#define MSGTR_MPDEMUX_AVIHDR_CantReadIdxFile "无法读索引文件 %s:%s\n"
#define MSGTR_MPDEMUX_AVIHDR_NotValidMPidxFile "%s 不是有效的 MPlayer 索引文件。\n"
#define MSGTR_MPDEMUX_AVIHDR_FailedMallocForIdxFile "无法为来自 %s 的索引数据分配内存。\n"
#define MSGTR_MPDEMUX_AVIHDR_PrematureEOF "过早结束的索引文件 %s\n"
-#define MSGTR_MPDEMUX_AVIHDR_IdxFileLoaded "装载索引文件: %s\n"
-#define MSGTR_MPDEMUX_AVIHDR_GeneratingIdx "正在生成索引: %3lu %s \r"
-#define MSGTR_MPDEMUX_AVIHDR_IdxGeneratedForHowManyChunks "AVI: 为 %d 区块生成索引表!\n"
-#define MSGTR_MPDEMUX_AVIHDR_Failed2WriteIdxFile "无法写索引文件 %s: %s\n"
-#define MSGTR_MPDEMUX_AVIHDR_IdxFileSaved "已保存索引文件: %s\n"
+#define MSGTR_MPDEMUX_AVIHDR_IdxFileLoaded "已加载索引文件:%s\n"
+#define MSGTR_MPDEMUX_AVIHDR_GeneratingIdx "正在生成索引:%3lu %s \r"
+#define MSGTR_MPDEMUX_AVIHDR_IdxGeneratedForHowManyChunks "AVI:为 %d 块数据生成索引表!\n"
+#define MSGTR_MPDEMUX_AVIHDR_Failed2WriteIdxFile "无法写入索引文件 %s:%s\n"
+#define MSGTR_MPDEMUX_AVIHDR_IdxFileSaved "已保存索引文件:%s\n"
// demux_audio.c
#define MSGTR_MPDEMUX_AUDIO_UnknownFormat "音频分路器: 未知格式 %d。\n"
diff --git a/libmpdemux/aviheader.c b/libmpdemux/aviheader.c
index a7b2b2c434..230e769fe0 100644
--- a/libmpdemux/aviheader.c
+++ b/libmpdemux/aviheader.c
@@ -632,11 +632,11 @@ if (index_file_load) {
}
gen_index:
if(index_mode>=2 || (priv->idx_size==0 && index_mode==1)){
+ int idx_pos = 0;
// build index for file:
stream_reset(demuxer->stream);
stream_seek(demuxer->stream,demuxer->movi_start);
- priv->idx_pos=0;
priv->idx_size=0;
priv->idx=NULL;
@@ -657,13 +657,13 @@ if(index_mode>=2 || (priv->idx_size==0 && index_mode==1)){
if(stream_eof(demuxer->stream)) break;
if(!id || avi_stream_id(id)==100) goto skip_chunk; // bad ID (or padding?)
- if(priv->idx_pos>=priv->idx_size){
+ if(idx_pos>=priv->idx_size){
// priv->idx_size+=32;
priv->idx_size+=1024; // +16kB
priv->idx=realloc(priv->idx,priv->idx_size*sizeof(AVIINDEXENTRY));
- if(!priv->idx){priv->idx_pos=0; break;} // error!
+ if(!priv->idx){idx_pos=0; break;} // error!
}
- idx=&((AVIINDEXENTRY *)priv->idx)[priv->idx_pos++];
+ idx=&((AVIINDEXENTRY *)priv->idx)[idx_pos++];
idx->ckid=id;
idx->dwFlags=AVIIF_KEYFRAME; // FIXME
idx->dwFlags|=(demuxer->filepos>>16)&0xffff0000U;
@@ -713,7 +713,7 @@ skip_chunk:
skip=(len+1)&(~1UL); // total bytes in this chunk
stream_seek(demuxer->stream,8+demuxer->filepos+skip);
}
- priv->idx_size=priv->idx_pos;
+ priv->idx_size=idx_pos;
mp_tmsg(MSGT_HEADER,MSGL_INFO,"AVI: Generated index table for %d chunks!\n",priv->idx_size);
if( mp_msg_test(MSGT_HEADER,MSGL_DBG2) ) print_index(priv->idx,priv->idx_size,MSGL_DBG2);
diff --git a/libvo/font_load_ft.c b/libvo/font_load_ft.c
index ae2c6cc2ba..1ddd15d268 100644
--- a/libvo/font_load_ft.c
+++ b/libvo/font_load_ft.c
@@ -1144,6 +1144,7 @@ void load_font_ft(int width, int height, font_desc_t** fontp, const char *font_n
FcChar8 *s;
int face_index;
FcBool scalable;
+ FcResult result;
#endif
font_desc_t *vo_font = *fontp;
vo_image_width = width;
@@ -1162,25 +1163,29 @@ void load_font_ft(int width, int height, font_desc_t** fontp, const char *font_n
FcConfigSubstitute(0, fc_pattern, FcMatchPattern);
FcDefaultSubstitute(fc_pattern);
fc_pattern2 = fc_pattern;
- fc_pattern = FcFontMatch(0, fc_pattern, 0);
- FcPatternDestroy(fc_pattern2);
- FcPatternGetBool(fc_pattern, FC_SCALABLE, 0, &scalable);
- if (scalable != FcTrue) {
- FcPatternDestroy(fc_pattern);
- fc_pattern = FcNameParse("sans-serif");
- FcConfigSubstitute(0, fc_pattern, FcMatchPattern);
- FcDefaultSubstitute(fc_pattern);
- fc_pattern2 = fc_pattern;
- fc_pattern = FcFontMatch(0, fc_pattern, 0);
- FcPatternDestroy(fc_pattern2);
- }
- // s doesn't need to be freed according to fontconfig docs
- FcPatternGetString(fc_pattern, FC_FILE, 0, &s);
- FcPatternGetInteger(fc_pattern, FC_INDEX, 0, &face_index);
- *fontp=read_font_desc_ft(s, face_index, width, height, font_scale_factor);
- FcPatternDestroy(fc_pattern);
+ fc_pattern = FcFontMatch(0, fc_pattern, &result);
+ if (fc_pattern) {
+ FcPatternDestroy(fc_pattern2);
+ FcPatternGetBool(fc_pattern, FC_SCALABLE, 0, &scalable);
+ if (scalable != FcTrue) {
+ FcPatternDestroy(fc_pattern);
+ fc_pattern = FcNameParse("sans-serif");
+ FcConfigSubstitute(0, fc_pattern, FcMatchPattern);
+ FcDefaultSubstitute(fc_pattern);
+ fc_pattern2 = fc_pattern;
+ fc_pattern = FcFontMatch(0, fc_pattern, 0);
+ FcPatternDestroy(fc_pattern2);
+ }
+ // s doesn't need to be freed according to fontconfig docs
+ FcPatternGetString(fc_pattern, FC_FILE, 0, &s);
+ FcPatternGetInteger(fc_pattern, FC_INDEX, 0, &face_index);
+ *fontp=read_font_desc_ft(s, face_index, width, height, font_scale_factor);
+ FcPatternDestroy(fc_pattern);
+ return;
+ }
+ mp_tmsg(MSGT_OSD, MSGL_ERR, "Fontconfig failed to select a font. "
+ "Trying without fontconfig...\n");
}
- else
#endif
*fontp=read_font_desc_ft(font_name, 0, width, height, font_scale_factor);
}
diff --git a/libvo/gl_common.c b/libvo/gl_common.c
index 3777d2513a..250f2df2da 100644
--- a/libvo/gl_common.c
+++ b/libvo/gl_common.c
@@ -36,6 +36,47 @@
#include "gl_common.h"
#include "libavutil/common.h"
+void (GLAPIENTRY *Begin)(GLenum);
+void (GLAPIENTRY *End)(void);
+void (GLAPIENTRY *Viewport)(GLint, GLint, GLsizei, GLsizei);
+void (GLAPIENTRY *MatrixMode)(GLenum);
+void (GLAPIENTRY *LoadIdentity)(void);
+void (GLAPIENTRY *Scaled)(double, double, double);
+void (GLAPIENTRY *Ortho)(double, double, double, double, double, double);
+void (GLAPIENTRY *PushMatrix)(void);
+void (GLAPIENTRY *PopMatrix)(void);
+void (GLAPIENTRY *Clear)(GLbitfield);
+GLuint (GLAPIENTRY *GenLists)(GLsizei);
+void (GLAPIENTRY *DeleteLists)(GLuint, GLsizei);
+void (GLAPIENTRY *NewList)(GLuint, GLenum);
+void (GLAPIENTRY *EndList)(void);
+void (GLAPIENTRY *CallList)(GLuint);
+void (GLAPIENTRY *CallLists)(GLsizei, GLenum, const GLvoid *);
+void (GLAPIENTRY *GenTextures)(GLsizei, GLuint *);
+void (GLAPIENTRY *DeleteTextures)(GLsizei, const GLuint *);
+void (GLAPIENTRY *TexEnvi)(GLenum, GLenum, GLint);
+void (GLAPIENTRY *Color4ub)(GLubyte, GLubyte, GLubyte, GLubyte);
+void (GLAPIENTRY *Color3f)(GLfloat, GLfloat, GLfloat);
+void (GLAPIENTRY *ClearColor)(GLclampf, GLclampf, GLclampf, GLclampf);
+void (GLAPIENTRY *Enable)(GLenum);
+void (GLAPIENTRY *Disable)(GLenum);
+const GLubyte *(GLAPIENTRY *GetString)(GLenum);
+void (GLAPIENTRY *DrawBuffer)(GLenum);
+void (GLAPIENTRY *DepthMask)(GLboolean);
+void (GLAPIENTRY *BlendFunc)(GLenum, GLenum);
+void (GLAPIENTRY *Flush)(void);
+void (GLAPIENTRY *Finish)(void);
+void (GLAPIENTRY *PixelStorei)(GLenum, GLint);
+void (GLAPIENTRY *TexImage1D)(GLenum, GLint, GLint, GLsizei, GLint, GLenum, GLenum, const GLvoid *);
+void (GLAPIENTRY *TexImage2D)(GLenum, GLint, GLint, GLsizei, GLsizei, GLint, GLenum, GLenum, const GLvoid *);
+void (GLAPIENTRY *TexSubImage2D)(GLenum, GLint, GLint, GLint, GLsizei, GLsizei, GLenum, GLenum, const GLvoid *);
+void (GLAPIENTRY *TexParameteri)(GLenum, GLenum, GLint);
+void (GLAPIENTRY *TexParameterf)(GLenum, GLenum, GLfloat);
+void (GLAPIENTRY *TexParameterfv)(GLenum, GLenum, const GLfloat *);
+void (GLAPIENTRY *TexCoord2f)(GLfloat, GLfloat);
+void (GLAPIENTRY *Vertex2f)(GLfloat, GLfloat);
+void (GLAPIENTRY *GetIntegerv)(GLenum, GLint *);
+
/**
* \defgroup glextfunctions OpenGL extension functions
*
@@ -43,43 +84,43 @@
* context is created
* \{
*/
-void (APIENTRY *GenBuffers)(GLsizei, GLuint *);
-void (APIENTRY *DeleteBuffers)(GLsizei, const GLuint *);
-void (APIENTRY *BindBuffer)(GLenum, GLuint);
-GLvoid* (APIENTRY *MapBuffer)(GLenum, GLenum);
-GLboolean (APIENTRY *UnmapBuffer)(GLenum);
-void (APIENTRY *BufferData)(GLenum, intptr_t, const GLvoid *, GLenum);
-void (APIENTRY *CombinerParameterfv)(GLenum, const GLfloat *);
-void (APIENTRY *CombinerParameteri)(GLenum, GLint);
-void (APIENTRY *CombinerInput)(GLenum, GLenum, GLenum, GLenum, GLenum,
+void (GLAPIENTRY *GenBuffers)(GLsizei, GLuint *);
+void (GLAPIENTRY *DeleteBuffers)(GLsizei, const GLuint *);
+void (GLAPIENTRY *BindBuffer)(GLenum, GLuint);
+GLvoid* (GLAPIENTRY *MapBuffer)(GLenum, GLenum);
+GLboolean (GLAPIENTRY *UnmapBuffer)(GLenum);
+void (GLAPIENTRY *BufferData)(GLenum, intptr_t, const GLvoid *, GLenum);
+void (GLAPIENTRY *CombinerParameterfv)(GLenum, const GLfloat *);
+void (GLAPIENTRY *CombinerParameteri)(GLenum, GLint);
+void (GLAPIENTRY *CombinerInput)(GLenum, GLenum, GLenum, GLenum, GLenum,
GLenum);
-void (APIENTRY *CombinerOutput)(GLenum, GLenum, GLenum, GLenum, GLenum,
+void (GLAPIENTRY *CombinerOutput)(GLenum, GLenum, GLenum, GLenum, GLenum,
GLenum, GLenum, GLboolean, GLboolean,
GLboolean);
-void (APIENTRY *BeginFragmentShader)(void);
-void (APIENTRY *EndFragmentShader)(void);
-void (APIENTRY *SampleMap)(GLuint, GLuint, GLenum);
-void (APIENTRY *ColorFragmentOp2)(GLenum, GLuint, GLuint, GLuint, GLuint,
+void (GLAPIENTRY *BeginFragmentShader)(void);
+void (GLAPIENTRY *EndFragmentShader)(void);
+void (GLAPIENTRY *SampleMap)(GLuint, GLuint, GLenum);
+void (GLAPIENTRY *ColorFragmentOp2)(GLenum, GLuint, GLuint, GLuint, GLuint,
GLuint, GLuint, GLuint, GLuint, GLuint);
-void (APIENTRY *ColorFragmentOp3)(GLenum, GLuint, GLuint, GLuint, GLuint,
+void (GLAPIENTRY *ColorFragmentOp3)(GLenum, GLuint, GLuint, GLuint, GLuint,
GLuint, GLuint, GLuint, GLuint, GLuint,
GLuint, GLuint, GLuint);
-void (APIENTRY *SetFragmentShaderConstant)(GLuint, const GLfloat *);
-void (APIENTRY *ActiveTexture)(GLenum);
-void (APIENTRY *BindTexture)(GLenum, GLuint);
-void (APIENTRY *MultiTexCoord2f)(GLenum, GLfloat, GLfloat);
-void (APIENTRY *GenPrograms)(GLsizei, GLuint *);
-void (APIENTRY *DeletePrograms)(GLsizei, const GLuint *);
-void (APIENTRY *BindProgram)(GLenum, GLuint);
-void (APIENTRY *ProgramString)(GLenum, GLenum, GLsizei, const GLvoid *);
-void (APIENTRY *GetProgramiv)(GLenum, GLenum, GLint *);
-void (APIENTRY *ProgramEnvParameter4f)(GLenum, GLuint, GLfloat, GLfloat,
+void (GLAPIENTRY *SetFragmentShaderConstant)(GLuint, const GLfloat *);
+void (GLAPIENTRY *ActiveTexture)(GLenum);
+void (GLAPIENTRY *BindTexture)(GLenum, GLuint);
+void (GLAPIENTRY *MultiTexCoord2f)(GLenum, GLfloat, GLfloat);
+void (GLAPIENTRY *GenPrograms)(GLsizei, GLuint *);
+void (GLAPIENTRY *DeletePrograms)(GLsizei, const GLuint *);
+void (GLAPIENTRY *BindProgram)(GLenum, GLuint);
+void (GLAPIENTRY *ProgramString)(GLenum, GLenum, GLsizei, const GLvoid *);
+void (GLAPIENTRY *GetProgramiv)(GLenum, GLenum, GLint *);
+void (GLAPIENTRY *ProgramEnvParameter4f)(GLenum, GLuint, GLfloat, GLfloat,
GLfloat, GLfloat);
-int (APIENTRY *SwapInterval)(int);
-void (APIENTRY *TexImage3D)(GLenum, GLint, GLenum, GLsizei, GLsizei, GLsizei,
+int (GLAPIENTRY *SwapInterval)(int);
+void (GLAPIENTRY *TexImage3D)(GLenum, GLint, GLenum, GLsizei, GLsizei, GLsizei,
GLint, GLenum, GLenum, const GLvoid *);
-void* (APIENTRY *AllocateMemoryMESA)(void *, int, size_t, float, float, float);
-void (APIENTRY *FreeMemoryMESA)(void *, int, void *);
+void* (GLAPIENTRY *AllocateMemoryMESA)(void *, int, size_t, float, float, float);
+void (GLAPIENTRY *FreeMemoryMESA)(void *, int, void *);
/** \} */ // end of glextfunctions group
//! \defgroup glgeneral OpenGL general helper functions
@@ -107,7 +148,7 @@ void glAdjustAlignment(int stride) {
gl_alignment=2;
else
gl_alignment=1;
- glPixelStorei (GL_UNPACK_ALIGNMENT, gl_alignment);
+ PixelStorei(GL_UNPACK_ALIGNMENT, gl_alignment);
}
struct gl_name_map_struct {
@@ -289,9 +330,54 @@ typedef struct {
void *funcptr;
const char *extstr;
const char *funcnames[7];
+ void *fallback;
} extfunc_desc_t;
+#define DEF_FUNC_DESC(name) {&name, NULL, {"gl"#name, NULL}, gl ##name}
static const extfunc_desc_t extfuncs[] = {
+ // these aren't extension functions but we query them anyway to allow
+ // different "backends" with one binary
+ DEF_FUNC_DESC(Begin),
+ DEF_FUNC_DESC(End),
+ DEF_FUNC_DESC(Viewport),
+ DEF_FUNC_DESC(MatrixMode),
+ DEF_FUNC_DESC(LoadIdentity),
+ DEF_FUNC_DESC(Scaled),
+ DEF_FUNC_DESC(Ortho),
+ DEF_FUNC_DESC(PushMatrix),
+ DEF_FUNC_DESC(PopMatrix),
+ DEF_FUNC_DESC(Clear),
+ DEF_FUNC_DESC(GenLists),
+ DEF_FUNC_DESC(DeleteLists),
+ DEF_FUNC_DESC(NewList),
+ DEF_FUNC_DESC(EndList),
+ DEF_FUNC_DESC(CallList),
+ DEF_FUNC_DESC(CallLists),
+ DEF_FUNC_DESC(GenTextures),
+ DEF_FUNC_DESC(DeleteTextures),
+ DEF_FUNC_DESC(TexEnvi),
+ DEF_FUNC_DESC(Color4ub),
+ DEF_FUNC_DESC(Color3f),
+ DEF_FUNC_DESC(ClearColor),
+ DEF_FUNC_DESC(Enable),
+ DEF_FUNC_DESC(Disable),
+ DEF_FUNC_DESC(DrawBuffer),
+ DEF_FUNC_DESC(DepthMask),
+ DEF_FUNC_DESC(BlendFunc),
+ DEF_FUNC_DESC(Flush),
+ DEF_FUNC_DESC(Finish),
+ DEF_FUNC_DESC(PixelStorei),
+ DEF_FUNC_DESC(TexImage1D),
+ DEF_FUNC_DESC(TexImage2D),
+ DEF_FUNC_DESC(TexSubImage2D),
+ DEF_FUNC_DESC(TexParameteri),
+ DEF_FUNC_DESC(TexParameterf),
+ DEF_FUNC_DESC(TexParameterfv),
+ DEF_FUNC_DESC(TexCoord2f),
+ DEF_FUNC_DESC(Vertex2f),
+ DEF_FUNC_DESC(GetIntegerv),
+
+ // here start the real extensions
{&GenBuffers, NULL, {"glGenBuffers", "glGenBuffersARB", NULL}},
{&DeleteBuffers, NULL, {"glDeleteBuffers", "glDeleteBuffersARB", NULL}},
{&BindBuffer, NULL, {"glBindBuffer", "glBindBufferARB", NULL}},
@@ -332,8 +418,18 @@ static const extfunc_desc_t extfuncs[] = {
static void getFunctions(void *(*getProcAddress)(const GLubyte *),
const char *ext2) {
const extfunc_desc_t *dsc;
- const char *extensions = (const char *)glGetString(GL_EXTENSIONS);
+ const char *extensions;
char *allexts;
+
+ if (!getProcAddress)
+ getProcAddress = setNull;
+
+ // special case, we need glGetString before starting to find the other functions
+ GetString = getProcAddress("glGetString");
+ if (!GetString)
+ GetString = glGetString;
+
+ extensions = (const char *)GetString(GL_EXTENSIONS);
if (!extensions) extensions = "";
if (!ext2) ext2 = "";
allexts = malloc(strlen(extensions) + strlen(ext2) + 2);
@@ -341,8 +437,6 @@ static void getFunctions(void *(*getProcAddress)(const GLubyte *),
strcat(allexts, " ");
strcat(allexts, ext2);
mp_msg(MSGT_VO, MSGL_DBG2, "OpenGL extensions string:\n%s\n", allexts);
- if (!getProcAddress)
- getProcAddress = setNull;
for (dsc = extfuncs; dsc->funcptr; dsc++) {
void *ptr = NULL;
int i;
@@ -350,6 +444,8 @@ static void getFunctions(void *(*getProcAddress)(const GLubyte *),
for (i = 0; !ptr && dsc->funcnames[i]; i++)
ptr = getProcAddress((const GLubyte *)dsc->funcnames[i]);
}
+ if (!ptr)
+ ptr = dsc->fallback;
*(void **)dsc->funcptr = ptr;
}
if (strstr(allexts, "_texture_float"))
@@ -383,16 +479,16 @@ void glCreateClearTex(GLenum target, GLenum fmt, GLenum format, GLenum type, GLi
init = malloc(stride * h);
memset(init, val, stride * h);
glAdjustAlignment(stride);
- glPixelStorei(GL_UNPACK_ROW_LENGTH, w);
- glTexImage2D(target, 0, fmt, w, h, 0, format, type, init);
- glTexParameterf(target, GL_TEXTURE_PRIORITY, 1.0);
- glTexParameteri(target, GL_TEXTURE_MIN_FILTER, filter);
- glTexParameteri(target, GL_TEXTURE_MAG_FILTER, filter);
- glTexParameteri(target, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
- glTexParameteri(target, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
+ PixelStorei(GL_UNPACK_ROW_LENGTH, w);
+ TexImage2D(target, 0, fmt, w, h, 0, format, type, init);
+ TexParameterf(target, GL_TEXTURE_PRIORITY, 1.0);
+ TexParameteri(target, GL_TEXTURE_MIN_FILTER, filter);
+ TexParameteri(target, GL_TEXTURE_MAG_FILTER, filter);
+ TexParameteri(target, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
+ TexParameteri(target, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
// Border texels should not be used with CLAMP_TO_EDGE
// We set a sane default anyway.
- glTexParameterfv(target, GL_TEXTURE_BORDER_COLOR, border);
+ TexParameterfv(target, GL_TEXTURE_BORDER_COLOR, border);
free(init);
}
@@ -540,13 +636,13 @@ void glUploadTex(GLenum target, GLenum format, GLenum type,
}
// this is not always correct, but should work for MPlayer
glAdjustAlignment(stride);
- glPixelStorei(GL_UNPACK_ROW_LENGTH, stride / glFmt2bpp(format, type));
+ PixelStorei(GL_UNPACK_ROW_LENGTH, stride / glFmt2bpp(format, type));
for (; y + slice <= y_max; y += slice) {
- glTexSubImage2D(target, 0, x, y, w, slice, format, type, data);
+ TexSubImage2D(target, 0, x, y, w, slice, format, type, data);
data += stride * slice;
}
if (y < y_max)
- glTexSubImage2D(target, 0, x, y, w, y_max - y, format, type, data);
+ TexSubImage2D(target, 0, x, y, w, y_max - y, format, type, data);
}
static void fillUVcoeff(GLfloat *ucoef, GLfloat *vcoef,
@@ -585,11 +681,11 @@ static void glSetupYUVCombiners(float uvcos, float uvsin) {
mp_msg(MSGT_VO, MSGL_FATAL, "[gl] Combiner functions missing!\n");
return;
}
- glGetIntegerv(GL_MAX_GENERAL_COMBINERS_NV, &i);
+ GetIntegerv(GL_MAX_GENERAL_COMBINERS_NV, &i);
if (i < 2)
mp_msg(MSGT_VO, MSGL_ERR,
"[gl] 2 general combiners needed for YUV combiner support (found %i)\n", i);
- glGetIntegerv(GL_MAX_TEXTURE_UNITS, &i);
+ GetIntegerv(GL_MAX_TEXTURE_UNITS, &i);
if (i < 3)
mp_msg(MSGT_VO, MSGL_ERR,
"[gl] 3 texture units needed for YUV combiner support (found %i)\n", i);
@@ -645,11 +741,11 @@ static void glSetupYUVCombinersATI(float uvcos, float uvsin) {
mp_msg(MSGT_VO, MSGL_FATAL, "[gl] Combiner (ATI) functions missing!\n");
return;
}
- glGetIntegerv(GL_NUM_FRAGMENT_REGISTERS_ATI, &i);
+ GetIntegerv(GL_NUM_FRAGMENT_REGISTERS_ATI, &i);
if (i < 3)
mp_msg(MSGT_VO, MSGL_ERR,
"[gl] 3 registers needed for YUV combiner (ATI) support (found %i)\n", i);
- glGetIntegerv (GL_MAX_TEXTURE_UNITS, &i);
+ GetIntegerv (GL_MAX_TEXTURE_UNITS, &i);
if (i < 3)
mp_msg(MSGT_VO, MSGL_ERR,
"[gl] 3 texture units needed for YUV combiner (ATI) support (found %i)\n", i);
@@ -711,11 +807,11 @@ static void gen_spline_lookup_tex(GLenum unit) {
store_weights(0, tex);
store_weights(1, &tex[4 * (LOOKUP_BSPLINE_RES - 1)]);
ActiveTexture(unit);
- glTexImage1D(GL_TEXTURE_1D, 0, GL_RGBA16, LOOKUP_BSPLINE_RES, 0, GL_RGBA, GL_FLOAT, tex);
- glTexParameterf(GL_TEXTURE_1D, GL_TEXTURE_PRIORITY, 1.0);
- glTexParameteri(GL_TEXTURE_1D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
- glTexParameteri(GL_TEXTURE_1D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
- glTexParameteri(GL_TEXTURE_1D, GL_TEXTURE_WRAP_S, GL_REPEAT);
+ TexImage1D(GL_TEXTURE_1D, 0, GL_RGBA16, LOOKUP_BSPLINE_RES, 0, GL_RGBA, GL_FLOAT, tex);
+ TexParameterf(GL_TEXTURE_1D, GL_TEXTURE_PRIORITY, 1.0);
+ TexParameteri(GL_TEXTURE_1D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
+ TexParameteri(GL_TEXTURE_1D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
+ TexParameteri(GL_TEXTURE_1D, GL_TEXTURE_WRAP_S, GL_REPEAT);
ActiveTexture(GL_TEXTURE0);
free(tex);
}
@@ -1024,15 +1120,15 @@ static void create_conv_textures(gl_conversion_params_t *params, int *texu, char
lookup_data = malloc(3 * sz * sz * sz);
gen_yuv2rgb_map(params, lookup_data, LOOKUP_3DRES);
glAdjustAlignment(sz);
- glPixelStorei(GL_UNPACK_ROW_LENGTH, 0);
+ PixelStorei(GL_UNPACK_ROW_LENGTH, 0);
TexImage3D(GL_TEXTURE_3D, 0, 3, sz, sz, sz, 1,
GL_RGB, GL_UNSIGNED_BYTE, lookup_data);
- glTexParameterf(GL_TEXTURE_3D, GL_TEXTURE_PRIORITY, 1.0);
- glTexParameteri(GL_TEXTURE_3D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
- glTexParameteri(GL_TEXTURE_3D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
- glTexParameteri(GL_TEXTURE_3D, GL_TEXTURE_WRAP_S, GL_CLAMP);
- glTexParameteri(GL_TEXTURE_3D, GL_TEXTURE_WRAP_T, GL_CLAMP);
- glTexParameteri(GL_TEXTURE_3D, GL_TEXTURE_WRAP_R, GL_CLAMP);
+ TexParameterf(GL_TEXTURE_3D, GL_TEXTURE_PRIORITY, 1.0);
+ TexParameteri(GL_TEXTURE_3D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
+ TexParameteri(GL_TEXTURE_3D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
+ TexParameteri(GL_TEXTURE_3D, GL_TEXTURE_WRAP_S, GL_CLAMP);
+ TexParameteri(GL_TEXTURE_3D, GL_TEXTURE_WRAP_T, GL_CLAMP);
+ TexParameteri(GL_TEXTURE_3D, GL_TEXTURE_WRAP_R, GL_CLAMP);
ActiveTexture(GL_TEXTURE0);
texs[0] += '0';
}
@@ -1158,13 +1254,13 @@ int loadGPUProgram(GLenum target, char *prog) {
return 0;
}
ProgramString(target, GL_PROGRAM_FORMAT_ASCII, strlen(prog), prog);
- glGetIntegerv(GL_PROGRAM_ERROR_POSITION, &err);
+ GetIntegerv(GL_PROGRAM_ERROR_POSITION, &err);
if (err != -1) {
mp_msg(MSGT_VO, MSGL_ERR,
"[gl] Error compiling fragment program, make sure your card supports\n"
"[gl] GL_ARB_fragment_program (use glxinfo to check).\n"
"[gl] Error message:\n %s at %.10s\n",
- glGetString(GL_PROGRAM_ERROR_STRING), &prog[err]);
+ GetString(GL_PROGRAM_ERROR_STRING), &prog[err]);
return 0;
}
if (!GetProgramiv || !mp_msg_test(MSGT_VO, MSGL_DBG2))
@@ -1212,7 +1308,7 @@ static void glSetupYUVFragprog(gl_conversion_params_t *params) {
memcpy(chrom_scale_texs, lum_scale_texs, sizeof(chrom_scale_texs));
else
create_scaler_textures(YUV_CHROM_SCALER(type), &cur_texu, chrom_scale_texs);
- glGetIntegerv(GL_MAX_TEXTURE_IMAGE_UNITS, &i);
+ GetIntegerv(GL_MAX_TEXTURE_IMAGE_UNITS, &i);
if (i < cur_texu)
mp_msg(MSGT_VO, MSGL_ERR,
"[gl] %i texture units needed for this type of YUV fragment support (found %i)\n",
@@ -1329,25 +1425,25 @@ void glEnableYUVConversion(GLenum target, int type) {
switch (YUV_CONVERSION(type)) {
case YUV_CONVERSION_COMBINERS:
ActiveTexture(GL_TEXTURE1);
- glEnable(target);
+ Enable(target);
ActiveTexture(GL_TEXTURE2);
- glEnable(target);
+ Enable(target);
ActiveTexture(GL_TEXTURE0);
- glEnable(GL_REGISTER_COMBINERS_NV);
+ Enable(GL_REGISTER_COMBINERS_NV);
break;
case YUV_CONVERSION_COMBINERS_ATI:
ActiveTexture(GL_TEXTURE1);
- glEnable(target);
+ Enable(target);
ActiveTexture(GL_TEXTURE2);
- glEnable(target);
+ Enable(target);
ActiveTexture(GL_TEXTURE0);
- glEnable(GL_FRAGMENT_SHADER_ATI);
+ Enable(GL_FRAGMENT_SHADER_ATI);
break;
case YUV_CONVERSION_FRAGMENT_LOOKUP3D:
case YUV_CONVERSION_FRAGMENT_LOOKUP:
case YUV_CONVERSION_FRAGMENT_POW:
case YUV_CONVERSION_FRAGMENT:
- glEnable(GL_FRAGMENT_PROGRAM);
+ Enable(GL_FRAGMENT_PROGRAM);
break;
}
}
@@ -1363,25 +1459,25 @@ void glDisableYUVConversion(GLenum target, int type) {
switch (YUV_CONVERSION(type)) {
case YUV_CONVERSION_COMBINERS:
ActiveTexture(GL_TEXTURE1);
- glDisable(target);
+ Disable(target);
ActiveTexture(GL_TEXTURE2);
- glDisable(target);
+ Disable(target);
ActiveTexture(GL_TEXTURE0);
- glDisable(GL_REGISTER_COMBINERS_NV);
+ Disable(GL_REGISTER_COMBINERS_NV);
break;
case YUV_CONVERSION_COMBINERS_ATI:
ActiveTexture(GL_TEXTURE1);
- glDisable(target);
+ Disable(target);
ActiveTexture(GL_TEXTURE2);
- glDisable(target);
+ Disable(target);
ActiveTexture(GL_TEXTURE0);
- glDisable(GL_FRAGMENT_SHADER_ATI);
+ Disable(GL_FRAGMENT_SHADER_ATI);
break;
case YUV_CONVERSION_FRAGMENT_LOOKUP3D:
case YUV_CONVERSION_FRAGMENT_LOOKUP:
case YUV_CONVERSION_FRAGMENT_POW:
case YUV_CONVERSION_FRAGMENT:
- glDisable(GL_FRAGMENT_PROGRAM);
+ Disable(GL_FRAGMENT_PROGRAM);
break;
}
}
@@ -1415,32 +1511,32 @@ void glDrawTex(GLfloat x, GLfloat y, GLfloat w, GLfloat h,
y += h;
h = -h;
}
- glBegin(GL_QUADS);
- glTexCoord2f(tx, ty);
+ Begin(GL_QUADS);
+ TexCoord2f(tx, ty);
if (is_yv12) {
MultiTexCoord2f(GL_TEXTURE1, tx2, ty2);
MultiTexCoord2f(GL_TEXTURE2, tx2, ty2);
}
- glVertex2f(x, y);
- glTexCoord2f(tx, ty + th);
+ Vertex2f(x, y);
+ TexCoord2f(tx, ty + th);
if (is_yv12) {
MultiTexCoord2f(GL_TEXTURE1, tx2, ty2 + th2);
MultiTexCoord2f(GL_TEXTURE2, tx2, ty2 + th2);
}
- glVertex2f(x, y + h);
- glTexCoord2f(tx + tw, ty + th);
+ Vertex2f(x, y + h);
+ TexCoord2f(tx + tw, ty + th);
if (is_yv12) {
MultiTexCoord2f(GL_TEXTURE1, tx2 + tw2, ty2 + th2);
MultiTexCoord2f(GL_TEXTURE2, tx2 + tw2, ty2 + th2);
}
- glVertex2f(x + w, y + h);
- glTexCoord2f(tx + tw, ty);
+ Vertex2f(x + w, y + h);
+ TexCoord2f(tx + tw, ty);
if (is_yv12) {
MultiTexCoord2f(GL_TEXTURE1, tx2 + tw2, ty2);
MultiTexCoord2f(GL_TEXTURE2, tx2 + tw2, ty2);
}
- glVertex2f(x + w, y);
- glEnd();
+ Vertex2f(x + w, y);
+ End();
}
#ifdef GL_WIN32
@@ -1459,8 +1555,11 @@ static void *w32gpa(const GLubyte *procName) {
return GetProcAddress(oglmod, procName);
}
-int setGlWindow(int *vinfo, HGLRC *context, HWND win)
+static int setGlWindow_w32(MPGLContext *ctx)
{
+ HWND win = vo_w32_window;
+ int *vinfo = &ctx->vinfo.w32;
+ HGLRC *context = &ctx->context.w32;
int new_vinfo;
HDC windc = vo_w32_get_dc(win);
HGLRC new_context = 0;
@@ -1470,7 +1569,7 @@ int setGlWindow(int *vinfo, HGLRC *context, HWND win)
// should only be needed when keeping context, but not doing glFinish
// can cause flickering even when we do not keep it.
if (*context)
- glFinish();
+ Finish();
new_vinfo = GetPixelFormat(windc);
if (*context && *vinfo && new_vinfo && *vinfo == new_vinfo) {
// we can keep the wglContext
@@ -1519,7 +1618,9 @@ out:
return res;
}
-void releaseGlContext(int *vinfo, HGLRC *context) {
+static void releaseGlContext_w32(MPGLContext *ctx) {
+ int *vinfo = &ctx->vinfo.w32;
+ HGLRC *context = &ctx->context.w32;
*vinfo = 0;
if (*context) {
wglMakeCurrent(0, 0);
@@ -1528,12 +1629,13 @@ void releaseGlContext(int *vinfo, HGLRC *context) {
*context = 0;
}
-void swapGlBuffers(void) {
+static void swapGlBuffers_w32(MPGLContext *ctx) {
HDC vo_hdc = vo_w32_get_dc(vo_w32_window);
SwapBuffers(vo_hdc);
vo_w32_release_dc(vo_w32_window, vo_hdc);
}
-#else
+#endif
+#ifdef CONFIG_X11
#ifdef HAVE_LIBDL
#include <dlfcn.h>
#endif
@@ -1596,8 +1698,11 @@ static void appendstr(char **dst, const char *str)
* and the caller must initialize it correctly.
* \ingroup glcontext
*/
-int setGlWindow(XVisualInfo **vinfo, GLXContext *context, Window win)
+static int setGlWindow_x11(MPGLContext *ctx)
{
+ XVisualInfo **vinfo = &ctx->vinfo.x11;
+ GLXContext *context = &ctx->context.x11;
+ Window win = vo_window;
XVisualInfo *new_vinfo;
GLXContext new_context = NULL;
int keep_context = 0;
@@ -1605,7 +1710,7 @@ int setGlWindow(XVisualInfo **vinfo, GLXContext *context, Window win)
// should only be needed when keeping context, but not doing glFinish
// can cause flickering even when we do not keep it.
if (*context)
- glFinish();
+ Finish();
new_vinfo = getWindowVisualInfo(win);
if (*context && *vinfo && new_vinfo &&
(*vinfo)->visualid == new_vinfo->visualid) {
@@ -1675,20 +1780,96 @@ int setGlWindow(XVisualInfo **vinfo, GLXContext *context, Window win)
* \brief free the VisualInfo and GLXContext of an OpenGL context.
* \ingroup glcontext
*/
-void releaseGlContext(XVisualInfo **vinfo, GLXContext *context) {
+static void releaseGlContext_x11(MPGLContext *ctx) {
+ XVisualInfo **vinfo = &ctx->vinfo.x11;
+ GLXContext *context = &ctx->context.x11;
if (*vinfo)
XFree(*vinfo);
*vinfo = NULL;
if (*context)
{
- glFinish();
+ Finish();
glXMakeCurrent(mDisplay, None, NULL);
glXDestroyContext(mDisplay, *context);
}
*context = 0;
}
-void swapGlBuffers(void) {
+static void swapGlBuffers_x11(MPGLContext *ctx) {
glXSwapBuffers(mDisplay, vo_window);
}
+
+static int x11_check_events(void) {
+ return vo_x11_check_events(mDisplay);
+}
+
+static void gl_update_xinerama_info(void)
+{
+ update_xinerama_info(global_vo);
+}
+
+static void gl_border(void)
+{
+ vo_x11_border();
+}
+
+static void gl_fullscreen(void)
+{
+ vo_x11_fullscreen();
+}
+
+static void gl_ontop(void)
+{
+ vo_x11_ontop();
+}
+#endif
+
+int init_mpglcontext(MPGLContext *ctx, enum MPGLType type) {
+ memset(ctx, 0, sizeof(*ctx));
+ ctx->type = type;
+ switch (ctx->type) {
+#ifdef GL_WIN32
+ case GLTYPE_W32:
+ ctx->setGlWindow = setGlWindow_w32;
+ ctx->releaseGlContext = releaseGlContext_w32;
+ ctx->swapGlBuffers = swapGlBuffers_w32;
+ ctx->update_xinerama_info = w32_update_xinerama_info;
+ ctx->border = vo_w32_border;
+ ctx->check_events = vo_w32_check_events;
+ ctx->fullscreen = vo_w32_fullscreen;
+ ctx->ontop = vo_w32_ontop;
+ return vo_w32_init();
+#endif
+#ifdef CONFIG_X11
+ case GLTYPE_X11:
+ ctx->setGlWindow = setGlWindow_x11;
+ ctx->releaseGlContext = releaseGlContext_x11;
+ ctx->swapGlBuffers = swapGlBuffers_x11;
+ ctx->update_xinerama_info = gl_update_xinerama_info;
+ ctx->border = gl_border;
+ ctx->check_events = x11_check_events;
+ ctx->fullscreen = gl_fullscreen;
+ ctx->ontop = gl_ontop;
+ return vo_init();
+#endif
+ default:
+ return 0;
+ }
+}
+
+void uninit_mpglcontext(MPGLContext *ctx) {
+ ctx->releaseGlContext(ctx);
+ switch (ctx->type) {
+#ifdef GL_WIN32
+ case GLTYPE_W32:
+ vo_w32_uninit();
+ break;
+#endif
+#ifdef CONFIG_X11
+ case GLTYPE_X11:
+ vo_x11_uninit();
+ break;
#endif
+ }
+ memset(ctx, 0, sizeof(*ctx));
+}
diff --git a/libvo/gl_common.h b/libvo/gl_common.h
index 56fcbba0e3..5a3b4c4163 100644
--- a/libvo/gl_common.h
+++ b/libvo/gl_common.h
@@ -31,21 +31,24 @@
#include <windows.h>
#include <GL/gl.h>
#include "w32_common.h"
-#else
+#endif
+#ifdef CONFIG_X11
#include <GL/gl.h>
#include <X11/Xlib.h>
#include <GL/glx.h>
#include "x11_common.h"
+// This old-vo wrapper macro would conflict with the struct member
+#undef update_xinerama_info
#endif
// workaround for some gl.h headers
-#ifndef APIENTRY
-#ifdef GLAPIENTRY
-#define APIENTRY GLAPIENTRY
+#ifndef GLAPIENTRY
+#ifdef APIENTRY
+#define GLAPIENTRY APIENTRY
#elif defined(GL_WIN32)
-#define APIENTRY __stdcall
+#define GLAPIENTRY __stdcall
#else
-#define APIENTRY
+#define GLAPIENTRY
#endif
#endif
@@ -352,60 +355,116 @@ void glDisableYUVConversion(GLenum target, int type);
#define SET_WINDOW_REINIT 1
/** \} */
+enum MPGLType {
+ GLTYPE_W32,
+ GLTYPE_X11,
+};
+
+typedef struct MPGLContext {
+ enum MPGLType type;
+ union {
+ int w32;
+#ifdef CONFIG_X11
+ XVisualInfo *x11;
+#endif
+ } vinfo;
+ union {
#ifdef GL_WIN32
-#define vo_gl_border(vo) vo_w32_border()
-#define vo_check_events() vo_w32_check_events()
-#define vo_fullscreen() vo_w32_fullscreen()
-#define vo_gl_ontop() vo_w32_ontop()
-#define vo_uninit() vo_w32_uninit()
-int setGlWindow(int *vinfo, HGLRC *context, HWND win);
-void releaseGlContext(int *vinfo, HGLRC *context);
-#else
-#define vo_gl_border(vo) vo_x11_border(vo)
-#define vo_check_events() vo_x11_check_events(mDisplay)
-#define vo_fullscreen() vo_x11_fullscreen()
-#define vo_gl_ontop() vo_x11_ontop()
-#define vo_uninit() vo_x11_uninit()
-int setGlWindow(XVisualInfo **vinfo, GLXContext *context, Window win);
-void releaseGlContext(XVisualInfo **vinfo, GLXContext *context);
-#endif
-void swapGlBuffers(void);
+ HGLRC w32;
+#endif
+#ifdef CONFIG_X11
+ GLXContext x11;
+#endif
+ } context;
+ int (*setGlWindow)(struct MPGLContext *);
+ void (*releaseGlContext)(struct MPGLContext *);
+ void (*swapGlBuffers)(struct MPGLContext *);
+ void (*update_xinerama_info)(void);
+ void (*border)(void);
+ int (*check_events)(void);
+ void (*fullscreen)(void);
+ void (*ontop)(void);
+} MPGLContext;
+
+int init_mpglcontext(MPGLContext *ctx, enum MPGLType type);
+void uninit_mpglcontext(MPGLContext *ctx);
+
+extern void (GLAPIENTRY *Begin)(GLenum);
+extern void (GLAPIENTRY *End)(void);
+extern void (GLAPIENTRY *Viewport)(GLint, GLint, GLsizei, GLsizei);
+extern void (GLAPIENTRY *MatrixMode)(GLenum);
+extern void (GLAPIENTRY *LoadIdentity)(void);
+extern void (GLAPIENTRY *Scaled)(double, double, double);
+extern void (GLAPIENTRY *Ortho)(double, double, double, double, double, double);
+extern void (GLAPIENTRY *PushMatrix)(void);
+extern void (GLAPIENTRY *PopMatrix)(void);
+extern void (GLAPIENTRY *Clear)(GLbitfield);
+extern GLuint (GLAPIENTRY *GenLists)(GLsizei);
+extern void (GLAPIENTRY *DeleteLists)(GLuint, GLsizei);
+extern void (GLAPIENTRY *NewList)(GLuint, GLenum);
+extern void (GLAPIENTRY *EndList)(void);
+extern void (GLAPIENTRY *CallList)(GLuint);
+extern void (GLAPIENTRY *CallLists)(GLsizei, GLenum, const GLvoid *);
+extern void (GLAPIENTRY *GenTextures)(GLsizei, GLuint *);
+extern void (GLAPIENTRY *DeleteTextures)(GLsizei, const GLuint *);
+extern void (GLAPIENTRY *TexEnvi)(GLenum, GLenum, GLint);
+extern void (GLAPIENTRY *Color4ub)(GLubyte, GLubyte, GLubyte, GLubyte);
+extern void (GLAPIENTRY *Color3f)(GLfloat, GLfloat, GLfloat);
+extern void (GLAPIENTRY *ClearColor)(GLclampf, GLclampf, GLclampf, GLclampf);
+extern void (GLAPIENTRY *Enable)(GLenum);
+extern void (GLAPIENTRY *Disable)(GLenum);
+extern const GLubyte *(GLAPIENTRY *GetString)(GLenum);
+extern void (GLAPIENTRY *DrawBuffer)(GLenum);
+extern void (GLAPIENTRY *DepthMask)(GLboolean);
+extern void (GLAPIENTRY *BlendFunc)(GLenum, GLenum);
+extern void (GLAPIENTRY *Flush)(void);
+extern void (GLAPIENTRY *Finish)(void);
+extern void (GLAPIENTRY *PixelStorei)(GLenum, GLint);
+extern void (GLAPIENTRY *TexImage1D)(GLenum, GLint, GLint, GLsizei, GLint, GLenum, GLenum, const GLvoid *);
+extern void (GLAPIENTRY *TexImage2D)(GLenum, GLint, GLint, GLsizei, GLsizei, GLint, GLenum, GLenum, const GLvoid *);
+extern void (GLAPIENTRY *TexSubImage2D)(GLenum, GLint, GLint, GLint, GLsizei, GLsizei, GLenum, GLenum, const GLvoid *);
+extern void (GLAPIENTRY *TexParameteri)(GLenum, GLenum, GLint);
+extern void (GLAPIENTRY *TexParameterf)(GLenum, GLenum, GLfloat);
+extern void (GLAPIENTRY *TexParameterfv)(GLenum, GLenum, const GLfloat *);
+extern void (GLAPIENTRY *TexCoord2f)(GLfloat, GLfloat);
+extern void (GLAPIENTRY *Vertex2f)(GLfloat, GLfloat);
+extern void (GLAPIENTRY *GetIntegerv)(GLenum, GLint *);
-extern void (APIENTRY *GenBuffers)(GLsizei, GLuint *);
-extern void (APIENTRY *DeleteBuffers)(GLsizei, const GLuint *);
-extern void (APIENTRY *BindBuffer)(GLenum, GLuint);
-extern GLvoid* (APIENTRY *MapBuffer)(GLenum, GLenum);
-extern GLboolean (APIENTRY *UnmapBuffer)(GLenum);
-extern void (APIENTRY *BufferData)(GLenum, intptr_t, const GLvoid *, GLenum);
-extern void (APIENTRY *CombinerParameterfv)(GLenum, const GLfloat *);
-extern void (APIENTRY *CombinerParameteri)(GLenum, GLint);
-extern void (APIENTRY *CombinerInput)(GLenum, GLenum, GLenum, GLenum, GLenum,
+extern void (GLAPIENTRY *GenBuffers)(GLsizei, GLuint *);
+extern void (GLAPIENTRY *DeleteBuffers)(GLsizei, const GLuint *);
+extern void (GLAPIENTRY *BindBuffer)(GLenum, GLuint);
+extern GLvoid* (GLAPIENTRY *MapBuffer)(GLenum, GLenum);
+extern GLboolean (GLAPIENTRY *UnmapBuffer)(GLenum);
+extern void (GLAPIENTRY *BufferData)(GLenum, intptr_t, const GLvoid *, GLenum);
+extern void (GLAPIENTRY *CombinerParameterfv)(GLenum, const GLfloat *);
+extern void (GLAPIENTRY *CombinerParameteri)(GLenum, GLint);
+extern void (GLAPIENTRY *CombinerInput)(GLenum, GLenum, GLenum, GLenum, GLenum,
GLenum);
-extern void (APIENTRY *CombinerOutput)(GLenum, GLenum, GLenum, GLenum, GLenum,
+extern void (GLAPIENTRY *CombinerOutput)(GLenum, GLenum, GLenum, GLenum, GLenum,
GLenum, GLenum, GLboolean, GLboolean,
GLboolean);
-extern void (APIENTRY *BeginFragmentShader)(void);
-extern void (APIENTRY *EndFragmentShader)(void);
-extern void (APIENTRY *SampleMap)(GLuint, GLuint, GLenum);
-extern void (APIENTRY *ColorFragmentOp2)(GLenum, GLuint, GLuint, GLuint, GLuint,
+extern void (GLAPIENTRY *BeginFragmentShader)(void);
+extern void (GLAPIENTRY *EndFragmentShader)(void);
+extern void (GLAPIENTRY *SampleMap)(GLuint, GLuint, GLenum);
+extern void (GLAPIENTRY *ColorFragmentOp2)(GLenum, GLuint, GLuint, GLuint, GLuint,
GLuint, GLuint, GLuint, GLuint, GLuint);
-extern void (APIENTRY *ColorFragmentOp3)(GLenum, GLuint, GLuint, GLuint, GLuint,
+extern void (GLAPIENTRY *ColorFragmentOp3)(GLenum, GLuint, GLuint, GLuint, GLuint,
GLuint, GLuint, GLuint, GLuint, GLuint,
GLuint, GLuint, GLuint);
-extern void (APIENTRY *SetFragmentShaderConstant)(GLuint, const GLfloat *);
-extern void (APIENTRY *ActiveTexture)(GLenum);
-extern void (APIENTRY *BindTexture)(GLenum, GLuint);
-extern void (APIENTRY *MultiTexCoord2f)(GLenum, GLfloat, GLfloat);
-extern void (APIENTRY *GenPrograms)(GLsizei, GLuint *);
-extern void (APIENTRY *DeletePrograms)(GLsizei, const GLuint *);
-extern void (APIENTRY *BindProgram)(GLenum, GLuint);
-extern void (APIENTRY *ProgramString)(GLenum, GLenum, GLsizei, const GLvoid *);
-extern void (APIENTRY *ProgramEnvParameter4f)(GLenum, GLuint, GLfloat, GLfloat,
+extern void (GLAPIENTRY *SetFragmentShaderConstant)(GLuint, const GLfloat *);
+extern void (GLAPIENTRY *ActiveTexture)(GLenum);
+extern void (GLAPIENTRY *BindTexture)(GLenum, GLuint);
+extern void (GLAPIENTRY *MultiTexCoord2f)(GLenum, GLfloat, GLfloat);
+extern void (GLAPIENTRY *GenPrograms)(GLsizei, GLuint *);
+extern void (GLAPIENTRY *DeletePrograms)(GLsizei, const GLuint *);
+extern void (GLAPIENTRY *BindProgram)(GLenum, GLuint);
+extern void (GLAPIENTRY *ProgramString)(GLenum, GLenum, GLsizei, const GLvoid *);
+extern void (GLAPIENTRY *ProgramEnvParameter4f)(GLenum, GLuint, GLfloat, GLfloat,
GLfloat, GLfloat);
-extern int (APIENTRY *SwapInterval)(int);
-extern void (APIENTRY *TexImage3D)(GLenum, GLint, GLenum, GLsizei, GLsizei,
+extern int (GLAPIENTRY *SwapInterval)(int);
+extern void (GLAPIENTRY *TexImage3D)(GLenum, GLint, GLenum, GLsizei, GLsizei,
GLsizei, GLint, GLenum, GLenum, const GLvoid *);
-extern void* (APIENTRY *AllocateMemoryMESA)(void *, int, size_t, float, float, float);
-extern void (APIENTRY *FreeMemoryMESA)(void *, int, void *);
+extern void* (GLAPIENTRY *AllocateMemoryMESA)(void *, int, size_t, float, float, float);
+extern void (GLAPIENTRY *FreeMemoryMESA)(void *, int, void *);
#endif /* MPLAYER_GL_COMMON_H */
diff --git a/libvo/vo_corevideo.m b/libvo/vo_corevideo.m
index 1748e059ec..9cd3447072 100644
--- a/libvo/vo_corevideo.m
+++ b/libvo/vo_corevideo.m
@@ -115,6 +115,9 @@ static void draw_alpha(int x0, int y0, int w, int h, unsigned char *src, unsigne
static void update_screen_info(void)
{
+ if (screen_id == -1 && xinerama_screen > -1)
+ screen_id = xinerama_screen;
+
screen_array = [NSScreen screens];
if(screen_id < (int)[screen_array count])
{
@@ -494,16 +497,21 @@ static int control(uint32_t request, void *data)
- (void) config
{
- uint32_t d_width;
- uint32_t d_height;
-
- NSRect frame;
+ NSRect visibleFrame;
CVReturn error = kCVReturnSuccess;
//config window
- d_width = vo_dwidth; d_height = vo_dheight;
- frame = NSMakeRect(0, 0, d_width, d_height);
- [window setContentSize: frame.size];
+ [window setContentSize:NSMakeSize(vo_dwidth, vo_dheight)];
+
+ // Use visibleFrame to position the window taking the menu bar and dock into account.
+ // Also flip vo_dy since the screen origin is in the bottom left on OSX.
+ if (screen_id < 0)
+ visibleFrame = [[[mpGLView window] screen] visibleFrame];
+ else
+ visibleFrame = [[[NSScreen screens] objectAtIndex:screen_id] visibleFrame];
+ [window setFrameTopLeftPoint:NSMakePoint(
+ visibleFrame.origin.x + vo_dx,
+ visibleFrame.origin.y + visibleFrame.size.height - vo_dy)];
[self releaseVideoSpecific];
error = CVPixelBufferCreateWithBytes(NULL, image_width, image_height, pixelFormat, image_datas[0], image_width*image_bytes, NULL, NULL, NULL, &frameBuffers[0]);
@@ -520,7 +528,6 @@ static int control(uint32_t request, void *data)
mp_msg(MSGT_VO, MSGL_ERR,"[vo_corevideo] Failed to create OpenGL texture(%d)\n", error);
//show window
- [window center];
[window makeKeyAndOrderFront:mpGLView];
if(vo_rootwin)
diff --git a/libvo/vo_gl.c b/libvo/vo_gl.c
index b319ecde67..e3c4571b32 100644
--- a/libvo/vo_gl.c
+++ b/libvo/vo_gl.c
@@ -44,15 +44,7 @@ static const vo_info_t info =
const LIBVO_EXTERN(gl)
-#ifdef GL_WIN32
-static int gl_vinfo = 0;
-static HGLRC gl_context = 0;
-#define update_xinerama_info w32_update_xinerama_info
-#define vo_init vo_w32_init
-#define vo_window vo_w32_window
-#else
-static XVisualInfo *gl_vinfo = NULL;
-static GLXContext gl_context = 0;
+#ifdef CONFIG_X11
static int wsGLXAttrib[] = { GLX_RGBA,
GLX_RED_SIZE,1,
GLX_GREEN_SIZE,1,
@@ -60,6 +52,7 @@ static int wsGLXAttrib[] = { GLX_RGBA,
GLX_DOUBLEBUFFER,
None };
#endif
+static MPGLContext glctx;
static int use_osd;
static int scaled_osd;
@@ -152,12 +145,12 @@ static void resize(int x,int y){
if (WinID >= 0) {
int top = 0, left = 0, w = x, h = y;
geometry(&top, &left, &w, &h, vo_screenwidth, vo_screenheight);
- glViewport(top, left, w, h);
+ Viewport(top, left, w, h);
} else
- glViewport( 0, 0, x, y );
+ Viewport( 0, 0, x, y );
- glMatrixMode(GL_PROJECTION);
- glLoadIdentity();
+ MatrixMode(GL_PROJECTION);
+ LoadIdentity();
ass_border_x = ass_border_y = 0;
if (aspect_scaling() && use_aspect) {
int new_w, new_h;
@@ -168,14 +161,14 @@ static void resize(int x,int y){
new_h += vo_panscan_y;
scale_x = (GLdouble)new_w / (GLdouble)x;
scale_y = (GLdouble)new_h / (GLdouble)y;
- glScaled(scale_x, scale_y, 1);
+ Scaled(scale_x, scale_y, 1);
ass_border_x = (vo_dwidth - new_w) / 2;
ass_border_y = (vo_dheight - new_h) / 2;
}
- glOrtho(0, image_width, image_height, 0, -1,1);
+ Ortho(0, image_width, image_height, 0, -1,1);
- glMatrixMode(GL_MODELVIEW);
- glLoadIdentity();
+ MatrixMode(GL_MODELVIEW);
+ LoadIdentity();
if (!scaled_osd) {
#ifdef CONFIG_FREETYPE
@@ -184,7 +177,7 @@ static void resize(int x,int y){
#endif
vo_osd_changed(OSDTYPE_OSD);
}
- glClear(GL_COLOR_BUFFER_BIT);
+ Clear(GL_COLOR_BUFFER_BIT);
redraw();
}
@@ -262,14 +255,14 @@ static void clearOSD(void) {
int i;
if (!osdtexCnt)
return;
- glDeleteTextures(osdtexCnt, osdtex);
+ DeleteTextures(osdtexCnt, osdtex);
#ifndef FAST_OSD
- glDeleteTextures(osdtexCnt, osdatex);
+ DeleteTextures(osdtexCnt, osdatex);
for (i = 0; i < osdtexCnt; i++)
- glDeleteLists(osdaDispList[i], 1);
+ DeleteLists(osdaDispList[i], 1);
#endif
for (i = 0; i < osdtexCnt; i++)
- glDeleteLists(osdDispList[i], 1);
+ DeleteLists(osdDispList[i], 1);
osdtexCnt = 0;
}
@@ -278,10 +271,10 @@ static void clearOSD(void) {
*/
static void clearEOSD(void) {
if (eosdDispList)
- glDeleteLists(eosdDispList, 1);
+ DeleteLists(eosdDispList, 1);
eosdDispList = 0;
if (eosdtexCnt)
- glDeleteTextures(eosdtexCnt, eosdtex);
+ DeleteTextures(eosdtexCnt, eosdtex);
eosdtexCnt = 0;
free(eosdtex);
eosdtex = NULL;
@@ -376,15 +369,15 @@ static void genEOSD(mp_eosd_images_t *imgs) {
glUploadTex(gl_target, GL_ALPHA, GL_UNSIGNED_BYTE, i->bitmap, i->stride,
x, y, i->w, i->h, 0);
}
- eosdDispList = glGenLists(1);
+ eosdDispList = GenLists(1);
skip_upload:
- glNewList(eosdDispList, GL_COMPILE);
+ NewList(eosdDispList, GL_COMPILE);
tinytexcur = smalltexcur = 0;
for (i = img, curtex = eosdtex; i; i = i->next) {
int x = 0, y = 0;
if (i->w <= 0 || i->h <= 0 || i->stride < i->w)
continue;
- glColor4ub(i->color >> 24, (i->color >> 16) & 0xff, (i->color >> 8) & 0xff, 255 - (i->color & 0xff));
+ Color4ub(i->color >> 24, (i->color >> 16) & 0xff, (i->color >> 8) & 0xff, 255 - (i->color & 0xff));
if (is_tinytex(i, tinytexcur)) {
tinytex_pos(tinytexcur, &x, &y);
sx = sy = LARGE_EOSD_TEX_SIZE;
@@ -401,7 +394,7 @@ skip_upload:
}
glDrawTex(i->dst_x, i->dst_y, i->w, i->h, x, y, i->w, i->h, sx, sy, use_rectangle == 1, 0, 0);
}
- glEndList();
+ EndList();
BindTexture(gl_target, 0);
}
@@ -416,12 +409,12 @@ static void uninitGl(void) {
while (default_texs[i] != 0)
i++;
if (i)
- glDeleteTextures(i, default_texs);
+ DeleteTextures(i, default_texs);
default_texs[0] = 0;
clearOSD();
clearEOSD();
if (largeeosdtex[0])
- glDeleteTextures(2, largeeosdtex);
+ DeleteTextures(2, largeeosdtex);
largeeosdtex[0] = 0;
if (DeleteBuffers && gl_buffer)
DeleteBuffers(1, &gl_buffer);
@@ -440,9 +433,9 @@ static void uninitGl(void) {
}
static void autodetectGlExtensions(void) {
- const char *extensions = glGetString(GL_EXTENSIONS);
- const char *vendor = glGetString(GL_VENDOR);
- const char *version = glGetString(GL_VERSION);
+ const char *extensions = GetString(GL_EXTENSIONS);
+ const char *vendor = GetString(GL_VENDOR);
+ const char *version = GetString(GL_VERSION);
int is_ati = strstr(vendor, "ATI") != NULL;
int ati_broken_pbo = 0;
if (is_ati && strncmp(version, "2.1.", 4) == 0) {
@@ -468,20 +461,20 @@ static int initGl(uint32_t d_width, uint32_t d_height) {
autodetectGlExtensions();
texSize(image_width, image_height, &texture_width, &texture_height);
- glDisable(GL_BLEND);
- glDisable(GL_DEPTH_TEST);
- glDepthMask(GL_FALSE);
- glDisable(GL_CULL_FACE);
- glEnable(gl_target);
- glDrawBuffer(vo_doublebuffering?GL_BACK:GL_FRONT);
- glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE);
+ Disable(GL_BLEND);
+ Disable(GL_DEPTH_TEST);
+ DepthMask(GL_FALSE);
+ Disable(GL_CULL_FACE);
+ Enable(gl_target);
+ DrawBuffer(vo_doublebuffering?GL_BACK:GL_FRONT);
+ TexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE);
mp_msg(MSGT_VO, MSGL_V, "[gl] Creating %dx%d texture...\n",
texture_width, texture_height);
if (image_format == IMGFMT_YV12) {
int i;
- glGenTextures(21, default_texs);
+ GenTextures(21, default_texs);
default_texs[21] = 0;
for (i = 0; i < 7; i++) {
ActiveTexture(GL_TEXTURE1 + i);
@@ -516,8 +509,8 @@ static int initGl(uint32_t d_width, uint32_t d_height) {
resize(d_width, d_height);
- glClearColor( 0.0f,0.0f,0.0f,0.0f );
- glClear( GL_COLOR_BUFFER_BIT );
+ ClearColor( 0.0f,0.0f,0.0f,0.0f );
+ Clear( GL_COLOR_BUFFER_BIT );
if (SwapInterval && swap_interval >= 0)
SwapInterval(swap_interval);
return 1;
@@ -537,10 +530,11 @@ config(uint32_t width, uint32_t height, uint32_t d_width, uint32_t d_height, uin
vo_flipped = !!(flags & VOFLAG_FLIPPING);
#ifdef GL_WIN32
- if (!vo_w32_config(d_width, d_height, flags))
+ if (glctx.type == GLTYPE_W32 && !vo_w32_config(d_width, d_height, flags))
return -1;
-#else
- {
+#endif
+#ifdef CONFIG_X11
+ if (glctx.type == GLTYPE_X11) {
XVisualInfo *vinfo=glXChooseVisual( mDisplay,mScreen,wsGLXAttrib );
if (vinfo == NULL)
{
@@ -558,7 +552,7 @@ config(uint32_t width, uint32_t height, uint32_t d_width, uint32_t d_height, uin
glconfig:
if (vo_config_count)
uninitGl();
- if (setGlWindow(&gl_vinfo, &gl_context, vo_window) == SET_WINDOW_FAILED)
+ if (glctx.setGlWindow(&glctx) == SET_WINDOW_FAILED)
return -1;
if (mesa_buffer && !AllocateMemoryMESA) {
mp_msg(MSGT_VO, MSGL_ERR, "Can not enable mesa-buffer because AllocateMemoryMESA was not found\n");
@@ -571,7 +565,7 @@ glconfig:
static void check_events(void)
{
- int e=vo_check_events();
+ int e=glctx.check_events();
if(e&VO_EVENT_RESIZE) resize(vo_dwidth,vo_dheight);
if(e&VO_EVENT_EXPOSE && int_pause) redraw();
}
@@ -601,14 +595,14 @@ static void create_osd_texture(int x0, int y0, int w, int h,
}
// create Textures for OSD part
- glGenTextures(1, &osdtex[osdtexCnt]);
+ GenTextures(1, &osdtex[osdtexCnt]);
BindTexture(gl_target, osdtex[osdtexCnt]);
glCreateClearTex(gl_target, GL_LUMINANCE, GL_LUMINANCE, GL_UNSIGNED_BYTE, scale_type, sx, sy, 0);
glUploadTex(gl_target, GL_LUMINANCE, GL_UNSIGNED_BYTE, src, stride,
0, 0, w, h, 0);
#ifndef FAST_OSD
- glGenTextures(1, &osdatex[osdtexCnt]);
+ GenTextures(1, &osdatex[osdtexCnt]);
BindTexture(gl_target, osdatex[osdtexCnt]);
glCreateClearTex(gl_target, GL_ALPHA, GL_ALPHA, GL_UNSIGNED_BYTE, scale_type, sx, sy, 0);
{
@@ -628,19 +622,19 @@ static void create_osd_texture(int x0, int y0, int w, int h,
// Create a list for rendering this OSD part
#ifndef FAST_OSD
- osdaDispList[osdtexCnt] = glGenLists(1);
- glNewList(osdaDispList[osdtexCnt], GL_COMPILE);
+ osdaDispList[osdtexCnt] = GenLists(1);
+ NewList(osdaDispList[osdtexCnt], GL_COMPILE);
// render alpha
BindTexture(gl_target, osdatex[osdtexCnt]);
glDrawTex(x0, y0, w, h, 0, 0, w, h, sx, sy, use_rectangle == 1, 0, 0);
- glEndList();
+ EndList();
#endif
- osdDispList[osdtexCnt] = glGenLists(1);
- glNewList(osdDispList[osdtexCnt], GL_COMPILE);
+ osdDispList[osdtexCnt] = GenLists(1);
+ NewList(osdDispList[osdtexCnt], GL_COMPILE);
// render OSD
BindTexture(gl_target, osdtex[osdtexCnt]);
glDrawTex(x0, y0, w, h, 0, 0, w, h, sx, sy, use_rectangle == 1, 0, 0);
- glEndList();
+ EndList();
osdtexCnt++;
}
@@ -660,10 +654,10 @@ static void draw_osd(void)
}
static void do_render(void) {
-// glEnable(GL_TEXTURE_2D);
-// glBindTexture(GL_TEXTURE_2D, texture_id);
+// Enable(GL_TEXTURE_2D);
+// BindTexture(GL_TEXTURE_2D, texture_id);
- glColor3f(1,1,1);
+ Color3f(1,1,1);
if (image_format == IMGFMT_YV12)
glEnableYUVConversion(gl_target, yuvconvtype);
glDrawTex(0, 0, image_width, image_height,
@@ -682,45 +676,45 @@ static void do_render_osd(int type) {
if (((type & 1) && osdtexCnt > 0) || ((type & 2) && eosdDispList)) {
// set special rendering parameters
if (!scaled_osd) {
- glMatrixMode(GL_PROJECTION);
- glPushMatrix();
- glLoadIdentity();
- glOrtho(0, vo_dwidth, vo_dheight, 0, -1, 1);
+ MatrixMode(GL_PROJECTION);
+ PushMatrix();
+ LoadIdentity();
+ Ortho(0, vo_dwidth, vo_dheight, 0, -1, 1);
}
- glEnable(GL_BLEND);
+ Enable(GL_BLEND);
if ((type & 2) && eosdDispList) {
- glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
- glCallList(eosdDispList);
+ BlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
+ CallList(eosdDispList);
}
if ((type & 1) && osdtexCnt > 0) {
- glColor4ub((osd_color >> 16) & 0xff, (osd_color >> 8) & 0xff, osd_color & 0xff, 0xff - (osd_color >> 24));
+ Color4ub((osd_color >> 16) & 0xff, (osd_color >> 8) & 0xff, osd_color & 0xff, 0xff - (osd_color >> 24));
// draw OSD
#ifndef FAST_OSD
- glBlendFunc(GL_ZERO, GL_ONE_MINUS_SRC_ALPHA);
- glCallLists(osdtexCnt, GL_UNSIGNED_INT, osdaDispList);
+ BlendFunc(GL_ZERO, GL_ONE_MINUS_SRC_ALPHA);
+ CallLists(osdtexCnt, GL_UNSIGNED_INT, osdaDispList);
#endif
- glBlendFunc(GL_SRC_ALPHA, GL_ONE);
- glCallLists(osdtexCnt, GL_UNSIGNED_INT, osdDispList);
+ BlendFunc(GL_SRC_ALPHA, GL_ONE);
+ CallLists(osdtexCnt, GL_UNSIGNED_INT, osdDispList);
}
// set rendering parameters back to defaults
- glDisable(GL_BLEND);
+ Disable(GL_BLEND);
if (!scaled_osd)
- glPopMatrix();
+ PopMatrix();
BindTexture(gl_target, 0);
}
}
static void flip_page(void) {
if (vo_doublebuffering) {
- if (use_glFinish) glFinish();
- swapGlBuffers();
+ if (use_glFinish) Finish();
+ glctx.swapGlBuffers(&glctx);
if (aspect_scaling() && use_aspect)
- glClear(GL_COLOR_BUFFER_BIT);
+ Clear(GL_COLOR_BUFFER_BIT);
} else {
do_render();
do_render_osd(3);
- if (use_glFinish) glFinish();
- else glFlush();
+ if (use_glFinish) Finish();
+ else Flush();
}
}
@@ -876,7 +870,7 @@ static uint32_t draw_image(mp_image_t *mpi) {
mpi_flipped = stride[0] < 0;
if (mpi->flags & MP_IMGFLAG_DIRECT) {
if (mesa_buffer) {
- glPixelStorei(GL_UNPACK_CLIENT_STORAGE_APPLE, 1);
+ PixelStorei(GL_UNPACK_CLIENT_STORAGE_APPLE, 1);
w = texture_width;
} else {
intptr_t base = (intptr_t)planes[0];
@@ -916,7 +910,7 @@ static uint32_t draw_image(mp_image_t *mpi) {
ActiveTexture(GL_TEXTURE0);
}
if (mpi->flags & MP_IMGFLAG_DIRECT) {
- if (mesa_buffer) glPixelStorei(GL_UNPACK_CLIENT_STORAGE_APPLE, 0);
+ if (mesa_buffer) PixelStorei(GL_UNPACK_CLIENT_STORAGE_APPLE, 0);
else BindBuffer(GL_PIXEL_UNPACK_BUFFER, 0);
}
skip_upload:
@@ -960,12 +954,11 @@ uninit(void)
{
if (!vo_config_count) return;
uninitGl();
- releaseGlContext(&gl_vinfo, &gl_context);
if (custom_prog) free(custom_prog);
custom_prog = NULL;
if (custom_tex) free(custom_tex);
custom_tex = NULL;
- vo_uninit();
+ uninit_mpglcontext(&glctx);
}
static const opt_t subopts[] = {
@@ -995,7 +988,11 @@ static const opt_t subopts[] = {
static int preinit(const char *arg)
{
+ enum MPGLType gltype = GLTYPE_X11;
// set defaults
+#ifdef GL_WIN32
+ gltype = GLTYPE_W32;
+#endif
many_fmts = 1;
use_osd = 1;
scaled_osd = 0;
@@ -1090,7 +1087,7 @@ static int preinit(const char *arg)
"Use -vo gl:nomanyfmts if playback fails.\n");
mp_msg(MSGT_VO, MSGL_V, "[gl] Using %d as slice height "
"(0 means image height).\n", slice_height);
- if (!vo_init()) return -1; // Can't open X11
+ if (!init_mpglcontext(&glctx, gltype)) return -1;
return 0;
}
@@ -1147,14 +1144,14 @@ static int control(uint32_t request, void *data)
}
return VO_TRUE;
case VOCTRL_ONTOP:
- vo_gl_ontop();
+ glctx.ontop();
return VO_TRUE;
case VOCTRL_FULLSCREEN:
- vo_fullscreen();
+ glctx.fullscreen();
resize(vo_dwidth, vo_dheight);
return VO_TRUE;
case VOCTRL_BORDER:
- vo_gl_border();
+ glctx.border();
resize(vo_dwidth, vo_dheight);
return VO_TRUE;
case VOCTRL_GET_PANSCAN:
@@ -1190,7 +1187,7 @@ static int control(uint32_t request, void *data)
}
break;
case VOCTRL_UPDATE_SCREENINFO:
- update_xinerama_info();
+ glctx.update_xinerama_info();
return VO_TRUE;
case VOCTRL_REDRAW_OSD:
if (vo_doublebuffering)
diff --git a/libvo/vo_gl2.c b/libvo/vo_gl2.c
index d814008f31..70557b07c2 100644
--- a/libvo/vo_gl2.c
+++ b/libvo/vo_gl2.c
@@ -59,16 +59,7 @@ const LIBVO_EXTERN(gl2)
/* local data */
static unsigned char *ImageData=NULL;
-#ifdef GL_WIN32
- static int gl_vinfo = 0;
- static HGLRC gl_context = 0;
-#define update_xinerama_info w32_update_xinerama_info
-#define vo_init vo_w32_init
-#define vo_window vo_w32_window
-#else
- static XVisualInfo *gl_vinfo = NULL;
- static GLXContext gl_context = 0;
-#endif
+static MPGLContext glctx;
static uint32_t image_width;
static uint32_t image_height;
@@ -112,7 +103,10 @@ struct TexSquare
static GLint getInternalFormat(void)
{
+ switch (glctx.type) {
#ifdef GL_WIN32
+ case GLTYPE_W32:
+ {
PIXELFORMATDESCRIPTOR pfd;
HDC vo_hdc = vo_w32_get_dc(vo_w32_window);
int pf = GetPixelFormat(vo_hdc);
@@ -125,12 +119,18 @@ static GLint getInternalFormat(void)
a_sz = pfd.cAlphaBits;
}
vo_w32_release_dc(vo_w32_window, vo_hdc);
-#else
- if (glXGetConfig(mDisplay, gl_vinfo, GLX_RED_SIZE, &r_sz) != 0) r_sz = 0;
- if (glXGetConfig(mDisplay, gl_vinfo, GLX_GREEN_SIZE, &g_sz) != 0) g_sz = 0;
- if (glXGetConfig(mDisplay, gl_vinfo, GLX_BLUE_SIZE, &b_sz) != 0) b_sz = 0;
- if (glXGetConfig(mDisplay, gl_vinfo, GLX_ALPHA_SIZE, &a_sz) != 0) a_sz = 0;
+ }
+ break;
#endif
+#ifdef CONFIG_X11
+ case GLTYPE_X11:
+ if (glXGetConfig(mDisplay, glctx.vinfo.x11, GLX_RED_SIZE, &r_sz) != 0) r_sz = 0;
+ if (glXGetConfig(mDisplay, glctx.vinfo.x11, GLX_GREEN_SIZE, &g_sz) != 0) g_sz = 0;
+ if (glXGetConfig(mDisplay, glctx.vinfo.x11, GLX_BLUE_SIZE, &b_sz) != 0) b_sz = 0;
+ if (glXGetConfig(mDisplay, glctx.vinfo.x11, GLX_ALPHA_SIZE, &a_sz) != 0) a_sz = 0;
+ break;
+#endif
+ }
rgb_sz=r_sz+g_sz+b_sz;
if(rgb_sz<=0) rgb_sz=24;
@@ -616,7 +616,7 @@ config(uint32_t width, uint32_t height, uint32_t d_width, uint32_t d_height, uin
#endif
return -1;
- if (setGlWindow(&gl_vinfo, &gl_context, vo_window) == SET_WINDOW_FAILED)
+ if (glctx.setGlWindow(&glctx) == SET_WINDOW_FAILED)
return -1;
glVersion = glGetString(GL_VERSION);
@@ -697,7 +697,7 @@ static void check_events(void)
}
}
#endif
- e=vo_check_events();
+ e=glctx.check_events();
if(e&VO_EVENT_RESIZE) resize(vo_dwidth, vo_dheight);
if(e&VO_EVENT_EXPOSE && int_pause) flip_page();
}
@@ -716,7 +716,7 @@ flip_page(void)
// glFlush();
if (use_glFinish)
glFinish();
- swapGlBuffers();
+ glctx.swapGlBuffers(&glctx);
if (aspect_scaling()) // Avoid flickering borders in fullscreen mode
glClear (GL_COLOR_BUFFER_BIT);
@@ -813,12 +813,11 @@ static void
uninit(void)
{
if ( !vo_config_count ) return;
- releaseGlContext(&gl_vinfo, &gl_context);
if (texgrid) {
free(texgrid);
texgrid = NULL;
}
- vo_uninit();
+ uninit_mpglcontext(&glctx);
}
static const opt_t subopts[] = {
@@ -829,7 +828,11 @@ static const opt_t subopts[] = {
static int preinit(const char *arg)
{
+ enum MPGLType gltype = GLTYPE_X11;
// set defaults
+#ifdef GL_WIN32
+ gltype = GLTYPE_W32;
+#endif
use_yuv = 0;
use_glFinish = 1;
if (subopt_parse(arg, subopts) != 0) {
@@ -849,7 +852,7 @@ static int preinit(const char *arg)
"\n" );
return -1;
}
- if( !vo_init() ) return -1; // Can't open X11
+ if(!init_mpglcontext(&glctx, gltype)) return -1;
return 0;
}
@@ -863,16 +866,16 @@ static int control(uint32_t request, void *data)
case VOCTRL_QUERY_FORMAT:
return query_format(*((uint32_t*)data));
case VOCTRL_ONTOP:
- vo_gl_ontop();
+ glctx.ontop();
return VO_TRUE;
case VOCTRL_FULLSCREEN:
- vo_fullscreen();
- if (setGlWindow(&gl_vinfo, &gl_context, vo_window) == SET_WINDOW_REINIT)
+ glctx.fullscreen();
+ if (glctx.setGlWindow(&glctx) == SET_WINDOW_REINIT)
initGl(vo_dwidth, vo_dheight);
resize(vo_dwidth, vo_dheight);
return VO_TRUE;
case VOCTRL_BORDER:
- vo_gl_border();
+ glctx.border();
return VO_TRUE;
case VOCTRL_GET_PANSCAN:
return VO_TRUE;
@@ -892,7 +895,7 @@ static int control(uint32_t request, void *data)
}
#endif
case VOCTRL_UPDATE_SCREENINFO:
- update_xinerama_info();
+ glctx.update_xinerama_info();
return VO_TRUE;
}
return VO_NOTIMPL;
diff --git a/stream/tvi_v4l2.c b/stream/tvi_v4l2.c
index 1472d7b6d9..6166a1fe16 100644
--- a/stream/tvi_v4l2.c
+++ b/stream/tvi_v4l2.c
@@ -613,7 +613,7 @@ static int vbi_init(priv_t* priv,char* device)
close(vbi_fd);
return TVI_CONTROL_FALSE;
}
- if(!cap.capabilities & V4L2_CAP_VBI_CAPTURE){
+ if(!(cap.capabilities & V4L2_CAP_VBI_CAPTURE)){
mp_msg(MSGT_TV,MSGL_ERR,"vbi: %s does not support VBI capture\n",priv->vbi_dev);
close(vbi_fd);
return TVI_CONTROL_FALSE;
diff --git a/tremor/misc.h b/tremor/misc.h
index 8a235d657b..541019a5bd 100644
--- a/tremor/misc.h
+++ b/tremor/misc.h
@@ -18,6 +18,7 @@
#ifndef _V_RANDOM_H_
#define _V_RANDOM_H_
#include "ivorbiscodec.h"
+#include "codec_internal.h"
#include "os_types.h"
#include "asm_arm.h"
@@ -29,6 +30,7 @@
/* 64 bit multiply */
#include <sys/types.h>
+#include <stdlib.h>
#include "config.h"
#if !HAVE_BIGENDIAN
diff --git a/tremor/tremor.diff b/tremor/tremor.diff
index 61e31c751a..c877b953d7 100644
--- a/tremor/tremor.diff
+++ b/tremor/tremor.diff
@@ -1,9 +1,18 @@
--- misc.h 2005-01-04 16:29:01.000000000 +0100
+++ misc.h 2004-12-30 13:09:20.000000000 +0100
-@@ -29,8 +29,9 @@
+@@ -18,6 +18,7 @@
+ #ifndef _V_RANDOM_H_
+ #define _V_RANDOM_H_
+ #include "ivorbiscodec.h"
++#include "codec_internal.h"
+ #include "os_types.h"
+
+ #include "asm_arm.h"
+@@ -29,8 +30,10 @@
/* 64 bit multiply */
#include <sys/types.h>
++#include <stdlib.h>
+#include "config.h"
-#if BYTE_ORDER==LITTLE_ENDIAN
@@ -11,7 +20,7 @@
union magic {
struct {
ogg_int32_t lo;
-@@ -38,9 +39,7 @@
+@@ -38,9 +41,7 @@
} halves;
ogg_int64_t whole;
};
diff --git a/vidix/AsmMacros.h b/vidix/AsmMacros.h
index 8cf052b916..da4e3b150b 100644
--- a/vidix/AsmMacros.h
+++ b/vidix/AsmMacros.h
@@ -77,8 +77,6 @@
#include "sysdep/AsmMacros_arm32.h"
#elif defined(__powerpc__)
#include "sysdep/AsmMacros_powerpc.h"
-#elif defined(__sh__)
-#include <sys/io.h>
#else
#include "sysdep/AsmMacros_x86.h"
#endif
diff --git a/vidix/pci_db2c.awk b/vidix/pci_db2c.awk
index 1f948a5d76..039bf0f55a 100644..100755
--- a/vidix/pci_db2c.awk
+++ b/vidix/pci_db2c.awk
@@ -1,9 +1,8 @@
+#!/usr/bin/awk -f
# This file converts given pci.db to "C" source and header files
# For latest version of pci ids see: http://pciids.sf.net
# Copyright 2002 Nick Kurshev
#
-# Usage: awk -f pci_db2c.awk pci.db
-#
# Tested with Gawk v 3.0.x and Mawk 1.3.3
# But it should work with standard Awk implementations (hopefully).
# (Nobody tested it with Nawk, but it should work, too).
@@ -28,7 +27,7 @@ BEGIN {
if(ARGC != 3) {
# check for arguments:
- print "Usage awk -f pci_db2c.awk pci.db (and make sure pci.db file exists first)";
+ print "Usage ./pci_db2c.awk pci.db (and make sure pci.db file exists first)";
exit(1);
}
in_file = ARGV[1];
diff --git a/vidix/sh_veu_vid.c b/vidix/sh_veu_vid.c
index 7ce49b4a94..cc45e32d86 100644
--- a/vidix/sh_veu_vid.c
+++ b/vidix/sh_veu_vid.c
@@ -1,6 +1,6 @@
/*
* VIDIX driver for SuperH Mobile VEU hardware block.
- * Copyright (C) 2008 Magnus Damm
+ * Copyright (C) 2008, 2009 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.
@@ -179,8 +179,7 @@ static int get_fb_info(char *device, struct fb_info *fip)
memset(iomem, 0, fip->line_length * fip->height);
munmap(iomem, fip->size);
- close(fd);
- return 0;
+ return fd;
}
#define VESTR 0x00 /* start register */
@@ -220,6 +219,8 @@ static int get_fb_info(char *device, struct fb_info *fip)
#define VCOFFR 0x224 /* color conversion offset */
#define VCBR 0x228 /* color conversion clip */
+#define VRPBR 0xc8 /* resize passband */
+
/* Helper functions for reading registers. */
static unsigned long read_reg(struct uio_map *ump, int reg_offs)
@@ -268,6 +269,7 @@ struct sh_veu_plane {
static struct sh_veu_plane _src, _dst;
static vidix_playback_t my_info;
+static int fb_fd;
static int sh_veu_probe(int verbose, int force)
{
@@ -276,6 +278,7 @@ static int sh_veu_probe(int verbose, int force)
ret = get_fb_info("/dev/fb0", &fbi);
if (ret < 0)
return ret;
+ fb_fd = ret;
if (fbi.bpp != 16) {
printf("sh_veu: only 16bpp supported\n");
@@ -315,18 +318,26 @@ static void sh_veu_wait_irq(vidix_playback_t *info)
read(uio_dev.fd, &n_pending, sizeof(unsigned long));
write_reg(&uio_mmio, 0x100, VEVTR); /* ack int, write 0 to bit 0 */
+
+ /* flush framebuffer to handle deferred io case */
+ fsync(fb_fd);
}
static int sh_veu_is_veu2h(void)
{
- return uio_mmio.size > 0xb8;
+ return uio_mmio.size == 0x27c;
+}
+
+static int sh_veu_is_veu3f(void)
+{
+ return uio_mmio.size == 0xcc;
}
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;
+ unsigned long fixpoint, mant, frac, value, rep, vb;
/* calculate FRAC and MANT */
do {
@@ -398,6 +409,34 @@ static unsigned long sh_veu_do_scale(struct uio_map *ump,
}
write_reg(ump, value, VRFSR);
+ /* VEU3F needs additional VRPBR register handling */
+ if (sh_veu_is_veu3f()) {
+ if (size_out > size_in)
+ vb = 64;
+ else {
+ if ((mant >= 8) && (mant < 16))
+ value = 4;
+ else if ((mant >= 4) && (mant < 8))
+ value = 2;
+ else
+ value = 1;
+
+ vb = 64 * 4096 * value;
+ vb /= 4096 * mant + frac;
+ }
+
+ /* set resize passband register */
+ value = read_reg(ump, VRPBR);
+ if (vertical) {
+ value &= ~0xffff0000;
+ value |= vb << 16;
+ } else {
+ value &= ~0xffff;
+ value |= vb;
+ }
+ write_reg(ump, value, VRPBR);
+ }
+
return (((size_in * crop_out) / size_out) + 0x03) & ~0x03;
}
@@ -486,6 +525,7 @@ static int sh_veu_init(void)
static void sh_veu_destroy(void)
{
+ close(fb_fd);
}
static int sh_veu_get_caps(vidix_capability_t *to)
diff --git a/vidix/sysdep/pci_linux.c b/vidix/sysdep/pci_linux.c
index 6accf0885d..62ccc9bd93 100644
--- a/vidix/sysdep/pci_linux.c
+++ b/vidix/sysdep/pci_linux.c
@@ -31,7 +31,7 @@
//#include <sys/perm.h> doesn't exist on libc5 systems
int iopl();
#else
-#if !defined(__sparc__) && !defined(__powerpc__) && !defined(__x86_64__)
+#if !defined(__sparc__) && !defined(__powerpc__) && !defined(__x86_64__) && !defined(__sh__)
#include <sys/io.h>
#endif
#endif