本文整理汇总了C++中TSK_DEBUG_INFO函数的典型用法代码示例。如果您正苦于以下问题:C++ TSK_DEBUG_INFO函数的具体用法?C++ TSK_DEBUG_INFO怎么用?C++ TSK_DEBUG_INFO使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了TSK_DEBUG_INFO函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: tdav_consumer_audiounit_stop
static int tdav_consumer_audiounit_stop(tmedia_consumer_t* self)
{
tdav_consumer_audiounit_t* consumer = (tdav_consumer_audiounit_t*)self;
if(!consumer){
TSK_DEBUG_ERROR("Invalid parameter");
return -1;
}
if(!consumer->started){
TSK_DEBUG_INFO("Not started");
return 0;
}
else {
int ret = tdav_audiounit_handle_stop(consumer->audioUnitHandle);
if(ret){
TSK_DEBUG_ERROR("tdav_audiounit_handle_stop failed with error code=%d", ret);
return ret;
}
}
#if TARGET_OS_IPHONE
//https://devforums.apple.com/thread/118595
if(consumer->audioUnitHandle){
tdav_audiounit_handle_destroy(&consumer->audioUnitHandle);
}
#endif
consumer->started = tsk_false;
TSK_DEBUG_INFO("AudioUnit consumer stoppped");
return 0;
}
示例2: tdav_speex_jitterbuffer_open
static int tdav_speex_jitterbuffer_open(tmedia_jitterbuffer_t* self, uint32_t frame_duration, uint32_t rate, uint32_t channels)
{
tdav_speex_jitterbuffer_t *jitterbuffer = (tdav_speex_jitterbuffer_t *)self;
spx_int32_t tmp;
TSK_DEBUG_INFO("Open speex jb (ptime=%u, rate=%u)", frame_duration, rate);
if(!(jitterbuffer->state = jitter_buffer_init((int)frame_duration))){
TSK_DEBUG_ERROR("jitter_buffer_init() failed");
return -2;
}
jitterbuffer->rate = rate;
jitterbuffer->frame_duration = frame_duration;
jitterbuffer->channels = channels;
jitterbuffer->x_data_size = ((frame_duration * jitterbuffer->rate) / 500) << (channels == 2 ? 1 : 0);
jitter_buffer_ctl(jitterbuffer->state, JITTER_BUFFER_GET_MARGIN, &tmp);
TSK_DEBUG_INFO("Default Jitter buffer margin=%d", tmp);
jitter_buffer_ctl(jitterbuffer->state, JITTER_BUFFER_GET_MAX_LATE_RATE, &tmp);
TSK_DEBUG_INFO("Default Jitter max late rate=%d", tmp);
if((tmp = tmedia_defaults_get_jb_margin()) >= 0){
jitter_buffer_ctl(jitterbuffer->state, JITTER_BUFFER_SET_MARGIN, &tmp);
TSK_DEBUG_INFO("New Jitter buffer margin=%d", tmp);
}
if((tmp = tmedia_defaults_get_jb_max_late_rate()) >= 0){
jitter_buffer_ctl(jitterbuffer->state, JITTER_BUFFER_SET_MAX_LATE_RATE, &tmp);
TSK_DEBUG_INFO("New Jitter buffer max late rate=%d", tmp);
}
return 0;
}
示例3: tdav_producer_audiounit_stop
static int tdav_producer_audiounit_stop(tmedia_producer_t* self)
{
tdav_producer_audiounit_t* producer = (tdav_producer_audiounit_t*)self;
if(!producer){
TSK_DEBUG_ERROR("Invalid parameter");
return -1;
}
if(!producer->started){
TSK_DEBUG_INFO("Not started");
return 0;
}
else {
int ret = tdav_audiounit_handle_stop(producer->audioUnitHandle);
if(ret){
TSK_DEBUG_ERROR("tdav_audiounit_handle_stop failed with error code=%d", ret);
// do not return even if failed => we MUST stop the thread!
}
#if TARGET_OS_IPHONE
//https://devforums.apple.com/thread/118595
if(producer->audioUnitHandle){
tdav_audiounit_handle_destroy(&producer->audioUnitHandle);
}
#endif
}
producer->started = tsk_false;
TSK_DEBUG_INFO("AudioUnit producer stoppped");
return 0;
}
示例4: tdav_codec_opus_open
static int tdav_codec_opus_open(tmedia_codec_t* self)
{
tdav_codec_opus_t* opus = (tdav_codec_opus_t*)self;
int opus_err;
if(!opus) {
TSK_DEBUG_ERROR("Invalid parameter");
return -1;
}
// Initialize the decoder
if(!opus->decoder.inst) {
TSK_DEBUG_INFO("[OPUS] Open decoder: rate=%d, channels=%d", (int)self->in.rate, (int)TMEDIA_CODEC_AUDIO(self)->in.channels);
if(!(opus->decoder.inst = opus_decoder_create((opus_int32)self->in.rate, (int)TMEDIA_CODEC_AUDIO(self)->in.channels, &opus_err)) || opus_err != OPUS_OK) {
TSK_DEBUG_ERROR("Failed to create Opus decoder(rate=%d, channels=%d) instance with error code=%d.", (int)self->in.rate, (int)TMEDIA_CODEC_AUDIO(self)->in.channels, opus_err);
return -2;
}
}
opus->decoder.last_seq = 0;
// Initialize the encoder
if(!opus->encoder.inst) {
TSK_DEBUG_INFO("[OPUS] Open encoder: rate=%d, channels=%d", (int)self->out.rate, (int)TMEDIA_CODEC_AUDIO(self)->out.channels);
if(!(opus->encoder.inst = opus_encoder_create((opus_int32)self->out.rate, (int)TMEDIA_CODEC_AUDIO(self)->out.channels, OPUS_APPLICATION_VOIP, &opus_err)) || opus_err != OPUS_OK) {
TSK_DEBUG_ERROR("Failed to create Opus decoder(rate=%d, channels=%d) instance with error code=%d.", (int)self->out.rate, (int)TMEDIA_CODEC_AUDIO(self)->out.channels, opus_err);
return -2;
}
}
#if TDAV_UNDER_MOBILE /* iOS, Android and WP8 */
opus_encoder_ctl(opus->encoder.inst, OPUS_SET_COMPLEXITY(3));
#endif
opus_encoder_ctl(opus->encoder.inst, OPUS_SET_SIGNAL(OPUS_SIGNAL_VOICE));
return 0;
}
示例5: __record_thread
static void* TSK_STDCALL __record_thread(void *param)
{
tdav_producer_waveapi_t* producer = (tdav_producer_waveapi_t*)param;
DWORD dwEvent;
tsk_size_t i;
TSK_DEBUG_INFO("__record_thread -- START");
SetPriorityClass(GetCurrentThread(), REALTIME_PRIORITY_CLASS);
for(;;){
dwEvent = WaitForMultipleObjects(2, producer->events, FALSE, INFINITE);
if (dwEvent == 1){
break;
}
else if (dwEvent == 0){
EnterCriticalSection(&producer->cs);
for(i = 0; i< sizeof(producer->hWaveHeaders)/sizeof(LPWAVEHDR); i++){
if(producer->hWaveHeaders[i] && (producer->hWaveHeaders[i]->dwFlags & WHDR_DONE)){
record_wavehdr(producer, producer->hWaveHeaders[i]);
}
}
LeaveCriticalSection(&producer->cs);
}
}
TSK_DEBUG_INFO("__record_thread() -- STOP");
return tsk_null;
}
示例6: publish_handle_event
int publish_handle_event(const tsip_event_t *_event)
{
const tsip_publish_event_t* pub_event = TSIP_PUBLISH_EVENT(_event);
const session_t* session;
tsip_ssession_id_t sid;
/* Find associated session */
sid = tsip_ssession_get_id(_event->ss);
if(!(session = session_get_by_sid(ctx->sessions, sid))){
TSK_DEBUG_WARN("Failed to match session event.");
return -1;
}
switch(pub_event->type){
case tsip_ao_publish: /* Answer to outgoing PUBLISH */
{
if(_event->sipmessage){
if(TSIP_MESSAGE_IS_RESPONSE(_event->sipmessage)){
TSK_DEBUG_INFO("Event: Answer to outgoing PUBLISH. Code=%d and phrase=%s",
_event->sipmessage->line.response.status_code, _event->sipmessage->line.response.reason_phrase);
}
else{
// request
}
}
break;
}
case tsip_ao_unpublish: /* Answer to outgoing unPUBLISH */
{
if(_event->sipmessage){
if(TSIP_MESSAGE_IS_RESPONSE(_event->sipmessage)){
TSK_DEBUG_INFO("Event: Answer to outgoing UNPUBLISH. Code=%d and phrase=%s",
_event->sipmessage->line.response.status_code, _event->sipmessage->line.response.reason_phrase);
}
else{
// request
}
}
break;
}
/* Server events (For whose dev. Server Side IMS Services) */
case tsip_i_publish: /* Incoming PUBLISH */
case tsip_i_unpublish: /* Incoming unPUBLISH */
{
TSK_DEBUG_WARN("Event not support by Client Framework.");
break;
}
default:
{ /* Any other event */
TSK_DEBUG_WARN("%d not a valid SIP Subscription event.", pub_event->type);
break;
}
}
return 0;
}
示例7: __CFWriteStreamClientCallBack
void __CFWriteStreamClientCallBack(CFWriteStreamRef stream, CFStreamEventType eventType, void *clientCallBackInfo) {
// Extract the context
tnet_transport_t *transport = (tnet_transport_t *) clientCallBackInfo;
transport_context_t *context = transport->context;
/* lock context */
tsk_safeobj_lock(context);
// Extract the native socket
CFDataRef data = CFWriteStreamCopyProperty(stream, kCFStreamPropertySocketNativeHandle);
CFSocketNativeHandle fd;
CFDataGetBytes(data, CFRangeMake(0, sizeof(CFSocketNativeHandle)), (UInt8*) &fd);
CFRelease(data);
transport_socket_t *sock = (transport_socket_t *) getSocket(context, fd);
switch(eventType) {
case kCFStreamEventOpenCompleted:
{
TSK_DEBUG_INFO("__CFWriteStreamClientCallBack --> kCFStreamEventOpenCompleted");
if (TNET_SOCKET_TYPE_IS_SECURE(sock->type)) {
#if !TARGET_OS_IPHONE
SSLContextRef sslContext = NULL;
data = CFWriteStreamCopyProperty(stream, kCFStreamPropertySocketSSLContext);
CFDataGetBytes(data, CFRangeMake(0, sizeof(SSLContextRef)), (UInt8*) &sslContext);
CFRelease(data);
// TODO: Set the client certificates
#endif
}
break;
}
case kCFStreamEventEndEncountered:
case kCFStreamEventErrorOccurred:
{
// Get the error code
CFErrorRef error = CFWriteStreamCopyError(stream);
CFIndex index = CFErrorGetCode(error);
CFRelease(error);
TSK_DEBUG_INFO("__CFWriteStreamClientCallBack --> Error %lu", index);
TSK_RUNNABLE_ENQUEUE(transport, event_error, transport->callback_data, sock->fd);
removeSocket(sock, context);
break;
}
default:
{
// Not Implemented
assert(42 == 0);
break;
}
}
/* unlock context */
tsk_safeobj_unlock(context);
}
示例8: TSK_DEBUG_INFO
static void *__playback_thread(void *param)
{
tdav_producer_dsound_t* dsound = (tdav_producer_dsound_t*)param;
HRESULT hr;
LPVOID lpvAudio1, lpvAudio2;
DWORD dwBytesAudio1, dwBytesAudio2;
TSK_DEBUG_INFO("__record_thread -- START");
SetPriorityClass(GetCurrentThread(), REALTIME_PRIORITY_CLASS);
for(;;){
DWORD dwEvent = WaitForMultipleObjects(sizeof(dsound->notifEvents)/sizeof(HANDLE), dsound->notifEvents, FALSE, INFINITE);
if(!dsound->started){
break;
}
else {
// lock
if((hr = IDirectSoundCaptureBuffer_Lock(dsound->captureBuffer, (dwEvent * dsound->bytes_per_notif), dsound->bytes_per_notif, &lpvAudio1, &dwBytesAudio1, &lpvAudio2, &dwBytesAudio2, 0)) != DS_OK){
tdav_win32_print_error("IDirectSoundCaptureBuffer_Lock", hr);
goto next;
}
if(TMEDIA_PRODUCER(dsound)->enc_cb.callback){
if(lpvAudio2){
TMEDIA_PRODUCER(dsound)->enc_cb.callback(TMEDIA_PRODUCER(dsound)->enc_cb.callback_data, lpvAudio1, dwBytesAudio1);
TMEDIA_PRODUCER(dsound)->enc_cb.callback(TMEDIA_PRODUCER(dsound)->enc_cb.callback_data, lpvAudio2, dwBytesAudio2);
}
else{
TMEDIA_PRODUCER(dsound)->enc_cb.callback(TMEDIA_PRODUCER(dsound)->enc_cb.callback_data, lpvAudio1, dwBytesAudio1);
}
}
// unlock
if((hr = IDirectSoundCaptureBuffer_Unlock(dsound->captureBuffer, lpvAudio1, dwBytesAudio1, lpvAudio2, dwBytesAudio2)) != DS_OK){
tdav_win32_print_error("IDirectSoundCaptureBuffer_Unlock", hr);
goto next;
}
next:;
}
}
TSK_DEBUG_INFO("__record_thread -- STOP");
return tsk_null;
}
示例9: addSocket
/*== Add new socket ==*/
int addSocket(tnet_fd_t fd, tnet_socket_type_t type, tnet_transport_t *transport, tsk_bool_t take_ownership, tsk_bool_t is_client)
{
transport_context_t *context = transport?transport->context:0;
if (context) {
transport_socket_t *sock = tsk_calloc(1, sizeof(transport_socket_t));
sock->fd = fd;
sock->type = type;
sock->owner = take_ownership;
// TODO: Find out how to specify client certificate
//if (TNET_SOCKET_TYPE_IS_TLS(sock->type)) {
// sock->tlshandle = tnet_sockfd_set_tlsfiles(sock->fd, is_client, transport->tls.ca, transport->tls.pvk, transport->tls.pbk);
//}
tsk_safeobj_lock(context);
context->sockets[context->count] = sock;
context->count++;
tsk_safeobj_unlock(context);
TSK_DEBUG_INFO("Socket added");
return 0;
}
else{
TSK_DEBUG_ERROR("Context is Null.");
return -1;
}
}
示例10: tdav_consumer_audiounit_deinit
int tdav_consumer_audiounit_deinit(tmedia_consumer_t* self)
{
tdav_consumer_audiounit_t* consumer = (tdav_consumer_audiounit_t*)self;
if(!consumer) {
TSK_DEBUG_ERROR("Invalid parameter");
return -1;
}
// Stop
if (consumer->started) {
int ret = tdav_audiounit_handle_stop(consumer->audioUnitHandle);
if (ret) {
TSK_DEBUG_ERROR("tdav_audiounit_handle_stop failed with error code=%d", ret);
}
consumer->started = tsk_false;
}
// Destroy handle (will be re-created by the next start)
#if TARGET_OS_IPHONE
//https://devforums.apple.com/thread/118595
if (consumer->audioUnitHandle) {
tdav_audiounit_handle_destroy(&consumer->audioUnitHandle);
}
#endif
consumer->ready = tsk_false;
consumer->paused = tsk_false;
TSK_DEBUG_INFO("AudioUnit consumer deinitialized");
return 0;
}
示例11: tnet_transport_sendto
/*
* Sends dgarm to the specified destionation.
*/
tsk_size_t tnet_transport_sendto(const tnet_transport_handle_t *handle, tnet_fd_t from, const struct sockaddr *to, const void* buf, tsk_size_t size)
{
tnet_transport_t *transport = (tnet_transport_t*)handle;
WSABUF wsaBuffer;
DWORD numberOfBytesSent = 0;
int ret = -1;
if (!transport){
TSK_DEBUG_ERROR("Invalid server handle.");
return ret;
}
if (!TNET_SOCKET_TYPE_IS_DGRAM(transport->master->type)){
TSK_DEBUG_ERROR("In order to use WSASendTo you must use an udp transport.");
return ret;
}
wsaBuffer.buf = (CHAR*)buf;
wsaBuffer.len = (ULONG)size;
if ((ret = WSASendTo(from, &wsaBuffer, 1, &numberOfBytesSent, 0, to, tnet_get_sockaddr_size(to), 0, 0)) == SOCKET_ERROR){
if ((ret = WSAGetLastError()) == WSA_IO_PENDING){
TSK_DEBUG_INFO("WSA_IO_PENDING error for WSASendTo SSESSION");
ret = 0;
}
else{
TNET_PRINT_LAST_ERROR("WSASendTo have failed.");
return ret;
}
}
else ret = 0;
return numberOfBytesSent;
}
示例12: tdav_consumer_audio_set
int tdav_consumer_audio_set(tdav_consumer_audio_t* self, const tmedia_param_t* param)
{
if(!self){
TSK_DEBUG_ERROR("Invalid parameter");
return -1;
}
if(param->plugin_type == tmedia_ppt_consumer){
if(param->value_type == tmedia_pvt_int32){
if(tsk_striequals(param->key, "gain")){
int32_t gain = *((int32_t*)param->value);
if(gain<TDAV_AUDIO_GAIN_MAX && gain>=0){
TMEDIA_CONSUMER(self)->audio.gain = (uint8_t)gain;
TSK_DEBUG_INFO("audio consumer gain=%u", gain);
}
else{
TSK_DEBUG_ERROR("%u is invalid as gain value", gain);
return -2;
}
}
else if(tsk_striequals(param->key, "volume")){
TMEDIA_CONSUMER(self)->audio.volume = TSK_TO_INT32((uint8_t*)param->value);
TMEDIA_CONSUMER(self)->audio.volume = TSK_CLAMP(0, TMEDIA_CONSUMER(self)->audio.volume, 100);
}
}
}
return 0;
}
示例13: dummy_pause
int dummy_pause(tmedia_t* self)
{
dummy_t *dummy = DUMMY(self);
TSK_DEBUG_INFO("dummy_pause");
return 0;
}
示例14: dummy_stop
int dummy_stop(tmedia_t* self)
{
dummy_t *dummy = DUMMY(self);
TSK_DEBUG_INFO("dummy_stop");
return 0;
}
示例15: tnet_transport_dtor
static tsk_object_t* tnet_transport_dtor(tsk_object_t * self)
{
tnet_transport_t *transport = self;
if (transport){
tnet_transport_set_callback(transport, tsk_null, tsk_null);
tnet_transport_shutdown(transport);
TSK_OBJECT_SAFE_FREE(transport->master);
TSK_OBJECT_SAFE_FREE(transport->context);
TSK_OBJECT_SAFE_FREE(transport->natt_ctx);
TSK_FREE(transport->local_ip);
TSK_FREE(transport->local_host);
// proxy
TSK_OBJECT_SAFE_FREE(transport->proxy.info);
// (tls and dtls) = ssl
TSK_FREE(transport->tls.ca);
TSK_FREE(transport->tls.pbk);
TSK_FREE(transport->tls.pvk);
_tnet_transport_ssl_deinit(transport); // openssl contexts
TSK_DEBUG_INFO("*** Transport (%s) destroyed ***", transport->description);
TSK_FREE(transport->description);
}
return self;
}