当前位置: 首页>>代码示例>>C++>>正文


C++ SDK_ASSERT函数代码示例

本文整理汇总了C++中SDK_ASSERT函数的典型用法代码示例。如果您正苦于以下问题:C++ SDK_ASSERT函数的具体用法?C++ SDK_ASSERT怎么用?C++ SDK_ASSERT使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了SDK_ASSERT函数的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: m_Format

SdkAudioStream::SdkAudioStream(sdk_audio_format_enum_t format,int maxpackets,int * pRunningBits) :
    m_Format(format),
    m_MaxPackets(maxpackets) ,
    m_pRunningBits(pRunningBits)
{
    GMI_RESULT gmiret;
    gmiret = m_Mutex.Create(NULL);
    SDK_ASSERT(gmiret == GMI_SUCCESS);
#ifdef AUDIO_DUAL_FILE_EMULATE
#else
    m_Initialized = 0;
    m_Registered = 0;
#endif /*AUDIO_DUAL_FILE_EMULATE*/
    /*ipc client will init itself*/
    SDK_ASSERT(m_DataVec.size() == 0);
    SDK_ASSERT(m_DataLenVec.size() == 0);
    SDK_ASSERT(m_FrameNumVec.size() == 0);
    SDK_ASSERT(m_PtsVec.size() == 0);

#ifdef AUDIO_PULL_MODE
    m_ThreadRunning  =0 ;
    m_ThreadExited = 1;
    m_pThread = NULL;
#endif
}
开发者ID:JammyWei,项目名称:ver30,代码行数:25,代码来源:sdk_audio_stream.cpp

示例2: SDK_ASSERT

SnpDocumentActionHelper::VPB::~VPB()
{
	ASErr result = kNoErr;
	try {
		SDK_ASSERT(sAIActionManager);
		result = sAIActionManager->AIDeleteActionParamValue(fActionParamValueRef);
		SDK_ASSERT(!result);
		fActionParamValueRef = NULL;
	}
	catch (ai::Error) {
	}
}
开发者ID:btempleton,项目名称:sg-aics3mac-plugins,代码行数:12,代码来源:SnpDocumentActionHelper.cpp

示例3: fActionParamValueRef

SnpDocumentActionHelper::VPB::VPB() : fActionParamValueRef(NULL)
{
	ASErr result = kNoErr;
	try {
		SDK_ASSERT(sAIActionManager);
		result = sAIActionManager->AINewActionParamValue(&fActionParamValueRef);
		SDK_ASSERT(!result);
		SDK_ASSERT(fActionParamValueRef);
	}
	catch (ai::Error) {
	}
}
开发者ID:btempleton,项目名称:sg-aics3mac-plugins,代码行数:12,代码来源:SnpDocumentActionHelper.cpp

示例4: SDK_ASSERT

int SdkServerBuffer::StartStream(sys_stream_info_t * pStreamInfo)
{
    int ret;

    if (this->m_Started > 0)
    {
        return 0;
    }

    this->StopStream();

    if (this->m_StreamId < 0 ||
            this->m_StreamId >= MAX_STREAM_IDS || this->m_MaxPacks == 0)
    {
        return -EINVAL;
    }
    /*now ,first to change the stream*/
    ret = this->__CopyStreamInfo(&(this->m_StreamInfo),pStreamInfo);
    if (ret < 0)
    {
        this->StopStream();
        return ret;
    }
    SDK_ASSERT(this->m_pStream == NULL);

    this->m_pStream = new SdkServerStream(this->m_StreamId,this->m_StreamInfo.s_Compression);
    ret = this->m_pStream->StartStream();
    if (ret < 0)
    {
        this->StopStream();
        return ret;
    }

    SDK_ASSERT(this->m_pPacks == NULL);
    this->m_pPacks =(stream_pack_t**) calloc(sizeof(*(this->m_pPacks)),this->m_MaxPacks);
    if (this->m_pPacks == NULL)
    {
        this->StopStream();
        return -ENOMEM;
    }


    this->m_StartIdx = 0;
    this->m_EndIdx = 0;
    this->m_PackSize = 0;
    SDK_ASSERT(this->m_pClientBuffers.size() == 0);
    /*started */
    this->m_Started = 1;
    return 0;
}
开发者ID:JammyWei,项目名称:ver30,代码行数:50,代码来源:sdk_server_buffer.cpp

示例5: SDK_ASSERT

int SdkAudioStream::__PushStreamData(void * pData,uint32_t datalen,uint32_t idx,uint64_t pts)
{
    GMI_RESULT gmiret;
    int ret = 1;
    void* pRemovePtr=NULL;
    uint32_t discardnum =0;

    gmiret = this->m_Mutex.Lock(TIMEOUT_INFINITE);
    SDK_ASSERT(gmiret == GMI_SUCCESS);
    VECTOR_EQUAL_ASSERT();
    if(this->m_MaxPackets && this->m_DataVec.size() == this->m_MaxPackets)
    {
        /*we pick the most early one to get this packet*/
        pRemovePtr = this->m_DataVec[0];
        discardnum = this->m_FrameNumVec[0];
        this->m_DataVec.erase(this->m_DataVec.begin());
        this->m_DataLenVec.erase(this->m_DataLenVec.begin());
        this->m_PtsVec.erase(this->m_PtsVec.begin());
        this->m_FrameNumVec.erase(this->m_FrameNumVec.begin());

        /*now to insert*/
        this->m_DataVec.push_back(pData);
        this->m_DataLenVec.push_back(datalen);
        this->m_FrameNumVec.push_back(idx);
        this->m_PtsVec.push_back(pts);
        ret = 0;
        SDK_ASSERT(this->m_DataVec.size() == this->m_MaxPackets || this->m_MaxPackets == 0);

    }
    else
    {
        ret = 1;
        /*now to insert*/
        this->m_DataVec.push_back(pData);
        this->m_DataLenVec.push_back(datalen);
        this->m_FrameNumVec.push_back(idx);
        this->m_PtsVec.push_back(pts);
    }
    this->m_Mutex.Unlock();

    if(pRemovePtr)
    {
        DEBUG_INFO("discard frame number %d\n",discardnum);
        free(pRemovePtr);
    }
    pRemovePtr = NULL;
    return ret;
}
开发者ID:JammyWei,项目名称:ver30,代码行数:48,代码来源:sdk_audio_stream.cpp

示例6: SDK_ASSERT

void SdkServerStream::__ClearVectors()
{
    GMI_RESULT gmiret;
    gmiret = this->m_Mutex.Lock(TIMEOUT_INFINITE);
    SDK_ASSERT(gmiret ==GMI_SUCCESS);

    SIZE_EQUAL_ASSERT();
    while(this->m_DataVec.size() > 0)
    {
        void* pData=NULL;
        pData = this->m_DataVec[0];
        this->m_DataVec.erase(this->m_DataVec.begin());
        this->m_DataLen.erase(this->m_DataLen.begin());
        this->m_DataType.erase(this->m_DataType.begin());
        this->m_DataIdx.erase(this->m_DataIdx.begin());
        this->m_DataPts.erase(this->m_DataPts.begin());
        if(pData)
        {
            DEBUG_INFO("data %p\n",pData);
            free(pData);
        }
        pData = NULL;
    }

    SIZE_EQUAL_ASSERT();
    this->m_Mutex.Unlock();
    return ;
}
开发者ID:JammyWei,项目名称:ver30,代码行数:28,代码来源:sdk_server_stream.cpp

示例7: DEBUG_INFO

    /*now first to initialize*/
    for(i=0; i<100; i++)
    {
        gmiret = this->m_IPCClient.Initialize(startport + i,GM_STREAM_APPLICATION_ID);
        if(gmiret == GMI_SUCCESS)
        {
            DEBUG_INFO("Initialize Port (%d)\n",startport + i);
            break;
        }
    }

    if(gmiret != GMI_SUCCESS)
    {
        return -EFAULT;
    }
    this->m_Initialized = 1;

    serverport += this->m_StreamId;
    if(this->m_Type == SYS_COMP_H264)
    {
        type = MEDIA_VIDEO_H264;
    }
    else if(this->m_Type == SYS_COMP_MJPEG)
    {
        type = MEDIA_VIDEO_MJPEG;
    }
    else if(this->m_Type == SYS_COMP_MPEG4)
    {
        type = MEDIA_VIDEO_MPEG4;
    }
    else
    {
        this->__ClearIPC();
        return -EFAULT;
    }
#ifdef STREAM_PULL_MODE
    gmiret = this->m_IPCClient.Register(serverport,type,this->m_StreamId,true,NULL,NULL);
#else
    gmiret = GMI_FAIL;
#endif
    if(gmiret != GMI_SUCCESS)
    {
        ERROR_INFO("register port %d at streamid %d error 0x%08lx\n",
                   serverport,this->m_StreamId,gmiret);
        this->__ClearIPC();
        return -EFAULT;
    }
    this->m_Registered = 1;
    return 0;
}


#endif /*VIDEO_STREAM_EMULATE*/

#ifdef VIDEO_STREAM_EMULATE

#ifdef STREAM_PULL_MODE
#define THREAD_EXIT_ASSERT() \
do\
{\
    SDK_ASSERT(this->m_ThreadRunning  == 0);\
    SDK_ASSERT(this->m_ThreadExited == 1);\
    SDK_ASSERT(this->m_pThread == NULL);\
}\
while(0)

#else

#define THREAD_EXIT_ASSERT() \
do\
{\
	;\
}\
while(0)


#endif /*STREAM_PULL_MODE*/


#else  /*VIDEO_STREAM_EMULATE*/

#ifdef STREAM_PULL_MODE
#define THREAD_EXIT_ASSERT() \
do\
{\
    SDK_ASSERT(this->m_ThreadRunning  == 0);\
    SDK_ASSERT(this->m_ThreadExited == 1);\
    SDK_ASSERT(this->m_pThread == NULL);\
    SDK_ASSERT(this->m_Initialized == 0);\
    SDK_ASSERT(this->m_Registered == 0);\
}\
while(0)

#else

#define THREAD_EXIT_ASSERT() \
do\
{\
    SDK_ASSERT(this->m_Initialized == 0);\
    SDK_ASSERT(this->m_Registered == 0);\
//.........这里部分代码省略.........
开发者ID:JammyWei,项目名称:ver30,代码行数:101,代码来源:sdk_server_stream.cpp

示例8: SDK_ASSERT

int SdkServerSession::__StartKeepAliveTimer()
{
    float ftime = (float)this->m_KeepAliveTime;
    SDK_ASSERT(this->m_InsertKeepAliveTimer == 0);
    ev_timer_init(&(this->m_KeepAliveTimer),SdkServerSession::KeepAliveTimerFunc,ftime,0.0,this);
    ev_timer_start(EV_DEFAULT,&(this->m_KeepAliveTimer));
    this->m_InsertKeepAliveTimer = 1;
    return 0;
}
开发者ID:JammyWei,项目名称:ver30,代码行数:9,代码来源:sdk_server_session.cpp

示例9: switch

int SdkServerBuffer::ForwardStreamData(int sock,struct iovec * pIoVec,int iovlen,int forwardlen)
{
    int ret;
    unsigned int i;
    client_buffer_t* pCBuffer=NULL,*pFindCBuffer=NULL;

    for (i=0; i<this->m_pClientBuffers.size(); i++)
    {
        pCBuffer = this->m_pClientBuffers[i];
        if (sock == pCBuffer->m_Sock)
        {
            pFindCBuffer = pCBuffer;
            break;
        }
    }

    if (pFindCBuffer == NULL)
    {
        return -ENODEV;
    }

    pCBuffer = pFindCBuffer;
    switch(pCBuffer->m_State)
    {
    case cb_end_state:
        /*this can not be happend ,so we make bug*/
        SDK_ASSERT(0!=0);
        ret = -EINVAL;
        break;
    case cb_i_frame_state:
    case cb_seq_state:
    case cb_block_state:
    case cb_pending_state:
        ret = this->__ForwardStreamDataInner(pCBuffer,pIoVec,iovlen,forwardlen);
        break;
    default:
        /*this can not be happend ,so we make bug*/
        SDK_ASSERT(0!=0);
        ret = -EFAULT;
        break;
    }

    return ret;
}
开发者ID:JammyWei,项目名称:ver30,代码行数:44,代码来源:sdk_server_buffer.cpp

示例10: ERROR_INFO

int SdkServerBuffer::GetStreamData(int sock,struct iovec * pIoVec,int & iovlen,int & begin)
{
    int ret;
    unsigned int i;
    client_buffer_t *pCBuffer=NULL,*pFindCBuffer=NULL;

    for (i=0; i<this->m_pClientBuffers.size(); i++)
    {
        pCBuffer = this->m_pClientBuffers[i];
        if (pCBuffer->m_Sock == sock)
        {
            pFindCBuffer = pCBuffer;
            break;
        }
    }

    if (pFindCBuffer == NULL)
    {
        ERROR_INFO("sock %d clientbuffers %d\n",sock,
                   this->m_pClientBuffers.size());
        return -ENODEV;
    }

    if(pFindCBuffer->m_Failed)
    {
        /*we have failed before ,so we should just return error*/
        return -EFAULT;
    }
    pCBuffer = pFindCBuffer;
    switch(pCBuffer->m_State)
    {
    case cb_end_state:
        ret = this->__GetStreamDataEndState(pCBuffer,pIoVec,iovlen,begin);
        break;
    case cb_i_frame_state:
        ret = this->__GetStreamDataIFrameState(pCBuffer,pIoVec,iovlen,begin);
        break;
    case cb_seq_state:
        ret = this->__GetStreamDataSeqState(pCBuffer,pIoVec,iovlen,begin);
        break;
    case cb_block_state:
        ret = this->__GetStreamDataBlockState(pCBuffer,pIoVec,iovlen,begin);
        break;
    case cb_pending_state:
        ret = this->__GetStreamDataPendingState(pCBuffer,pIoVec,iovlen,begin);
        break;
    default:
        SDK_ASSERT(0!=0);
        ret = -EINVAL;
        break;
    }

    return ret;

}
开发者ID:JammyWei,项目名称:ver30,代码行数:55,代码来源:sdk_server_buffer.cpp

示例11: SDK_ASSERT

ASErr SnpSelectionHelper::DeselectAll()
{
	ASErr result = kNoErr;
	try {
		SDK_ASSERT(sAIMatchingArt);
		result = sAIMatchingArt->DeselectAll();
		aisdk::check_ai_error(result);
	}
	catch (ai::Error& ex) {
		result = ex;
	}
	return result;
}
开发者ID:btempleton,项目名称:sg-aics3mac-plugins,代码行数:13,代码来源:SnpSelectionHelper.cpp

示例12: m_StreamId

SdkServerBuffer::SdkServerBuffer(int streamid,int maxpacks,int* pRunningBits)
    : m_StreamId(streamid)
    ,m_MaxPacks(maxpacks)
    ,m_pRunningBits(pRunningBits)
{
    m_Started = 0 ;
    memset(&m_StreamInfo,0,sizeof(m_StreamInfo));
    m_pPacks = NULL;
    m_StartIdx = 0;
    m_EndIdx = 0;
    m_PackSize = 0;
    SDK_ASSERT(m_pClientBuffers.size() == 0);
    m_pStream = NULL;
}
开发者ID:JammyWei,项目名称:ver30,代码行数:14,代码来源:sdk_server_buffer.cpp


注:本文中的SDK_ASSERT函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。