Beispiel #1
0
        public HKCardPlayer(IVideoSourceConfig config, IVideoSourceFactory factory, IntPtr hWnd)
            : base(config, null, factory)
        {
            HWnd = hWnd;

            Target = (Int32)config.Channel;
        }
Beispiel #2
0
 public CVideoSource(IVideoSourceConfig config, IVideoDevice device, IVideoSourceFactory factory)
     : base()
 {
     mConfig  = config;
     mDevice  = device;
     mFactory = factory;
 }
Beispiel #3
0
        public CVideoDevice(IVideoSourceFactory factory)
            : base()
        {
            mVideoSourceFactory = factory;

            Init();
        }
Beispiel #4
0
        public HKMP4FilePlayer(IVideoSourceConfig config, IVideoSourceFactory factory, IntPtr hWnd)
            : base(config, null, factory)
        {
            HWnd = hWnd;

            mPort = Handle % 64;

            mTimer.Enabled  = false;
            mTimer.Interval = 500;
            mTimer.Tick    += new EventHandler(OnTimerTick);

            Target = config.FileName;
        }
Beispiel #5
0
        public ImageVideoSource(IVideoSourceConfig config, IVideoSourceFactory factory, IntPtr hWnd)
            : base(config, factory, hWnd)
        {
            if (HWnd != IntPtr.Zero)
            {
                mGraophics = Graphics.FromHwnd(HWnd);
            }

            mTimer.Enabled  = false;
            mTimer.Interval = 25;
            mTimer.Tick    += new EventHandler(OnTimerTick);

            Target = config.FileName;
        }
Beispiel #6
0
        public IVideoSource Open(IVideoSourceConfig config, IVideoSourceType type, IntPtr hWnd)
        {
            if (config != null && config.Enabled)
            {
                IVideoSource vs = GetVideoSource(config.Name);
                if (vs == null)
                {
                    IVideoSourceFactory vsFactory = GetVideoSourceFactory(type);
                    if (vsFactory != null)
                    {
                        vs = vsFactory.CreateVideoSource(config, hWnd);
                        if (vs != null)
                        {
                            lock (mVideoSources.SyncRoot)
                            {
                                if (vs.Open(null))
                                {
                                    vs.OnPlayStatusChanged += new PLAYSTATUS_CHANGED(DoPlayStausChanged);
                                    vs.OnRecordProgress    += new RECORD_PROGRESS(DoRecordProgress);
                                    (vs as IKernelVideoSource).OnKernelStatus += new KERNELSTATUS_CHANGED(DoKernelStatus);

                                    mVideoSources.Add(vs.Name, vs);

                                    vs.RefreshState();
                                }
                                else
                                {
                                    return(null);
                                }
                            }
                        }
                    }
                }
                else
                {
                    if (hWnd != IntPtr.Zero)
                    {
                        vs.HWnd = hWnd;
                    }

                    if (!vs.IsOpen)
                    {
                        vs.Open(null);
                    }
                }
                return(vs);
            }
            return(null);
        }
Beispiel #7
0
        public IVideoSource InitVideoSource(IVideoSourceConfig config, IVideoSourceFactory factory, IntPtr hWnd)
        {
            if (config != null)
            {
                lock (mVideoSourstTable.SyncRoot)
                {
                    IVideoSource vs = (IVideoSource)mVideoSourstTable[config.Name];
                    if (vs == null)
                    {
                        vs = new StreamMediaPlayer(this, config, factory, hWnd);

                        mVideoSourstTable.Add(vs.Name, vs);
                    }
                    return(vs);
                }
            }
            return(null);
        }
Beispiel #8
0
        public HKCardNetPlayer(IVideoSourceConfig config, IVideoSourceFactory factory, IntPtr hWnd)
            : base(config, null, factory)
        {
            HWnd = hWnd;

            mClientVideoInfo.m_sIPAddress     = config.IP;
            mClientVideoInfo.m_sUserName      = "******";
            mClientVideoInfo.m_sUserPassword  = "******";
            mClientVideoInfo.m_bUserCheck     = false;
            mClientVideoInfo.m_bRemoteChannel = (byte)config.Channel;
            mClientVideoInfo.m_hShowVideo     = hWnd;
            mClientVideoInfo.m_nImgFormat     = 0; //0 主通道 1 子通道
            mClientVideoInfo.m_bSendMode      = HikClientSDKWrap.NetSendMode.TCPMODE;

            //mReadDataCallBack = new READDATA_CALLBACK(OnReadDataCallBack);
            mCapPicFun = new CAP_PIC_FUN(OnCapPicFun);

            Target = (Int32)config.Channel;
        }
Beispiel #9
0
        public CHKDVRBackPlayer(IVideoSourceConfig config, CHKDVRDevice device, IVideoSourceFactory factory, string fileName, IntPtr hWnd)
            : base(config, device, factory)
        {
            RecordFile = new CHKDVRRecordFile(device);
            RecordFile.RemoteFileName = fileName;

            HWnd = hWnd;
            if (HWnd == IntPtr.Zero)
            {
                if (mPanel == null)
                {
                    mPanel = new Panel();
                }

                HWnd = mPanel.Handle;
            }
            mType = 1;

            Target = fileName;
        }
Beispiel #10
0
        public AVIVideoSource(IVideoSourceConfig config, IVideoSourceFactory factory, IntPtr hWnd)
            : base(config, factory, hWnd)
        {
            if (HWnd != IntPtr.Zero && mGraophics == null)
            {
                mGraophics = Graphics.FromHwnd(HWnd);
                win32.GetClientRect(HWnd, ref mRect);
            }

            mTimer.Enabled  = false;
            mTimer.Interval = 40;
            mTimer.Tick    += new EventHandler(OnTimerTick);

            Target = config.FileName;

            if (Config.IsPush)
            {
                mDoEndOfFrameEvenHandle = new FileEndOfFrameEvenHandle(DoEndOfWriteFrame);
            }
        }
Beispiel #11
0
        public CHKDVRBackPlayer(IVideoSourceConfig config, CHKDVRDevice device, IVideoSourceFactory factory, int channel, ref DateTime startTime, ref DateTime stopTime, IntPtr hWnd)
            : base(config, device, factory)
        {
            RecordFile           = new CHKDVRRecordFile(device);
            RecordFile.Channel   = channel;
            RecordFile.StartTime = startTime;
            RecordFile.StopTime  = stopTime;

            HWnd = hWnd;
            if (HWnd == IntPtr.Zero)
            {
                if (mPanel == null)
                {
                    mPanel = new Panel();
                }

                HWnd = mPanel.Handle;
            }

            mType = 2;

            mTStartTime         = startTime;
            mStartTime.dwYear   = startTime.Year;
            mStartTime.dwMonth  = startTime.Month;
            mStartTime.dwDay    = startTime.Day;
            mStartTime.dwHour   = startTime.Hour;
            mStartTime.dwMinute = startTime.Minute;
            mStartTime.dwSecond = startTime.Second;

            mTStopTime         = stopTime;
            mStopTime.dwYear   = stopTime.Year;
            mStopTime.dwMonth  = stopTime.Month;
            mStopTime.dwDay    = stopTime.Day;
            mStopTime.dwHour   = stopTime.Hour;
            mStopTime.dwMinute = stopTime.Minute;
            mStopTime.dwSecond = stopTime.Second;

            Target = (Int32)channel;
        }
Beispiel #12
0
        public CHKDVRRealPlayer(IVideoSourceConfig config, CHKDVRDevice device, IVideoSourceFactory factory, int channel, uint linkmode, IntPtr hWnd, string multiCastIP)
            : base(config, device, factory)
        {
            HWnd = hWnd;
            if (HWnd == IntPtr.Zero)
            {
                if (mPanel == null)
                {
                    mPanel = new Panel();
                }

                HWnd = mPanel.Handle;
            }

            /* 最高位(31)为0表示主码流,为1表示子码流,0-30位表示码流连接方式:0:TCP方式,1:UDP方式,2:多播方式,3 - RTP方式,4—音视频分开 */
            //子码流: 0x80000000
            mClientInfo.lLinkMode    = linkmode;
            mClientInfo.sMultiCastIP = multiCastIP;
            mClientInfo.hPlayWnd     = HWnd;

            PTZCtrl = new CHKPTZCtrl(this);

            Target = (Int32)channel;
        }
Beispiel #13
0
 public CHKDVRVideoSource(IVideoSourceConfig config, IVideoDevice device, IVideoSourceFactory factory)
     : base(config, device, factory)
 {
     mPlayDataCallback = new PLAY_DATA_CALLBACK(DoPlayDataCallback);
 }
Beispiel #14
0
        public StreamMediaVideoSource(StreamMediaClientManager manager, IVideoSourceConfig config, IVideoSourceFactory factory, IntPtr hWnd)
            : base(config, null, factory)
        {
            HWnd = hWnd;
            mStreamMidiaClientManager = manager;

            mHikClientPtr = Marshal.AllocHGlobal(Marshal.SizeOf(mHikClientAdviseSink));
        }
Beispiel #15
0
 public StreamMediaPlayer(StreamMediaClientManager manager, IVideoSourceConfig config, IVideoSourceFactory factory, IntPtr hWnd)
     : base(manager, config, factory, hWnd)
 {
     Target = "StreamMedia";
 }
Beispiel #16
0
 public FileVideoSource(IVideoSourceConfig config, IVideoSourceFactory factory, IntPtr hWnd)
     : base(config, null, factory)
 {
     HWnd = hWnd;
 }