[MPlayer-cvslog] CVS: main/libmpcodecs vd.c, 1.81, 1.82 ve_divx4.c, 1.16, 1.17 ve_lavc.c, 1.110, 1.111 ve_libdv.c, 1.11, 1.12 ve_nuv.c, 1.4, 1.5 ve_qtvideo.c, 1.12, 1.13 ve_raw.c, 1.4, 1.5 ve_vfw.c, 1.17, 1.18 ve_x264.c, 1.20, 1.21 ve_xvid.c, 1.28, 1.29 ve_xvid4.c, 1.12, 1.13 vf.c, 1.111, 1.112 vf.h, 1.26, 1.27 vfcap.h, 1.3, 1.4

Jindrich Makovicka CVS syncmail at mplayerhq.hu
Tue Mar 1 21:22:01 CET 2005


CVS change done by Jindrich Makovicka CVS

Update of /cvsroot/mplayer/main/libmpcodecs
In directory mail:/var2/tmp/cvs-serv20320/libmpcodecs

Modified Files:
	vd.c ve_divx4.c ve_lavc.c ve_libdv.c ve_nuv.c ve_qtvideo.c 
	ve_raw.c ve_vfw.c ve_x264.c ve_xvid.c ve_xvid4.c vf.c vf.h 
	vfcap.h 
Log Message:
fixes for encoding of multiple files

- do not uninitialize video encoder between files
- checks for image size & format change moved from mencoder.c to vfilters

by Oded Shimon <ods15 at ods15.dyndns.org>



Index: vd.c
===================================================================
RCS file: /cvsroot/mplayer/main/libmpcodecs/vd.c,v
retrieving revision 1.81
retrieving revision 1.82
diff -u -r1.81 -r1.82
--- vd.c	18 Dec 2004 14:06:35 -0000	1.81
+++ vd.c	1 Mar 2005 20:21:58 -0000	1.82
@@ -309,10 +309,10 @@
 
     vf->w = sh->disp_w;
     vf->h = sh->disp_h;
-    if(vf->config(vf,sh->disp_w,sh->disp_h,
-                      screen_size_x,screen_size_y,
-                      fullscreen|(vidmode<<1)|(softzoom<<2)|(flip<<3),
-                      out_fmt)==0){
+    if(vf_config_wrapper(vf,sh->disp_w,sh->disp_h,
+			 screen_size_x,screen_size_y,
+			 fullscreen|(vidmode<<1)|(softzoom<<2)|(flip<<3),
+			 out_fmt)==0){
 //                      "MPlayer",out_fmt)){
 	mp_msg(MSGT_CPLAYER,MSGL_WARN,MSGTR_CannotInitVO);
 	sh->vf_inited=-1;

Index: ve_divx4.c
===================================================================
RCS file: /cvsroot/mplayer/main/libmpcodecs/ve_divx4.c,v
retrieving revision 1.16
retrieving revision 1.17
diff -u -r1.16 -r1.17
--- ve_divx4.c	20 Jan 2005 22:53:37 -0000	1.16
+++ ve_divx4.c	1 Mar 2005 20:21:58 -0000	1.17
@@ -453,6 +453,7 @@
 
 static int vf_open(vf_instance_t *vf, char* args){
     vf->config=config;
+    vf->default_caps=VFCAP_CONSTANT;
     vf->control=control;
     vf->query_format=query_format;
     vf->put_image=put_image;

Index: ve_lavc.c
===================================================================
RCS file: /cvsroot/mplayer/main/libmpcodecs/ve_lavc.c,v
retrieving revision 1.110
retrieving revision 1.111
diff -u -r1.110 -r1.111
--- ve_lavc.c	24 Feb 2005 02:31:41 -0000	1.110
+++ ve_lavc.c	1 Mar 2005 20:21:58 -0000	1.111
@@ -923,6 +923,7 @@
 static int vf_open(vf_instance_t *vf, char* args){
     vf->uninit=uninit;
     vf->config=config;
+    vf->default_caps=VFCAP_CONSTANT;
     vf->control=control;
     vf->query_format=query_format;
     vf->put_image=put_image;

Index: ve_libdv.c
===================================================================
RCS file: /cvsroot/mplayer/main/libmpcodecs/ve_libdv.c,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -r1.11 -r1.12
--- ve_libdv.c	20 Jan 2005 22:53:37 -0000	1.11
+++ ve_libdv.c	1 Mar 2005 20:21:58 -0000	1.12
@@ -85,6 +85,7 @@
 
 static int vf_open(vf_instance_t *vf, char* args){
     vf->config=config;
+    vf->default_caps=VFCAP_CONSTANT;
     vf->control=control;
     vf->query_format=query_format;
     vf->put_image=put_image;

Index: ve_nuv.c
===================================================================
RCS file: /cvsroot/mplayer/main/libmpcodecs/ve_nuv.c,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- ve_nuv.c	20 Jan 2005 22:53:37 -0000	1.4
+++ ve_nuv.c	1 Mar 2005 20:21:58 -0000	1.5
@@ -192,6 +192,7 @@
 
 static int vf_open(vf_instance_t *vf, char* args){
   vf->config=config;
+  vf->default_caps=VFCAP_CONSTANT;
   vf->control=control;
   vf->query_format=query_format;
   vf->put_image=put_image;

Index: ve_qtvideo.c
===================================================================
RCS file: /cvsroot/mplayer/main/libmpcodecs/ve_qtvideo.c,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -r1.12 -r1.13
--- ve_qtvideo.c	20 Jan 2005 22:53:37 -0000	1.12
+++ ve_qtvideo.c	1 Mar 2005 20:21:58 -0000	1.13
@@ -278,6 +278,7 @@
 static int vf_open(vf_instance_t *vf, char* args){
     OSErr cres = 1;
     vf->config=config;
+    vf->default_caps=VFCAP_CONSTANT;
     vf->control=control;
     vf->query_format=query_format;
     vf->put_image=put_image;

Index: ve_raw.c
===================================================================
RCS file: /cvsroot/mplayer/main/libmpcodecs/ve_raw.c,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- ve_raw.c	20 Jan 2005 22:53:37 -0000	1.4
+++ ve_raw.c	1 Mar 2005 20:21:58 -0000	1.5
@@ -125,6 +125,7 @@
 
 static int vf_open(vf_instance_t *vf, char* args){
     vf->config = config;
+    vf->default_caps = VFCAP_CONSTANT;
     vf->control = control;
     vf->query_format = query_format;
     vf->put_image = put_image;

Index: ve_vfw.c
===================================================================
RCS file: /cvsroot/mplayer/main/libmpcodecs/ve_vfw.c,v
retrieving revision 1.17
retrieving revision 1.18
diff -u -r1.17 -r1.18
--- ve_vfw.c	20 Jan 2005 22:53:37 -0000	1.17
+++ ve_vfw.c	1 Mar 2005 20:21:58 -0000	1.18
@@ -251,6 +251,7 @@
 
 static int vf_open(vf_instance_t *vf, char* args){
     vf->config=config;
+    vf->default_caps=VFCAP_CONSTANT;
     vf->control=control;
     vf->query_format=query_format;
     vf->put_image=put_image;

Index: ve_x264.c
===================================================================
RCS file: /cvsroot/mplayer/main/libmpcodecs/ve_x264.c,v
retrieving revision 1.20
retrieving revision 1.21
diff -u -r1.20 -r1.21
--- ve_x264.c	27 Feb 2005 21:54:40 -0000	1.20
+++ ve_x264.c	1 Mar 2005 20:21:58 -0000	1.21
@@ -375,6 +375,7 @@
     h264_module_t *mod;
 
     vf->config = config;
+    vf->default_caps = VFCAP_CONSTANT;
     vf->control = control;
     vf->query_format = query_format;
     vf->put_image = put_image;

Index: ve_xvid.c
===================================================================
RCS file: /cvsroot/mplayer/main/libmpcodecs/ve_xvid.c,v
retrieving revision 1.28
retrieving revision 1.29
diff -u -r1.28 -r1.29
--- ve_xvid.c	20 Jan 2005 22:53:37 -0000	1.28
+++ ve_xvid.c	1 Mar 2005 20:21:58 -0000	1.29
@@ -539,6 +539,7 @@
 {
     XVID_INIT_PARAM params = { 0, 0, 0};
     vf->config = config;
+    vf->default_caps = VFCAP_CONSTANT;
     vf->control = control;
     vf->uninit = uninit;
     vf->query_format = query_format;

Index: ve_xvid4.c
===================================================================
RCS file: /cvsroot/mplayer/main/libmpcodecs/ve_xvid4.c,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -r1.12 -r1.13
--- ve_xvid4.c	20 Jan 2005 22:53:37 -0000	1.12
+++ ve_xvid4.c	1 Mar 2005 20:21:58 -0000	1.13
@@ -546,6 +546,7 @@
 
 	/* Setting libmpcodec module API pointers */
 	vf->config       = config;
+	vf->default_caps = VFCAP_CONSTANT;
 	vf->control      = control;
 	vf->uninit       = uninit;
 	vf->query_format = query_format;

Index: vf.c
===================================================================
RCS file: /cvsroot/mplayer/main/libmpcodecs/vf.c,v
retrieving revision 1.111
retrieving revision 1.112
diff -u -r1.111 -r1.112
--- vf.c	16 Feb 2005 23:46:59 -0000	1.111
+++ vf.c	1 Mar 2005 20:21:58 -0000	1.112
@@ -541,6 +541,37 @@
 	dst->qscale= src->qscale;
     }
 }
+/**
+ * \brief Video config() function wrapper
+ *
+ * Blocks config() calls with different size or format for filters
+ * with VFCAP_CONSTANT
+ *
+ * First call is redirected to vf->config.
+ *
+ * In following calls, it verifies that the configuration parameters
+ * are unchanged, and returns either success or error.
+ *
+*/
+int vf_config_wrapper(struct vf_instance_s* vf,
+		    int width, int height, int d_width, int d_height,
+		    unsigned int flags, unsigned int outfmt)
+{
+    if ((vf->default_caps&VFCAP_CONSTANT) && vf->fmt.have_configured) {
+        if ((vf->fmt.orig_width != width)
+	    || (vf->fmt.orig_height != height)
+	    || (vf->fmt.orig_fmt != outfmt)) {
+            mp_msg(MSGT_VFILTER,MSGL_FATAL,MSGTR_ResolutionDoesntMatch);
+            return 0;
+        }
+        return 1;
+    }
+    vf->fmt.have_configured = 1;
+    vf->fmt.orig_height = height;
+    vf->fmt.orig_width = width;
+    vf->fmt.orig_fmt = outfmt;
+    vf->config(vf, width, height, d_width, d_height, flags, outfmt);
+}
 
 int vf_next_config(struct vf_instance_s* vf,
         int width, int height, int d_width, int d_height,
@@ -571,7 +602,7 @@
 	vf->next=vf2;
     }
     vf->next->w = width; vf->next->h = height;
-    return vf->next->config(vf->next,width,height,d_width,d_height,voflags,outfmt);
+    return vf_config_wrapper(vf->next,width,height,d_width,d_height,voflags,outfmt);
 }
 
 int vf_next_control(struct vf_instance_s* vf, int request, void* data){

Index: vf.h
===================================================================
RCS file: /cvsroot/mplayer/main/libmpcodecs/vf.h,v
retrieving revision 1.26
retrieving revision 1.27
diff -u -r1.26 -r1.27
--- vf.h	18 Dec 2004 14:06:35 -0000	1.26
+++ vf.h	1 Mar 2005 20:21:58 -0000	1.27
@@ -19,6 +19,11 @@
     int static_idx;
 } vf_image_context_t;
 
+typedef struct vf_format_context_t {
+    int have_configured;
+    int orig_width, orig_height, orig_fmt;
+} vf_format_context_t;
+
 typedef struct vf_instance_s {
     vf_info_t* info;
     // funcs:
@@ -44,6 +49,7 @@
     // data:
     int w, h;
     vf_image_context_t imgctx;
+    vf_format_context_t fmt;
     struct vf_instance_s* next;
     mp_image_t *dmpi;
     struct vf_priv_s* priv;
@@ -99,3 +105,6 @@
 void vf_uninit_filter(vf_instance_t* vf);
 void vf_uninit_filter_chain(vf_instance_t* vf);
 
+int vf_config_wrapper(struct vf_instance_s* vf,
+		      int width, int height, int d_width, int d_height,
+		      unsigned int flags, unsigned int outfmt);

Index: vfcap.h
===================================================================
RCS file: /cvsroot/mplayer/main/libmpcodecs/vfcap.h,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- vfcap.h	9 Oct 2002 22:32:04 -0000	1.3
+++ vfcap.h	1 Mar 2005 20:21:58 -0000	1.4
@@ -24,4 +24,6 @@
 #define VFCAP_ACCEPT_STRIDE 0x400
 // filter does postprocessing (so you shouldn't scale/filter image before it)
 #define VFCAP_POSTPROC 0x800
+// filter cannot be reconfigured to different size & format
+#define VFCAP_CONSTANT 0x1000
 




More information about the MPlayer-cvslog mailing list