摘要: 参考资料:https://blog.csdn.net/tiandc/article/details/81489447 nginx的守护进程实现如下: ngx_int_t ngx_daemon(ngx_log_t *log) { int fd; switch (fork()) { case -1: n 阅读全文
posted @ 2020-09-09 11:41 yushimeng 阅读(160) 评论(0) 推荐(0)
摘要: 结论: G711音频时间戳增量和字节数的关系:数值上相等 推导 公式: 时间戳增量= 时钟频率/帧率;G711时钟频率默认8000,含义为一秒采样8000次,每次采样8比特,即一个字节。帧率即每秒打多少包,假设x毫秒打一包,帧率即:1000ms/Xms,时间戳增量=8000/(1000/X) = 8 阅读全文
posted @ 2020-09-09 09:40 yushimeng 阅读(934) 评论(0) 推荐(1)
摘要: H264附录B指明一种简单高效的方案解决解码器分辨每个NAL的起始位置和终止位置-当数据流存储在介质中时,在每个NAL前添加:0x000001 在某些类型的存储介质中,为了寻址方便,要求数据流在长度上对齐,或必须是某个常数的倍数。考虑到这种情况,H264建议在起始码前添加若干字节的0来填充,直到该N 阅读全文
posted @ 2020-09-08 09:18 yushimeng 阅读(677) 评论(0) 推荐(0)
摘要: 现象 服务器软解软编 浏览器可以播放 服务器硬解软编 浏览器可以播放 服务器软解硬编 浏览器播放不出来 服务器硬解硬编 浏览器播放不出来 保存硬编后的h264流,本地播放可以播放,但是发现gop=25,帧率=8; 但是我们在服务器不管是软编还是硬编都是设置的帧率=25,但是软编出来的流可以播放,但是 阅读全文
posted @ 2020-08-28 09:47 yushimeng 阅读(354) 评论(0) 推荐(0)
摘要: 1、同一文件,默认编译选项 在同一.c文件内gcc默认编译选项: gcc -S test.c -o test1.s 生成的test.s中不会内联展开,而是对其普通函数处理。 2、同一文件,编译选项O3优化 在同一.c文件内gcc O3编译选项: gcc -S test.c -o test2.s -O 阅读全文
posted @ 2020-08-06 14:27 yushimeng 阅读(309) 评论(0) 推荐(0)
摘要: 1 启动时指定信号处理函数 在nginx启动的时候就会指定信号的处理函数: ngx_int_t ngx_init_signals(ngx_log_t *log) { ngx_signal_t *sig; struct sigaction sa; for (sig = signals; sig->si 阅读全文
posted @ 2020-07-23 17:31 yushimeng 阅读(860) 评论(0) 推荐(0)
摘要: int findDuplicate(int* nums, int numsSize){ int max=0, i; int *map; for (i=0; i<numsSize; ++i) { max = max>nums[i]?max:nums[i]; } map = malloc(sizeof( 阅读全文
posted @ 2020-07-22 19:57 yushimeng 阅读(121) 评论(0) 推荐(0)
摘要: char * getHint(char * secret, char * guess){ if (secret == NULL || guess == NULL) { return "0A0B"; } int len, i, bulls=0, cows=0; int nums1[10]={0}, n 阅读全文
posted @ 2020-07-22 13:51 yushimeng 阅读(165) 评论(0) 推荐(0)
摘要: 目前没通过;https://leetcode-cn.com/problems/3sum/ /** * Return an array of arrays of size *returnSize. * The sizes of the arrays are returned as *returnCol 阅读全文
posted @ 2020-07-18 23:56 yushimeng 阅读(129) 评论(0) 推荐(0)
摘要: char * longestCommonPrefix(char ** strs, int strsSize){ char ch; int len=0, i, j; if (strsSize < 1) {return "";} len = strlen(strs[0]); for (i=1; i<st 阅读全文
posted @ 2020-07-18 23:10 yushimeng 阅读(116) 评论(0) 推荐(0)