ireader / sdk Goto Github PK
View Code? Open in Web Editor NEWportable system call(aio/socket/thread/process/lock/event/pipe)
License: MIT License
portable system call(aio/socket/thread/process/lock/event/pipe)
License: MIT License
Windows 10, VS2015 ,32/64bit projects,same thing.
Hi, I've just found the following compilation error under Linux (Ubuntu under WSL).
gcc -I. -I./include -I../include -DOS_LINUX -DDEBUG -D_DEBUG -Wall -fPIC -g -Wall -fvisibility=hidden -fvisibility=default -c -MMD -MP -MF debug.linux/aio-connect.d -o src/aio-connect.o src/aio-connect.c
In file included from ../include/sockutil.h:4,
from src/aio-connect.c:6:
../include/sys/sock.h: In function ‘socket_multicast_join’:
../include/sys/sock.h:1268:5: error: ‘struct ip_mreq’ has no member named ‘imr_ifindex’
1268 | imr.imr_ifindex = 0; // any interface
| ^
../include/sys/sock.h:1269:32: error: ‘struct ip_mreq’ has no member named ‘imr_address’
1269 | inet_pton(AF_INET, local, &imr.imr_address);
| ^
make[1]: *** [../gcc.mk:84: src/aio-connect.o] Error 1
Very small change of the following should resolve the issue.
diff --git a/include/sys/sock.h b/include/sys/sock.h
index 3db2fbf..d4e6f7a 100644
--- a/include/sys/sock.h
+++ b/include/sys/sock.h
@@ -1263,7 +1263,7 @@ static inline int socket_multicast_join(IN socket_t sock, IN const char* group,
inet_pton(AF_INET, local, &imr.imr_interface);
return setsockopt(sock, IPPROTO_IP, IP_ADD_MEMBERSHIP, (char*)&imr, sizeof(imr));
#else
- struct ip_mreq imr;
+ struct ip_mreqn imr;
memset(&imr, 0, sizeof(imr));
imr.imr_ifindex = 0; // any interface
inet_pton(AF_INET, local, &imr.imr_address);
Hope the above may be of your help
Best regards,
smg31
sdk/libhttp/source/rfc822-datetime.c
Line 59 in e62b76e
in case,i want to realization a keepalive stun request,so i call ice_agent_start every 2 second with same ice_agent*.
in ice-checklist.c#157
darray_clear(&l->valids);
darray_clear(&l->trigger);
ice_candidate_components_clear(&l->components); // reset components
this code will reset darray->count = 0; but never free darry. so i change this code
darray_free(&l->valids);
darray_free(&l->trigger);
ice_candidate_components_free(&l->components);
another memory leak in ice-checklist.c #530 ice_checklist_ontimer
l->timer = stun_timer_start(ICE_TIMER_INTERVAL * ice_agent_active_checklist_count(l->ice), ice_checklist_ontimer, l);
checklist* l will obtain timer but never free,so i free this code in ice_checklist_ontimer#466
l = (struct ice_checklist_t*)param;
locker_lock(&l->locker);
assert(ICE_CHECKLIST_FROZEN != l->state);
if(l->timer){
free(l->timer);
l->timer = NULL;
}
目前移植libaio到liteos系统,但是liteos不支持epoll系统调用,不知大佬是否有时间实现一下aio的poll版本,或者能否给一些建议吗?
感谢!
linux下的network_getmac返回的mac地址,是否可以更改冒号作为分隔符而非"-",这样可以跟windows保持一致
after successfully make
, run:
make test
make -C test
(normal)
make[1]: 进入目录“/home/lzhx/video/sdk/test”
../source/port/linux-async-pipe.c:61:24: error: unknown type name ‘sigval_t’; did you mean ‘__sigval_t’?
static void aio_onread(sigval_t sigval)
^~~~~~~~
__sigval_t
../source/port/linux-async-pipe.c:95:25: error: unknown type name ‘sigval_t’; did you mean ‘__sigval_t’?
static void aio_onwrite(sigval_t sigval)
^~~~~~~~
__sigval_t
../source/port/linux-async-pipe.c: In function ‘async_pipe_read’:
../source/port/linux-async-pipe.c:140:46: error: ‘aio_onread’ undeclared (first use in this function); did you mean ‘aio_read’?
o->aio.aio_sigevent.sigev_notify_function = aio_onread;
^~~~~~~~~~
aio_read
../source/port/linux-async-pipe.c:140:46: note: each undeclared identifier is reported only once for each function it appears in
../source/port/linux-async-pipe.c: In function ‘async_pipe_write’:
../source/port/linux-async-pipe.c:164:46: error: ‘aio_onwrite’ undeclared (first use in this function); did you mean ‘aio_write’?
o->aio.aio_sigevent.sigev_notify_function = aio_onwrite;
^~~~~~~~~~~
aio_write
../gcc.mk:89: recipe for target 'debug.linux/objs/../source/port/linux-async-pipe.o' failed
make[1]: *** [debug.linux/objs/../source/port/linux-async-pipe.o] Error 1
make[1]: 离开目录“/home/lzhx/video/sdk/test”
Makefile:36: recipe for target 'test' failed
make: *** [test] Error 2
I just wanna build this dependency for media_server, how can I pass the test? Or it doesn't matter if I do not run this test?
thanks a lot!
aio 或者 http 服务端设定超时时间(TO),任何客户端只要在该短时间内没有交互,就主动关闭其链接。
在代码里面使用OS_WINDOWS区分linux和windows,windows平台定义的宏是_WIN32,OS_WINDOWS是在哪里定义的,使用者自己定义吗?
我想增加rtos的代码,比如freertos rtthread或者其他pr,提交前想先交流下,有群或者联系方式吗?
在http_client.c http_client_onread_header函数里面对重定向进行了判断
if(300 <= code && code < 400) { if(http_client_redirect_handler(http)) { code = http_client_request(http, http->parameters.method, http->parameters.uri, http->parameters.headers, http->parameters.n, http->parameters.msg, http->parameters.bytes, http->onreply, http->cbparam); if(0 != code) http_client_handle(http, code > 0 ? -code : code); return; } }
重定向这里没有使用Location指定的url,http_client_redirect_handler含就仅仅是把Location指向的url写入http->redirect.urls中,应该进行如下修改
http->redirect.urls[http->redirect.n++] = strdup(uri);; http->parameters.uri=http->redirect.urls[http->redirect.n];
你好,想使用librtmp推流,请问该库支持推流h265视频吗
[09:27:09]Thread 40 received signal SIGSEGV, Segmentation fault.
[09:27:09][Switching to Thread 0xaa3824b0 (LWP 29466)]
[09:27:09]0xb5c3c880 in twtimer_cascade (tm=0x1886240, tv=0x1886658, index=11)
[09:27:09] at ../source/twtimer.c:155
[09:27:09]155 ../source/twtimer.c: No such file or directory.
09:27:09
09:27:09
09:27:09
09:27:09
09:29:54 bt
[09:29:54]#0 0xb5c3c880 in twtimer_cascade (tm=0x1886240, tv=0x1886658, index=11)
[09:29:54] at ../source/twtimer.c:155
[09:29:54]#1 0xb5c3c5d4 in twtimer_process (tm=0x1886240, clock=222451756)
[09:29:54] at ../source/twtimer.c:107
[09:29:54]#2 0xb5c3c1f4 in aio_timeout_process () at src/aio-timeout.c:28
[09:29:54]#3 0xb5c37e1c in aio_worker (param=0x0) at src/aio-worker.c:23
[09:29:54]#4 0xb4ed8f6c in start_thread () from /lib/libpthread.so.0
[09:29:54]#5 0xb4d40134 in clone () from /lib/libc.so.0
[09:29:54]Backtrace stopped: previous frame identical to this frame (corrupt stack?)
请问libice/test下的例子有编译脚本吗?我在linux上make完后得到了一些库,然后尝试编译libice/test下的例子。但是好像缺少一些库,所以一直无法成功编译libice/test。
在 x264 windows compile.txt 中x64编译命令./configure --host=x86-64-w64-mingw32 --enable-static --enable-shared 中应该要改为
./configure --host=x86_64-w64-mingw32 --enable-static --enable-shared --extra-ldflags=-Wl,--output-def=libx264.def
host, srflx, relay这些地址都可以获取到了,按照demo做了,数据发送不成功。
demo效果是和libnice是一样的效果吧,libnice双方发送数据都可以通。
这个demo始终想对方发送数据失败,对方收不到数据
如何修改使得 server 支持 https 呢
eg: when ' ::ffff:127.0.0.1' used as input, the out parameter 'ip' not filled.
1、头文件缺少
#include "sys/time.h"
2、位置错误
typedef uint32_t useconds_t;
只在#if defined(OS_WINDOWS)中声明,导致linux下未声明错误。
epoll模式下的HTTP服务器,使用一个TCP客户端去链接,没发任何数据;
服务端调用aio_socket_destroy()去关闭它,不成功;
in case,i want to realization a keepalive stun request,so i call ice_agent_start every 2 second with same ice_agent*.
in ice-checklist.c#157
darray_clear(&l->valids);
darray_clear(&l->trigger);
ice_candidate_components_clear(&l->components); // reset components
this code will reset darray->count = 0; but never free darry. so i change this code
darray_free(&l->valids);
darray_free(&l->trigger);
ice_candidate_components_free(&l->components);
another memory leak in ice-checklist.c #530 ice_checklist_ontimer
l->timer = stun_timer_start(ICE_TIMER_INTERVAL * ice_agent_active_checklist_count(l->ice), ice_checklist_ontimer, l);
checklist* l will obtain timer but never free,so i free this code in ice_checklist_ontimer#466
l = (struct ice_checklist_t*)param;
locker_lock(&l->locker);
assert(ICE_CHECKLIST_FROZEN != l->state);
if(l->timer){
free(l->timer);
l->timer = NULL;
}
make -C sdk/libaio
提示make: *** 没有规则可以创建“debug.linux/libaio.so”需要的目标“../source/timer.o”。 停止。
make -C sdk/libaio && make -C sdk/libhttp && make -C media-server/libmpeg && make -C media-server/libflv && make -C media-server/libhls
make: *** 没有规则可以创建“debug.linux/libaio.so”需要的目标“../source/timer.o”。 停止。
worker quit timer leak
musl doesn't define PTHREAD_MUTEX_RECURSIVE_NP
, on distros with musl libc like alpine, it won't compile.
可以用交叉编译工具链在其他平台上编译 sdk
吗?比如 QNX 和 Android ?
make PLATFORM=${QNX_HOST}/usr/bin/ntoaarch64 -j4
../include/sys/sock.h:196:62: error: unknown type name ‘IN6_ADDR’
static inline int socket_ipv6_netmask(IN uint8_t prefix, OUT IN6_ADDR* addr);
sdk/source/port/aio-socket-epoll.c
Line 377 in e62b76e
http_client.c http_client_onread_header函数里面对重定向进行了判断
'''
if(300 <= code && code < 400)
{
if(http_client_redirect_handler(http))
{
code = http_client_request(http, http->parameters.method, http->parameters.uri, http->parameters.headers, http->parameters.n, http->parameters.msg, http->parameters.bytes, http->onreply, http->cbparam);
if(0 != code)
http_client_handle(http, code > 0 ? -code : code);
return;
}
}
'''
但是这里并没有使用Location指定的url,http_client_redirect_handler函数里面仅仅是把Location指定的url保存到http->redirect.urls,应该进行如下修改
'''
http->redirect.urls[http->redirect.n++] = strdup(uri);
//指向Location指定的url
http->parameters.uri=http->redirect.urls[http->redirect.n-1];
'''
uuid_generate 接口中 s[36] = '0'
; 应当更正为 s[36] = '\0'
;
使用base64_decode函数解码,cnRzcDovL2FkbWluOkhLMTIzNDU2QDE5Mi4xNjguMTUwLjg4OjU1NC9oMjY0LzAvbWFpbi9hdl9zdHJlYW0被解码为rtsp://admin:[email protected]:554/h264/0/main/av_stre,缺少两个字节,使用ffmpeg的av_base64_decode函数,解码正确。
ice_transport_bind中创建了socket文件描述符,但是在ice_transport_destroy中并未看到close的代码,造成文件描述符泄漏
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.