diff options
author | Uoti Urpala <uau@glyph.nonexistent.invalid> | 2009-12-30 00:14:20 +0200 |
---|---|---|
committer | Uoti Urpala <uau@glyph.nonexistent.invalid> | 2009-12-30 00:14:20 +0200 |
commit | dc7f1830224e1953fb07ffcc045735b2b15af310 (patch) | |
tree | 3028341d6fd07c19b8b7c78fdfd7c411cbdce573 | |
parent | 0f81e5f9732d143ab47c9b03dfd528f3a0af4aea (diff) | |
parent | a0601ed2566d132fec57dcf163372f9f341f3c13 (diff) | |
download | mpv-dc7f1830224e1953fb07ffcc045735b2b15af310.tar.bz2 mpv-dc7f1830224e1953fb07ffcc045735b2b15af310.tar.xz |
Merge svn changes up to r30104
Ignore the broken correct-pts change in r30100.
-rw-r--r-- | DOCS/man/en/mplayer.1 | 13 | ||||
-rw-r--r-- | DOCS/man/fr/mplayer.1 | 54 | ||||
-rw-r--r-- | Makefile | 6 | ||||
-rwxr-xr-x | configure | 2 | ||||
-rw-r--r-- | etc/codecs.conf | 33 | ||||
-rw-r--r-- | libmpdemux/mp_taglists.c | 1 | ||||
-rw-r--r-- | libvo/gl_common.c | 60 | ||||
-rw-r--r-- | libvo/gl_common.h | 3 | ||||
-rw-r--r-- | libvo/vo_gl.c | 54 | ||||
-rwxr-xr-x | vidix/pci_db2c.awk | 366 | ||||
-rw-r--r-- | vidix/pci_names.c | 50 | ||||
-rw-r--r-- | vidix/pci_names.h | 38 |
12 files changed, 393 insertions, 287 deletions
diff --git a/DOCS/man/en/mplayer.1 b/DOCS/man/en/mplayer.1 index 60c9ac9599..61d2e36adf 100644 --- a/DOCS/man/en/mplayer.1 +++ b/DOCS/man/en/mplayer.1 @@ -3814,6 +3814,9 @@ Values below 0 will leave it at the system default. This limits the framerate to (horizontal refresh rate / n). Requires GLX_SGI_swap_control support to work. With some (most/all?) implementations this only works in fullscreen mode. +.IPs ycbcr +Use the GL_MESA_ycbcr_texture extension to convert YUV to RGB. +In most cases this is probably slower than doing software conversion to RGB. .IPs yuv=<n> Select the type of YUV to RGB conversion. .RSss @@ -3857,9 +3860,6 @@ Provides brightness, contrast, saturation, hue and gamma control. Gamma can also be set independently for red, green and blue. Speed depends more on GPU memory bandwidth than other methods. .RE -.IPs ycbcr -Use the GL_MESA_ycbcr_texture extension to convert YUV to RGB. -In most cases this is probably slower than doing software conversion to RGB. .IPs lscale=<n> Select the scaling function to use for luminance scaling. Only valid for yuv modes 2, 3, 4 and 6. @@ -3897,6 +3897,13 @@ for customtex texture. .IPs (no)customtrect If enabled, use texture_rectangle for customtex texture. Default is disabled. +.IPs (no)mipmapgen +If enabled, mipmaps for the video are automatically generated. +This should be useful together with the customprog and the TXB +instruction to implement blur filters with a large radius. +For most OpenGL implementations this is very slow for any non-RGB +formats. +Default is disabled. .RE .sp 1 .RS diff --git a/DOCS/man/fr/mplayer.1 b/DOCS/man/fr/mplayer.1 index 2f49395c57..61ae44e954 100644 --- a/DOCS/man/fr/mplayer.1 +++ b/DOCS/man/fr/mplayer.1 @@ -1,4 +1,4 @@ -.\" synced with r29244 +.\" synced with r29731 .\" Encoding: iso-8859-1 .\" MPlayer (C) 2000-2009 MPlayer Team .\" The English man page was/is done by Gabucino, Diego Biurrun, Jonas Jermann @@ -551,10 +551,17 @@ Vous pouvez également écrire des fichiers de config spécifiques à un fichier. Si vous souhaitez avoir un fichier de config pour un fichier nommé 'film.avi', créez un fichier nommé 'film.avi.conf' contenant les options spécifiques à ce fichier et placez-le dans ~/.mplayer/. -Vous pouvez aussi mettre le fichier de configuration dans le même répertoire -que le fichier à jouer, pour autant que vous spécifiez l'option -\-use\-filedir\-conf (soit depuis la ligne de commande, soit dans le fichier -de configuration global). + +Si un tel fichier de configuration se trouve dans le même répertoire, +aucun fichier de configuration spécifique ne sera lu depuis +~/.mplayer/. + +De plus, l'option \-use\-filedir\-conf permet de définir des fichiers +de configuration spécifiques à un répertoire. + +Pour ce faire, MPlayer essaye de charger un fichier mplayer.conf +depuis le même répertoire que celui du fichier joué, et essaye ensuite +de charger un fichier de configuration spécifique. .PP .I EXEMPLE DE FICHIER DE CONFIGURATION MPLAYER\ : @@ -2444,6 +2451,11 @@ Si vous n'arrivez pas à sélectionner une des pistes de sous-titres d'un DVD, essayez avec \-vobsubid. . .TP +.B \-nosub +Désactive la sélection automatique de sous-titres (c'est ce qui se +passe par défaut avec le démultiplexeur Matroska/mkv par exemple). +. +.TP .B \-slang <code de pays[,code de langue,...]> (voir aussi l'option \-sid) Définit une liste de langues de sous-titres à afficher en priorité. Chaque format de conteneur utilise des codes de pays différents. @@ -3466,6 +3478,9 @@ uniquement) Dit à MPlayer de s'attacher à une fenêtre existante. Utile pour intégrer MPlayer dans un navigateur (avec l'extension plugger par exemple). +Cette option rempli complètement la fenêtre donnée, si bien que le +ratio d'aspect, panscan, etc. ne sont plus assurés par MPlayer et +doivent ainsi être assurés par l'application qui a créé la fenêtre. . .TP .B \-xineramascreen <\-2\-...> @@ -3800,7 +3815,8 @@ Force le mode WarpOverlay!. .IPs dive Force le mode DIVE. .IPs (no)t23 -Active le contournement pour les bugs de l'ordinateur portable T23. +Active le contournement pour les bugs de l'ordinateur portable T23 +(par défaut\ : désactivé). Essayez d'activer cette option si votre carte vidéo ne gère que l'agrandissement d'image (upscaling). .RE @@ -7719,6 +7735,28 @@ Pourcentage de pixels qui doivent être sous le seuil (par défaut: 98). Seuil en dessous duquel un pixel est considéré comme noir (par défaut: 32) .RE . +.TP +.B gradfun[=force[:rayon]] +Corrige les "effets de bande" (banding) qui se produisent parfois dans les +régions presque uniformes, dûes à la troncature de la profondeur des +couleur à 8bits. +Interpole le dégradé qui devraient se situer où les bandes sont, et +effectue un tramage. +.sp 1 +Ce filtre est destiné à être uniquement utilisé pour la lecture. +Ne l'utilisez pas avant une compression à perte, car la compression tend +à supprimer le tramage et de rétablir les bandes. +.RSs +.IPs <force> +Le delta maximum permis pour la modification d'un pixel. +Est aussi le seuil pour détecter les régions presque uniformes (par +defaut\ : 1.2). +.IPs <rayon> +Le voisinage avec lequel le dégradé doit être injecté. +Un rayon plus grand produit des dégradés plus doux, mais empêche le filtre +de modifier les pixels près des régions détaillées (par defaut\ : 16). +.RE +. . .SH "OPTIONS D'ENCODAGE GÉNÉRALES (MENCODER UNIQUEMENT)" . @@ -8273,10 +8311,6 @@ formats adaptatifs PCM \- voir la documentation HTML pour plus de details. Free Lossless Audio Codec (FLAC) .IPs "g726\ " G.726 ADPCM -.IPs libamr_nb -3GPP Adaptive Multi-Rate (AMR) narrow-band (bande étroite) -.IPs libamr_wb -3GPP Adaptive Multi-Rate (AMR) wide-band (large bande) .IPs libfaac Advanced Audio Coding (AAC) \- utilisant FAAC .IPs libmp3lame @@ -814,11 +814,11 @@ tremor/%: CFLAGS += $(CFLAGS_TREMOR_LOW) vidix/%: CFLAGS += $(CFLAGS_DHAHELPER) $(CFLAGS_SVGALIB_HELPER) -VIDIX_PCI_FILES = vidix/pci_dev_ids.c vidix/pci_ids.h vidix/pci_names.c \ - vidix/pci_names.h vidix/pci_vendors.h +VIDIX_PCI_FILES = vidix/pci_dev_ids.c vidix/pci_ids.h vidix/pci_vendor_ids.h \ + vidix/pci_vendors.h $(VIDIX_PCI_FILES): vidix/pci_db2c.awk vidix/pci.db - awk -f $^ $(VIDIX_PCIDB) + $^ $(VIDIX_PCIDB) VIDIX_DEPS = $(filter vidix/%,$(SRCS_MPLAYER:.c=.d)) VIDIX_OBJS = $(filter vidix/%,$(SRCS_MPLAYER:.c=.o)) @@ -1342,7 +1342,7 @@ else # if test -z "$_target" qnx) system_name=QNX ;; morphos) system_name=MorphOS ;; amigaos) system_name=AmigaOS ;; - mingw32msvc) system_name=MINGW32 ;; + mingw32*) system_name=MINGW32 ;; esac # We need to convert underscores so that values like k6-2 and pentium-mmx can be passed host_arch=$(echo $_target | cut -d '-' -f 1) diff --git a/etc/codecs.conf b/etc/codecs.conf index 9c7751b909..8f05bf9203 100644 --- a/etc/codecs.conf +++ b/etc/codecs.conf @@ -9,6 +9,14 @@ release 20090308 ; VIDEO CODECS ;============================================================================= +videocodec ffcdgraphics + info "FFmpeg CD-Graphics" + status working + fourcc CDGR ; internal MPlayer FourCC + driver ffmpeg + dll cdgraphics + out BGR8 + videocodec ffmvi1 info "FFmpeg Motion Pixels" status working @@ -520,6 +528,22 @@ videocodec ffcyuv dll "cyuv" out 411P +videocodec ffaura + info "Auravision Aura (libavcodec)" + status working + fourcc aura,AURA + driver ffmpeg + dll "aura" + out 411P + +videocodec ffaura2 + info "Auravision Aura 2 (libavcodec)" + status working + fourcc aur2,AUR2 + driver ffmpeg + dll "aura2" + out 422P + videocodec ffmsrle info "Microsoft RLE" status working @@ -2048,12 +2072,19 @@ videocodec vp6 info "On2 VP6 Personal Codec" status working fourcc VP60,VP61,VP62 - fourcc VP6F VP60 driver vfwex dll "vp6vfw.dll" out YUY2 out BGR32,BGR24 +videocodec vp6f + info "On2 VP6F Personal Codec" + status working + fourcc VP6F VP60 + driver vfwex + dll "vp6vfw.dll" + out YUY2,BGR32,BGR24 flip + videocodec vp7 info "On2 VP7 Personal Codec" status working diff --git a/libmpdemux/mp_taglists.c b/libmpdemux/mp_taglists.c index de3e3a707c..d40c17c34c 100644 --- a/libmpdemux/mp_taglists.c +++ b/libmpdemux/mp_taglists.c @@ -88,6 +88,7 @@ static const struct mp_AVCodecTag mp_bmp_tags[] = { { CODEC_ID_BETHSOFTVID, MKTAG('B', 'E', 'T', 'H')}, { CODEC_ID_BFI, MKTAG('B', 'F', 'I', 'V')}, { CODEC_ID_C93, MKTAG('C', '9', '3', 'V')}, + { CODEC_ID_CDGRAPHICS, MKTAG('C', 'D', 'G', 'R')}, { CODEC_ID_DNXHD, MKTAG('A', 'V', 'd', 'n')}, { CODEC_ID_DSICINVIDEO, MKTAG('D', 'C', 'I', 'V')}, { CODEC_ID_DXA, MKTAG('D', 'X', 'A', '1')}, diff --git a/libvo/gl_common.c b/libvo/gl_common.c index f9b8359906..527c891327 100644 --- a/libvo/gl_common.c +++ b/libvo/gl_common.c @@ -834,11 +834,11 @@ static const char *bilin_filt_template = "LRP yuv.%c, parmx.b, a.bbbb, a.aaaa;" static const char *bicub_filt_template_2D = - "MAD coord.xy, fragment.texcoord[%c], {%f, %f}, {0.5, 0.5};" + "MAD coord.xy, fragment.texcoord[%c], {%e, %e}, {0.5, 0.5};" "TEX parmx, coord.x, texture[%c], 1D;" - "MUL cdelta.xz, parmx.rrgg, {-%f, 0, %f, 0};" + "MUL cdelta.xz, parmx.rrgg, {-%e, 0, %e, 0};" "TEX parmy, coord.y, texture[%c], 1D;" - "MUL cdelta.yw, parmy.rrgg, {0, -%f, 0, %f};" + "MUL cdelta.yw, parmy.rrgg, {0, -%e, 0, %e};" BICUB_FILT_MAIN("2D"); static const char *bicub_filt_template_RECT = @@ -860,12 +860,12 @@ static const char *bicub_filt_template_RECT = "SUB "t".y, "t".yyyy, "s";" static const char *bicub_notex_filt_template_2D = - "MAD coord.xy, fragment.texcoord[%c], {%f, %f}, {0.5, 0.5};" + "MAD coord.xy, fragment.texcoord[%c], {%e, %e}, {0.5, 0.5};" "FRC coord.xy, coord.xyxy;" CALCWEIGHTS("parmx", "coord.xxxx") - "MUL cdelta.xz, parmx.rrgg, {-%f, 0, %f, 0};" + "MUL cdelta.xz, parmx.rrgg, {-%e, 0, %e, 0};" CALCWEIGHTS("parmy", "coord.yyyy") - "MUL cdelta.yw, parmy.rrgg, {0, -%f, 0, %f};" + "MUL cdelta.yw, parmy.rrgg, {0, -%e, 0, %e};" BICUB_FILT_MAIN("2D"); static const char *bicub_notex_filt_template_RECT = @@ -886,9 +886,9 @@ static const char *bicub_notex_filt_template_RECT = "LRP yuv.%c, parmx.b, a.rrrr, b.rrrr;" static const char *bicub_x_filt_template_2D = - "MAD coord.x, fragment.texcoord[%c], {%f}, {0.5};" + "MAD coord.x, fragment.texcoord[%c], {%e}, {0.5};" "TEX parmx, coord, texture[%c], 1D;" - "MUL cdelta.xyz, parmx.rrgg, {-%f, 0, %f};" + "MUL cdelta.xyz, parmx.rrgg, {-%e, 0, %e};" BICUB_X_FILT_MAIN("2D"); static const char *bicub_x_filt_template_RECT = @@ -898,7 +898,7 @@ static const char *bicub_x_filt_template_RECT = BICUB_X_FILT_MAIN("RECT"); static const char *unsharp_filt_template = - "PARAM dcoord%c = {%f, %f, %f, %f};" + "PARAM dcoord%c = {%e, %e, %e, %e};" "ADD coord, fragment.texcoord[%c].xyxy, dcoord%c;" "SUB coord2, fragment.texcoord[%c].xyxy, dcoord%c;" "TEX a.r, fragment.texcoord[%c], texture[%c], %s;" @@ -909,11 +909,11 @@ static const char *unsharp_filt_template = "TEX b.g, coord2.zwzw, texture[%c], %s;" "DP3 b, b, {0.25, 0.25, 0.25};" "SUB b.r, a.r, b.r;" - "MAD yuv.%c, b.r, {%f}, a.r;"; + "MAD yuv.%c, b.r, {%e}, a.r;"; static const char *unsharp_filt_template2 = - "PARAM dcoord%c = {%f, %f, %f, %f};" - "PARAM dcoord2%c = {%f, 0, 0, %f};" + "PARAM dcoord%c = {%e, %e, %e, %e};" + "PARAM dcoord2%c = {%e, 0, 0, %e};" "ADD coord, fragment.texcoord[%c].xyxy, dcoord%c;" "SUB coord2, fragment.texcoord[%c].xyxy, dcoord%c;" "TEX a.r, fragment.texcoord[%c], texture[%c], %s;" @@ -933,13 +933,13 @@ static const char *unsharp_filt_template2 = "TEX b.g, coord2.zwzw, texture[%c], %s;" "DP4 b.r, b, {-0.1171875, -0.1171875, -0.1171875, -0.09765625};" "MAD b.r, a.r, {0.859375}, b.r;" - "MAD yuv.%c, b.r, {%f}, a.r;"; + "MAD yuv.%c, b.r, {%e}, a.r;"; static const char *yuv_prog_template = - "PARAM ycoef = {%.4f, %.4f, %.4f};" - "PARAM ucoef = {%.4f, %.4f, %.4f};" - "PARAM vcoef = {%.4f, %.4f, %.4f};" - "PARAM offsets = {%.4f, %.4f, %.4f};" + "PARAM ycoef = {%e, %e, %e};" + "PARAM ucoef = {%e, %e, %e};" + "PARAM vcoef = {%e, %e, %e};" + "PARAM offsets = {%e, %e, %e};" "TEMP res;" "MAD res.rgb, yuv.rrrr, ycoef, offsets;" "MAD res.rgb, yuv.gggg, ucoef, res;" @@ -947,11 +947,11 @@ static const char *yuv_prog_template = "END"; static const char *yuv_pow_prog_template = - "PARAM ycoef = {%.4f, %.4f, %.4f};" - "PARAM ucoef = {%.4f, %.4f, %.4f};" - "PARAM vcoef = {%.4f, %.4f, %.4f};" - "PARAM offsets = {%.4f, %.4f, %.4f};" - "PARAM gamma = {%.4f, %.4f, %.4f};" + "PARAM ycoef = {%e, %e, %e};" + "PARAM ucoef = {%e, %e, %e};" + "PARAM vcoef = {%e, %e, %e};" + "PARAM offsets = {%e, %e, %e};" + "PARAM gamma = {%e, %e, %e};" "TEMP res;" "MAD res.rgb, yuv.rrrr, ycoef, offsets;" "MAD res.rgb, yuv.gggg, ucoef, res;" @@ -962,10 +962,10 @@ static const char *yuv_pow_prog_template = "END"; static const char *yuv_lookup_prog_template = - "PARAM ycoef = {%.4f, %.4f, %.4f, 0};" - "PARAM ucoef = {%.4f, %.4f, %.4f, 0};" - "PARAM vcoef = {%.4f, %.4f, %.4f, 0};" - "PARAM offsets = {%.4f, %.4f, %.4f, 0.125};" + "PARAM ycoef = {%e, %e, %e, 0};" + "PARAM ucoef = {%e, %e, %e, 0};" + "PARAM vcoef = {%e, %e, %e, 0};" + "PARAM offsets = {%e, %e, %e, 0.125};" "TEMP res;" "MAD res, yuv.rrrr, ycoef, offsets;" "MAD res.rgb, yuv.gggg, ucoef, res;" @@ -1093,7 +1093,7 @@ static void create_conv_textures(gl_conversion_params_t *params, int *texu, char switch (conv) { case YUV_CONVERSION_FRAGMENT: case YUV_CONVERSION_FRAGMENT_POW: - break; + break; case YUV_CONVERSION_FRAGMENT_LOOKUP: texs[0] = (*texu)++; ActiveTexture(GL_TEXTURE0 + texs[0]); @@ -1409,6 +1409,8 @@ void glSetupYUVConversion(gl_conversion_params_t *params) { case YUV_CONVERSION_FRAGMENT_POW: glSetupYUVFragprog(params); break; + case YUV_CONVERSION_NONE: + break; default: mp_msg(MSGT_VO, MSGL_ERR, "[gl] unknown conversion type %i\n", YUV_CONVERSION(params->type)); } @@ -1421,7 +1423,6 @@ void glSetupYUVConversion(gl_conversion_params_t *params) { * \ingroup glconversion */ void glEnableYUVConversion(GLenum target, int type) { - if (type <= 0) return; switch (YUV_CONVERSION(type)) { case YUV_CONVERSION_COMBINERS: ActiveTexture(GL_TEXTURE1); @@ -1443,6 +1444,7 @@ void glEnableYUVConversion(GLenum target, int type) { case YUV_CONVERSION_FRAGMENT_LOOKUP: case YUV_CONVERSION_FRAGMENT_POW: case YUV_CONVERSION_FRAGMENT: + case YUV_CONVERSION_NONE: Enable(GL_FRAGMENT_PROGRAM); break; } @@ -1455,7 +1457,6 @@ void glEnableYUVConversion(GLenum target, int type) { * \ingroup glconversion */ void glDisableYUVConversion(GLenum target, int type) { - if (type <= 0) return; switch (YUV_CONVERSION(type)) { case YUV_CONVERSION_COMBINERS: ActiveTexture(GL_TEXTURE1); @@ -1477,6 +1478,7 @@ void glDisableYUVConversion(GLenum target, int type) { case YUV_CONVERSION_FRAGMENT_LOOKUP: case YUV_CONVERSION_FRAGMENT_POW: case YUV_CONVERSION_FRAGMENT: + case YUV_CONVERSION_NONE: Disable(GL_FRAGMENT_PROGRAM); break; } diff --git a/libvo/gl_common.h b/libvo/gl_common.h index 654f13caf9..e556718ec0 100644 --- a/libvo/gl_common.h +++ b/libvo/gl_common.h @@ -69,6 +69,9 @@ #ifndef GL_CLAMP_TO_EDGE #define GL_CLAMP_TO_EDGE 0x812F #endif +#ifndef GL_GENERATE_MIPMAP +#define GL_GENERATE_MIPMAP 0x8191 +#endif #ifndef GL_REGISTER_COMBINERS_NV #define GL_REGISTER_COMBINERS_NV 0x8522 #endif diff --git a/libvo/vo_gl.c b/libvo/vo_gl.c index fab076355f..ad23b7963a 100644 --- a/libvo/vo_gl.c +++ b/libvo/vo_gl.c @@ -86,6 +86,9 @@ static int osd_color; static int use_aspect; static int use_ycbcr; +#define MASK_ALL_YUV (~(1 << YUV_CONVERSION_NONE)) +#define MASK_NOT_COMBINERS (~((1 << YUV_CONVERSION_NONE) | (1 << YUV_CONVERSION_COMBINERS) | (1 << YUV_CONVERSION_COMBINERS_ATI))) +#define MASK_GAMMA_SUPPORT (MASK_NOT_COMBINERS & ~(1 << YUV_CONVERSION_FRAGMENT)) static int use_yuv; static int lscale; static int cscale; @@ -120,6 +123,7 @@ static char *custom_prog; static char *custom_tex; static int custom_tlin; static int custom_trect; +static int mipmap_gen; static int int_pause; static int eq_bri = 0; @@ -458,6 +462,7 @@ static void autodetectGlExtensions(void) { * set global gl-related variables to their default values */ static int initGl(uint32_t d_width, uint32_t d_height) { + int scale_type = mipmap_gen ? GL_LINEAR_MIPMAP_NEAREST : GL_LINEAR; autodetectGlExtensions(); texSize(image_width, image_height, &texture_width, &texture_height); @@ -483,29 +488,34 @@ static int initGl(uint32_t d_width, uint32_t d_height) { BindTexture(GL_TEXTURE_3D, default_texs[i + 14]); } ActiveTexture(GL_TEXTURE1); - glCreateClearTex(gl_target, gl_texfmt, gl_format, gl_type, GL_LINEAR, + glCreateClearTex(gl_target, gl_texfmt, gl_format, gl_type, scale_type, texture_width / 2, texture_height / 2, 128); + if (mipmap_gen) + TexParameteri(gl_target, GL_GENERATE_MIPMAP, GL_TRUE); ActiveTexture(GL_TEXTURE2); - glCreateClearTex(gl_target, gl_texfmt, gl_format, gl_type, GL_LINEAR, + glCreateClearTex(gl_target, gl_texfmt, gl_format, gl_type, scale_type, texture_width / 2, texture_height / 2, 128); - switch (use_yuv) { - case YUV_CONVERSION_FRAGMENT_LOOKUP: - case YUV_CONVERSION_FRAGMENT_POW: - case YUV_CONVERSION_FRAGMENT: - if (!GenPrograms || !BindProgram) { - mp_msg(MSGT_VO, MSGL_ERR, "[gl] fragment program functions missing!\n"); - break; - } + if (mipmap_gen) + TexParameteri(gl_target, GL_GENERATE_MIPMAP, GL_TRUE); + ActiveTexture(GL_TEXTURE0); + BindTexture(gl_target, 0); + } + if (image_format == IMGFMT_YV12 || custom_prog) + { + if ((MASK_NOT_COMBINERS & (1 << use_yuv)) || custom_prog) { + if (!GenPrograms || !BindProgram) { + mp_msg(MSGT_VO, MSGL_ERR, "[gl] fragment program functions missing!\n"); + } else { GenPrograms(1, &fragprog); BindProgram(GL_FRAGMENT_PROGRAM, fragprog); - break; + } } - ActiveTexture(GL_TEXTURE0); - BindTexture(gl_target, 0); update_yuvconv(); } - glCreateClearTex(gl_target, gl_texfmt, gl_format, gl_type, GL_LINEAR, + glCreateClearTex(gl_target, gl_texfmt, gl_format, gl_type, scale_type, texture_width, texture_height, 0); + if (mipmap_gen) + TexParameteri(gl_target, GL_GENERATE_MIPMAP, GL_TRUE); resize(d_width, d_height); @@ -658,14 +668,14 @@ static void do_render(void) { // BindTexture(GL_TEXTURE_2D, texture_id); Color3f(1,1,1); - if (image_format == IMGFMT_YV12) + if (image_format == IMGFMT_YV12 || custom_prog) glEnableYUVConversion(gl_target, yuvconvtype); glDrawTex(0, 0, image_width, image_height, 0, 0, image_width, image_height, texture_width, texture_height, use_rectangle == 1, image_format == IMGFMT_YV12, mpi_flipped ^ vo_flipped); - if (image_format == IMGFMT_YV12) + if (image_format == IMGFMT_YV12 || custom_prog) glDisableYUVConversion(gl_target, yuvconvtype); } @@ -982,6 +992,7 @@ static const opt_t subopts[] = { {"customtex", OPT_ARG_MSTRZ,&custom_tex, NULL}, {"customtlin", OPT_ARG_BOOL, &custom_tlin, NULL}, {"customtrect", OPT_ARG_BOOL, &custom_trect, NULL}, + {"mipmapgen", OPT_ARG_BOOL, &mipmap_gen, NULL}, {"osdcolor", OPT_ARG_INT, &osd_color, NULL}, {NULL} }; @@ -1013,6 +1024,7 @@ static int preinit(const char *arg) custom_tex = NULL; custom_tlin = 1; custom_trect = 0; + mipmap_gen = 0; osd_color = 0xffffff; if (subopt_parse(arg, subopts) != 0) { mp_msg(MSGT_VO, MSGL_FATAL, @@ -1043,6 +1055,8 @@ static int preinit(const char *arg) " Interval in displayed frames between to buffer swaps.\n" " 1 is equivalent to enable VSYNC, 0 to disable VSYNC.\n" " Requires GLX_SGI_swap_control support to work.\n" + " ycbcr\n" + " also try to use the GL_MESA_ycbcr_texture extension\n" " yuv=<n>\n" " 0: use software YUV to RGB conversion.\n" " 1: use register combiners (nVidia only, for older cards).\n" @@ -1070,10 +1084,10 @@ static int preinit(const char *arg) " use GL_NEAREST scaling for customtex texture\n" " customtrect\n" " use texture_rectangle for customtex texture\n" + " mipmapgen\n" + " generate mipmaps for the video image (use with TXB in customprog)\n" " osdcolor=<0xAARRGGBB>\n" " use the given color for the OSD\n" - " ycbcr\n" - " also try to use the GL_MESA_ycbcr_texture extension\n" "\n" ); return -1; } @@ -1092,10 +1106,6 @@ static int preinit(const char *arg) return 0; } -#define MASK_ALL_YUV (~(1 << YUV_CONVERSION_NONE)) -#define MASK_NOT_COMBINERS (~((1 << YUV_CONVERSION_NONE) | (1 << YUV_CONVERSION_COMBINERS) | (1 << YUV_CONVERSION_COMBINERS_ATI))) -#define MASK_GAMMA_SUPPORT (MASK_NOT_COMBINERS & ~(1 << YUV_CONVERSION_FRAGMENT)) - static const struct { const char *name; int *value; diff --git a/vidix/pci_db2c.awk b/vidix/pci_db2c.awk index 039bf0f55a..976dd76640 100755 --- a/vidix/pci_db2c.awk +++ b/vidix/pci_db2c.awk @@ -25,266 +25,196 @@ BEGIN { - if(ARGC != 3) { -# check for arguments: - print "Usage ./pci_db2c.awk pci.db (and make sure pci.db file exists first)"; - exit(1); + if (ARGC != 3) { + # check for arguments: + print "Usage ./pci_db2c.awk pci.db (and make sure pci.db file exists first)"; + exit(1); } in_file = ARGV[1]; with_pci_db = ARGV[2]; - vendor_file = "vidix/pci_vendors.h"; - ids_file = "vidix/pci_ids.h" - name_file = "vidix/pci_names.c" - name_h_file = "vidix/pci_names.h" - dev_ids_file = "vidix/pci_dev_ids.c" - line=0; -# print out head lines - print_head(vendor_file); - print_head(ids_file); - print_head(name_file); - print_head(name_h_file); - print_head(dev_ids_file); - print_includes(dev_ids_file); - print "#ifndef MPLAYER_PCI_VENDORS_H" >vendor_file - print "#define MPLAYER_PCI_VENDORS_H">vendor_file - print "" >vendor_file - print "#ifndef MPLAYER_PCI_IDS_H" >ids_file - print "#define MPLAYER_PCI_IDS_H">ids_file - print "" >ids_file - print "#include \"pci_vendors.h\"">ids_file - print "" >ids_file + dev_ids_c_file = "vidix/pci_dev_ids.c" + ids_h_file = "vidix/pci_ids.h" + vendor_ids_h_file = "vidix/pci_vendor_ids.h" + vendors_h_file = "vidix/pci_vendors.h"; + # print out head lines + print_head(vendors_h_file); + print_head(ids_h_file); + print_head(vendor_ids_h_file); + print_head(dev_ids_c_file); + print "#include <stdlib.h>" > dev_ids_c_file; + print "#include \"pci_names.h\"" > dev_ids_c_file; - print "#ifndef MPLAYER_PCI_NAMES_H" >name_h_file - print "#define MPLAYER_PCI_NAMES_H">name_h_file - print "" >name_h_file - print_name_struct(name_h_file); - print "#include <stddef.h>">name_file - print "#include \"pci_names.h\"">name_file + print_guards_start(vendors_h_file); + print_guards_start(ids_h_file); + print "#include \"pci_vendors.h\"" > ids_h_file + print "" > ids_h_file + + print "#include <stddef.h>" > vendor_ids_h_file + print "#include \"pci_names.h\"" > vendor_ids_h_file if (with_pci_db) { - print "#include \"pci_dev_ids.c\"">name_file - print "">name_file - print "static struct vendor_id_s vendor_ids[] = {">name_file + print "#include \"pci_dev_ids.c\"" > vendor_ids_h_file + print "" > vendor_ids_h_file + print "static struct vendor_id_s vendor_ids[] = {" > vendor_ids_h_file } - first_pass=1; + first_pass = 1; init_name_db(); - while(getline <in_file) - { -# count up lines - line++; - n=split($0, field, "[\t]"); - name_field = kill_double_quoting(field[3]) - if(field[1] == "v" && length(field[3])>0 && field[4] == "0") - { - init_device_db() - svend_name = get_short_vendor_name(field[3]) - printf("#define VENDOR_%s\t", svend_name) >vendor_file; - if(length(svend_name) < 9) printf("\t") >vendor_file; - printf("0x%s /*%s*/\n",field[2], name_field) >vendor_file; - if (with_pci_db) printf("{ 0x%s, \"%s\", dev_lst_%s },\n",field[2], name_field, field[2]) >name_file; - printf("/* Vendor: %s: %s */\n", field[2], name_field) > ids_file - if(first_pass == 1) { first_pass=0; } - else { print "{ 0xFFFF, NULL }\n};" >dev_ids_file; } - printf("static const struct device_id_s dev_lst_%s[]={\n", field[2])>dev_ids_file - } - if(field[1] == "d" && length(field[3])>0 && field[4] == "0") - { - sdev_name = get_short_device_name(field[3]) - full_name = sprintf("#define DEVICE_%s_%s", svend_name, sdev_name); - printf("%s\t", full_name) >ids_file - if(length(full_name) < 9) printf("\t") >ids_file; - if(length(full_name) < 17) printf("\t") >ids_file; - if(length(full_name) < 25) printf("\t") >ids_file; - if(length(full_name) < 32) printf("\t") >ids_file; - if(length(full_name) < 40) printf("\t") >ids_file; - if(length(full_name) < 48) printf("\t") >ids_file; - printf("0x%s /*%s*/\n", substr(field[2], 5), name_field) >ids_file - printf("{ 0x%s, \"%s\" },\n", substr(field[2], 5), name_field) >dev_ids_file - } - if(field[1] == "s" && length(field[3])>0 && field[4] == "0") - { - subdev_name = get_short_subdevice_name(field[3]) - full_name = sprintf("#define SUBDEVICE_%s_%s", svend_name, subdev_name) - printf("\t%s\t", full_name) >ids_file - if(length(full_name) < 9) printf("\t") >ids_file; - if(length(full_name) < 17) printf("\t") >ids_file; - if(length(full_name) < 25) printf("\t") >ids_file; - if(length(full_name) < 32) printf("\t") >ids_file; - if(length(full_name) < 40) printf("\t") >ids_file; - printf("0x%s /*%s*/\n", substr(field[2], 9), name_field) >ids_file - } + while (getline < in_file) { + n = split($0, field, "[\t]"); + name_field = kill_double_quoting(field[3]) + if (field[1] == "v" && length(field[3]) > 0 && field[4] == "0") { + init_device_db() + svend_name = get_short_vendor_name(field[3]) + printf("#define VENDOR_%s\t", svend_name) > vendors_h_file; + if (length(svend_name) < 9) printf("\t") > vendors_h_file; + printf("0x%s /*%s*/\n", field[2], name_field) > vendors_h_file; + if (with_pci_db) printf("{ 0x%s, \"%s\", dev_lst_%s },\n", field[2], name_field, field[2]) > vendor_ids_h_file; + printf("/* Vendor: %s: %s */\n", field[2], name_field) > ids_h_file + if (first_pass == 1) first_pass = 0; + else print "{ 0xFFFF, NULL }\n};" > dev_ids_c_file; + printf("static const struct device_id_s dev_lst_%s[] = {\n", field[2])> dev_ids_c_file + } + if (field[1] == "d" && length(field[3]) > 0 && field[4] == "0") { + sdev_name = get_short_device_name(field[3]) + full_name = sprintf("#define DEVICE_%s_%s", svend_name, sdev_name); + printf("%s\t", full_name) > ids_h_file + if (length(full_name) < 9) printf("\t") > ids_h_file; + if (length(full_name) < 17) printf("\t") > ids_h_file; + if (length(full_name) < 25) printf("\t") > ids_h_file; + if (length(full_name) < 32) printf("\t") > ids_h_file; + if (length(full_name) < 40) printf("\t") > ids_h_file; + if (length(full_name) < 48) printf("\t") > ids_h_file; + printf("0x%s /*%s*/\n", substr(field[2], 5), name_field) > ids_h_file + printf("{ 0x%s, \"%s\" },\n", substr(field[2], 5), name_field) > dev_ids_c_file + } + if (field[1] == "s" && length(field[3]) > 0 && field[4] == "0") { + subdev_name = get_short_subdevice_name(field[3]) + full_name = sprintf("#define SUBDEVICE_%s_%s", svend_name, subdev_name) + printf("\t%s\t", full_name) > ids_h_file + if (length(full_name) < 9) printf("\t") > ids_h_file; + if (length(full_name) < 17) printf("\t") > ids_h_file; + if (length(full_name) < 25) printf("\t") > ids_h_file; + if (length(full_name) < 32) printf("\t") > ids_h_file; + if (length(full_name) < 40) printf("\t") > ids_h_file; + printf("0x%s /*%s*/\n", substr(field[2], 9), name_field) > ids_h_file + } } - #print "Total lines parsed:", line; - print "">vendor_file - print "#endif /* MPLAYER_PCI_VENDORS_H */">vendor_file - print "">ids_file - print "#endif /* MPLAYER_PCI_IDS_H */">ids_file - print "">name_h_file - print "#endif /* MPLAYER_PCI_NAMES_H */">name_h_file - if (with_pci_db) print "};">name_file - print "{ 0xFFFF, NULL }" >dev_ids_file; - print "};">dev_ids_file - print_func_bodies(name_file); + print_guards_end(vendors_h_file); + print_guards_end(ids_h_file); + if (with_pci_db) print "};" > vendor_ids_h_file + print "{ 0xFFFF, NULL }" > dev_ids_c_file; + print "};" > dev_ids_c_file } -function print_includes(out_file) +function construct_guard_name(out_file) { - print "#include <stdlib.h>" >out_file; - print "#include \"pci_names.h\"" >out_file; - return; + split(out_file, path_components, "/"); + sub(".h","_h", path_components[2]); + return "MPLAYER_" toupper(path_components[2]); } -function print_head( out_file) +function print_guards_start(out_file) { - print "/*" >out_file; - printf(" * File: %s\n", out_file) >out_file; - printf(" * This file was generated automatically. Don't modify it.\n") >out_file; - print "*/" >out_file; - return; + guard_name = construct_guard_name(out_file); + printf("#ifndef %s\n", guard_name) > out_file + printf("#define %s\n", guard_name) > out_file + print "" > out_file } -function print_name_struct(out_file) +function print_guards_end(out_file) { - print "">out_file - print "struct device_id_s" >out_file - print "{" >out_file - print "\tunsigned short\tid;" >out_file - print "\tconst char *\tname;" >out_file - print "};" >out_file - print "">out_file - print "struct vendor_id_s" >out_file - print "{" >out_file - print "\tunsigned short\tid;" >out_file - print "\tconst char *\tname;" >out_file - print "\tconst struct device_id_s *\tdev_list;" >out_file - print "};" >out_file - print "const char *pci_vendor_name(unsigned short id);">out_file - print "const char *pci_device_name(unsigned short vendor_id, unsigned short device_id);">out_file - print "">out_file - return + guard_name = construct_guard_name(out_file); + print "" > out_file + printf("#endif /* %s */\n", guard_name) > out_file } -function print_func_bodies(out_file) +function print_head(out_file) { - print "">out_file - print "const char *pci_vendor_name(unsigned short id)" >out_file - print "{" >out_file - if (with_pci_db) { - print " unsigned i;" >out_file - print " for(i=0;i<sizeof(vendor_ids)/sizeof(struct vendor_id_s);i++)">out_file - print " {" >out_file - print "\tif(vendor_ids[i].id == id) return vendor_ids[i].name;" >out_file - print " }" >out_file - } - print " return NULL;" >out_file - print "}">out_file - print "" >out_file - print "const char *pci_device_name(unsigned short vendor_id, unsigned short device_id)" >out_file - print "{" >out_file - if (with_pci_db) { - print " unsigned i, j;" >out_file - print " for(i=0;i<sizeof(vendor_ids) |