summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--DOCS/man/en/mplayer.113
-rw-r--r--etc/codecs.conf2
-rw-r--r--libmpcodecs/vf_format.c19
-rw-r--r--libmpcodecs/vf_noformat.c1
4 files changed, 31 insertions, 4 deletions
diff --git a/DOCS/man/en/mplayer.1 b/DOCS/man/en/mplayer.1
index 6303db7c83..05fa8a04c0 100644
--- a/DOCS/man/en/mplayer.1
+++ b/DOCS/man/en/mplayer.1
@@ -6106,7 +6106,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
@@ -6116,6 +6116,17 @@ For a list of available formats see format=fmt=help.
.RSs
.IPs <fourcc>
format name like rgb15, bgr24, yv12, etc (default: yuy2)
+.IPs <outfourcc>
+Format name that should be substituted for the output.
+If this is not 100% compatible with the <fourcc> 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/etc/codecs.conf b/etc/codecs.conf
index 10a6f12c24..2ef08582f0 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
diff --git a/libmpcodecs/vf_format.c b/libmpcodecs/vf_format.c
index 5a28801966..422956539b 100644
--- a/libmpcodecs/vf_format.c
+++ b/libmpcodecs/vf_format.c
@@ -33,27 +33,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 }
};
diff --git a/libmpcodecs/vf_noformat.c b/libmpcodecs/vf_noformat.c
index 17f7844121..b143ac0005 100644
--- a/libmpcodecs/vf_noformat.c
+++ b/libmpcodecs/vf_noformat.c
@@ -47,6 +47,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;
}