Example #1
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;
		}
		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 #3
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 #4
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;
		}