[Sumover-dev] [svn commit] r3910 - in vic/branches/mpeg4: ffmpeg render

sumover-dev at cs.ucl.ac.uk sumover-dev at cs.ucl.ac.uk
Wed Nov 8 03:05:36 GMT 2006


Author: barz
Date: Wed Nov  8 03:05:10 2006
New Revision: 3910

Removed:
   vic/branches/mpeg4/ffmpeg/libavcodec-uninstalled.pc
   vic/branches/mpeg4/ffmpeg/libavcodec.pc
   vic/branches/mpeg4/ffmpeg/libavformat-uninstalled.pc
   vic/branches/mpeg4/ffmpeg/libavformat.pc
   vic/branches/mpeg4/ffmpeg/libpostproc-uninstalled.pc
   vic/branches/mpeg4/ffmpeg/libpostproc.pc
Modified:
   vic/branches/mpeg4/render/color-x11.cpp
   vic/branches/mpeg4/render/renderer-window.cpp
   vic/branches/mpeg4/render/renderer.cpp
   vic/branches/mpeg4/render/vw.cpp
   vic/branches/mpeg4/render/xvideo.h
   vic/branches/mpeg4/tcl/ui-windows.tcl

Log:


Modified: vic/branches/mpeg4/render/color-x11.cpp
==============================================================================
--- vic/branches/mpeg4/render/color-x11.cpp	(original)
+++ vic/branches/mpeg4/render/color-x11.cpp	Wed Nov  8 03:05:10 2006
@@ -1,41 +1,5 @@
-/*
- * Copyright (c) 2004 Regents of National Center of High Performance Computing.
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- *    must display the following acknowledgement:
- *      This product includes software developed by the University of
- *      California, Berkeley and the Network Research Group at
- *      Lawrence Berkeley Laboratory.
- * 4. Neither the name of the University nor of the Laboratory may be used
- *    to endorse or promote products derived from this software without
- *    specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-#ifndef lint
-static char rcsid[] =
-    "@(#) $Header: /forge/cvsroot/nchc-vic/vic/render/color-x11.cpp,v 1.1.1.1 2005/08/11 15:28:33 barz Exp $ (LBL)";
-#endif
+
+#ifdef ENABLE_SWSCALE
 
 #include <stdlib.h>
 #include <stdio.h>
@@ -43,8 +7,8 @@
 #include "renderer-window.h"
 #include "vw.h"
 #include "renderer.h"
-#include "postproc/swscale.h"
-#include "postproc/cpudetect.h"
+#include "ffmpeg/postproc/swscale.h"
+#include "ffmpeg/postproc/cpudetect.h"
 
 class X11WindowRenderer : public WindowDitherer {
 public:
@@ -87,21 +51,23 @@
 	    if(resized()){
 	      if(sws_context){
 	        sws_freeContext(sws_context);	
-		sws_context = NULL;
+			sws_context = NULL;
 	      }
 	      int flags = SWS_FAST_BILINEAR;
-	      flags |= (gCpuCaps.hasMMX ? SWS_CPU_CAPS_MMX : 0);
+	      /*flags |= (gCpuCaps.hasMMX ? SWS_CPU_CAPS_MMX : 0);
 	      flags |= (gCpuCaps.hasMMX2 ? SWS_CPU_CAPS_MMX2 : 0);
 	      flags |= (gCpuCaps.has3DNow ? SWS_CPU_CAPS_3DNOW : 0);
 	      flags |= (gCpuCaps.hasAltiVec ? SWS_CPU_CAPS_ALTIVEC : 0);
-	      
+	      */
+		  if(!outw_ || !outh_ || !width_ || !height_) return;
+
 	      sws_context = sws_getContext(width_, height_, IMGFMT_I420,
 	                 outw_, outh_, out_format, flags, NULL, NULL, NULL); 	   
-	      printf("X11WindowRenderer: %dx%d ==> %dx%d\n", width_, height_, outw_, outh_);
+	      // printf("X11WindowRenderer: %dx%d ==> %dx%d\n", width_, height_, outw_, outh_);
 	      
 	      if(sws_context == NULL){
-		printf("X11WindowRenderer: error! cannot allocate memory for swscontext!\n");
-		return;
+			debug_msg("X11WindowRenderer: error! cannot allocate memory for swscontext!\n");
+			return;
 	      }
 		      
 			    
@@ -112,14 +78,14 @@
   	      sws_tar[1] = sws_tar[2] = NULL;
   	      sws_tar_stride[0] = outw_*bytes_per_pixel;
   	      sws_tar_stride[1] = sws_tar_stride[2] = 0;	  	      
-            }
+        }
 
 	    i_width = width_; i_height = height_; o_width = outw_; o_height = outh_;	  		 	
 	    sws_src[0] = (uint8_t*)frm;
 	    sws_src[1] = sws_src[0] + framesize_;
 	    sws_src[2] = sws_src[1] + framesize_/4;
 
-     	    sws_scale_ordered(sws_context, sws_src, sws_src_stride, 0, height_, sws_tar, sws_tar_stride);
+     	sws_scale_ordered(sws_context, sws_src, sws_src_stride, 0, height_, sws_tar, sws_tar_stride);
 	  }	
 	}
 protected:
@@ -190,4 +156,4 @@
 
 					       
 
-
+#endif // ENABLE_SWSCALE

Modified: vic/branches/mpeg4/render/renderer-window.cpp
==============================================================================
--- vic/branches/mpeg4/render/renderer-window.cpp	(original)
+++ vic/branches/mpeg4/render/renderer-window.cpp	Wed Nov  8 03:05:10 2006
@@ -86,7 +86,7 @@
 	outw_ = (ww_ >> 2) << 2;
 	outh_ = (wh_ >> 2) << 2;
 
-// 	should be commented if we use libswscale 
+#ifndef ENABLE_SWSCALE
 	int d = distance(ww_, width_);
 	int t = distance(ww_, width_ << 1);
 	if (t < d) {
@@ -112,7 +112,7 @@
 		outw_ = width_ >> scale_;
 		outh_ = height_ >> scale_;
 	}
-// commen end
+#endif
 }
 
 void WindowRenderer::sync() const
@@ -124,11 +124,12 @@
 {
         if(enable_xv){
             window_->render(image_, 0, outh_, 0, outw_ );
-        }else{
-            window_->render(image_, 0, 0 , 0, 0);
-	}
+			return;
+        }            
 	
-/*
+#ifdef ENABLE_SWSCALE
+	window_->render(image_, 0, 0 , 0, 0);
+#else
 	if (scale_ >= 0) {
 		miny >>= scale_;
 		maxy >>= scale_;
@@ -141,7 +142,8 @@
 		maxx <<= -scale_;
 	}
 	window_->render(image_, miny, maxy, minx, maxx);
-*/	
+#endif	
+
 }
 
 /*

Modified: vic/branches/mpeg4/render/renderer.cpp
==============================================================================
--- vic/branches/mpeg4/render/renderer.cpp	(original)
+++ vic/branches/mpeg4/render/renderer.cpp	Wed Nov  8 03:05:10 2006
@@ -123,11 +123,22 @@
 			return (0);
 		need_update_ = 0;
 	}
+
+#ifdef ENABLE_SWSCALE
+	render(vf->bp_, 0, 0, 0, 0);
+	
+	// put the image to display
+	// in WindowRenderer::push
+	push(NULL, 0, 0, 0, 0);
+	sync();
+#else
+	
+	
 	/*
 	 * check how many blocks we need to update.  If more than
 	 * 12%, do a single image push call for them.  Otherwise,
 	 * only push the ones that change.
-	 */
+	 */	
 	u_int now = now_;
 	const u_int8_t* ts = p->crvec_;
 	u_int bcnt = 0;
@@ -163,7 +174,7 @@
 				ymin = y;
 			if (y > ymax)
 				ymax = y;
-			/*XXX*/
+			// XXX
 			int off = y * width_ + sx;
 			render(p->bp_, off, sx, x - sx, 8);
 			if (immed)
@@ -171,12 +182,14 @@
 		}
 		ts += width_ >> 3;
 	}
-	/*XXX*/
+	// XXX
 	now_ = p->ts_;
 	if (ymin <= ymax) {
 		if (!immed)
 			push(p->bp_, ymin, ymax + 8, 0, 0);
 		sync();
 	}
+#endif
+
 	return (0);
 }

Modified: vic/branches/mpeg4/render/vw.cpp
==============================================================================
--- vic/branches/mpeg4/render/vw.cpp	(original)
+++ vic/branches/mpeg4/render/vw.cpp	Wed Nov  8 03:05:10 2006
@@ -41,7 +41,9 @@
 #include "vw.h"
 #include "color.h"
 #include "rgb-converter.h"
+#ifdef HAVE_XVIDEO
 #include "xvideo.h"
+#endif
 extern "C" {
 #include <tk.h>
 

Modified: vic/branches/mpeg4/render/xvideo.h
==============================================================================
--- vic/branches/mpeg4/render/xvideo.h	(original)
+++ vic/branches/mpeg4/render/xvideo.h	Wed Nov  8 03:05:10 2006
@@ -1,7 +1,7 @@
 #ifndef _XVIDEO_H_
 #define _XVIDEO_H_
 
-#include "postproc/config.h"
+#include "ffmpeg/postproc/config.h"
 
 #include "vic_tcl.h"
 extern "C"{

Modified: vic/branches/mpeg4/tcl/ui-windows.tcl
==============================================================================
--- vic/branches/mpeg4/tcl/ui-windows.tcl	(original)
+++ vic/branches/mpeg4/tcl/ui-windows.tcl	Wed Nov  8 03:05:10 2006
@@ -188,11 +188,11 @@
 	toplevel $w -class Vic \
 		-visual "[winfo visual .top] [winfo depth .top]" \
 		-colormap .top
-	#catch "wm resizable $w false false"
+	catch "wm resizable $w false false"
 	#
 	# make windows become x-y resizeable
 	#
-	catch "wm resizable $w true false"
+	#catch "wm resizable $w true true"
 	frame $w.frame
 
 
@@ -337,7 +337,7 @@
 	}
 	
 	# Resize
-	bind $w <Configure> {	  
+	bind $w <B1-Motion> {	  
 	  global win_src win_target
 
 	  if { [info exists win_src(%W)] & [info exists win_target(%W)]} {
@@ -354,11 +354,11 @@
 	    
 	    set ow [expr int(%w + 2*%x)]
 	    set oh [expr int($aspect_r * $ow)]
-
-	    if { $iw != $ow || $ih != $oh} {	
-	      #resize_window %W $ow $oh     
-	      resize %W $ow $oh		       
-	    }    
+  
+        # open_dialog "$iw $ih $ow $oh"
+        resize %W $ow $oh		       	      
+	    #resize_window %W $ow $oh   	      
+	       
 	  }	 
 	}		
 	switcher_register $v $src window_switch



More information about the Sumover-dev mailing list