Exemplo n.º 1
0
 protected override bool PrepStop()
 {
     if ((uint)mChannelHandle != 0xFFFFFFFF)
     {
         if (DS40xxSDKWrap.StopVideoPreview(mChannelHandle) == 0)
         {
             return(true);
         }
     }
     return(false);
 }
Exemplo n.º 2
0
        protected override bool PrepPlay()
        {
            if ((uint)mChannelHandle != 0xFFFFFFFF)
            {
                win32.RECT rect = new win32.RECT();
                win32.GetClientRect(HWnd, ref rect);

                if (DS40xxSDKWrap.StartVideoPreview(mChannelHandle, HWnd, ref rect, true, TypeVideoFormat.vdfRGB24, mFps) == 0)
                {
                    return(true);
                }
            }
            return(false);
        }
Exemplo n.º 3
0
        protected override bool PrepClose()
        {
            if ((uint)mChannelHandle != 0xFFFFFFFF)
            {
                //DS40xxSDKWrap.StopRegisterDrawFun((Int32)Target);
                DS40xxSDKWrap.SetImageStream(mChannelHandle, false, mFps, mWidth, mHeight, mImageBuf);

                if (DS40xxSDKWrap.ChannelClose(mChannelHandle) == 0)
                {
                    mChannelHandle = IntPtr.Zero;
                    return(true);
                }
            }
            return(false);
        }
Exemplo n.º 4
0
 protected override bool PrepOpen(object target)
 {
     if ((uint)mChannelHandle == 0xFFFFFFFF)
     {
         mChannelHandle = DS40xxSDKWrap.ChannelOpen((Int32)target);
         if ((uint)mChannelHandle != 0xFFFFFFFF)
         {
             //DS40xxSDKWrap.RegisterDrawFun((Int32)Target, ImageDrawer.DrawFun, 0);
             DS40xxSDKWrap.SetImageStream(mChannelHandle, true, mFps, mWidth, mHeight, mImageBuf);
             //ShowOSDType = ShowOSDType;
             return(true);
         }
     }
     return(false);
 }
Exemplo n.º 5
0
        private static bool CleanupCard()
        {
            lock (mInitObj)
            {
                if (mRefCount > 0)
                {
                    mRefCount--;
                }

                if (mDSPInit && mRefCount <= 0)
                {
                    DS40xxSDKWrap.RegisterImageStreamCallback(null, IntPtr.Zero);

                    DS40xxSDKWrap.DeInitDSPs();

                    mDSPInit      = false;
                    mRefCount     = 0;
                    mChannelCount = 0;
                    mPlays        = null;
                }
                return(!mDSPInit);
            }
        }
Exemplo n.º 6
0
        private static bool InitCard(VideoStandard_t VideoStandard)
        {
            lock (mInitObj)
            {
                mRefCount++;

                if (!mDSPInit)
                {
                    DS40xxSDKWrap.SetDefaultVideoStandard(VideoStandard);
                    mChannelCount = DS40xxSDKWrap.InitDSPs();
                    if (mChannelCount > 0)
                    {
                        mPlays = new HKCardPlayer[mChannelCount];

                        mImageStreamCallback = new IMAGE_STREAM_CALLBACK(DoImageStreamCallBack);
                        DS40xxSDKWrap.RegisterImageStreamCallback(mImageStreamCallback, IntPtr.Zero);

                        mDSPInit = true;
                    }
                }
                return(mDSPInit);
            }
        }
Exemplo n.º 7
0
 public bool RefreshPlayArea()
 {
     if (IsOpen)
     {
         if (IsPlay)
         {
             if (DS40xxSDKWrap.StopVideoPreview(mChannelHandle) == 0)
             {
                 win32.RECT rect = new win32.RECT();
                 win32.GetClientRect(HWnd, ref rect);
                 if (DS40xxSDKWrap.StartVideoPreview(mChannelHandle, HWnd, ref rect, true, TypeVideoFormat.vdfRGB24, mFps) == 0)
                 {
                     return(true);
                 }
                 else
                 {
                     Stop();
                 }
             }
             return(false);
         }
     }
     return(true);
 }