// 获得媒体信息
void CTranVideoTitleBar::OnBnClickedBtnTitleInf()
{
    SetCurrentPaneToActivePane();

    CVideoPane *pVideoPane = dynamic_cast<CVideoPane *>(m_pVideoPane);
    CHECK_POINTER_VOID(pVideoPane);

	//通知CU,由他来弹出对话框
	CVideoPaneMgr * pVideoPaneMgr = pVideoPane->GetVideoPaneMgr();
	CHECK_POINTER_VOID(pVideoPaneMgr);
	// 删除自适应大小对话框
	//	pVideoPaneMgr->DeleteRealtimeBarLocker();
	pVideoPaneMgr->DeleteSoundCtrl();

	//没有在实况,事件不触发
	if (VIDEO_PLAY_STATE_NOT_PLAYING == pVideoPane->GetPlayState())
	{
		return;
	}
	ULONG ulWinID = pVideoPane->GetPaneID();
	if (NULL != pVideoPane->GetOCXPlayerCtrl())
	{
		pVideoPane->GetOCXPlayerCtrl()->PostGetPlayInfoEventMsg(ulWinID);
	}
}
void CTranZoomTitleBar::OnKeyUp(UINT nChar, UINT nRepCnt, UINT nFlags)
{
	// TODO: Add your message handler code here and/or call default
	if (VK_RETURN == nChar)
	{
		return;
	}

	CVideoPane* pVideoPane = dynamic_cast<CVideoPane*>(m_pVideoPane);
	CHECK_POINTER_VOID(pVideoPane);

	CVideoPaneMgr * pVideoPaneMgr = pVideoPane->GetVideoPaneMgr();
	CHECK_POINTER_VOID(pVideoPaneMgr);

	if (pVideoPaneMgr->GetActivePaneID()!=pVideoPane->GetPaneID())
	{
		return;
	}

	CWnd *pWnd = pVideoPaneMgr->GetParentWnd();
	CHECK_POINTER_VOID(pWnd);

	::PostMessage(pWnd->GetSafeHwnd(),WM_KEYUP,static_cast<LONG>(nChar),0);//lint !e732

	//CTranslucentDialog::OnKeyUp(nChar, nRepCnt, nFlags);
}//lint !e715
Example #3
0
 void DecoderAudio::flush()
 {
     // TODO: more precise, should put a flush pkt
     CHECK_POINTER_VOID(mQueue);
     mQueue -> flush();
     CHECK_POINTER_VOID(mStream);
     avcodec_flush_buffers(mStream -> codec);
 }
void CTranZoomTitleBar::OnBnClickedClose()
{
	CVideoPane *pVideoPane = dynamic_cast<CVideoPane *>(m_pVideoPane);
	CHECK_POINTER_VOID(pVideoPane);
	CVideoPane *pSrcVideoPane = pVideoPane->GetMagnifySrcPane();
	CHECK_POINTER_VOID(pSrcVideoPane);
	::PostMessage(pSrcVideoPane->GetSafeHwnd(), WM_MAGNIFY_CLOSE, 0, (int)m_pVideoPane);
}
void CTranAnalysisToolBar::OnBnClickedBtnDisplayMode()
{
    SetCurrentPaneToActivePane();
	CVideoPane *pVideoPane = dynamic_cast<CVideoPane *>(m_pVideoPane);
	CHECK_POINTER_VOID(pVideoPane);
	CIVS_OCXPlayerCtrl *pPlayerCtrl = pVideoPane->GetOCXPlayerCtrl();
	CHECK_POINTER_VOID(pPlayerCtrl);
	pPlayerCtrl->PostToolBarClickEventMsg(1,IVS_IA_TOOLBAR_DISPLAY_MODE,pVideoPane->GetPaneID());
}
void CTranAnalysisToolBar::OnBnClickedBtnDelete()
{
	SetCurrentPaneToActivePane();
	CVideoPane *pVideoPane = dynamic_cast<CVideoPane *>(m_pVideoPane);
	CHECK_POINTER_VOID(pVideoPane);
	CIVS_OCXPlayerCtrl *pPlayerCtrl = pVideoPane->GetOCXPlayerCtrl();
	CHECK_POINTER_VOID(pPlayerCtrl);
	if (GRAPHICS_STATE_EDITING == pVideoPane->GetCurrentGraphicState())
	{
		pPlayerCtrl->PostToolBarClickEventMsg(1,IVS_IA_TOOLBAR_DELETE,pVideoPane->GetPaneID(),_T("Delete"));
// 	    pPlayerCtrl->IVS_OCX_Windows_Event(EVENT_INTELLIGENT_TOOL_BAR_DELETE, NULL);
	}
}
void CTranAnalysisToolBar::OnBnClickedBtnRect()
{
    SetCurrentPaneToActivePane();
	CVideoPane *pVideoPane = dynamic_cast<CVideoPane *>(m_pVideoPane);
	CHECK_POINTER_VOID(pVideoPane);
	CIVS_OCXPlayerCtrl *pPlayerCtrl = pVideoPane->GetOCXPlayerCtrl();
	CHECK_POINTER_VOID(pPlayerCtrl);
	pPlayerCtrl->PostToolBarClickEventMsg(1,IVS_IA_TOOLBAR_DRAW_RECT,pVideoPane->GetPaneID());
// 	if (GRAPHICS_STATE_EDITING == pVideoPane->GetCurrentGraphicState())
// 	{	
		pVideoPane->SetCurrentGraphicType(IA_GRAPHICS_TYPE_RECTANGLE);
		pVideoPane->SetCurrentGraphicState(GRAPHICS_STATE_DRAWING);
		(void)pVideoPane->SelectCancelWhileDraw();
// 	}
}
 void CXmlProcess::SetElemValueStr(const IVS_CHAR* pXmlValue,IVS_UINT32 ulLength,CXml &xml)
 {
	 CHECK_POINTER_VOID(pXmlValue);
	 IVS_CHAR* pXmlNewValue = IVS_NEW((IVS_CHAR* &)pXmlNewValue,ulLength+1);
	 CHECK_POINTER_VOID(pXmlNewValue);
	 memset(pXmlNewValue,0,ulLength+1);
	 if (!CToolsHelp::Memcpy(pXmlNewValue, ulLength+1, pXmlValue, ulLength))
	 {
		 BP_RUN_LOG_ERR(IVS_ALLOC_MEMORY_ERROR, "CToolsHelp::Memcpy fail", "NA");
		 IVS_DELETE(pXmlNewValue,MUILI);
		 return;
	 }
	 (void)xml.SetElemValue(pXmlNewValue);
	 IVS_DELETE(pXmlNewValue,MUILI);
 }
Example #9
0
    void DecoderAudio::onInitialize()
    {
        mSamplesSize = AVCODEC_MAX_AUDIO_FRAME_SIZE;
        mSamples     = (int16_t *) av_malloc(mSamplesSize);

        if (!mSamples ||!mStream)
        {
            return;
        }

        if (mStream -> start_time != AV_NOPTS_VALUE)
        {
            mAudioClock = mStream -> start_time * av_q2d(mStream -> time_base);
        }
        else
        {
            mAudioClock = 0.0;
        }

        LOGD("onInitialize mAudioClock:%f!", mAudioClock);

        mLastClock   = mAudioClock;
        mLastAbsTime = now();

        LOGD("onInitialize mLastAbsTime:%lld, now():%lld!", mLastAbsTime, now());
        CHECK_POINTER_VOID(mBuddy);
        mBuddy -> onInitialize();
    }
void CPlayTimerBar::StopVideoPlay()
{
	CVideoPane* pVideoPane = dynamic_cast<CVideoPane*>(m_pVideoPane);
	CHECK_POINTER_VOID(pVideoPane);

	(void)pVideoPane->StopRecordPlay();
}
void CPlayTimerBar::InitTimeRange()
{
	m_IvsTimer.InitTimeRange();
	CVideoPane* pVideoPane = dynamic_cast<CVideoPane*>(m_pVideoPane);
	CHECK_POINTER_VOID(pVideoPane);
	m_IvsTimer.SetVideoPane(pVideoPane);
}
void CTranAnalysisToolBar::OnBnClickedBtnPlay()
{
    SetCurrentPaneToActivePane();
	CVideoPane *pVideoPane = dynamic_cast<CVideoPane *>(m_pVideoPane);
	CHECK_POINTER_VOID(pVideoPane);
	CIVS_OCXPlayerCtrl *pPlayerCtrl = pVideoPane->GetOCXPlayerCtrl();
	CHECK_POINTER_VOID(pPlayerCtrl);
	if (m_IsStartPay)
	{
		pPlayerCtrl->PostToolBarClickEventMsg(1,IVS_IA_TOOLBAR_PLAY,pVideoPane->GetPaneID(),_T("Stop"));
// 		pPlayerCtrl->IVS_OCX_Windows_Event(EVENT_INTELLIGENT_TOOL_BAR_PAUSE, NULL);
	} else{ 
		pPlayerCtrl->PostToolBarClickEventMsg(1,IVS_IA_TOOLBAR_PLAY,pVideoPane->GetPaneID(),_T("Play"));
// 		pPlayerCtrl->IVS_OCX_Windows_Event(EVENT_INTELLIGENT_TOOL_BAR_PLAY, NULL);
	}
}
void CPlayTimerBar::SetPlayCurrentTime(const ST_TIME &stCurrenttime)
{
	CVideoPane* pVideoPane = dynamic_cast<CVideoPane*>(m_pVideoPane);
	CHECK_POINTER_VOID(pVideoPane);

	(void)m_IvsTimer.SetCurrentTime(stCurrenttime);
}
void CTranAnalysisToolBar::OnMouseMove(UINT nFlags, CPoint point)
{
    CVideoPane *pVideoPane = dynamic_cast<CVideoPane *>(m_pVideoPane);
    CHECK_POINTER_VOID(pVideoPane);
    pVideoPane->OnMouseMove(nFlags, point);
    CTranslucentDialog::OnMouseMove(nFlags, point);
}
// 调用接口获取当前回放时间
void CPlayTimerBar::GetPlayTime(ST_TIME& PlayTime)
{
    CVideoPane* pVideoPane = dynamic_cast<CVideoPane*>(m_pVideoPane);
    CHECK_POINTER_VOID(pVideoPane);

    pVideoPane->GetPlayBackCurrentTime(PlayTime);
}
Example #16
0
/**************************************************************************
* name       : OutOfElem
* description: 退出到上一级
* input      : NA
* output     : NA
* return     : NA
* remark     : NA
**************************************************************************/
void CXml::OutOfElem()
{
    CHECK_POINTER_VOID (m_pXmlNode);

    m_pXmlNode = m_pXmlNode->Parent();
    m_pXmlElem = m_pXmlNode->ToElement();
}
void CAutoResumeTrigger::onTrigger(void * /*pArg*/, ULONGLONG /*ullScales*/, TriggerStyle /*enStyle*/)
{
	CHECK_POINTER_VOID(m_pTVWallMgr);
    m_pTVWallMgr->HandleAutoResume();

    m_pTVWallMgr->DelIdleCh();
}
void CPlayTimerBar::ResetTimer()
{
	CVideoPane* pVideoPane = dynamic_cast<CVideoPane*>(m_pVideoPane);
	CHECK_POINTER_VOID(pVideoPane);
	//m_IvsTimer.InitTimeRange();
	m_IvsTimer.ResetTimer();
	//pVideoPane->ResetBarPosition();
}
void CPlayTimerBar::SetCurrentTime(const ST_TIME &time)
{
	SetCurrentPaneToActivePane();
	CVideoPane* pVideoPane = dynamic_cast<CVideoPane*>(m_pVideoPane);
	CHECK_POINTER_VOID(pVideoPane);
	m_stCurrentTime.iHour = time.iHour;
	m_stCurrentTime.iMinute = time.iMinute;
	m_stCurrentTime.iScond = time.iScond;
}
Example #20
0
/**************************************************************************
* name       : AddAttribute
* description: 添加元素属性
* input      : pszAttriName 待添加的属性名
               pszAttriValue 对应的属性值
* output     : NA
* return     : NA
* remark     : NA
**************************************************************************/
void CXml::AddAttribute(const char *pszAttriName, const char *pszAttriValue)
{
    if ((NULL == pszAttriName) || (NULL == pszAttriValue))
    {
        return;
    }

    CHECK_POINTER_VOID(m_pXmlElem);

    m_pXmlElem->SetAttribute(pszAttriName, pszAttriValue);
}
// 播放进度滑动条滑动事件
void CZoomSliderCtrl::ProcessSliderMoved()
{
	(void)AFX_MANAGE_STATE(AfxGetStaticModuleState());

	// 滑动条手动滑动
	m_ulSliderPosition = (ULONG) m_sliderMagbifyCtrl.GetPos();
	// 更新数字
	CTranZoomBar* pParent = dynamic_cast<CTranZoomBar*>(GetParent());
	CHECK_POINTER_VOID(pParent);
	pParent->SetMagnifyRate((IVS_INT32)m_ulSliderPosition);
	pParent->Invalidate(TRUE);

	// 将百分比跟对象传递出去
	CVideoPane *pVideoPane = dynamic_cast<CVideoPane *>(pParent->GetVideoPane());
	CHECK_POINTER_VOID(pVideoPane);
	CVideoPane *pSrcVideoPane = pVideoPane->GetMagnifySrcPane();
	CHECK_POINTER_VOID(pSrcVideoPane);
	::PostMessage(pSrcVideoPane->GetSafeHwnd(),WM_MAGNIFY_RATE_CHANGE, m_ulSliderPosition, (int)pVideoPane);
	return;
}
void CNSSOperator::ParseData2TLV(const void* pData, TNssTLVMsg& tlvMsg)const
{
	CHECK_POINTER_VOID(pData);
	tlvMsg.usiTag = ntohs(*(uint16_t*)pData);
	tlvMsg.uiLength = (uint32_t)ntohl(*(uint32_t*)((char*)pData+sizeof(uint16_t)));//lint !e826
	if (0 != tlvMsg.uiLength)
	{
		tlvMsg.pszValue = (char*)pData + sizeof(uint16_t) + sizeof(uint32_t);
	}
// 	tlvMsg = *(TNssTLVMsg*)pData;
// 	tlvMsg.usiTag = ntohs(tlvMsg.usiTag);
// 	tlvMsg.uiLength = (uint32_t)ntohl(tlvMsg.uiLength);
// 	tlvMsg.pszValue = (char*)pData + sizeof(uint16_t) + sizeof(uint32_t);
}
Example #23
0
    DecoderAudio::~DecoderAudio()
    {
        CHECK_POINTER_VOID(mBuddy);
        CHECK_POINTER_VOID(mLoopThread);
        mLoopThread -> quit();

        if (NULL != mQueue)
        {
            mQueue -> flush();
            av_free(mQueue);

            mQueue = NULL;
        }

        CHECK_POINTER_VOID(mStream);
        avcodec_close(mStream -> codec);

        if ((BuddyRunnable::GC_BY_EXTERNAL == mBuddy -> getGCFlags()) && (FOLLOWER == mBuddy -> getBuddyType()))
        {
            delete mBuddy;

            mBuddy = NULL;
        }
    }
void CSDKDecoderMgr::invoke(void *argc)
{
	CSDKDecoderMgr* pDecoderMgr = (CSDKDecoderMgr*)argc;
	CHECK_POINTER_VOID(pDecoderMgr);
	while(!pDecoderMgr->m_bThreadExit)
	{
		time_t lNow = time(NULL);
		if(pDecoderMgr->m_lLastLoginTime<(lNow-60))
		{//60一次
			pDecoderMgr->m_lLastLoginTime = lNow;
			pDecoderMgr->LoginToDecoder();
		}
		Sleep(500);
	}
	pDecoderMgr->m_lLastLoginTime = 0;
	VOS_pthread_exit(NULL);
}
Example #25
0
    void DecoderAudio::onFinalize()
    {
        CHECK_POINTER_VOID(mBuddy);

        if (mBuddy)
        {
            mBuddy -> onInitialize();
        }

        // Free audio samples buffer
        if (mSamples)
        {
            av_free(mSamples);

            mSamples = NULL;
        }

        // ourself stuff here
    }
void CTranVideoTitleBar::OnBnClickedBtnTitleOff()
{
    // 视频窗口右上角关闭事件,迭代一只做实况,后续要区分是实况还是回放
    SetCurrentPaneToActivePane();

    CVideoPane* pVideoPane = dynamic_cast<CVideoPane*>(m_pVideoPane);
    CHECK_POINTER_VOID(pVideoPane);

	pVideoPane->StopSerialSnapshot();
	if (pVideoPane->GetShowInstantStatus())
	{
		pVideoPane->ResumeRealPlay();
	}
	pVideoPane->SetResumeState(false);
	pVideoPane->SetStopDrag(true);
	CIVS_OCXPlayerCtrl *pCtrl = pVideoPane->GetOCXPlayerCtrl();
	ASSERT(NULL != pCtrl);
	(void)pCtrl->StopRealPlayByPane(pVideoPane);
    pCtrl->PostStopButtonClickMsg(pVideoPane->GetPaneID());
}
Example #27
0
void CXml::ModifyElemValueCDATA(const char *pszElemValue)
{
	if (NULL == pszElemValue)
	{
		return;
	}

	if (NULL == m_pXmlNode)
	{
		return;
	}

	TiXmlText *pXmlText = m_pXmlNode->FirstChild()->ToText();

    //判断指针是否为空
    CHECK_POINTER_VOID(pXmlText);

	pXmlText->SetCDATA(true);  // 添加CDATA属性
	pXmlText->SetValue(pszElemValue);
}
static void __SDK_CALL g_fNetDataCallBack( char *pBuf, unsigned int uiSize, void *pUser)//lint !e818 !e830
{
    CHECK_POINTER_VOID(pBuf);
    //获取回调出来的类对象;
    CMediaBase* pMediaBase = reinterpret_cast<CMediaBase*>(pUser);
    if (NULL == pMediaBase)
    {
        BP_RUN_LOG_ERR(IVS_FAIL,"Play back g_fNet Data Call Back", "transform pUser to MediaBase pointer failed.");
        return;
    }

    unsigned int uiPlayerChannel = pMediaBase->GetPlayerChannel();
    if (0 == uiPlayerChannel)
    {
        BP_RUN_LOG_ERR(IVS_FAIL,"Play back g_fNet Data Call Back", "pMediaBase's uiPlayerChannel = 0.");
        return;
    }

    (void)IVS_PLAY_InputRtpData(uiPlayerChannel, pBuf, uiSize);


    return;
}//lint !e818 !e528
void CTranZoomTitleBar::SetCurrentPaneToActivePane()
{
	CVideoPane* pVideoPane = dynamic_cast<CVideoPane*>(m_pVideoPane);
	CHECK_POINTER_VOID(pVideoPane);
	pVideoPane->SetActivePane();
}
void CPlayTimerBar::SetCurrentPaneToActivePane()
{
	CVideoPane* pVideoPane = dynamic_cast<CVideoPane*>(m_pVideoPane);
	CHECK_POINTER_VOID(pVideoPane);
	pVideoPane->SetActivePane();
}