summaryrefslogtreecommitdiffstats
path: root/libmpcodecs/vf_format.c
diff options
context:
space:
mode:
authoralbeu <albeu@b3059339-0415-0410-9bf9-f77b7e298cf2>2003-03-15 20:51:35 +0000
committeralbeu <albeu@b3059339-0415-0410-9bf9-f77b7e298cf2>2003-03-15 20:51:35 +0000
commit9a78fbaa84f42f816e32c78cef2d1cde13935aa7 (patch)
tree9327dafeb449acc1903eca9fae778cae8c1bda11 /libmpcodecs/vf_format.c
parentd4a3dfac98a54a368610f932d3ddd2e06f2a1033 (diff)
downloadmpv-9a78fbaa84f42f816e32c78cef2d1cde13935aa7.tar.bz2
mpv-9a78fbaa84f42f816e32c78cef2d1cde13935aa7.tar.xz
New options stuff
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@9602 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'libmpcodecs/vf_format.c')
-rw-r--r--libmpcodecs/vf_format.c32
1 files changed, 26 insertions, 6 deletions
diff --git a/libmpcodecs/vf_format.c b/libmpcodecs/vf_format.c
index 772a575478..c199f7d68d 100644
--- a/libmpcodecs/vf_format.c
+++ b/libmpcodecs/vf_format.c
@@ -10,8 +10,13 @@
#include "mp_image.h"
#include "vf.h"
-struct vf_priv_s {
+#include "m_option.h"
+#include "m_struct.h"
+
+static struct vf_priv_s {
unsigned int fmt;
+} vf_priv_dflt = {
+ IMGFMT_YUY2
};
//===========================================================================//
@@ -25,8 +30,10 @@ static int query_format(struct vf_instance_s* vf, unsigned int fmt){
static int open(vf_instance_t *vf, char* args){
vf->query_format=query_format;
vf->default_caps=0;
- vf->priv=malloc(sizeof(struct vf_priv_s));
-
+ if(!vf->priv) {
+ vf->priv=malloc(sizeof(struct vf_priv_s));
+ vf->priv->fmt=IMGFMT_YUY2;
+ }
if(args){
if(!strcasecmp(args,"444p")) vf->priv->fmt=IMGFMT_444P; else
if(!strcasecmp(args,"422p")) vf->priv->fmt=IMGFMT_422P; else
@@ -55,19 +62,32 @@ static int open(vf_instance_t *vf, char* args){
if(!strcasecmp(args,"rg4b")) vf->priv->fmt=IMGFMT_RG4B; else
if(!strcasecmp(args,"rgb1")) vf->priv->fmt=IMGFMT_RGB1; else
{ printf("Unknown format name: '%s'\n",args);return 0;}
- } else
- vf->priv->fmt=IMGFMT_YUY2;
+ }
+
return 1;
}
+#define ST_OFF(f) M_ST_OFF(struct vf_priv_s,f)
+static m_option_t vf_opts_fields[] = {
+ {"fmt", ST_OFF(fmt), CONF_TYPE_IMGFMT, 0,0 ,0, NULL},
+ { NULL, NULL, 0, 0, 0, 0, NULL }
+};
+
+static m_struct_t vf_opts = {
+ "format",
+ sizeof(struct vf_priv_s),
+ &vf_priv_dflt,
+ vf_opts_fields
+};
+
vf_info_t vf_info_format = {
"force output format",
"format",
"A'rpi",
"FIXME! get_image()/put_image()",
open,
- NULL
+ &vf_opts
};
//===========================================================================//