[longomatch] Change capturer factory to add new capturer types



commit 981414dd6195090018dd024402d00178a29b9bae
Author: Andoni Morales Alastruey <ylatuya gmail com>
Date:   Wed Feb 17 22:24:28 2010 +0100

    Change capturer factory to add new capturer types

 CesarPlayer/MultimediaFactory.cs |  100 +++++++++++++++++--------------------
 1 files changed, 46 insertions(+), 54 deletions(-)
---
diff --git a/CesarPlayer/MultimediaFactory.cs b/CesarPlayer/MultimediaFactory.cs
index c4c6027..6c029ee 100644
--- a/CesarPlayer/MultimediaFactory.cs
+++ b/CesarPlayer/MultimediaFactory.cs
@@ -36,83 +36,75 @@ namespace LongoMatch.Video
 		public MultimediaFactory()
 		{
 			oS = Environment.OSVersion;	
-		
 		}
 		
 		public IPlayer getPlayer(int width, int height){
-			
 			switch (oS.Platform) { 
-			 case PlatformID.Unix:
-				return new GstPlayer(width,height,GstUseType.Video);
-				
-				
-			case PlatformID.Win32NT:
-				return new GstPlayer(width,height,GstUseType.Video);
-				//return new DSPlayer(UseType.Video);
-				
-				
-			 default:
-				return new GstPlayer(width,height,GstUseType.Video);
+				case PlatformID.Unix:
+					return new GstPlayer(width,height,GstUseType.Video);
+					
+				case PlatformID.Win32NT:
+					return new GstPlayer(width,height,GstUseType.Video);
 				
-			}
-		
+				default:
+					return new GstPlayer(width,height,GstUseType.Video);
+			}		
 		}
 		
 		public IMetadataReader getMetadataReader(){
 			
 			switch (oS.Platform) { 
-			 case PlatformID.Unix:
-				return new GstPlayer(1,1,GstUseType.Metadata);
-				
-			case PlatformID.Win32NT:
-				return new GstPlayer(1,1,GstUseType.Metadata);
-				
-			 default:
-				return new GstPlayer(1,1,GstUseType.Metadata);
+				case PlatformID.Unix:
+					return new GstPlayer(1,1,GstUseType.Metadata);
+					
+				case PlatformID.Win32NT:
+					return new GstPlayer(1,1,GstUseType.Metadata);
+					
+				default:
+					return new GstPlayer(1,1,GstUseType.Metadata);
 			}
 		}
 		
 		public IFramesCapturer getFramesCapturer(){
-			
 			switch (oS.Platform) { 
-			 case PlatformID.Unix:
-				return new GstPlayer(1,1,GstUseType.Capture);
-				
-			case PlatformID.Win32NT:
-				return new GstPlayer(1,1,GstUseType.Capture);
-				
-			 default:
-				return new GstPlayer(1,1,GstUseType.Capture);
+				case PlatformID.Unix:
+					return new GstPlayer(1,1,GstUseType.Capture);
+					
+				case PlatformID.Win32NT:
+					return new GstPlayer(1,1,GstUseType.Capture);
+					
+				default:
+					return new GstPlayer(1,1,GstUseType.Capture);
 			}
 		}
 		
 		public IVideoEditor getVideoEditor(){
 			switch (oS.Platform) { 
-				
-			 case PlatformID.Unix:
-				return new GstVideoSplitter();
-				
-			case PlatformID.Win32NT:
-				return new GstVideoSplitter();	
-				
-			 default:
-				return new GstVideoSplitter();
+				case PlatformID.Unix:
+					return new GstVideoSplitter();
+					
+				case PlatformID.Win32NT:
+					return new GstVideoSplitter();	
+					
+				default:
+					return new GstVideoSplitter();
 			}
-		}
-		
+		}	
 		
-		public ICapturer getCapturer(){
-			switch (oS.Platform) { 
-				
-			 case PlatformID.Unix:
-				return new GstCameraCapturer("test.avi");
-				
-			case PlatformID.Win32NT:
-				return new GstCameraCapturer("test.avi");	
+		public ICapturer getCapturer(CapturerType type){
+			switch (type) { 
+				case CapturerType.FAKE:
+					return new FakeCapturer();
+					
+				case CapturerType.DVCAM:
+					return new GstCameraCapturer("test.avi");
 				
-			 default:
-				return new GstCameraCapturer("test.avi");
+				case CapturerType.WEBCAM:
+					return new FakeCapturer();
+									
+				default:
+					return new FakeCapturer();
 			}			
 		}
 	}
-}
+}
\ No newline at end of file



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]