Index: video_freebsd.c
===================================================================
--- video_freebsd.c	(revisión: 310)
+++ video_freebsd.c	(copia de trabajo)
@@ -1192,7 +1192,7 @@
 		pthread_mutex_unlock(&dev->mutex);
 	}
 	
- 	if(cnt->rotate_data.degrees > 0){ 
+ 	if ((cnt->rotate_data.degrees > 0) || (conf->mirror)) { 
 		/* rotate the image as specified */
 		rotate_map(cnt, map);
  	}
Index: conf.c
===================================================================
--- conf.c	(revisión: 310)
+++ conf.c	(copia de trabajo)
@@ -41,6 +41,7 @@
 	height:                DEF_HEIGHT,
 	quality:               DEF_QUALITY,
 	rotate_deg:            0,
+	mirror:                0,							
 	max_changes:           DEF_CHANGES,
 	threshold_tune:        0,
 	output_normal:         "on",
@@ -272,6 +273,15 @@
 	print_int
 	},
 	{
+	"mirror",
+	"# Flip images in X axis\n"
+	"# default: off.",
+	0,
+	CONF_OFFSET(mirror),
+	copy_bool,
+	print_bool
+	},
+	{
 	"width",
 	"# Image width (pixels). Valid range: Camera dependent, default: 352",
 	0,
Index: conf.h
===================================================================
--- conf.h	(revisión: 310)
+++ conf.h	(copia de trabajo)
@@ -24,6 +24,7 @@
 	int height;
 	int quality;
 	int rotate_deg;
+	int mirror;
 	int max_changes;
 	int threshold_tune;
 	const char *output_normal;
Index: rotate.c
===================================================================
--- rotate.c	(revisión: 310)
+++ rotate.c	(copia de trabajo)
@@ -147,6 +147,18 @@
 	}
 }
 
+/* Code suggested by phil@firestorm.cx (Philip Heron), used with permission.
+ * -wusel, 20051029 */
+void h_flip(unsigned char *src, int size, int width, int height)
+{
+        register int y;
+
+        for(y = 0; y < height; y++) {
+                reverse_inplace_quad(src, width);
+                src += width;
+        }
+}
+
 /**
  * rot90cw
  * 
@@ -233,6 +245,9 @@
 	/* Make sure temp_buf isn't freed if it hasn't been allocated. */
 	cnt->rotate_data.temp_buf = NULL;
 
+	if (cnt->conf.mirror)
+		 cnt->conf.rotate_deg = 180;
+
 	/* Assign the value in conf.rotate_deg to rotate_data.degrees. This way,
 	 * we have a value that is safe from changes caused by motion-control.
 	 */
@@ -391,11 +406,17 @@
 		/* 180 degrees is easy - just reverse the data within
 		 * Y, U and V.
 		 */
-		reverse_inplace_quad(map, wh);
+		//reverse_inplace_quad(map, wh);
+
+		if (cnt->conf.mirror) 
+			h_flip(map, size, width, height);
+		else reverse_inplace_quad(map, wh);
+
 		if(cnt->imgs.type == VIDEO_PALETTE_YUV420P) {
 			reverse_inplace_quad(map + wh, wh4);
 			reverse_inplace_quad(map + wh + wh4, wh4);
 		}
+
 		break;
 
 	case 270:
Index: motion-dist.conf.in
===================================================================
--- motion-dist.conf.in	(revisión: 310)
+++ motion-dist.conf.in	(copia de trabajo)
@@ -66,6 +66,10 @@
 # well as mpeg movies. Valid values: 0 (default = no rotation), 90, 180 and 270.
 rotate 0
 
+# Flip images in X axis
+# default: off.
+mirror off
+
 # Image width (pixels). Valid range: Camera dependent, default: 352
 width 320
 
Index: video_common.c
===================================================================
--- video_common.c	(revisión: 310)
+++ video_common.c	(copia de trabajo)
@@ -939,7 +939,7 @@
 			pthread_mutex_unlock(&dev->mutex);
 		}
 
-		if (cnt->rotate_data.degrees > 0) {
+		if ((cnt->rotate_data.degrees > 0) || (conf->mirror)) {
 			/* rotate the image as specified */
 			rotate_map(cnt, map);
 		}
