コード例 #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);
 }
コード例 #2
0
 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);
 }
コード例 #3
0
        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);
        }
コード例 #4
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);
        }
コード例 #5
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()))));
 }
コード例 #6
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);
 }
コード例 #7
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);
 }
コード例 #8
0
        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);
        }