“*libRTMP study”的版本间的差异
来自个人维基
free6d1823(讨论 | 贡献) (以“source code download: git clone git://git.ffmpeg.org/rtmpdump Calling flow: 1. Init RTMP_LogSetLevel(level); RTMP_LogSetCallback(rtmp_log); static vo...”为内容创建页面) |
free6d1823(讨论 | 贡献) |
||
第11行: | 第11行: | ||
2. Setup | 2. Setup | ||
RTMP_SetupURL(r, filename) | RTMP_SetupURL(r, filename) | ||
− | RTMP_EnableWrite(r); | + | RTMP_EnableWrite(r); //r->Link.protocol |= RTMP_FEATURE_WRITE; |
RTMP_Connect(r, NULL) | RTMP_Connect(r, NULL) | ||
RTMP_ConnectStream(r, 0) | RTMP_ConnectStream(r, 0) | ||
第24行: | 第24行: | ||
5. close | 5. close | ||
RTMP_Close(r) | RTMP_Close(r) | ||
+ | RTMP_Free(RTMP *r) // free(r) |
2020年4月7日 (二) 22:03的版本
source code download:
git clone git://git.ffmpeg.org/rtmpdump
Calling flow:
1. Init
RTMP_LogSetLevel(level); RTMP_LogSetCallback(rtmp_log); static void rtmp_log(int level, const char *fmt, va_list args) RTMP *r = {}; RTMP_Init(r); //init RTMP. BufferMS=30000,
2. Setup
RTMP_SetupURL(r, filename) RTMP_EnableWrite(r); //r->Link.protocol |= RTMP_FEATURE_WRITE; RTMP_Connect(r, NULL) RTMP_ConnectStream(r, 0) // setsockopt()
3. write
RTMP_Write(r, buf, size);
4. read
RTMP_Read(r, buf, size); RTMP_Pause(r, pause); RTMP_SendSeek(r, timestamp);
5. close
RTMP_Close(r) RTMP_Free(RTMP *r) // free(r)