summaryrefslogtreecommitdiffstats
path: root/libmpcodecs
diff options
context:
space:
mode:
authorUoti Urpala <uau@glyph.nonexistent.invalid>2010-06-05 23:37:42 +0300
committerUoti Urpala <uau@glyph.nonexistent.invalid>2010-06-05 23:37:42 +0300
commit8362ad36ac2ee8dc452765a9de559b50927d14be (patch)
tree93c9ab1208e7186a03c12cf580b0bde04bca0ec7 /libmpcodecs
parentb6db3567508ea5a4313e2a4894fe96d1840fd74f (diff)
parent601d6af3ece91f65df77ed213a7eafb56e75abd1 (diff)
downloadmpv-8362ad36ac2ee8dc452765a9de559b50927d14be.tar.bz2
mpv-8362ad36ac2ee8dc452765a9de559b50927d14be.tar.xz
Merge svn changes up to r31332
Diffstat (limited to 'libmpcodecs')
-rw-r--r--libmpcodecs/vf_format.c19
-rw-r--r--libmpcodecs/vf_noformat.c1
2 files changed, 18 insertions, 2 deletions
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;
}