[MPlayer-cvslog] r31331 - in trunk: DOCS/man/en/mplayer.1 libmpcodecs/vf_format.c

reimar subversion at mplayerhq.hu
Sat Jun 5 19:55:20 CEST 2010


Author: reimar
Date: Sat Jun  5 19:55:20 2010
New Revision: 31331

Log:
Extend -vf format to allow substituting the format for a compatible one
(e.g. chaning rgb24 to bgr24).

Modified:
   trunk/libmpcodecs/vf_format.c

Changes in other areas also in this revision:
Modified:
   trunk/DOCS/man/en/mplayer.1

Modified: trunk/libmpcodecs/vf_format.c
==============================================================================
--- trunk/libmpcodecs/vf_format.c	Sat Jun  5 19:45:35 2010	(r31330)
+++ trunk/libmpcodecs/vf_format.c	Sat Jun  5 19:55:20 2010	(r31331)
@@ -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 }
 };
 


More information about the MPlayer-cvslog mailing list