protected override DirectShow.Binding.IGraph Open(Uri.Locator name)
		{
			DirectShow.Binding.IGraph result = null;
			if (name.Scheme == "directshow+capture" && name.Scheme.Tail.NotNull() && name.Authority.NotNull() && name.Query["video"].NotEmpty())
			{
				name = name.Copy();
				name.Scheme = name.Scheme.Tail;
				DirectShow.Binding.Graph temporary = new DirectShow.Binding.Graph();
				bool built = temporary.Open(new DirectShow.Binding.Filters.Capture.All(name.Authority, new DirectShow.Binding.Filters.SampleGrabber.Yuyv(new DirectShow.Binding.Filters.NullRenderer()) { FuzzyMatch = this.Fuzzy }));
				if (built)
				{
					temporary.Play();
					System.Threading.Thread.Sleep(500);
				}
				temporary.Close();
				temporary = null;
				result = new DirectShow.Binding.Graph(this.Application);
				if (this.Open(result, name))
					result.Play();
				else
				{
					result.Close();
					result = null;
				}
			}
			return result;
		}
Example #2
0
		protected override DirectShow.Binding.IGraph Open(Uri.Locator name)
		{
			DirectShow.Binding.IGraph result = null;
			if (name.Scheme.Head == "elecard" && name.Scheme.Tail.NotNull() && name.Scheme.Tail.Head != "file" && name.Authority.NotNull() && name.Query["video"].IsNull())
			{
				name = name.Copy();
				this.Timeout = name.Query.Get("timeout", this.Timeout);
				this.Latency = name.Query.Get("latency", this.Latency);
				name.Query.Remove("timeout", "latency");
				name.Scheme = name.Scheme.Tail;
				result = new DirectShow.Binding.Graph(this.Application);
				if (this.Open(result, name))
				{
					result.Play();
					result.Stop();
					result.Play();
				}
				else
				{
					result.Close();
					result = null;
				}
			}
			return result;
		}
Example #3
0
		protected override DirectShow.Binding.IGraph Open(Uri.Locator name)
		{
			Graph.Live result = null;
			if (name.Scheme == "directshow+capture" && name.Authority.NotNull() && name.Query.NotNull() && name.Query["video"].NotNull())
			{
				string filename = name.Query["video"];
				result = new Graph.Live();
				result.Recorder = new DirectShow.Binding.Graph();
				if (result.Recorder.Open(new DirectShow.Binding.Filters.Capture.All(name.Authority, new DirectShow.Binding.Filters.SampleGrabber.Yuyv(new Filters.Encoder.Mpeg2(new Filters.Multiplexer.Mpeg2(new DirectShow.Binding.Filters.File.Sink(filename)))))))
				{
					result.Recorder.Play();
					System.Threading.Thread.Sleep(2000);
					bool built = result.Open(new Filters.IO.Reader(filename, new Filters.Demultiplexer.Mpeg2(new Filters.Decoder.Mpeg2(new DirectShow.Binding.Filters.SampleGrabber.All()) { Output = -1 })));
					if (built)
					{
						System.Threading.Thread.Sleep(1000);
						result.Play();
					}
					else
					{
						result.Close();
						result = null;
					}
				}
				else
				{
					result.Close();
					result = null;
				}
			}
			return result as DirectShow.Binding.IGraph;
		}
		bool Open(DirectShow.Binding.IGraph graph, Uri.Locator name)
		{
			bool result = false;
			string filename = name.Query["video"];
			name.Query.Remove("video");
			if (result = filename.NotEmpty())
				result = graph.Open(new DirectShow.Binding.Filters.Capture.All(name.Authority, new DirectShow.Binding.Filters.SampleGrabber.Yuyv(new Filters.Encoder.Mpeg(new Filters.Multiplexer.Mpeg(new Filters.IO.Dump(filename))))));
			return result;
		}
Example #5
0
		protected override DirectShow.Binding.IGraph Open(Uri.Locator locator)
		{
			DirectShow.Binding.IGraph result = null; 
			if (locator.Scheme == "directshow+capture" && locator.Authority.NotNull())
			{
				result = new DirectShow.Binding.Graph();
				bool built = result.Open(new DirectShow.Binding.Filters.Capture.All(locator.Authority, new DirectShow.Binding.Filters.SampleGrabber.Yuyv(new DirectShow.Binding.Filters.NullRenderer()) { FuzzyMatch = this.Fuzzy }));
				if (built)
					result.Play();
				else
				{
					result.Close();
					result = null;
				}
			}
			return result;
		}
Example #6
0
		protected override DirectShow.Binding.IGraph Open(Uri.Locator locator)
		{
			DirectShow.Binding.IGraph result = null;
			if (locator.Path.NotNull())
			{
				string file = locator.PlatformPath;
				string extension = System.IO.Path.GetExtension(file).ToLower().TrimStart('.');
				if (locator.Scheme == "file" && file.NotEmpty() && this.SupportedExtensions.Exists(v => v == extension) && System.IO.File.Exists(file))
				{
					result = new Binding.Graph();
					if (!this.Open(result, file))
					{
						result.Close();
						result = null;
					}
				}
			}
			return result;
		}
Example #7
0
		protected override DirectShow.Binding.IGraph Open(Uri.Locator name)
		{
			DirectShow.Binding.IGraph result = null;
			if (name.Scheme.Head == "axrtsphttp" && name.Authority.NotNull() && name.Query["video"].IsNull())
			{
				name = name.Copy();
				result = new DirectShow.Binding.Graph(this.Application);
				if (this.Open(result, name))
				{
					result.Play();
					//result.Stop();
					//result.Play();
				}
				else
				{
					result.Close();
					result = null;
				}
			}
			return result;
		}
Example #8
0
		protected override DirectShow.Binding.IGraph Open(Uri.Locator locator)
		{
			Timeshift.Graph.NonLive result = null;
			if (locator.Scheme == "elecard+udp" && locator.Query["video"].NotNull())
			{
				string filename = locator.Query["video"];
				locator = locator.Copy();
				locator.Scheme = "udp";
				locator.Query.Remove("video");
				result = new Graph.NonLive();
				result.Recorder = new DirectShow.Binding.Graph();
				if (result.Recorder.Open(new Filters.Net.SourcePlus(locator, new Filters.File.Sink(filename))))
				{
					result.Recorder.Play();
					System.Threading.Thread.Sleep(1000);
					DirectShow.Binding.Filters.SampleGrabber.All samplegrabber = new DirectShow.Binding.Filters.SampleGrabber.All() { FuzzyMatch = this.Fuzzy };
					bool built = result.Open(new Filters.File.Source(filename, new Filters.Demultiplexer.Mpeg(new Filters.Decoder.All(samplegrabber)) { Output = 0 })) ||
					 result.Open(new Filters.File.Source(filename, new Filters.Demultiplexer.Mpeg(new Filters.Decoder.All(samplegrabber)) { Output = 1 })); 
					if (built)
					{
						System.Threading.Thread.Sleep(1000);
						result.Play();
					}
					else
					{
						result.Close();
						result = null;
					}
				}
				else
				{
					result.Close();
					result = null;
				}
			}
			return result as DirectShow.Binding.IGraph;
		}
Example #9
0
		bool Open(DirectShow.Binding.IGraph graph, Uri.Locator name)
		{
			return graph.Open(new Filters.Net.SourcePlus(name, new Filters.Demultiplexer.MpegPush(new Filters.Decoder.All(new DirectShow.Binding.Filters.SampleGrabber.All()) { Output = -1 }) { WaitForOutput = new TimeSpan(0, 0, 0, 1), Latency = this.Latency }) { Timeout = this.Timeout }) ||
			graph.Open(new Filters.Net.RtspSource(name, new Filters.Decoder.SD.Avc(new DirectShow.Binding.Filters.SampleGrabber.All())));
		}
Example #10
0
		bool Open(DirectShow.Binding.IGraph graph, Uri.Locator name)
		{
			bool result = graph.Open(new Filters.Net.RTPSource(name, new DirectShow.Binding.Filters.Decoder.Mpeg2(new DirectShow.Binding.Filters.Dmo.ColorConverter(new DirectShow.Binding.Filters.SampleGrabber.All() { FuzzyMatch = true } ))) { Output = 0 });
			graph.Save("file:///./test.grf");
			return result;
		}
Example #11
-1
		bool Open(DirectShow.Binding.IGraph graph, Uri.Locator name)
		{
			bool result = false;
			string filename = name.Query["video"];
			name.Query.Remove("video");
			if (result = filename.NotEmpty())
			{
				result = graph.Open(
					new Filters.Net.SourcePlus(name, new DirectShow.Binding.Filters.Utils.InfinitePinTee(
					new DirectShow.Binding.Filters.Abstract[] { new Filters.Demultiplexer.MpegPush(new Filters.Decoder.SD.All(new DirectShow.Binding.Filters.SampleGrabber.All()) { Output = -1 }) { WaitForOutput = new TimeSpan(0, 0, 0, 1) }},
					new DirectShow.Binding.Filters.Abstract[] { new Filters.File.Sink(filename) }
					)));  
			}
			return result;
		}