Example #1
0
        public DVRChannelInfo GetDVRChannelInfo(ulong videoID)
        {
            DVRChannelInfo info  = null;
            ulong          dvrID = 0;

            lock (_videoInfos)
            {
                if (_videoInfos.ContainsKey(videoID))
                {
                    VideoInfo vi = _videoInfos[videoID];
                    info         = new DVRChannelInfo();
                    info.Type    = GetDvrType(vi.DvrType);
                    info.Host    = vi.DvrHost;
                    info.Channel = vi.Channel;
                    dvrID        = vi.DvrId;
                }
            }

            if (info != null)
            {
                DVRCustom dc = getDVRInfo(dvrID);
                info.Port = dc.Port;
                info.User = dc.User;
                info.Pass = dc.Pass;
            }

            return(info);
        }
Example #2
0
        private void getInfos(HashSet <ulong> servers, Dictionary <ulong, VideoInfo> infos, VideoParser.Node node)
        {
            VideoParser.Server server = node as VideoParser.Server;
            if (server != null && !servers.Contains(server.Id))
            {
                servers.Add(server.Id);
                foreach (VideoParser.Node child in server.Childs)
                {
                    getInfos(servers, infos, child);
                }
            }

            VideoParser.Front front = node as VideoParser.Front;
            if (front != null)
            {
                DVRCustom custom = new DVRCustom()
                {
                    User = front.User,
                    Pass = front.Pass,
                    Port = front.Port,
                };
                _dvrCustoms[front.Id] = custom;

                int index = 1;
                foreach (VideoParser.Video video in front.Childs)
                {
                    getInfo(infos, video, front.Id, front.Host, front.Type, index);
                    index++;
                }
            }
        }