protected override bool PrepOpen(object target) { lock (mSessionLockObject) { if (mSessionHandle < 0) { string sm = Config.StrValue("TransMethod"); mSessionHandle = StreamMediaClientSDKWrap.HIKS_CreatePlayer(mHikClientPtr, HWnd, IntPtr.Zero, IntPtr.Zero, Convert.ToInt32(sm)); } } if (mSessionHandle >= 0) { mPause = false; mOpened = -1; string url = GetURL(); int result = StreamMediaClientSDKWrap.HIKS_OpenURL(mSessionHandle, url, 0); if (result == 1) { //while (mOpened < 0) Thread.Sleep(100); Target = target; return(true); } } return(false); }
protected static bool Cleanup() { lock (mInitObj) { if (mRefCount > 0) { mRefCount--; } if (mSDKInit && mRefCount <= 0) { if (StreamMediaClientSDKWrap.FiniStreamClientLib() == 0) { mSDKInit = false; mRefCount = 0; return(true); } else { return(false); } } else { return(true); } } }
public override void Dispose() { if (mSessionHandle >= 0) { if (StreamMediaClientSDKWrap.HIKS_Destroy(mSessionHandle) == 0) { mSessionHandle = -1; } } base.Dispose(); }
protected static bool Init() { lock (mInitObj) { mRefCount++; if (!mSDKInit) { mSDKInit = StreamMediaClientSDKWrap.InitStreamClientLib() == 0; } return(mSDKInit); } }
protected override bool PrepClose() { if (mSessionHandle >= 0) { if (StreamMediaClientSDKWrap.HIKS_Stop(mSessionHandle) == 1) { mSessionHandle = -1; return(true); } } return(false); }
protected override bool PrepStop() { if (mSessionHandle >= 0) { if (StreamMediaClientSDKWrap.HIKS_Pause(mSessionHandle) == 1) { mPause = true; return(true); } } return(false); }
protected override bool PrepPlay() { if (mSessionHandle >= 0) { if (!mPause) { if (StreamMediaClientSDKWrap.HIKS_Play(mSessionHandle) == 1) { mPause = false; return(true); } } else { if (StreamMediaClientSDKWrap.HIKS_Resume(mSessionHandle) == 1) { mPause = false; return(true); } } } return(false); }