本文整理汇总了C++中TRACE_2函数的典型用法代码示例。如果您正苦于以下问题:C++ TRACE_2函数的具体用法?C++ TRACE_2怎么用?C++ TRACE_2使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了TRACE_2函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: parse_pes_header
/*!
* \brief Parse PES packet header, common to all PES packet types.
* \param *bitstr: The bitstream to use.
* \param *header: A pointer to a PES header structure.
* \return 1 if succeed, 0 otherwise.
*
* From 'ISO/IEC 13818-1' specification:
* 2.4.3.6 PES packet.
* Table 2-17 – PES packet.
*/
int parse_pes_header(Bitstream_t *bitstr, PesHeader_t *header)
{
TRACE_2(MPS, "> parse_pes_header()");
header->offset_start = bitstream_get_absolute_byte_offset(bitstr);
header->start_code = read_bits(bitstr, 32);
header->stream_id = header->start_code & 0x000000FF;
header->payload_length = read_bits(bitstr, 16);
header->packet_length = header->payload_length + 6;
header->offset_end = header->offset_start + header->packet_length;
return SUCCESS;
}
示例2: sendVoid
void sendVoid( void *data , size_t size )
{
TRACE_2( SERVER , "sendVoid()");
ssize_t b = 0;
if( lastRequester != 0 )
{
b = send( lastRequester , data , size , 0 );
if( b < 0 )
TRACE_WARNING( SERVER , "Fail to send data");
}
}
示例3: initEnvironment
int initEnvironment( void )
{
TRACE_2( COMMON , "initEnvironment().\n");
int ret = 0;
env = ( struct environment * )zmalloc( sizeof( struct environment ) );
if( !env )
{
TRACE_ERROR( COMMON , "Failed to allocate environment structure.\n");
ret = -ENOMEM;
}
return ret;
}
示例4: launchServer
void launchServer( void )
{
TRACE_2( SERVERMANAGER , "lanchServer()");
TRACE_1( SERVERMANAGER , "Start server on port %d..." , portCommander );
pthread_create( &serverCommanderThread , NULL , ( void * )&createServer , &portCommander );
TRACE_1( SERVERMANAGER , "Start server on port %d..." , portCli );
pthread_create( &serverCliThread , NULL , ( void * )&createServer , &portCli );
/* We have to increment the thread count by 2, because we don't use createThread() function. */
incrementThreadCount( 2 );
}
示例5: mqa_asapi_unregister
/****************************************************************************
Name : mqa_asapi_unregister
Description : This routine registers with ASAPi library.
Arguments : cb - MQA control block
Return Values : NCSCC_RC_SUCCESS/NCSCC_RC_FAILURE
Notes : None
******************************************************************************/
static void mqa_asapi_unregister(MQA_CB *cb)
{
ASAPi_OPR_INFO asapi_or;
uint32_t rc = NCSCC_RC_SUCCESS;
TRACE_ENTER();
/* Register with ASAPi library */
asapi_or.type = ASAPi_OPR_UNBIND;
if ((rc = asapi_opr_hdlr(&asapi_or)) != NCSCC_RC_SUCCESS) {
TRACE_2("ASAPi Deregisteration Failed with returncode %d", rc);
}
TRACE_LEAVE();
return;
}
示例6: writeFile
int writeFile( void *data )
{
TRACE_2( FILEMANAGER , "writeFile()");
static int firstTime = 0;
int status = PC_SUCCESS;
size_t ret;
FILE *f = NULL;
f = fopen( filename , "ab");
if( f == NULL )
{
TRACE_ERROR( FILEMANAGER , "f FILE is NULL");
status = PC_ERROR;
}
else
{
ret = fwrite( data , DATA_SIZE , 1 , f );
if( ret != 1 )
{
TRACE_ERROR( FILEMANAGER , "Not all data have been written.");
status = PC_ERROR;
}
else
{
TRACE_1( FILEMANAGER , "Data have been written.");
fclose( f );
if( firstTime++ == 10 )
{
TRACE_1( FILEMANAGER , "Start to stream file.");
streamFile( filename );
}
}
}
return status;
}
示例7: lga_mds_rcv
static uint32_t lga_mds_rcv(struct ncsmds_callback_info *mds_cb_info)
{
lgsv_msg_t *lgsv_msg = (lgsv_msg_t *)mds_cb_info->info.receive.i_msg;
uint32_t rc;
pthread_mutex_lock(&lga_cb.cb_lock);
/* process the message */
rc = lga_lgs_msg_proc(&lga_cb, lgsv_msg, mds_cb_info->info.receive.i_priority);
if (rc != NCSCC_RC_SUCCESS) {
TRACE_2("lga_lgs_msg_proc returned: %d", rc);
}
pthread_mutex_unlock(&lga_cb.cb_lock);
return rc;
}
示例8: freeMbArrayContent
/*!
* \param *dc The DecodingContext containing macroblock array we want to freed.
*
* This function try to freed every macroblock of the picture stored in mb_array.
* The total number of macroblocks is equal to (picture width / 16) * (picture height / 16).
*/
void freeMbArrayContent(DecodingContext_t *dc)
{
if (dc->mb_array != NULL)
{
unsigned int i = 0;
for (i = 0; i < dc->PicSizeInMbs; i++)
{
if (dc->mb_array[i] != NULL)
{
free(dc->mb_array[i]);
dc->mb_array[i] = NULL;
}
}
TRACE_2(MB, ">> mb_array content freed\n");
}
}
示例9: read_ebml_data_int
int64_t read_ebml_data_int(Bitstream_t *bitstr, EbmlElement_t *element,
FILE *xml, const char *name)
{
TRACE_2(MKV, "read_ebml_data_int2(%i bits)", element->size*8);
int64_t value = (int64_t)read_bits_64(bitstr, element->size*8);
if (name)
{
TRACE_1(MKV, "* %s = %lli", name, value);
if (xml)
{
fprintf(xml, " <%s>%" PRId64 "</%s>\n", name, value, name);
}
}
return value;
}
示例10: music_delivery
int music_delivery( sp_session *session , const sp_audioformat *format , const void *frames , int num_frames )
{
TRACE_2( PLAYERMANAGER , "music_delivery().");
TRACE_3( PLAYERMANAGER , "Playing music...%d" , num_frames );
audio_fifo_t *af = &g_audiofifo;
audio_fifo_data_t *afd;
size_t s;
TRACE_3( PLAYERMANAGER , "###############################################");
TRACE_3( PLAYERMANAGER , "Channels: %d" , format->channels );
TRACE_3( PLAYERMANAGER , "Rate: %d" , format->sample_rate );
TRACE_3( PLAYERMANAGER , "NSamples: %d" , num_frames );
TRACE_3( PLAYERMANAGER , "###############################################");
// audio discontinuity, do nothing
if( num_frames == 0 )
{
pthread_mutex_unlock( &af->mutex );
return 0;
}
// buffer one second of audio
if( af->qlen > format->sample_rate )
return 0;
s = num_frames * sizeof( int16_t ) * format->channels;
afd = zmalloc( sizeof( *afd ) + s );
afd->channels = format->channels;
afd->rate = format->sample_rate;
afd->nsamples = num_frames;
memcpy( afd->samples , frames , s );
TAILQ_INSERT_TAIL( &af->q , afd , link );
af->qlen += num_frames;
pthread_cond_signal( &af->cond );
pthread_mutex_unlock( &af->mutex );
return num_frames;
}
示例11: read_ebml_data_uint_UID
uint64_t read_ebml_data_uint_UID(Bitstream_t *bitstr, EbmlElement_t *element,
FILE *xml, const char *name)
{
TRACE_2(MKV, "read_ebml_data_uint_UID(%i bits)", element->size*8);
uint64_t value = read_bits_64(bitstr, element->size * 8);
if (name)
{
TRACE_1(MKV, "* %08X = %llu", name, value);
if (xml)
{
fprintf(xml, " <%s>0x%" PRIX64 "</%s>\n", name, value, name);
}
}
return value;
}
示例12: immnd_mds_msg_send
/****************************************************************************
Name : immnd_mds_msg_send
Description : This routine sends the Events from IMMND
Arguments : cb - ptr to the IMMND CB
i_evt - ptr to the IMMSV message
o_evt - ptr to the IMMSV message returned
timeout - timeout value in 10 ms
Return Values : NCSCC_RC_SUCCESS/NCSCC_RC_FAILURE
Notes : None.
******************************************************************************/
uint32_t immnd_mds_msg_send(IMMND_CB *cb, uint32_t to_svc, MDS_DEST to_dest, IMMSV_EVT *evt)
{
NCSMDS_INFO mds_info;
uint32_t rc;
if (!evt)
return NCSCC_RC_FAILURE;
m_NCS_LOCK(&cb->immnd_immd_up_lock, NCS_LOCK_WRITE);
if ((to_svc == NCSMDS_SVC_ID_IMMD) && (cb->is_immd_up == false)) {
/* IMMD is not UP */
TRACE_2("Director Service Is Down");
m_NCS_UNLOCK(&cb->immnd_immd_up_lock, NCS_LOCK_WRITE);
return NCSCC_RC_FAILURE;
}
m_NCS_UNLOCK(&cb->immnd_immd_up_lock, NCS_LOCK_WRITE);
memset(&mds_info, 0, sizeof(NCSMDS_INFO));
mds_info.i_mds_hdl = cb->immnd_mds_hdl;
mds_info.i_svc_id = NCSMDS_SVC_ID_IMMND;
mds_info.i_op = MDS_SEND;
/* fill the send structure */
mds_info.info.svc_send.i_msg = (NCSCONTEXT)evt;
mds_info.info.svc_send.i_priority = MDS_SEND_PRIORITY_MEDIUM;
mds_info.info.svc_send.i_to_svc = to_svc;
mds_info.info.svc_send.i_sendtype = MDS_SENDTYPE_SND;
mds_info.info.svc_send.info.snd.i_to_dest = to_dest;
immsv_msg_trace_send(to_dest, evt);
/* send the message */
rc = ncsmds_api(&mds_info);
if (rc != NCSCC_RC_SUCCESS) {
LOG_WA("MDS Send Failed to service:%s rc:%u",
(to_svc == NCSMDS_SVC_ID_IMMD) ? "IMMD" :
(to_svc == NCSMDS_SVC_ID_IMMA_OM) ? "IMMA OM" :
(to_svc == NCSMDS_SVC_ID_IMMA_OI) ? "IMMA OI" :
(to_svc == NCSMDS_SVC_ID_IMMND) ? "IMMND" : "NO SERVICE!", rc);
}
return rc;
}
示例13: loadMusic
int loadMusic( sp_session *session, char *uri , char *name , playqueue_fifo_t *playqueue )
{
TRACE_2( PLAYERMANAGER , "loadMusic().");
int status = PC_SUCCESS;
char response[255] = { 0 };
/* If it's the first time we load a track, we have to init the audio driver and the playqueue */
// if( firstTime++ == 0 )
// initPlayerEnv();
LOCK_MUTEX( PLAYERMANAGER , &mutexSession );
sp_track *track = NULL;
currentTrack = track;
if( createTrackFromUri( uri , name ) == PC_ERROR )
status = PC_ERROR;
if( currentTrack != NULL)
{
TRACE_1( PLAYERMANAGER , "Adding track to the playlist.");
addTracksToPlayqueue( playqueue , currentTrack );
snprintf( response , 255 , "OK");
sendVoid( ( void * )response , strlen( response ) );
}
else
{
TRACE_ERROR( PLAYERMANAGER , "Cannot add track to the playlist because track is NULL.");
status = PC_ERROR;
snprintf( response , 255 , "NOK: Cannot add the track to the playlist because the URI might be invalid.");
sendVoid( ( void * )response , strlen( response ) );
}
UNLOCK_MUTEX( PLAYERMANAGER , &mutexSession );
return status;
}
示例14: cpd_amf_csi_rmv_callback
/****************************************************************************
* Name : cpd_amf_csi_rmv_callback
*
* Description : TBD
*
*
* Return Values : None
*****************************************************************************/
void
cpd_amf_csi_rmv_callback(SaInvocationT invocation,
const SaNameT *compName, const SaNameT *csiName, SaAmfCSIFlagsT csiFlags)
{
CPD_CB *cb = 0;
SaAisErrorT saErr = SA_AIS_OK;
TRACE_ENTER();
cb = ncshm_take_hdl(NCS_SERVICE_ID_CPD, gl_cpd_cb_hdl);
if (cb) {
saAmfResponse(cb->amf_hdl, invocation, saErr);
ncshm_give_hdl(cb->cpd_hdl);
}
TRACE_2("cpd amf csi rmv cb invoked");
TRACE_LEAVE();
return;
}
示例15: sendVoidSocket
void sendVoidSocket( int socket , void *data , size_t size )
{
TRACE_2( SERVERMANAGER , "sendVoidSocket()");
ssize_t b = 0;
if( socket != 0 )
{
b = send( socket , data , size , 0 );
if( b < 0 )
TRACE_WARNING( SERVERMANAGER , "Fail to send data");
}
else
{
TRACE_ERROR( SERVERMANAGER , "Cannot send data, socket might be disconnected.");
}
}