From 1689c3422f1ce4557cfaa184827d9a1c0962b5ea Mon Sep 17 00:00:00 2001 From: reimar Date: Sat, 5 Jun 2010 17:45:35 +0000 Subject: Fix -vf format and -vf noformat to work with slices. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@31330 b3059339-0415-0410-9bf9-f77b7e298cf2 --- libmpcodecs/vf_format.c | 1 + libmpcodecs/vf_noformat.c | 1 + 2 files changed, 2 insertions(+) diff --git a/libmpcodecs/vf_format.c b/libmpcodecs/vf_format.c index fa511e9e79..a8be4cdfef 100644 --- a/libmpcodecs/vf_format.c +++ b/libmpcodecs/vf_format.c @@ -48,6 +48,7 @@ static int query_format(struct vf_instance *vf, unsigned int fmt){ static int vf_open(vf_instance_t *vf, char *args){ vf->query_format=query_format; + vf->draw_slice=vf_next_draw_slice; vf->default_caps=0; return 1; } diff --git a/libmpcodecs/vf_noformat.c b/libmpcodecs/vf_noformat.c index f92014f88d..037800cf73 100644 --- a/libmpcodecs/vf_noformat.c +++ b/libmpcodecs/vf_noformat.c @@ -48,6 +48,7 @@ static int query_format(struct vf_instance *vf, unsigned int fmt){ static int vf_open(vf_instance_t *vf, char *args){ vf->query_format=query_format; + vf->draw_slice=vf_next_draw_slice; vf->default_caps=0; return 1; } -- cgit v1.2.3 From 7e9ff557a03e16f2a8c1ce4cf4a8786878835b88 Mon Sep 17 00:00:00 2001 From: reimar Date: Sat, 5 Jun 2010 17:55:20 +0000 Subject: Extend -vf format to allow substituting the format for a compatible one (e.g. chaning rgb24 to bgr24). git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@31331 b3059339-0415-0410-9bf9-f77b7e298cf2 --- DOCS/man/en/mplayer.1 | 13 ++++++++++++- libmpcodecs/vf_format.c | 18 ++++++++++++++++-- 2 files changed, 28 insertions(+), 3 deletions(-) diff --git a/DOCS/man/en/mplayer.1 b/DOCS/man/en/mplayer.1 index 6238b1f3b2..fe11e783f5 100644 --- a/DOCS/man/en/mplayer.1 +++ b/DOCS/man/en/mplayer.1 @@ -6101,7 +6101,7 @@ Also perform R <\-> B swapping. RGB/BGR 8 \-> 15/16/24/32bpp colorspace conversion using palette. . .TP -.B format[=fourcc] +.B format[=fourcc[:outfourcc]] Restricts the colorspace for the next filter without doing any conversion. Use together with the scale filter for a real conversion. .br @@ -6111,6 +6111,17 @@ For a list of available formats see format=fmt=help. .RSs .IPs format name like rgb15, bgr24, yv12, etc (default: yuy2) +.IPs +Format name that should be substituted for the output. +If this is not 100% compatible with the value it will crash. +.br +Valid examples: +.br +format=rgb24:bgr24 format=yuyv:yuy2 +.br +Invalid examples (will crash): +.br +format=rgb24:yv12 .RE .PD 1 . diff --git a/libmpcodecs/vf_format.c b/libmpcodecs/vf_format.c index a8be4cdfef..8969e6d759 100644 --- a/libmpcodecs/vf_format.c +++ b/libmpcodecs/vf_format.c @@ -34,28 +34,42 @@ static struct vf_priv_s { unsigned int fmt; + unsigned int outfmt; } const vf_priv_dflt = { - IMGFMT_YUY2 + IMGFMT_YUY2, + 0 }; //===========================================================================// static int query_format(struct vf_instance *vf, unsigned int fmt){ - if(fmt==vf->priv->fmt) + if(fmt==vf->priv->fmt) { + if (vf->priv->outfmt) + fmt = vf->priv->outfmt; return vf_next_query_format(vf,fmt); + } return 0; } +static int config(struct vf_instance *vf, int width, int height, + int d_width, int d_height, + unsigned flags, unsigned outfmt){ + return vf_next_config(vf, width, height, d_width, d_height, flags, vf->priv->outfmt); +} + static int vf_open(vf_instance_t *vf, char *args){ vf->query_format=query_format; vf->draw_slice=vf_next_draw_slice; vf->default_caps=0; + if (vf->priv->outfmt) + vf->config=config; return 1; } #define ST_OFF(f) M_ST_OFF(struct vf_priv_s,f) static const m_option_t vf_opts_fields[] = { {"fmt", ST_OFF(fmt), CONF_TYPE_IMGFMT, 0,0 ,0, NULL}, + {"outfmt", ST_OFF(outfmt), CONF_TYPE_IMGFMT, 0,0 ,0, NULL}, { NULL, NULL, 0, 0, 0, 0, NULL } }; -- cgit v1.2.3 From 601d6af3ece91f65df77ed213a7eafb56e75abd1 Mon Sep 17 00:00:00 2001 From: reimar Date: Sat, 5 Jun 2010 18:11:51 +0000 Subject: Update codecs.conf version again, we had quite a few additions to it. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@31332 b3059339-0415-0410-9bf9-f77b7e298cf2 --- etc/codecs.conf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/etc/codecs.conf b/etc/codecs.conf index a8bef9dfef..87036ef5a1 100644 --- a/etc/codecs.conf +++ b/etc/codecs.conf @@ -3,7 +3,7 @@ ; Before editing this file, please read DOCS/tech/codecs.conf.txt ! ;============================================================================= -release 20090308 +release 20100605 ;============================================================================= ; VIDEO CODECS -- cgit v1.2.3