当前位置: 首页>>代码示例>>C#>>正文


C# StreamInfo类代码示例

本文整理汇总了C#中StreamInfo的典型用法代码示例。如果您正苦于以下问题:C# StreamInfo类的具体用法?C# StreamInfo怎么用?C# StreamInfo使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


StreamInfo类属于命名空间,在下文中一共展示了StreamInfo类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: CreateObjectFromStreamInfo

    private static GameObject CreateObjectFromStreamInfo(StreamInfo stream, bool visible)
    {
        GameObject streamObj = new GameObject("Stream #" + streamID++);

        //Need a mesh filter and a mesh renderer for the stream's mesh rendering
        MeshFilter filter = streamObj.AddComponent("MeshFilter") as MeshFilter;
        filter.mesh = Object.Instantiate(stream.mesh) as Mesh;

        MeshRenderer renderer = streamObj.AddComponent("MeshRenderer") as MeshRenderer;
        renderer.material = Object.Instantiate(stream.material) as Material;
        renderer.enabled = visible;

        //Add a box collider
        MeshCollider hitBox = streamObj.AddComponent("MeshCollider") as MeshCollider;
        hitBox.transform.parent = streamObj.transform;

        //Add proper stream script
        string streamScript = "FluidStream";
        if(stream.type == Source.SourceType.Electricity)
            streamScript = "ElectricityStream";
        else if (stream.type == Source.SourceType.Wind)
            streamScript = "WindStream";

        streamObj.AddComponent(streamScript);

        return streamObj;
    }
开发者ID:Gatlink,项目名称:elementum-dare,代码行数:27,代码来源:StreamFactory.cs

示例2: AudioStreamWrapper

 internal AudioStreamWrapper(StreamInfo adaptiveAudioStream)
 {
     AdaptiveAudioStream = adaptiveAudioStream;
     base.Name = adaptiveAudioStream.GetName();
     base.Language = adaptiveAudioStream.GetLanguage();
     //base.Language = new CultureInfo(adaptiveAudioStream.GetLanguage()).DisplayName;
 }
开发者ID:bondarenkod,项目名称:pf-arm-deploy-error,代码行数:7,代码来源:AudioStreamWrapper.cs

示例3: SerializeObject

 public override CustomObjectInfo SerializeObject()
 {
     StreamInfo x = new StreamInfo();
     x.BasicSerialization(this);
     x.direction=direction;
     x.power=power;
     return x;
 }
开发者ID:crassus0,项目名称:Edge-drivers,代码行数:8,代码来源:Stream.cs

示例4: GetVideoMedatada

		public StreamInfo GetVideoMedatada()
		{
			StreamInfo sinfo = new StreamInfo();

			sinfo.Author = currentUrl;
			sinfo.Title = currentUrl;

			return sinfo;
		}
开发者ID:psychob,项目名称:livestreamer-gui,代码行数:9,代码来源:GenericPage.cs

示例5: AddBytes

        private static void AddBytes(IBinaryStorage storage, string key, byte[] data)
        {
            var streamInfo = new StreamInfo();
            using (var md5 = MD5.Create()) {
                streamInfo.Hash = md5.ComputeHash(data);
            }
            streamInfo.Length = data.Length;
            streamInfo.IsCompressed = false;

            using (var ms = new MemoryStream(data)) {
                storage.Add(key, ms, streamInfo);
            }
        }
开发者ID:saktanorovich,项目名称:interview,代码行数:13,代码来源:Program.cs

示例6: Clone

        internal StreamInfo Clone()
        {
            StreamInfo clone = new StreamInfo
            {
                SectionName = SectionName,
                ConfigSource = ConfigSource,
                StreamName = StreamName,
                IsMonitored = IsMonitored,
                Version = Version
            };


            return clone;
        }
开发者ID:chcosta,项目名称:corefx,代码行数:14,代码来源:StreamInfo.cs

示例7: GetVideoMedatada

		public StreamInfo GetVideoMedatada()
		{
			StreamInfo sinfo = new StreamInfo();

			sinfo.Author = GetCanonicalUrl();
			sinfo.Title = GetCanonicalUrl();

			if (localInitData.Config.GetBoolean(ConfigurationConstants.ApiInternetAccess,
				true, false))
			{
				try
				{
					// pobieramy informacje o video
					string yt_url = GetCanonicalUrl();
					string oembed = "http://www.youtube.com/oembed";

					{
						var qstr = HttpUtility.ParseQueryString(string.Empty);
						qstr["url"] = yt_url;
						qstr["format"] = "xml";

						oembed += "?" + qstr.ToString();
					}

					WebRequest wr = WebRequest.Create(oembed);
					WebResponse wre = wr.GetResponse();
					Stream data = wre.GetResponseStream();

					System.Xml.XmlDocument xmldoc = new System.Xml.XmlDocument();
					xmldoc.Load(data);
					data.Close();

					sinfo.Author = xmldoc.GetElementsByTagName("author_name")[0].InnerText;
					sinfo.Title = xmldoc.GetElementsByTagName("title")[0].InnerText;
					sinfo.CanonicalUrl = GetCanonicalUrl();
				}
				catch (Exception)
				{
					sinfo.Author = "Unknown author";
					sinfo.Title = "Unknown title";
					sinfo.CanonicalUrl = GetCanonicalUrl();
				}
			}

			return sinfo;
		}
开发者ID:psychob,项目名称:livestreamer-gui,代码行数:46,代码来源:YouTubeCom.cs

示例8: GetADSes

 public static IList<string> GetADSes(this FileInfo info)
 {
     List<string> result = new List<string>();
        using (FileStream stream = new StreamInfo(info.FullName).Open(FileMode.Open,
     FileAccess.Read, FileShare.ReadWrite))
        using (SafeFileHandle streamHandle = stream.SafeFileHandle)
        {
     NativeMethods.FILE_STREAM_INFORMATION[] streams = GetADSes(streamHandle);
     foreach (NativeMethods.FILE_STREAM_INFORMATION streamInfo in streams)
     {
      string streamName = streamInfo.StreamName.Substring(1,
       streamInfo.StreamName.LastIndexOf(':') - 1);
      if (streamName.Length != 0)
       result.Add(streamName);
     }
        }
        return result.AsReadOnly();
 }
开发者ID:RoDaniel,项目名称:featurehouse,代码行数:18,代码来源:IO.cs

示例9: StreamInlet

 public StreamInlet(StreamInfo info, int max_buflen, int max_chunklen)
 {
     obj = dll.lsl_create_inlet(info.handle(), max_buflen, max_chunklen, 1);
 }
开发者ID:conphyture,项目名称:beta,代码行数:4,代码来源:LSL.cs

示例10: results

 /**
 * Obtain the set of currently present streams on the network (i.e. resolve result).
 * @return An array of matching stream info objects (excluding their meta-data), any of
 *         which can subsequently be used to open an inlet.
 */
 public StreamInfo[] results()
 {
     IntPtr[] buf = new IntPtr[1024];
     int num = dll.lsl_resolver_results(obj,buf,(uint)buf.Length);
     StreamInfo[] res = new StreamInfo[num];
     for (int k = 0; k < num; k++)
     res[k] = new StreamInfo(buf[k]);
     return res;
 }
开发者ID:conphyture,项目名称:beta,代码行数:14,代码来源:LSL.cs

示例11: resolve_stream

 public static StreamInfo[] resolve_stream(string pred, int minimum, double timeout)
 {
     IntPtr[] buf = new IntPtr[1024]; int num = dll.lsl_resolve_bypred(buf, (uint)buf.Length, pred, minimum, timeout);
     StreamInfo[] res = new StreamInfo[num];
     for (int k = 0; k < num; k++)
     res[k] = new StreamInfo(buf[k]);
     return res;
 }
开发者ID:conphyture,项目名称:beta,代码行数:8,代码来源:LSL.cs

示例12: StreamOutlet

 public StreamOutlet(StreamInfo info, int chunk_size)
 {
     obj = dll.lsl_create_outlet(info.handle(), chunk_size, 360);
 }
开发者ID:conphyture,项目名称:beta,代码行数:4,代码来源:LSL.cs

示例13: PutFileInternal

        private void PutFileInternal(string s3Filename, string filename, StreamInfo file) {
            var tmpfile = Path.Combine(_tempDirectory, Guid.NewGuid() + ".cache");
            try {
                using(file) {
                    Tuplet<string, TaskTimer, DateTime?> entry = null;

                    // create tmp file
                    try {

                        // copy stream to tmp file
                        using(Stream stream = File.Create(tmpfile)) {
                            file.Stream.CopyTo(stream, file.Length, new Result<long>(TimeSpan.MaxValue)).Wait();
                        }

                        // create cached entry
                        if(_cacheTtl != TimeSpan.Zero) {
                            lock(_cache) {
                                if(_cache.TryGetValue(s3Filename, out entry)) {
                                    entry.Item2.Change(_cacheTtl, TaskEnv.None);
                                    entry.Item3 = file.Modified;
                                } else {
                                    var timer = _timerFactory.New(_cacheTtl, OnTimer, s3Filename, TaskEnv.None);
                                    _cache[s3Filename] = entry = new Tuplet<string, TaskTimer, DateTime?>(tmpfile, timer, file.Modified);
                                }
                            }
                        }
                    } catch(Exception e) {
                        try {

                            // delete tmp file and clear out timer and cache, if any exist
                            SafeFileDelete(tmpfile);
                            if(entry != null) {
                                lock(_cache) {
                                    entry.Item2.Cancel();
                                    _cache.Remove(s3Filename);
                                }
                            }
                        } catch(Exception e2) {
                            _log.WarnFormat("Failed cleaned-up post tmp file creation failure for attachment {0}: {1}", s3Filename, e2.Message);
                        }
                        throw new DreamInternalErrorException(string.Format("Unable to cache file attachment to '{0}' ({1})", s3Filename, e.Message));
                    }
                }

                // forward cached file to S3
                Stream filestream = File.Open(tmpfile, FileMode.Open, FileAccess.Read, FileShare.Read);
                file = new StreamInfo(filestream, file.Length, file.Type);
                var s3Msg = DreamMessage.Ok(file.Type, file.Length, file.Stream);
                s3Msg.Headers.ContentDisposition = new ContentDisposition(true, DateTime.UtcNow, null, null, filename, file.Length);

                // Note (arnec): The timeout is just a workaround Plug not having some kind of heartbeat on progress. Ideally 30 seconds of inactivity
                // should be perfectly fine, as long as we track uploads that are proceeding as active
                _s3.AtPath(s3Filename).WithTimeout(TimeSpan.FromMinutes(30)).Put(s3Msg);
            } finally {
                if(_cacheTtl == TimeSpan.Zero) {
                    SafeFileDelete(tmpfile);
                }
            }
        }
开发者ID:heran,项目名称:DekiWiki,代码行数:59,代码来源:S3Storage.cs

示例14: PutFile

 public void PutFile(ResourceBE attachment, SizeType size, StreamInfo file) {
     CheckDisposed();
     PutFileInternal(BuildS3Filename(attachment, size), attachment.Name, file);
 }
开发者ID:heran,项目名称:DekiWiki,代码行数:4,代码来源:S3Storage.cs

示例15: ParseStreams

    private void ParseStreams(IAMStreamSelect pStrm)
    {
      int cStreams = 0;
      pStrm.Count(out cStreams);

      _audioStreams.Clear();
      _subtitleStreams.Clear();

      for (int istream = 0; istream < cStreams; istream++)
      {
        AMMediaType sType;
        AMStreamSelectInfoFlags sFlag;
        int sPDWGroup;
        int sPLCid;
        string sName;
        object pppunk; 
        object ppobject;

        pStrm.Info(istream, out sType, out sFlag, out sPLCid, out sPDWGroup, out sName, out pppunk, out ppobject);

        if (sPDWGroup == 1)
        {
          StreamInfo info = new StreamInfo(istream, sName);
          _audioStreams.Add(info);
        }

        if (sPDWGroup == 2)
        {
          StreamInfo info = new StreamInfo(istream, sName);
          _subtitleStreams.Add(info);
        }
      }
    }
开发者ID:MediaPortal,项目名称:MediaPortal-1,代码行数:33,代码来源:BDPlayer.cs


注:本文中的StreamInfo类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。