Fix warnnings for iOS\nUse CFDataGetBytePtr to retrieve the pointer to the remote address
This commit is contained in:
parent
46062ac149
commit
f5d1688e2a
|
@ -321,7 +321,7 @@ int tdav_video_jb_put(tdav_video_jb_t* self, trtp_rtp_packet_t* rtp_pkt)
|
|||
self->fps = TSK_CLAMP(TDAV_VIDEO_JB_FPS_MIN, fps_new, TDAV_VIDEO_JB_FPS_MAX);
|
||||
self->tail_max = (self->fps << TDAV_VIDEO_JB_TAIL_MAX_LOG2); // maximum delay = 2 seconds
|
||||
self->latency_max = self->fps; // maximum = 1 second
|
||||
TSK_DEBUG_INFO("According to rtp-timestamps ...FPS = %d (clipped to %d) tail_max=%d, latency_max=%u", fps_new, self->fps, self->tail_max, self->latency_max);
|
||||
TSK_DEBUG_INFO("According to rtp-timestamps ...FPS = %d (clipped to %d) tail_max=%d, latency_max=%u", fps_new, self->fps, self->tail_max, (unsigned)self->latency_max);
|
||||
tdav_video_jb_reset_fps_prob(self);
|
||||
if(self->callback && (fps_old != self->fps)){
|
||||
self->cb_data_any.type = tdav_video_jb_cb_data_type_fps_changed;
|
||||
|
@ -454,7 +454,7 @@ static void* TSK_STDCALL _tdav_video_jb_decode_thread_func(void *arg)
|
|||
}
|
||||
}
|
||||
else{
|
||||
TSK_DEBUG_INFO("frames_count(%lld)>=latency_max(%u)...decoding video frame even if pkts are missing :(", jb->frames_count, jb->latency_max);
|
||||
TSK_DEBUG_INFO("frames_count(%lld)>=latency_max(%u)...decoding video frame even if pkts are missing :(", jb->frames_count, (unsigned)jb->latency_max);
|
||||
jb->decode_last_seq_num_with_mark = -1; // unset()
|
||||
}
|
||||
if(!postpone){
|
||||
|
|
|
@ -362,7 +362,6 @@ int tnet_ice_pair_send_response(tnet_ice_pair_t *self, const tnet_stun_pkt_req_t
|
|||
tnet_stun_pkt_t* message = tsk_null;
|
||||
const char *password, *username;
|
||||
int ret = -1;
|
||||
tnet_stun_attr_t *stun_att = tsk_null;
|
||||
tsk_bool_t is_error = ((code / 100) != 2);
|
||||
|
||||
if(!self || !phrase || !request || !self->candidate_offer || !self->candidate_answer){
|
||||
|
@ -585,7 +584,7 @@ int tnet_ice_pair_auth_conncheck(const tnet_ice_pair_t *self, const tnet_stun_pk
|
|||
tsk_size_t size = (kStunPktHdrSizeInOctets + msg_integrity_start);
|
||||
uint8_t* new_buffer = (uint8_t*)tsk_calloc(size, 1);
|
||||
if (!new_buffer) {
|
||||
TSK_DEBUG_ERROR("Failed to allocate buffer with size = %u", msg_integrity_start);
|
||||
TSK_DEBUG_ERROR("Failed to allocate buffer with size = %u", (unsigned)msg_integrity_start);
|
||||
return -30;
|
||||
}
|
||||
memcpy(new_buffer, request_buff, size);
|
||||
|
|
|
@ -52,13 +52,10 @@
|
|||
# endif
|
||||
#endif
|
||||
|
||||
#if defined(__APPLE__)
|
||||
# include <TargetConditionals.h>
|
||||
#endif
|
||||
|
||||
// OS X or iOS
|
||||
#if defined(__APPLE__)
|
||||
# define TNET_UNDER_APPLE 1
|
||||
# include <TargetConditionals.h>
|
||||
#endif
|
||||
#if TARGET_OS_MAC
|
||||
# define TNET_UNDER_MAC 1
|
||||
|
|
|
@ -551,6 +551,7 @@ int removeSocketAtIndex(int index, transport_context_t *context)
|
|||
|
||||
if (index < (int)context->count) {
|
||||
transport_socket_xt *sock = context->sockets[index];
|
||||
tnet_fd_t fd = sock->fd;
|
||||
|
||||
// Remove from runloop
|
||||
if (context->cf_run_loop && sock->cf_run_loop_source) {
|
||||
|
@ -599,7 +600,7 @@ int removeSocketAtIndex(int index, transport_context_t *context)
|
|||
context->sockets[context->count-1] = tsk_null;
|
||||
context->count--;
|
||||
|
||||
TSK_DEBUG_INFO("Socket removed");
|
||||
TSK_DEBUG_INFO("Socket removed: %d", fd);
|
||||
}
|
||||
|
||||
tsk_safeobj_unlock(context);
|
||||
|
@ -938,7 +939,8 @@ void __CFSocketCallBack(CFSocketRef s, CFSocketCallBackType callbackType, CFData
|
|||
memcpy(e->data, ptr, len);
|
||||
e->size = len;
|
||||
}
|
||||
memcpy(&e->remote_addr, (struct sockaddr*)address, tnet_get_sockaddr_size((struct sockaddr*)address));
|
||||
struct sockaddr* address_ = (struct sockaddr*)CFDataGetBytePtr(address);
|
||||
memcpy(&e->remote_addr, address_, tnet_get_sockaddr_size(address_));
|
||||
TSK_RUNNABLE_ENQUEUE_OBJECT_SAFE(TSK_RUNNABLE(transport), e);
|
||||
}
|
||||
}
|
||||
|
@ -1105,8 +1107,7 @@ void *tnet_transport_mainthread(void *param)
|
|||
}
|
||||
tsk_safeobj_unlock(context);
|
||||
|
||||
while(TSK_RUNNABLE(transport)->running)
|
||||
{
|
||||
while(TSK_RUNNABLE(transport)->running) {
|
||||
// Give some time to process sources
|
||||
CFRunLoopRunInMode(kCFRunLoopDefaultMode, 1.0, false);
|
||||
|
||||
|
|
|
@ -45,7 +45,7 @@ extern Platform::String^ rt_tsk_str_to_managed(char const* str);
|
|||
|
||||
#if HAVE_NET_ROUTE_H
|
||||
# if defined(__APPLE__) && __IPHONE_OS_VERSION_MIN_REQUIRED <= __IPHONE_3_2
|
||||
# include "net/route.h" // from Doubango 3rd parties folder beacuse the one from iOS SDK is incomplete
|
||||
# include "net/_route.h" // from Doubango 3rd parties folder beacuse the one from iOS SDK is incomplete
|
||||
# else
|
||||
# include <net/route.h>
|
||||
# endif
|
||||
|
|
|
@ -83,10 +83,10 @@
|
|||
#endif
|
||||
|
||||
// http://code.google.com/p/idoubs/issues/detail?id=111
|
||||
#if TARGET_IPHONE_SIMULATOR
|
||||
# undef HAVE_SRTP
|
||||
# define HAVE_SRTP 0
|
||||
#endif
|
||||
//#if TARGET_IPHONE_SIMULATOR
|
||||
//# undef HAVE_SRTP
|
||||
//# define HAVE_SRTP 0
|
||||
//#endif
|
||||
|
||||
#if HAVE_CONFIG_H
|
||||
#include <config.h>
|
||||
|
|
|
@ -57,6 +57,7 @@
|
|||
// OS X or iOS
|
||||
#if defined(__APPLE__)
|
||||
# define TSK_UNDER_APPLE 1
|
||||
# include <TargetConditionals.h>
|
||||
#endif
|
||||
#if TARGET_OS_MAC
|
||||
# define TSK_UNDER_MAC 1
|
||||
|
|
Loading…
Reference in New Issue